dealpos 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/POS/3rdpartylicenses.txt +1645 -0
- package/POS/assets/icons/icon-128x128.png +0 -0
- package/POS/assets/icons/icon-144x144.png +0 -0
- package/POS/assets/icons/icon-152x152.png +0 -0
- package/POS/assets/icons/icon-192x192.png +0 -0
- package/POS/assets/icons/icon-384x384.png +0 -0
- package/POS/assets/icons/icon-512x512.png +0 -0
- package/POS/assets/icons/icon-72x72.png +0 -0
- package/POS/assets/icons/icon-96x96.png +0 -0
- package/POS/chunk-26YXEYJK.js +1 -0
- package/POS/chunk-2DNKBN6G.js +1 -0
- package/POS/chunk-2FKYC63K.js +1 -0
- package/POS/chunk-2FWFPV5I.js +1 -0
- package/POS/chunk-2OSKJOSS.js +1 -0
- package/POS/chunk-2OXMYDYT.js +1 -0
- package/POS/chunk-2OZMF5DL.js +1 -0
- package/POS/chunk-2W3MAOOP.js +1 -0
- package/POS/chunk-33XCA4ER.js +14 -0
- package/POS/chunk-35V3VL6F.js +1 -0
- package/POS/chunk-3A7KA4YN.js +1 -0
- package/POS/chunk-3BODNSIH.js +1 -0
- package/POS/chunk-3FOIEYAT.js +4 -0
- package/POS/chunk-3PFXZUB6.js +7 -0
- package/POS/chunk-3QABPVXZ.js +3 -0
- package/POS/chunk-4BDQDYVB.js +1 -0
- package/POS/chunk-4CBDK52E.js +4 -0
- package/POS/chunk-4G26RHGA.js +1 -0
- package/POS/chunk-4MX7Q77M.js +2 -0
- package/POS/chunk-4UAHOTBD.js +1 -0
- package/POS/chunk-56EQRIAH.js +1 -0
- package/POS/chunk-5KBFQLSN.js +1 -0
- package/POS/chunk-5W7F4VJH.js +1 -0
- package/POS/chunk-64PDX5ZX.js +1 -0
- package/POS/chunk-65YDOCXF.js +1 -0
- package/POS/chunk-67VBXFVT.js +6 -0
- package/POS/chunk-6BQZINLH.js +1 -0
- package/POS/chunk-6L6CIH5M.js +1 -0
- package/POS/chunk-6PXJEE4K.js +1 -0
- package/POS/chunk-6S4Q5VRA.js +1 -0
- package/POS/chunk-75STMWUR.js +6 -0
- package/POS/chunk-76C33PK5.js +1 -0
- package/POS/chunk-77D6X2SQ.js +11 -0
- package/POS/chunk-7DWKYGA4.js +1 -0
- package/POS/chunk-7M6CWVRI.js +1 -0
- package/POS/chunk-7Q3437BR.js +1 -0
- package/POS/chunk-AA32I4UN.js +1 -0
- package/POS/chunk-AJMKP7YZ.js +1 -0
- package/POS/chunk-AOJW6WJT.js +1 -0
- package/POS/chunk-AOPKPEVH.js +1 -0
- package/POS/chunk-APJK7OH2.js +2 -0
- package/POS/chunk-APYNCJ2H.js +1 -0
- package/POS/chunk-AUYYX2UQ.js +45 -0
- package/POS/chunk-AVDGNFC7.js +1 -0
- package/POS/chunk-AWGZKLLY.js +1 -0
- package/POS/chunk-AYKDALBT.js +1 -0
- package/POS/chunk-B2OT7HA4.js +4 -0
- package/POS/chunk-B36XIZVJ.js +1 -0
- package/POS/chunk-B5FODXLM.js +1 -0
- package/POS/chunk-B7RM5KKA.js +1 -0
- package/POS/chunk-BCVO66L3.js +5 -0
- package/POS/chunk-BETKNHFK.js +1 -0
- package/POS/chunk-BH2ZVZIU.js +1 -0
- package/POS/chunk-BHXS5IA6.js +1 -0
- package/POS/chunk-BLZEDUEI.js +1 -0
- package/POS/chunk-BYXBJQAS.js +0 -0
- package/POS/chunk-BZC5JINN.js +5 -0
- package/POS/chunk-C43IYFVU.js +1 -0
- package/POS/chunk-CBW7IA6S.js +1 -0
- package/POS/chunk-CCGPOEE3.js +4 -0
- package/POS/chunk-CFIFFKWA.js +1 -0
- package/POS/chunk-CI45CZMG.js +1 -0
- package/POS/chunk-CJO25BBP.js +1 -0
- package/POS/chunk-CLL3TEL5.js +1 -0
- package/POS/chunk-CPUGWH3I.js +1 -0
- package/POS/chunk-CPW6IWAB.js +1 -0
- package/POS/chunk-CRSUSQ3W.js +1 -0
- package/POS/chunk-CW27R4N3.js +2 -0
- package/POS/chunk-CWU5DTSS.js +1 -0
- package/POS/chunk-CY2FQLP4.js +1 -0
- package/POS/chunk-DRGWLGRP.js +1 -0
- package/POS/chunk-DXF4M3Z6.js +1 -0
- package/POS/chunk-E72IOARD.js +1 -0
- package/POS/chunk-EA7CLJMQ.js +18 -0
- package/POS/chunk-ECMSF3OR.js +1 -0
- package/POS/chunk-EOFWQEK7.js +1 -0
- package/POS/chunk-EQOB7536.js +156 -0
- package/POS/chunk-ESD5O3BQ.js +1 -0
- package/POS/chunk-EZCHVNC5.js +3 -0
- package/POS/chunk-F3ZYFWTM.js +1 -0
- package/POS/chunk-F6GAPEFT.js +1 -0
- package/POS/chunk-FBR7TAEJ.js +5 -0
- package/POS/chunk-FE5LZK5I.js +1 -0
- package/POS/chunk-FOEYBSQT.js +2 -0
- package/POS/chunk-FWVI7M5F.js +1 -0
- package/POS/chunk-G4DDQBH4.js +1 -0
- package/POS/chunk-GDFWXFK2.js +1 -0
- package/POS/chunk-GHQFOULJ.js +2 -0
- package/POS/chunk-GNSQPTDB.js +1 -0
- package/POS/chunk-GSLPZSSX.js +1 -0
- package/POS/chunk-GVXSG66Q.js +1 -0
- package/POS/chunk-H55AJAX5.js +8 -0
- package/POS/chunk-HIRUHGYD.js +2 -0
- package/POS/chunk-HKR2C3HA.js +1 -0
- package/POS/chunk-HSOC6U4B.js +1 -0
- package/POS/chunk-I6CGSFEU.js +1 -0
- package/POS/chunk-I6YPWC52.js +1 -0
- package/POS/chunk-IDDHFZWG.js +1 -0
- package/POS/chunk-IE5R6YWY.js +1 -0
- package/POS/chunk-IOQ3OION.js +1 -0
- package/POS/chunk-IUKSWU5B.js +1 -0
- package/POS/chunk-IY6EDHBT.js +1 -0
- package/POS/chunk-IZGPRDGN.js +2 -0
- package/POS/chunk-J3W6DQKW.js +1 -0
- package/POS/chunk-JLWKTGB2.js +1 -0
- package/POS/chunk-JM3SJLS7.js +1 -0
- package/POS/chunk-JNUC6PO5.js +1 -0
- package/POS/chunk-K5XVN3MT.js +1 -0
- package/POS/chunk-KBQ5ZM55.js +1 -0
- package/POS/chunk-KCNSCS4R.js +1 -0
- package/POS/chunk-KI2MQKDF.js +1 -0
- package/POS/chunk-KNRLGMUT.js +1 -0
- package/POS/chunk-KR4OPCRF.js +1 -0
- package/POS/chunk-KW4B7WMB.js +1 -0
- package/POS/chunk-KYX6U2UX.js +1 -0
- package/POS/chunk-KZNSGBGF.js +2 -0
- package/POS/chunk-L3UWNQXB.js +1 -0
- package/POS/chunk-LHWN2J4H.js +15 -0
- package/POS/chunk-LJUP6CCS.js +1 -0
- package/POS/chunk-LY4FOMQ6.css +1 -0
- package/POS/chunk-LZ3SKBTU.js +1 -0
- package/POS/chunk-M5ONTRWK.js +1 -0
- package/POS/chunk-MA7NEQCZ.js +1 -0
- package/POS/chunk-MDKYCLYA.js +17 -0
- package/POS/chunk-MGDA6GY6.js +1 -0
- package/POS/chunk-MWWGZRMN.js +1 -0
- package/POS/chunk-NCATMO6T.js +1 -0
- package/POS/chunk-NDAI7L23.js +1 -0
- package/POS/chunk-NHUK6IK5.js +40 -0
- package/POS/chunk-NUZ5K7GT.js +1 -0
- package/POS/chunk-O2PELRQA.js +1 -0
- package/POS/chunk-OUOP65JB.js +1 -0
- package/POS/chunk-OXSD6KML.js +1 -0
- package/POS/chunk-PEOMRJUI.js +3 -0
- package/POS/chunk-PHGK3EAU.js +1 -0
- package/POS/chunk-PLC4GZ67.js +1 -0
- package/POS/chunk-PTF6AQY6.js +1 -0
- package/POS/chunk-PTXKBWBA.js +1 -0
- package/POS/chunk-Q3SJOSAG.js +1 -0
- package/POS/chunk-QBDEGNJP.js +1 -0
- package/POS/chunk-QCTMAR3L.js +1 -0
- package/POS/chunk-QZWOQRAM.js +1 -0
- package/POS/chunk-R5VG3XDC.js +1 -0
- package/POS/chunk-R7NR3M2Q.js +1 -0
- package/POS/chunk-RBKYZOZX.js +3 -0
- package/POS/chunk-RHQGCHFI.js +1 -0
- package/POS/chunk-RL3GYZVU.js +8 -0
- package/POS/chunk-RRKCUSBB.js +1 -0
- package/POS/chunk-S4OLP2TR.js +18 -0
- package/POS/chunk-SDH32O74.js +1 -0
- package/POS/chunk-SE7OFLAL.js +1 -0
- package/POS/chunk-SEVYM4GA.js +1 -0
- package/POS/chunk-SGRJ5YG2.js +1 -0
- package/POS/chunk-SNNLFZQ3.js +3 -0
- package/POS/chunk-SVNOJVQF.js +1 -0
- package/POS/chunk-TCLYGBIP.js +1 -0
- package/POS/chunk-TIDDF777.js +1 -0
- package/POS/chunk-TJQIORGG.js +1 -0
- package/POS/chunk-TK5H65DN.js +1 -0
- package/POS/chunk-TLHNFDPP.js +1 -0
- package/POS/chunk-TVNDX4KA.js +3 -0
- package/POS/chunk-TX6G2LAN.js +1 -0
- package/POS/chunk-U3O6FO5X.js +1 -0
- package/POS/chunk-UJMXJABS.js +1 -0
- package/POS/chunk-UNGT7KQO.js +1 -0
- package/POS/chunk-UPRH3DLS.js +1 -0
- package/POS/chunk-UVFDCVT4.js +2 -0
- package/POS/chunk-V22EVF6N.js +1 -0
- package/POS/chunk-V4RKZMUB.js +11 -0
- package/POS/chunk-VBOV2ZGQ.js +1 -0
- package/POS/chunk-VGGNSOCP.js +1 -0
- package/POS/chunk-VLGOEX3D.js +24 -0
- package/POS/chunk-VPAQFQA7.js +1 -0
- package/POS/chunk-VSMYP4AC.js +1 -0
- package/POS/chunk-VXCP4DBC.js +1 -0
- package/POS/chunk-W43P2XHR.js +1 -0
- package/POS/chunk-W7PIRMKD.js +1 -0
- package/POS/chunk-WG6PV6VL.js +4 -0
- package/POS/chunk-WK4T26FX.js +2 -0
- package/POS/chunk-WKS7JIOA.js +1 -0
- package/POS/chunk-WKXE4B24.js +1 -0
- package/POS/chunk-WLRXTHLM.js +1 -0
- package/POS/chunk-WSZGVB3P.js +1 -0
- package/POS/chunk-WXHOQKTU.js +1 -0
- package/POS/chunk-X55EKFUZ.js +1 -0
- package/POS/chunk-X7QMXCEW.js +4 -0
- package/POS/chunk-XIGLLWLV.js +1 -0
- package/POS/chunk-XRKZOON6.js +4 -0
- package/POS/chunk-XW2QKXZF.js +5 -0
- package/POS/chunk-XZPCPUT7.js +1 -0
- package/POS/chunk-Y5SPDICN.js +2 -0
- package/POS/chunk-Y7XBMFXR.js +1 -0
- package/POS/chunk-YATUCULL.js +1 -0
- package/POS/chunk-YBFOOZH4.js +2 -0
- package/POS/chunk-YBINYTS7.js +1 -0
- package/POS/chunk-YE2HNBMX.js +1 -0
- package/POS/chunk-YENHZRM5.js +9 -0
- package/POS/chunk-YHCFOJEX.js +1 -0
- package/POS/chunk-YKBQYDEJ.js +2 -0
- package/POS/chunk-YPFXYXHP.js +8 -0
- package/POS/chunk-YRHYSRBM.js +1 -0
- package/POS/chunk-YRITVFOW.js +1 -0
- package/POS/chunk-YRNTUREW.js +1 -0
- package/POS/chunk-YXRRTX7W.js +1 -0
- package/POS/chunk-Z426RGUL.js +24 -0
- package/POS/chunk-ZB45Y55B.js +1 -0
- package/POS/chunk-ZGRVB4IB.js +1 -0
- package/POS/chunk-ZJ3TX62Q.js +1 -0
- package/POS/chunk-ZKWXTWYY.js +1 -0
- package/POS/index.html +33 -0
- package/POS/main-CNMNNNEI.js +4 -0
- package/POS/main-VPAR6OBK.css +1 -0
- package/POS/manifest.webmanifest +59 -0
- package/POS/media/color-727V6BA6.png +0 -0
- package/POS/media/hue-3YTJE6JS.png +0 -0
- package/POS/media/primeicons-4GST5W3O.woff2 +0 -0
- package/POS/media/primeicons-DHQU4SEP.svg +345 -0
- package/POS/media/primeicons-GEFHGEHP.ttf +0 -0
- package/POS/media/primeicons-P53SE5CV.woff +0 -0
- package/POS/media/primeicons-RSSEDYLY.eot +0 -0
- package/POS/polyfills-FHOOFFEX.js +2 -0
- package/POS/scripts-3E2G6IZ4.js +10 -0
- package/POS/styles-T7FPZRNG.css +25 -0
- package/Styles/Master/app_custom.css +18 -0
- package/Styles/Master/login_custom.css +0 -0
- package/Styles/Print/PaperSize8cm_custom.css +1 -0
- package/Styles/Print/PaperSizeA4_custom.css +1 -0
- package/StylesB/Master/app_custom.css +0 -0
- package/package.json +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as An}from"./chunk-QCTMAR3L.js";import{a as Nn}from"./chunk-Y7XBMFXR.js";import"./chunk-SGRJ5YG2.js";import{a as Pn}from"./chunk-GSLPZSSX.js";import{a as un}from"./chunk-TK5H65DN.js";import{a as hn,b as xn}from"./chunk-FWVI7M5F.js";import{a as gn,b as fn,c as Cn,d as ot,e as _n}from"./chunk-AVDGNFC7.js";import{a as Tn,e as On,f as wn}from"./chunk-F3ZYFWTM.js";import{a as st}from"./chunk-65YDOCXF.js";import{a as Mn}from"./chunk-AYKDALBT.js";import"./chunk-LJUP6CCS.js";import{c as vn,d as rt}from"./chunk-MGDA6GY6.js";import{a as yn}from"./chunk-4UAHOTBD.js";import"./chunk-SE7OFLAL.js";import"./chunk-LZ3SKBTU.js";import"./chunk-5W7F4VJH.js";import"./chunk-GVXSG66Q.js";import"./chunk-XW2QKXZF.js";import{a as kn}from"./chunk-B7RM5KKA.js";import{a as Dn}from"./chunk-YE2HNBMX.js";import{a as it}from"./chunk-B5FODXLM.js";import{a as mn,b as pn}from"./chunk-C43IYFVU.js";import{b as En}from"./chunk-YKBQYDEJ.js";import{a as at,b as ct,c as lt}from"./chunk-XIGLLWLV.js";import"./chunk-G4DDQBH4.js";import{b as dn}from"./chunk-CLL3TEL5.js";import{a as Sn,b as In}from"./chunk-VXCP4DBC.js";import"./chunk-EZCHVNC5.js";import"./chunk-7DWKYGA4.js";import"./chunk-64PDX5ZX.js";import{a as bn}from"./chunk-AOJW6WJT.js";import{a as Xt,c as Zt,e as en,g as tn}from"./chunk-I6YPWC52.js";import{a as fe,b as Ce}from"./chunk-FBR7TAEJ.js";import{h as sn}from"./chunk-XRKZOON6.js";import"./chunk-4CBDK52E.js";import{a as nn,b as on}from"./chunk-CBW7IA6S.js";import"./chunk-VPAQFQA7.js";import"./chunk-AOPKPEVH.js";import{H as ln,K as Q,i as R,j,k as Oe,l as we,m as re,o as Ae,p as Ve,q as Fe,r as rn,t as an,u as cn}from"./chunk-V4RKZMUB.js";import{Aa as tt,Ba as nt,ua as Yt}from"./chunk-2FKYC63K.js";import"./chunk-2W3MAOOP.js";import{e as ke,f as Ne}from"./chunk-WK4T26FX.js";import"./chunk-BCVO66L3.js";import"./chunk-LHWN2J4H.js";import{a as Se}from"./chunk-2FWFPV5I.js";import{C as oe,D as Te,a as et,c as ne,h as K,l as Me,n as ie,q as Jt,r as Ee}from"./chunk-4G26RHGA.js";import"./chunk-R7NR3M2Q.js";import{a as Kt}from"./chunk-MA7NEQCZ.js";import{a as g,d as ge}from"./chunk-26YXEYJK.js";import"./chunk-WG6PV6VL.js";import{a as Y}from"./chunk-RRKCUSBB.js";import{$a as Qt,$b as S,$c as te,Ab as a,Bb as D,Cb as y,D as At,Db as h,E as T,Ea as V,Fb as A,Hc as H,I as Vt,Ib as d,Kb as p,L as Ft,Ld as zt,Nb as Et,Nd as Ke,Od as Ye,P as Rt,Pa as jt,Pc as ee,Qa as He,Qd as Xe,R as Bt,Rc as de,Sa as Ge,Sb as qt,Sc as G,Sd as Ze,Tb as $t,U as Ut,Ua as l,Ub as Ht,Va as Z,W as Ie,Xc as Pe,Yb as J,Zb as s,_ as X,_b as U,ac as xe,bb as F,cc as L,cd as O,d as kt,da as k,dc as W,eb as Lt,ec as q,fc as De,gb as v,gc as E,ha as N,hc as Je,ic as $,jc as Gt,k as Nt,la as u,mb as m,nb as Wt,o as Mt,pa as M,qc as _,rc as b,sc as Tt,t as ue,ub as ze,wa as f,wc as se,xa as C,zb as r}from"./chunk-H55AJAX5.js";import{a as B,b as Pt}from"./chunk-KW4B7WMB.js";var mt=class{AppConfigJSON;Currencies;CustomerPOTypes;Entities;Payments;Taxes;SalesPOTypes;EstimateOptions;Data};var Re=class{CurrencyID;CustomerID;Date;Discount;DiscountAmount;EntityID;ID;Note;Number;SalesID;TaxTypeID;TypeID;constructor(){this.CustomerID=g.GuidEmpty,this.EntityID=g.GuidEmpty,this.ID=g.GuidEmpty,this.TaxTypeID=g.GuidEmpty,this.Discount=0,this.DiscountAmount=0,this.Date=new Date().toDateString()}};var ae=class{Email;Key;Mobile;Name;Phone;Value;PricebookID};var pt=class{ID;Index;Symbol;Name;ExchangeRate;ConversionSuggestion;ExchangeRateDate;ExchangeRateDateDisplay};var ut=class{ID;Name;DueDays;BlockDays;Description;PrintTemplateID;AccountID};var dt=class{DeliveryID;InvoiceID;InvoiceNumber;Message;OrderID;PaymentStateID;PaymentStateLabel;PrintMode;Success};var P=class o{estimateState=kn({loadForm:new mt,outlet:{Name:"",ID:g.GuidEmpty},order:new Re,cartItems:[],customer:new ae,tax:new un,currency:new pt,tag:new ut,discount:{discountAmount:0,discount:0},state:0,complete:new dt});loadForm=this.estimateState.select(e=>Object.freeze(e.loadForm()));order=this.estimateState.select(e=>Object.freeze(e.order()));outlet=this.estimateState.select(e=>Object.freeze(e.outlet()));cartItems=this.estimateState.select(e=>Object.freeze(e.cartItems()));customer=this.estimateState.select(e=>Object.freeze(e.customer()));tax=this.estimateState.select(e=>Object.freeze(e.tax()));currency=this.estimateState.select(e=>Object.freeze(e.currency()));tag=this.estimateState.select(e=>Object.freeze(e.tag()));discount=this.estimateState.select(e=>Object.freeze(e.discount()));state=this.estimateState.select(e=>Object.freeze(e.state()));complete=this.estimateState.select(e=>Object.freeze(e.complete()));updateLoadForm(e){this.estimateState.update("loadForm",e)}updateOutlet(e){this.estimateState.update("outlet",e)}updateOrder(e){this.estimateState.update("order",e)}updateCartItems(e){this.estimateState.update("cartItems",e)}updateCustomer(e){this.estimateState.update("customer",e)}updateTax(e){this.estimateState.update("tax",e)}updateCurrency(e){this.estimateState.update("currency",e)}updateTag(e){this.estimateState.update("tag",e)}updateDiscount(e){this.estimateState.update("discount",e)}updateState(e){this.estimateState.update("state",e)}updateComplete(e){this.estimateState.update("complete",e)}static \u0275fac=function(t){return new(t||o)};static \u0275prov=N({token:o,factory:o.\u0275fac})};var _e=class{ID;Name;Code;Cost;ThumbnailUrl;CouponDiscount;Discount;DiscountAmount;EntityID;Expense;InventoryTypeID;LoyaltyPoint;Note;PromotionGift;Quantity;UnitQuantity;SalesID;VariantID;VariantUnitQuantity;isMaxInventory;UOM;UOMName;UnitCost;UnitPrice;TypeID;Storage;Taxable;Price;Serial;PriceBookID;Variant;PriceTypeID;PriceNote;get Total(){return this.Price*(this.Quantity*this.UnitQuantity)*((100-this.Discount)/100)}get getItemAfterDiscount(){let e=this.getDiscPercentagePerItem();return this.DiscountAmount<e?e-this.DiscountAmount:0}getDiscPercentagePerItem(){let e=this.UnitPrice;return this.Discount>0&&(e=(100-this.Discount)/100*this.UnitPrice),e}};var be=class o{constructor(){}generateCartItem(e){let t=new _e;return t.Name=e.Name,t.ThumbnailUrl=e.ThumbnailUrl,t.Price=e.UnitPrice,t.UnitPrice=e.UnitPrice,t.UnitCost=e.UnitCost,t.UnitQuantity=e.UnitQuantity,t.Quantity=1,t.Code=e.Code,t.TypeID=e.TypeID,t.Discount=e.PriceDiscount,t.VariantUnitQuantity=e.VariantUnitQuantity,t.Storage=e.Storage,t.UOM=e.UOM,t.UOMName=e.UOMName,t.VariantID=e.ID,t.Taxable=e.Taxable,t.InventoryTypeID=e.TypeID,t.PriceTypeID=e.PriceTypeID,t.PriceNote=e.PriceNote,t.Variant=e,t}generateCartItemOnEdit(e){let t=new _e;return t.ID=e.ID,t.Name=e.Variant?.Name,t.ThumbnailUrl=e.Variant?.ThumbnailUrl,t.Price=e.Price,t.UnitPrice=e.Price,t.UnitCost=e.Cost,t.UnitQuantity=e.Variant?.UnitQuantity,t.Quantity=e.Quantity,t.Code=e.Variant?.Code,t.TypeID=e.Variant?.TypeID,t.Discount=e.Discount,t.VariantUnitQuantity=e.Variant?.VariantUnitQuantity,t.Storage=e.Variant?.Storage,t.UOM=e.Variant?.UOM,t.UOMName=e.Variant?.UOMName,t.VariantID=e.VariantID,t.Taxable=e.Taxable,t.Note=e.Note,t.Serial=e.Serial,t.InventoryTypeID=e.InventoryTypeID,t.PriceTypeID=e.PriceTypeID,t.Variant=e.Variant,t.PriceNote=e.PriceNote,t}static \u0275fac=function(t){return new(t||o)};static \u0275prov=N({token:o,factory:o.\u0275fac})};var je=class o{httpService=u(Y);storeService=u(P);factoryService=u(be);activatedRoute=u(zt);getLoadForm$=this.activatedRoute.queryParams.pipe(X(e=>this.httpService.post("/API/estimate/LoadForm",e)),k(e=>this.storeService.updateLoadForm(e)),k(e=>{g.IsNotEmpty(e.Data)?this.onEditOrder(e):(this.initDefaultCurrency(),this.initTag(),this.initTax())}),R());constructor(){this.getLoadForm$.subscribe()}onEditOrder(e){let t=e.Data,n=this.findTaxById(t.Order.TaxTypeID),i=this.findCurrencyById(t.Order.CurrencyID),c=this.findOutletById(t.Order.EntityID),x=this.findTagById(t.Order.TypeID),I=this.getCartItemsOnEdit(e);this.storeService.updateState(1),this.storeService.updateOrder(t.Order),this.storeService.updateCartItems(I),this.storeService.updateCustomer({Key:t.Order.CustomerID,Value:t.ContactName}),this.storeService.updateTax(n),this.storeService.updateCurrency(i),this.storeService.updateOutlet(c),this.storeService.updateDiscount({discount:t.Order.Discount,discountAmount:t.Order.DiscountAmount}),this.storeService.updateTag(x)}getCartItemsOnEdit(e){return e.Data.Items.map(i=>this.factoryService.generateCartItemOnEdit(i))}initDefaultCurrency(){let e=this.storeService.loadForm()?.AppConfigJSON?.CoreDefaults?.CurrencyID,t=this.storeService.loadForm()?.Currencies.find(n=>n.ID===e);this.storeService.updateCurrency(t)}initTag(){let e=this.storeService.loadForm()?.CustomerPOTypes;this.storeService.updateTag(e[0])}initTax(){let e=this.storeService.loadForm()?.Taxes;this.storeService.updateTax(e[0])}findTaxById(e){return(this.storeService.loadForm()?.Taxes).find(i=>i.ID===e)}findCurrencyById(e){return(this.storeService.loadForm()?.Currencies).find(i=>i.ID===e)}findOutletById(e){return(this.storeService.loadForm()?.Entities).find(i=>i.ID===e)}findTagById(e){return(this.storeService.loadForm()?.CustomerPOTypes).find(i=>i.ID===e)}static \u0275fac=function(t){return new(t||o)};static \u0275prov=N({token:o,factory:o.\u0275fac})};var Qe=class o{storeService=u(P);isOpenDialog$=j(this.storeService.loadForm).pipe(T(e=>g.IsNotEmpty(e.Entities)),ue(()=>{let e=!1,t=this.storeService.state(),n=this.storeService.outlet();return(t==0||t==1)&&(e=g.IsEmpty(n.ID)),e}));updateOutlet(e){this.storeService.updateOutlet(e)}static \u0275fac=function(t){return new(t||o)};static \u0275prov=N({token:o,factory:o.\u0275fac,providedIn:"root"})};var me=class o{storeService=u(P);httpService=u(Y);router=u(Ke);orderNumber$=j(this.storeService.outlet).pipe(T(e=>g.IsNotEmpty(e.ID)),X(e=>{if(this.storeService.state()==0)return this.httpService.post(Q.EstimateGenerateNumber,{ID:e.ID}).pipe(ue(t=>t.Number));{let t=this.storeService.order().Number;return Mt(t)}}),k(e=>{this.storeService.state()==0&&this.updateOrderNumber(e)}),R());salesPersons$=j(this.storeService.outlet).pipe(X(e=>g.IsNotEmpty(e.ID)?this.httpService.get(Q.GetSalesPersonByOutletId,[{key:"ID",value:e.ID}]):Mt([])),Ie(1));updateTagOrder$=j(this.storeService.tag).pipe(k(e=>{let t=B({},this.storeService.order());t.TypeID=e.ID,this.storeService.updateOrder(t)}),R());updateCurrencyOrder$=j(this.storeService.currency).pipe(k(e=>{let t=B({},this.storeService.order());t.CurrencyID=e.ID,this.storeService.updateOrder(t)}),R());updateTaxOrder$=j(this.storeService.tax).pipe(k(e=>{let t=B({},this.storeService.order());t.TaxTypeID=e.ID,this.storeService.updateOrder(t)}),R());updateDiscountOrder$=j(this.storeService.discount).pipe(k(e=>{let t=B({},this.storeService.order());t.Discount=e.discount,t.DiscountAmount=e.discountAmount,this.storeService.updateOrder(t)}),R());updateCustomerOrder$=j(this.storeService.customer).pipe(k(e=>{let t=B({},this.storeService.order());t.CustomerID=e.Key,this.storeService.updateOrder(t)}),R());updateEntityId$=j(this.storeService.outlet).pipe(T(e=>g.IsNotEmpty(e.ID)),k(e=>{let t=B({},this.storeService.order());t.EntityID=e.ID,this.storeService.updateOrder(t)}),R());constructor(){this.updateTagOrder$.subscribe(),this.updateCurrencyOrder$.subscribe(),this.updateTaxOrder$.subscribe(),this.updateDiscountOrder$.subscribe(),this.updateCustomerOrder$.subscribe(),this.updateEntityId$.subscribe()}newOrder(){let e=this.storeService.loadForm(),t=this.getDefaultCurrency(),n=this.storeService.outlet();this.storeService.updateOrder(new Re),this.storeService.updateCartItems([]),this.storeService.updateCustomer(new ae),this.storeService.updateTax(B({},e.Taxes[0])),this.storeService.updateCurrency(B({},t)),this.storeService.updateTag(B({},e.CustomerPOTypes[0])),this.storeService.updateDiscount({discountAmount:0,discount:0}),this.storeService.updateOutlet(B({},n)),this.router.navigate([],{queryParams:{}}),this.storeService.updateState(0)}getDefaultCurrency(){let e=this.storeService.loadForm()?.AppConfigJSON?.CoreDefaults?.CurrencyID;return this.storeService.loadForm()?.Currencies.find(n=>n.ID===e)}updateOrderNumber(e){g.IsNotEmpty(e)&&this.storeService.order().Number!==e&&this.storeService.updateOrder(Pt(B({},this.storeService.order()),{Number:e}))}updateOrderDate(e){g.IsNotEmpty(e)&&this.storeService.order().Date!==e&&this.storeService.updateOrder(Pt(B({},this.storeService.order()),{Date:e}))}updateSalesPersonId(e){let t=B({},this.storeService.order());t.SalesID=e,this.storeService.updateOrder(t)}static \u0275fac=function(t){return new(t||o)};static \u0275prov=N({token:o,factory:o.\u0275fac})};var Le=class o{storeService=u(P);httpService=u(Y);quickkeys$=j(this.storeService.outlet).pipe(T(e=>g.IsNotEmpty(e.ID)),Rt((e,t)=>e.ID===t.ID),X(e=>this.httpService.get(Q.GetQuickKeyByEntityID,[{key:"ID",value:e.ID}])),Ie(1));static \u0275fac=function(t){return new(t||o)};static \u0275prov=N({token:o,factory:o.\u0275fac})};var Vn=o=>({"qtyBtn-disabled":o}),gt=class o{disabled=!1;decimalPlaces=4;max=1e15;min=-1e15;quantity;constructor(){}ngOnInit(){}incrementQty(){this.quantity<this.max&&(this.quantity++,this.onChange(this.quantity))}decrementQty(){this.quantity>this.min&&(this.quantity--,this.onChange(this.quantity))}quantityChange(){this.onChange(this.quantity)}onChange=e=>{};onTouched=()=>{};writeValue(e){g.IsEmpty(e)?this.quantity=0:this.quantity=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=M({type:o,selectors:[["POS-input-quantity"]],inputs:{disabled:"disabled",decimalPlaces:"decimalPlaces",max:"max",min:"min"},standalone:!0,features:[De([{provide:et,multi:!0,useExisting:o}]),E],decls:6,vars:11,consts:[[1,"input-group"],["type","button","id","button-addon1",1,"btn","btn-outline-secondary","fw-bold","rounded-0","fs-2","border-end-0","py-4","qty-input","d-flex","align-items-center","qty_btn","justify-content-center",3,"click","ngClass","disabled"],["id","txtCartQuantity","type","text","autoNum","",1,"form-control","input-numpad","qty-input","text-center",3,"ngModelChange","ngModel","disabled","decimalPlaces"],["type","button","id","button-addon2",1,"btn","btn-outline-secondary","fw-bold","rounded-0","fs-5","border-start-0","py-4","qty-input","d-flex","align-items-center","qty_btn","justify-content-center",3,"click","ngClass","disabled"]],template:function(t,n){t&1&&(r(0,"div",0)(1,"button",1),d("click",function(){return n.decrementQty()}),s(2,"-"),a(),r(3,"input",2),q("ngModelChange",function(c){return W(n.quantity,c)||(n.quantity=c),c}),d("ngModelChange",function(){return n.quantityChange()}),a(),r(4,"button",3),d("click",function(){return n.incrementQty()}),s(5,"+"),a()()),t&2&&(l(),m("ngClass",$(7,Vn,n.disabled))("disabled",n.disabled),l(2),L("ngModel",n.quantity),m("disabled",n.disabled)("decimalPlaces",n.decimalPlaces),l(),m("ngClass",$(9,Vn,n.disabled))("disabled",n.disabled))},dependencies:[O,ee,oe,ne,K,ie,fe,Ce],styles:[".qtyBtn-disabled[_ngcontent-%COMP%]{background-color:#e9ecef;color:#000!important}button.qty_btn[_ngcontent-%COMP%]{background:#eee;border:1px solid #ddd;width:36px}.qty-input[_ngcontent-%COMP%]{height:36px!important}"]})};var ye=class o{storeService=u(P);autoApplyPricebook(e){let t=e?.Variant?.PriceBook?e?.Variant?.PriceBook:[],n=this.storeService.customer(),i=this.findCustomerPricebook(t,n),c=this.sortAppliedPricebooks(t,e.Quantity);return c.length>0||g.IsNotEmpty(i)?g.IsNotEmpty(i)?e=this.applyPricebook(e,i):e=this.applyPricebook(e,c[0]):e.PriceTypeID===2&&(e=this.removePricebook(e)),e}findCustomerPricebook(e=[],t){let n;return g.IsNotEmpty(t)&&g.IsNotEmpty(t?.Key)&&(n=e.find(i=>i.ID==t.PricebookID)),n}applyCustomerPricebook(){let e=[],t=this.storeService.customer(),n=this.storeService.cartItems();return g.IsNotEmpty(t.PricebookID)&&n.forEach(i=>{let c=this.findCustomerPricebook(i.Variant.PriceBook,t);c&&(i=this.applyPricebook(i,c),e.push(i))}),e}removeCustomerPricebook(e){let t=[];return this.storeService.cartItems().forEach(i=>{this.findCustomerPricebook(i.Variant.PriceBook,e)&&(i=this.removePricebook(i),t.push(i))}),t}sortAppliedPricebooks(e=[],t){return e.sort((n,i)=>i.MinimumQuantity-n.MinimumQuantity).filter(n=>t>=n.MinimumQuantity&&n.MinimumQuantity!=0)}applyPricebook(e,t){let n=this.storeService.loadForm()?.AppConfigJSON?.ModuleSell?.Pricebook?.PricebookVisible;return e.Discount=t.PriceDiscount,e.UnitPrice=t.UnitPrice,e.PriceBookID=t.ID,e.Price=t.UnitPrice,e.PriceTypeID=2,e.PriceNote=t.Name,n?e.Note=t.Name:e.Note="",e}removePricebook(e){return e.Discount=e.Variant.PriceDiscount,e.UnitPrice=e.Variant.UnitPrice,e.PriceBookID=null,e.Price=e.Variant.UnitPrice,e.PriceTypeID=0,e.Note="",e.PriceNote="",e}static \u0275fac=function(t){return new(t||o)};static \u0275prov=N({token:o,factory:o.\u0275fac})};var wt=o=>({selected:o}),Ln=()=>["/menu/Products/Catalog/Variants/Info"],Wn=o=>({ID:o});function qn(o,e){if(o&1){let t=A();y(0),r(1,"a",10),d("click",function(){f(t);let i=p();return C(i.tabState="PRODUCT")}),s(2," Product "),a(),h()}if(o&2){let t=p();l(),m("ngClass",$(1,wt,t.tabState=="PRODUCT"))}}function $n(o,e){if(o&1){let t=A();y(0),r(1,"a",11),d("click",function(){f(t);let i=p();return C(i.tabState="SERIAL")}),s(2," Serial "),a(),h()}if(o&2){let t=p();l(),m("ngClass",$(1,wt,t.tabState=="SERIAL"))}}function Hn(o,e){if(o&1&&(y(0),r(1,"div",12)(2,"div",21),D(3,"POS-variant-autocomplete",22),a()(),h()),o&2){let t=p(2);l(3),m("formControl",t.variantSearchCtrl)}}function Gn(o,e){if(o&1&&(r(0,"span"),s(1),a()),o&2){let t=p(2);l(),S("(",t.cartItem().UOMName,")")}}function zn(o,e){if(o&1){let t=A();r(0,"div",15)(1,"h6"),s(2,"Pricebook"),a(),r(3,"ng-select",23),q("ngModelChange",function(i){f(t);let c=p(2);return W(c.cartItem().PriceBookID,i)||(c.cartItem().PriceBookID=i),C(i)}),d("ngModelChange",function(i){f(t);let c=p(2);return C(c.onSelectPricebook(i))}),a()()}if(o&2){let t,n=p(2);l(3),m("items",(t=n.cartItem())==null||t.Variant==null?null:t.Variant.PriceBook),L("ngModel",n.cartItem().PriceBookID)}}function Jn(o,e){if(o&1){let t=A();y(0),v(1,Hn,4,1,"ng-container",8),r(2,"div",12)(3,"div",13)(4,"h6"),s(5," Qty "),v(6,Gn,2,1,"span",8),a(),r(7,"POS-input-quantity",14,0),q("ngModelChange",function(i){f(t);let c=p();return W(c.cartItem().Quantity,i)||(c.cartItem().Quantity=i),C(i)}),d("ngModelChange",function(){f(t);let i=p();return C(i.onQtyChange())}),a()(),r(9,"div",15)(10,"h6"),s(11,"Discount (%)"),a(),r(12,"input",16),q("ngModelChange",function(i){f(t);let c=p();return W(c.cartItem().Discount,i)||(c.cartItem().Discount=i),C(i)}),a()(),r(13,"div",15)(14,"h6"),s(15,"Price"),a(),r(16,"input",17,1),q("ngModelChange",function(i){f(t);let c=p();return W(c.cartItem().Price,i)||(c.cartItem().Price=i),C(i)}),a()(),v(18,zn,4,2,"div",15),a(),r(19,"div",18)(20,"div",19)(21,"POS-tinymce-editor",20),q("valueChange",function(i){f(t);let c=p();return W(c.cartItem().Note,i)||(c.cartItem().Note=i),C(i)}),a()()(),h()}if(o&2){let t,n=p();l(),m("ngIf",n.isEditState()==!1),l(5),m("ngIf",n.cartItem().UOMName),l(),L("ngModel",n.cartItem().Quantity),m("decimalPlaces",n.isSerialItem()?0:4),l(5),L("ngModel",n.cartItem().Discount),l(4),L("ngModel",n.cartItem().Price),m("disabled",!(!(n.roleService==null||n.roleService.sell==null)&&n.roleService.sell.UnitPriceEditor)),l(2),ze(((t=n.cartItem().Variant)==null||t.PriceBook==null?null:t.PriceBook.length)>0?18:-1),l(3),L("value",n.cartItem().Note)}}function Kn(o,e){o&1&&(y(0),D(1,"i",42),r(2,"h6"),s(3,"No Image"),a(),h())}function Yn(o,e){if(o&1&&D(0,"img",43),o&2){let t=p(2);m("src",t.cartItem().ThumbnailUrl,He)}}function Xn(o,e){if(o&1&&(y(0),r(1,"tr")(2,"td",44),s(3),_(4,"number"),a(),r(5,"td",44),s(6),_(7,"number"),a(),r(8,"td",44),s(9),_(10,"number"),a()(),h()),o&2){let t=e.ngIf;l(3),S(" ",b(4,3,t==null?null:t.OnHand)," "),l(3),S(" ",b(7,5,t==null?null:t.Allocated)," "),l(3),S(" ",b(10,7,(t==null?null:t.OnHand)-(t==null?null:t.Allocated))," ")}}function Zn(o,e){if(o&1){let t=A();r(0,"tr")(1,"th",39),s(2,"Cost"),a(),r(3,"td",45)(4,"input",46),q("ngModelChange",function(i){f(t);let c=p(2);return W(c.cartItem().UnitCost,i)||(c.cartItem().UnitCost=i),C(i)}),a()()()}if(o&2){let t,n=p(2);l(4),L("ngModel",n.cartItem().UnitCost),m("readonly",!(!((t=n.appConfig())==null||t.ModuleSell==null)&&t.ModuleSell.Cost.Enabled))}}function ei(o,e){if(o&1&&(r(0,"tr")(1,"th",39),s(2,"Content"),a(),r(3,"td",40)(4,"div",47),s(5),_(6,"number"),a()()()),o&2){let t,n=p(2);l(5),xe(" ",(t=n.cartItem())==null?null:t.VariantUnitQuantity," (@",b(6,2,n.cartItem().Price/((t=n.cartItem())==null?null:t.VariantUnitQuantity)),")")}}function ti(o,e){if(o&1&&(r(0,"div",37)(1,"table",48)(2,"thead")(3,"tr")(4,"th",49),s(5,"Storage Location"),a()()(),r(6,"tbody")(7,"tr")(8,"td"),s(9),a()()()()()),o&2){let t=p(2);l(9),S(" ",t.cartItem().Storage," ")}}function ni(o,e){if(o&1&&(y(0),r(1,"div",24)(2,"div",25)(3,"a",26),v(4,Kn,4,0,"ng-container",27)(5,Yn,1,1,"ng-template",null,2,se),a()(),r(7,"div",28)(8,"div",29)(9,"div",19)(10,"div",30),D(11,"i",31),r(12,"div",32),s(13,"Inventory"),a()(),r(14,"table",33)(15,"thead")(16,"tr")(17,"th",34),s(18,"On Hand"),a(),r(19,"th",34),s(20,"Allocated"),a(),r(21,"th",35),s(22,"Available"),a()()(),r(23,"tbody"),v(24,Xn,11,9,"ng-container",8),_(25,"async"),a()()()(),r(26,"div",36)(27,"div",37)(28,"table",38)(29,"thead"),v(30,Zn,5,2,"tr",8),r(31,"tr")(32,"th",39),s(33,"Price"),a(),r(34,"td",40),s(35),_(36,"number"),a()(),v(37,ei,7,4,"tr",8),a()()(),v(38,ti,10,1,"div",41),a()()(),h()),o&2){let t,n,i,c,x,I,ce=J(6),le=p();l(3),m("routerLink",Je(13,Ln))("queryParams",$(14,Wn,(t=le.cartItem())==null?null:t.ID)),l(),m("ngIf",((n=le.cartItem())==null?null:n.ThumbnailUrl)==null)("ngIfElse",ce),l(20),m("ngIf",b(25,9,le.variantInventory$)),l(6),m("ngIf",((i=le.appConfig())==null||i.ModuleSell==null?null:i.ModuleSell.Cost.Visible)&&le.roleService.product.Cost),l(5),S(" ",b(36,11,(c=le.cartItem())==null?null:c.Price)," "),l(2),m("ngIf",((x=le.cartItem())==null?null:x.VariantUnitQuantity)>1),l(),m("ngIf",((I=le.appConfig())==null||I.ModuleSell==null||I.ModuleSell.Grid==null?null:I.ModuleSell.Grid.StorageVisible)&&((I=le.cartItem())==null?null:I.Storage))}}function ii(o,e){if(o&1){let t=A();y(0),r(1,"app-item-serial",50),d("cartItemChange",function(i){f(t);let c=p();return C(c.onSerialChanges(i))}),a(),h()}if(o&2){let t=p();l(),m("entityId",t.storeService.outlet().ID)("cartItem",t.cartItem())}}var qe=class o{constructor(e,t){this.data=e;this.dialogRef=t;this.cartItem=F(e),this.initVariantInventory(),this.initIsSerialItem(),this.initModalConfig(),this.initDialogState()}storeService=u(P);cartItemService=u(pe);roleService=u(ge);toastr=u(Ze);pricebookService=u(ye);modalConfig=new Ae;tabState="CART";cartItem;appConfig=F(this.storeService.loadForm()?.AppConfigJSON);isSerialItem=F(!1);variantInventory$;isEditState=F(!1);showProductTab=F(!1);variantSearchCtrl=new Me;getItemFromSearch$=this.variantSearchCtrl.valueChanges.pipe(T(e=>g.IsNotEmpty(e)),X(e=>{if(e.type==="ID")return this.cartItemService.getItemByVariantId(e.str);if(e.type==="Code")return this.cartItemService.getItemByVariantByCode(e.str)}),k(e=>{this.cartItem.set(e),this.initModalTitle(),this.initProductTab(),this.initIsSerialItem(),this.initVariantInventory()}),R());ngOnInit(){this.isEditState()||this.getItemFromSearch$.subscribe()}initDialogState(){this.isEditState.set(g.IsNotEmpty(this.cartItem().VariantID)),this.initProductTab()}initVariantInventory(){this.variantInventory$=this.cartItemService.getVariantInventory(this.cartItem().VariantID).pipe(Ie(1))}initProductTab(){this.showProductTab.set(g.IsNotEmpty(this.cartItem().VariantID))}initIsSerialItem(){this.isSerialItem.set(this.cartItem().TypeID==4)}initModalConfig(){this.initModalTitle(),this.modalConfig.customWidth="680px",this.modalConfig.noPadding=!0,this.modalConfig.bodyScrollable=!0}initModalTitle(){this.modalConfig.title=this.cartItem()?.Name??"Add Variant"}onSerialChanges(e){this.cartItem.set(e)}onQtyChange(){let e=this.pricebookService.autoApplyPricebook(this.cartItem());this.cartItem.set(e)}onSelectPricebook(e){let t;if(g.IsNotEmpty(e)){let i=this.cartItem().Variant.PriceBook.find(c=>c.ID===e);t=this.pricebookService.applyPricebook(this.cartItem(),i)}else t=this.pricebookService.removePricebook(this.cartItem());this.cartItem.set(t)}onCancel(){this.dialogRef.close()}onSave(){g.IsNotEmpty(this.cartItem().VariantID)&&g.IsNotEmpty(this.cartItem().Name)?this.dialogRef.close(this.cartItem()):this.toastr.warning("Please select a product","Warning")}static \u0275fac=function(t){return new(t||o)(Z(we),Z(Oe))};static \u0275cmp=M({type:o,selectors:[["app-dialog-item"]],standalone:!0,features:[E],decls:13,vars:9,consts:[["quantity",""],["price",""],["SHOW_IMAGE",""],[3,"onOk","onCancel","onClose","config"],[1,"mb-5"],[1,"container","w-100","h-100","mt-8"],[1,"row","border-bottom","mx-5"],["data-cy","input_sell",1,"btn","btn-link",3,"click","ngClass"],[4,"ngIf"],[1,"mx-8"],["data-cy","product",1,"btn","btn-link",3,"click","ngClass"],["data-cy","serial",1,"btn","btn-link",3,"click","ngClass"],[1,"row","mt-8"],[1,"col-auto","pe-0",2,"width","145px"],[3,"ngModelChange","ngModel","decimalPlaces"],[1,"col-auto","pe-0"],["type","text","percentage","","autoNum","",1,"form-control","input-cart",2,"width","100px",3,"ngModelChange","ngModel"],["id","inputPrice","type","text","autoNum","",1,"form-control","input-cart",2,"width","112px",3,"ngModelChange","ngModel","disabled"],[1,"row","my-6"],[1,"col-12"],["height","220px",3,"valueChange","value"],[1,"col-12","px-0"],[3,"formControl"],["bindLabel","Name","bindValue","ID","placeholder","Pricebook","appendTo","body",2,"width","170px",3,"ngModelChange","items","ngModel"],[1,"row","my-8"],[1,"col-sm-4","d-flex","justify-content-center","flex-column","align-items-center","text-body-secondary"],["target","_blank",2,"color","inherit",3,"routerLink","queryParams"],[4,"ngIf","ngIfElse"],[1,"col-sm-8","inventory"],[1,"row","mb-8"],[1,"d-flex"],["aria-hidden","true",1,"fa-archive","fa-solid","fa-1x","pt-3","pe-2"],[2,"font-size","15px","font-family","'Roboto Slab'"],[1,"table","table-bordered","text-center","inventory-table"],[1,"table-light","py-6","border-end",2,"text-transform","none"],[1,"table-light","py-6",2,"text-transform","none"],[1,"row"],[1,"col-6"],[1,"table","table-bordered",2,"width","171px"],[1,"table-light",2,"text-transform","none"],[1,"pe-6","text-end"],["class","col-6",4,"ngIf"],["aria-hidden","true",1,"fa-solid","fa-image","fa-5x"],[1,"border","rounded",3,"src"],[1,"py-6"],[1,"p-0"],["type","text","autoNum","",1,"form-control","border-0","bg-white","text-end",3,"ngModelChange","ngModel","readonly"],["ngClass","ms-3"],[1,"table","table-bordered","text-center"],[1,"table-light"],[3,"cartItemChange","entityId","cartItem"]],template:function(t,n){t&1&&(r(0,"modal-material",3),d("onOk",function(){return n.onSave()})("onCancel",function(){return n.onCancel()})("onClose",function(){return n.onCancel()}),r(1,"content",4)(2,"div",5)(3,"div",6)(4,"div")(5,"a",7),d("click",function(){return n.tabState="CART"}),s(6," Cart "),a(),v(7,qn,3,3,"ng-container",8)(8,$n,3,3,"ng-container",8),a()(),r(9,"div",9),v(10,Jn,22,9,"ng-container",8)(11,ni,39,16,"ng-container",8)(12,ii,2,2,"ng-container",8),a()()()()),t&2&&(m("config",n.modalConfig),l(5),m("ngClass",$(7,wt,n.tabState=="CART")),l(2),m("ngIf",n.showProductTab()),l(),m("ngIf",n.isSerialItem()),l(2),m("ngIf",n.tabState=="CART"),l(),m("ngIf",n.tabState=="PRODUCT"),l(),m("ngIf",n.tabState=="SERIAL"))},dependencies:[O,ee,G,Pe,te,Fe,Ve,yn,oe,ne,K,ie,fe,Ce,In,Sn,Xe,Ye,st,Te,Ee,xn,hn,gt,Ne,ke],styles:[".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}.inventory-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .inventory-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:6px!important}.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:4px solid #07a519}.input-cart[_ngcontent-%COMP%]{height:36px!important}"]})};var pe=class o{httpService=u(Y);storeService=u(P);factoryService=u(be);pricebookService=u(ye);dialog=u(re);variantSearchCtrl=new Me;viewContainerRef=u(Qt);selectedCustomer;cartItemEvent=new kt;onEditCartItems$=j(this.storeService.cartItems).pipe(T(()=>this.storeService.state()==1),ue(e=>({action:"INIT",items:e})),Bt());applyCustomerPricebook$=j(this.storeService.customer).pipe(k(e=>{this.onApplyCustomerPricebook(e)}),R());cartItems$=At(this.onEditCartItems$,this.cartItemEvent.asObservable()).pipe(Ut((e,t)=>{let n=[];switch(t.action){case"INIT":n=t.items;break;case"ADD":n=this.addNewItem(e,t);break;case"UPDATE":n=this.updateItems(e,t);break;case"REMOVE":n=e.filter((i,c)=>t.index!==c);break;case"CLEAR":n=[];break;case"PURCHASE":n=this.updateItems(e,t);break;case"RETURN":n=this.updateItems(e,t);break;case"DROP":n=t.items;break}return this.storeService.updateCartItems(n),n},this.storeService.cartItems()));addCartItemBySearch$=this.variantSearchCtrl.valueChanges.pipe(T(e=>g.IsNotEmpty(e)),k(e=>{e.type==="ID"?this.addItemByVariantId(e.str):e.type==="Code"&&this.addItemByVariantCode(e.str)}),R());constructor(){this.addCartItemBySearch$.subscribe(),this.applyCustomerPricebook$.subscribe()}onApplyCustomerPricebook(e){let t=[],n=this.storeService.cartItems();g.IsNotEmpty(e.PricebookID)?(this.selectedCustomer=e,t=this.pricebookService.applyCustomerPricebook()):g.IsNotEmpty(this.selectedCustomer)&&(t=this.pricebookService.removeCustomerPricebook(this.selectedCustomer),this.selectedCustomer=null),n.forEach((i,c)=>{let x=t.find(I=>I.VariantID===i.VariantID);x&&this.updateCartItem({cartItem:x,index:c})})}onApplyPricebook(e){return this.pricebookService.autoApplyPricebook(e)}onOpenAddDialog(){this.dialog.open(qe,{data:new _e,viewContainerRef:this.viewContainerRef}).afterClosed().pipe(T(e=>g.IsNotEmpty(e))).subscribe(e=>{this.cartItemEvent.next({item:e,action:"ADD",newRow:!0})})}onOpenEditDialog(e){this.dialog.open(qe,{data:B({},e.cartItem),viewContainerRef:this.viewContainerRef}).afterClosed().pipe(T(t=>g.IsNotEmpty(t))).subscribe(t=>{this.cartItemEvent.next({item:t,action:"UPDATE",index:e.index})})}onSelectQuickkeyItem(e){this.addItemByVariantId(e)}addNewItem(e,t){let n=[],i=e.find(c=>c.VariantID===t.item?.VariantID);return i?t.newRow?(t.item=this.onApplyPricebook(t.item),n=[...e,t.item]):(i.Quantity+=1,i=this.onApplyPricebook(i),n=[...e]):(t.item=this.onApplyPricebook(t.item),n=[...e,t.item]),n}updateItems(e,t){return e.map((i,c)=>c===t.index?ln(_e,t.item):i)}onDropItems(e){this.cartItemEvent.next({action:"DROP",items:e})}addItemByVariantId(e){this.getItemByVariantId(e).pipe(k(t=>{this.cartItemEvent.next({item:t,action:"ADD",newRow:!1})})).subscribe()}addItemByVariantCode(e){this.getItemByVariantByCode(e).pipe(k(t=>{this.cartItemEvent.next({item:t,action:"ADD",newRow:!1})})).subscribe()}removeCartItem(e){this.cartItemEvent.next({action:"REMOVE",index:e.index})}updateCartItem(e){this.cartItemEvent.next({action:"UPDATE",item:e.cartItem,index:e.index})}clearCart(){this.dialog.open(An,{data:{title:"Clear Order Items",message:'<p class="h4">Are you sure you want to clear all order items?</p>',headerType:Se.Warning}}).afterClosed().pipe(T(e=>e)).subscribe(()=>{this.cartItemEvent.next({action:"CLEAR"})})}onPurchaseItem(e){this.cartItemEvent.next({action:"PURCHASE",item:e.cartItem,index:e.index})}onReturnItem(e){this.cartItemEvent.next({action:"RETURN",item:e.cartItem,index:e.index})}getItemByVariantId(e){return this.httpService.get(Q.GetVariantByID,[{key:"ID",value:e},{key:"EntityID",value:this.storeService.outlet().ID}]).pipe(ue(t=>this.factoryService.generateCartItem(t)))}getItemByVariantByCode(e){return this.httpService.get(Q.GetVariantByCode,[{key:"Code",value:e},{key:"EntityID",value:this.storeService.outlet().ID},{key:"Promotion",value:!0}]).pipe(ue(t=>this.factoryService.generateCartItem(t)))}getVariantInventory(e){return this.httpService.get(Q.GetVariantStockByID,[{key:"EntityID",value:this.storeService.outlet().ID},{key:"ID",value:e}])}static \u0275fac=function(t){return new(t||o)};static \u0275prov=N({token:o,factory:o.\u0275fac})};function oi(o,e){if(o&1&&(r(0,"td",29),s(1),a()),o&2){let t=p().index;l(),S(" ",t+1,". ")}}function ri(o,e){if(o&1&&(y(0),r(1,"div",30),D(2,"img",31),a(),h()),o&2){let t=p().$implicit;l(2),m("src",t.ThumbnailUrl,He)}}function ai(o,e){o&1&&(r(0,"div",32),D(1,"i",33),a())}function ci(o,e){if(o&1&&D(0,"small",16),o&2){let t=p().$implicit;m("innerHtml",t.Note,jt)}}function li(o,e){if(o&1&&(y(0),r(1,"span",24),s(2),_(3,"number"),a(),h()),o&2){let t=p().$implicit;l(2),U(Tt(3,1,t.Quantity,"1.0-4"))}}function si(o,e){if(o&1&&(y(0),r(1,"span",34),s(2,"x"),a(),r(3,"div",35)(4,"span",36),s(5),_(6,"number"),a()(),h()),o&2){let t=p().$implicit;l(5),U(b(6,1,t.UnitQuantity))}}function mi(o,e){if(o&1&&(y(0),r(1,"span",37),s(2),_(3,"number"),a(),h()),o&2){let t=p().$implicit;l(2),S("@",b(3,1,t.VariantUnitQuantity),"")}}function pi(o,e){if(o&1&&(y(0),r(1,"small",38),s(2),a(),h()),o&2){let t=p().$implicit;l(2),U(t.UOM?t==null?null:t.UOMName:"")}}function ui(o,e){if(o&1&&(y(0),r(1,"div",39),s(2),_(3,"number"),a(),h()),o&2){let t=p().$implicit;l(2),S(" ",Tt(3,1,t.Price,"1.0-4")," ")}}function di(o,e){if(o&1){let t=A();y(0),r(1,"tr",9),d("contextmenu",function(i){let c=f(t),x=c.$implicit,I=c.index,ce=p(2);return C(ce.onContextMenu(i,x,I))}),v(2,oi,2,1,"td",10),r(3,"td",11),d("click",function(){let i=f(t),c=i.$implicit,x=i.index,I=p(2);return C(I.onEdit(c,x))}),r(4,"div",12),v(5,ri,3,1,"ng-container",3)(6,ai,2,0,"ng-template",null,2,se),r(8,"div",13)(9,"div"),s(10),a(),r(11,"span",14),s(12),a(),r(13,"div"),D(14,"app-serial-note",15),a(),v(15,ci,1,1,"small",16),a()()(),r(16,"td",17),d("click",function(){let i=f(t),c=i.$implicit,x=i.index,I=p(2);return C(I.onEdit(c,x))}),r(17,"div",18)(18,"div",19),v(19,li,4,4,"ng-container",20)(20,si,7,3,"ng-container",20)(21,mi,4,3,"ng-container",20)(22,pi,3,1,"ng-container",20),a()()(),r(23,"td",21),d("click",function(){let i=f(t),c=i.$implicit,x=i.index,I=p(2);return C(I.onEdit(c,x))}),v(24,ui,4,4,"ng-container",20),a(),r(25,"td",21),d("click",function(){let i=f(t),c=i.$implicit,x=i.index,I=p(2);return C(I.onEdit(c,x))}),r(26,"div",22),s(27),_(28,"number"),a()(),r(29,"td",23),d("click",function(){let i=f(t),c=i.$implicit,x=i.index,I=p(2);return C(I.onEdit(c,x))}),r(30,"div",18)(31,"div",24),s(32),_(33,"number"),a()()(),r(34,"td",25)(35,"div",26)(36,"span",27),d("click",function(){let i=f(t),c=i.$implicit,x=i.index,I=p(2);return C(I.onRemove(c,x))}),D(37,"i",28),a()()()(),h()}if(o&2){let t=e.$implicit,n=J(7),i=p(2);l(2),m("ngIf",i.appConfig==null?null:i.appConfig.ModuleSell.Grid.RowNumberVisible),l(3),m("ngIf",t.ThumbnailUrl)("ngIfElse",n),l(5),U(t.Name),l(2),U(t.Code),l(2),m("serials",t==null?null:t.Serial),l(),ze(t.Note?15:-1),l(4),m("ngIf",t.Quantity!==1&&t.Quantity!==0||t.UnitQuantity>1||t.VariantUnitQuantity>1),l(),m("ngIf",t.UnitQuantity>1),l(),m("ngIf",t.VariantUnitQuantity>1),l(),m("ngIf",t.UOM&&(i.appConfig==null||i.appConfig.ModuleSell==null?null:i.appConfig.ModuleSell.Grid.UOMVisible)),l(2),m("ngIf",t.Price!==t.Total),l(3),S(" ",t.Discount?b(28,14,t.Discount*-1)+"%":""," "),l(5),S(" ",i.roleService.product!=null&&i.roleService.product.Price?b(33,16,t.Total):" - "," ")}}function gi(o,e){if(o&1){let t=A();y(0),r(1,"table",6)(2,"tbody",7),d("cdkDropListDropped",function(i){f(t);let c=p();return C(c.onDrop(i))}),v(3,di,38,18,"ng-container",8),a()(),h()}if(o&2){let t=p();l(3),m("ngForOf",t.cartItems)}}function fi(o,e){o&1&&(r(0,"div",40)(1,"div",41)(2,"div",42)(3,"div",43)(4,"div",44),D(5,"i",45),a(),r(6,"div",46)(7,"span"),s(8,"Empty Cart"),a(),D(9,"br"),r(10,"span"),s(11,"Add products to the cart"),a(),D(12,"br"),r(13,"span"),s(14,"or scan barcode"),a()()()()()())}function Ci(o,e){if(o&1){let t=A();r(0,"button",47),d("click",function(){let i=f(t).item,c=p();return C(c.onReverse(i,!0))}),s(1,"Return"),a(),r(2,"button",47),d("click",function(){let i=f(t).item,c=p();return C(c.onReverse(i,!1))}),s(3,"Purchase"),a()}}var ft=class o{roleService=u(ge);appConfig;cartItems=[];set _cartItems(e){e&&(this.cartItems=[...e])}onRemoveEvent=new V;onEditEvent=new V;onDropItems=new V;onReturnEvent=new V;onPurchaseEvent=new V;contextMenu;contextMenuPosition={x:"0px",y:"0px"};onContextMenu(e,t,n){e.preventDefault(),this.contextMenuPosition.x=e.clientX+"px",this.contextMenuPosition.y=e.clientY+"px",t.Index=n,this.contextMenu.menuData={item:t},this.contextMenu.openMenu()}onDrop(e){Xt(this.cartItems,e.previousIndex,e.currentIndex),this.onDropItems.emit(this.cartItems)}onEdit(e,t){this.onEditEvent.emit({cartItem:e,index:t})}onRemove(e,t){this.onRemoveEvent.emit({cartItem:e,index:t})}onReverse(e,t){let n=e.Index;t?(e.Quantity>0&&(e.Quantity=e.Quantity*-1),this.onReturnEvent.emit({cartItem:e,index:n})):(e.Quantity<0&&(e.Quantity=e.Quantity*-1),this.onPurchaseEvent.emit({cartItem:e,index:n}))}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=M({type:o,selectors:[["POS-cart-display"]],viewQuery:function(t,n){if(t&1&&qt(ot,7),t&2){let i;$t(i=Ht())&&(n.contextMenu=i.first)}},inputs:{appConfig:"appConfig",_cartItems:[0,"cartItems","_cartItems"]},outputs:{onRemoveEvent:"onRemove",onEditEvent:"onEdit",onDropItems:"onDropItems",onReturnEvent:"onReturn",onPurchaseEvent:"onPurchase"},standalone:!0,features:[E],decls:7,vars:7,consts:[["EMPTY_CART",""],["contextMenu","matMenu"],["NO_IMAGE",""],[4,"ngIf","ngIfElse"],[2,"visibility","hidden","position","fixed",3,"matMenuTriggerFor"],["matMenuContent",""],[1,"table","table-borderless"],["cdkDropList","",3,"cdkDropListDropped"],[4,"ngFor","ngForOf"],["cdkDrag","",1,"border-bottom",3,"contextmenu"],["style","width: 10px",4,"ngIf"],[1,"pe-0",2,"width","50%",3,"click"],[1,"d-flex","align-items-center"],[1,"d-block","ms-4",2,"line-height","18px"],[1,"fw-normal","fs-6","text-muted"],[3,"serials"],["title","Note",1,"special-TinyMCE","m-0","fst-italic","d-block",3,"innerHtml"],[1,"px-0","text-end",2,"width","15%",3,"click"],[1,"d-flex","align-items-center","justify-content-end"],[1,"d-flex","text-end","fw-normal","align-items-center",2,"line-height","20px"],[4,"ngIf"],[3,"click"],[1,"fw-normal","fs-5","text-danger"],[1,"pe-0",3,"click"],[1,"fs-5"],[1,"mt-6","ps-0"],[1,"d-flex","justify-content-end","align-items-center"],["role","button","title","Delete Item",1,"fs-3","cursor-pointer",3,"click"],[1,"fa","fa-trash","text-danger","fs-4"],[2,"width","10px"],[1,"ratio","ratio-1x1",2,"width","55px"],[1,"item-image",3,"src"],[1,"item-image","d-flex","justify-content-center","align-items-center","text-center","fs-1"],[1,"fa-solid","fa-image",2,"color","#b4b4b4c2"],[1,"fs-6","me-1","ms-1"],[1,"d-flex","algin-items-center"],["title","Unit Quantity",1,"fs-5","me-1"],["title","Variant Unit Quantity",1,"fs-5"],["title","UOM",1,"ps-1","fs-5"],[1,"fs-5","text-end"],[1,"row","g-0","h-100"],[1,"col-12"],[1,"d-flex","justify-content-center","align-items-center","h-100"],[1,"row"],[1,"col-12","d-flex","justify-content-center"],[1,"fa-regular","fa-cart-arrow-up","text-secondary",2,"font-size","110px"],[1,"col-12","justify-content-center","text-center","mt-5","empty-cart-description","text-secondary","headings-font-family"],["mat-menu-item","",3,"click"]],template:function(t,n){if(t&1&&(v(0,gi,4,1,"ng-container",3)(1,fi,15,0,"ng-template",null,0,se),D(3,"div",4),r(4,"mat-menu",null,1),v(6,Ci,4,0,"ng-template",5),a()),t&2){let i=J(2),c=J(5);m("ngIf",n.cartItems.length>0)("ngIfElse",i),l(3),Wt("left",n.contextMenuPosition.x)("top",n.contextMenuPosition.y),m("matMenuTriggerFor",c)}},dependencies:[O,de,G,te,tn,en,Zt,On,bn,_n,Cn,gn,fn,ot],styles:[".item-image[_ngcontent-%COMP%]{height:50px;width:56px;display:block;border:solid 1px #dddddd;border-radius:5px;object-fit:contain}.example-menu[_ngcontent-%COMP%]{display:inline-flex;flex-direction:column;min-width:180px;max-width:280px;background-color:#fff;padding:6px 0}.example-menu-item[_ngcontent-%COMP%]{background-color:transparent;cursor:pointer;border:none;-webkit-user-select:none;user-select:none;min-width:64px;line-height:36px;padding:0 16px;display:flex;align-items:center;flex-direction:row;flex:1}.example-menu-item[_ngcontent-%COMP%]:hover{background-color:#f5f5f5}.example-menu-item[_ngcontent-%COMP%]:active{background-color:#dcdcdc}.table[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:not(caption) > *[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{padding:12px 10px} .cdk-menu.cdk-menu-group.example-menu{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.empty-cart-description[_ngcontent-%COMP%]{font-size:14px;font-weight:500;color:#c7c7c7}"]})};var bi=(o,e)=>({"text-danger":o,"text-custom-warning":e});function vi(o,e){if(o&1&&(r(0,"mat-option",6)(1,"div",7)(2,"div",8)(3,"div"),s(4),a()()()()),o&2){let t=e.$implicit,n=p();m("value",t),l(2),m("ngClass",Gt(4,bi,t.StateID==n.customerState.Suspended,t.StateID==n.customerState.WaitingForApproval))("title",t.StateID==n.customerState.Suspended?"Suspended":t.StateID==n.customerState.WaitingForApproval?"Waiting for Approval":""),l(2),U(t==null?null:t.Value)}}var Ct=class o{httpService=u(Y);customerCtrl=new Me;customerFiltered$=this.customerCtrl.valueChanges.pipe(T(e=>typeof e=="string"&&e.length>=3),Ft(300),X(e=>this.getCustomerSuggestion(e)));customerSelected$=this.customerCtrl.valueChanges.pipe(T(e=>typeof e!="string"),k(e=>{this.onChange(e)}));createNewCustomer=new V;clickInput=new V;customerState=Pn;constructor(){this.customerSelected$.pipe(R()).subscribe()}getCustomerSuggestion(e){return this.httpService.get(Q.GetCustomerSuggestions,[{key:"count",value:100},{key:"prefix",value:e}])}displayFn(e){return e?.Value}onCreateCustomer(){this.createNewCustomer.emit()}onClickInputValue(){this.clickInput.emit()}onChange=e=>{};onTouched=()=>{};writeValue(e){this.customerCtrl.patchValue(e,{onlySelf:!0,emitEvent:!1})}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=M({type:o,selectors:[["POS-customer-autocomplete"]],outputs:{createNewCustomer:"onCreateNewCustomer",clickInput:"onClickInput"},standalone:!0,features:[De([{provide:et,multi:!0,useExisting:o}]),E],decls:7,vars:6,consts:[["auto","matAutocomplete"],[1,"d-flex","align-items-center","position-relative"],["matTooltipPosition","above","matTooltip","New Customer","role","button",1,"fa-light","fa-user-plus","position-absolute","cursor-pointer",2,"font-size","12px",3,"click"],["type","text","placeholder","Assign Customer",3,"click","formControl","matAutocomplete"],[3,"displayWith"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break",3,"ngClass","title"]],template:function(t,n){if(t&1){let i=A();r(0,"div",1)(1,"i",2),d("click",function(){return f(i),C(n.onCreateCustomer())}),a(),r(2,"input",3),d("click",function(){return f(i),C(n.onClickInputValue())}),a(),r(3,"mat-autocomplete",4,0),v(5,vi,5,7,"mat-option",5),_(6,"async"),a()()}if(t&2){let i=J(4);l(2),m("formControl",n.customerCtrl)("matAutocomplete",i),l(),m("displayWith",n.displayFn),l(2),m("ngForOf",b(6,4,n.customerFiltered$))}},dependencies:[O,ee,de,Pe,cn,rn,Yt,an,Te,ne,K,Ee,nt,tt,rt],styles:["input[_ngcontent-%COMP%]{width:100%;height:38px!important;border-radius:.375rem;border:1px solid #ced4da;padding-left:32px}input[_ngcontent-%COMP%]::placeholder{color:#ced4da}i[_ngcontent-%COMP%]{font-size:16px;top:12px;left:11px}.text-custom-warning[_ngcontent-%COMP%]{color:#ff7a00d6}"]})};var $e=class o{storeService=u(P);dialog=u(re);httpService=u(Y);createNewCustomer(){this.dialog.open(vn,{data:{options:this.storeService.loadForm()?.EstimateOptions,config:this.storeService.loadForm()?.AppConfigJSON?.ModuleContact,type:"customer",title:"New Customer Form"}}).afterClosed().pipe(T(e=>g.IsNotEmpty(e))).subscribe(e=>{let t=new ae;t.Key=e.CustomerID,t.Value=e.ContactName,this.storeService.updateCustomer(t)})}onSelectCustomer(e){let t=this.storeService.outlet();this.httpService.get(Q.GetCustomerPrivilegeByID,[{key:"ID",value:e.Key},{key:"EntityID",value:t.ID}]).pipe(Vt(()=>{let n=new ae;return this.storeService.updateCustomer(n),Nt})).subscribe(n=>{let i=JSON.parse(JSON.stringify(e));i.PricebookID=n.PricebookID,this.storeService.updateCustomer(i)})}onDeleteCustomer(){g.IsNotEmpty(this.storeService?.customer()?.Key)&&this.dialog.open(Dn,{data:{title:"Re-assign customer",message:"Are you sure to re-assign the customer?"}}).afterClosed().pipe(T(e=>e)).subscribe(()=>{let e=new ae;this.storeService.updateCustomer(e)})}static \u0275fac=function(t){return new(t||o)};static \u0275prov=N({token:o,factory:o.\u0275fac})};var _t=class o{clickEvent=new V;onClick(){this.clickEvent.emit()}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=M({type:o,selectors:[["app-note-button"]],outputs:{clickEvent:"onClickEvent"},standalone:!0,features:[E],decls:2,vars:0,consts:[["type","button",1,"btn","btn-gray","w-100","fs-3","px-0","py-6","headings-font-family",3,"click"],[1,"fa-regular","fa-note-sticky","fa-xl"]],template:function(t,n){t&1&&(r(0,"button",0),d("click",function(){return n.onClick()}),D(1,"i",1),a())},dependencies:[O],styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"]})};function yi(o,e){if(o&1&&(r(0,"div"),s(1),_(2,"number"),a()),o&2){let t=p();l(),S(" ",b(2,1,t.totalAmount)," ")}}function hi(o,e){o&1&&s(0," - ")}var bt=class o{payEvent=new V;totalItems=0;totalQuantity=0;totalAmount=0;rolePrice=!0;constructor(){}ngOnInit(){}onPay(){this.payEvent.emit()}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=M({type:o,selectors:[["app-pay-button"]],inputs:{totalItems:"totalItems",totalQuantity:"totalQuantity",totalAmount:"totalAmount",rolePrice:"rolePrice"},outputs:{payEvent:"onPayEvent"},standalone:!0,features:[E],decls:11,vars:6,consts:[["HIDDENCOST",""],["type","button",1,"btn","btn-success","fs-1","py-4","w-100",3,"click"],[1,"d-flex","align-items-center","justify-content-between"],[1,"fs-6"],[4,"ngIf","ngIfElse"]],template:function(t,n){if(t&1){let i=A();r(0,"button",1),d("click",function(){return f(i),C(n.onPay())}),r(1,"div",2)(2,"div")(3,"span"),s(4,"Submit"),a(),r(5,"small",3),s(6),_(7,"number"),a()(),v(8,yi,3,3,"div",4)(9,hi,1,0,"ng-template",null,0,se),a()()}if(t&2){let i=J(10);l(6),xe(" (",b(7,4,n.totalItems)," Items & ",n.totalQuantity," Qty) "),l(2),m("ngIf",n.rolePrice)("ngIfElse",i)}},dependencies:[O,G,te],styles:["button[_ngcontent-%COMP%]{border-right:.1px solid #fff;margin-left:-1px;border-top-left-radius:0;border-bottom-left-radius:0;position:relative;flex:1 1 auto;border-left:.1px solid #fff}"]})};var vt=class o{clickEvent=new V;onClick(){this.clickEvent.emit()}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=M({type:o,selectors:[["app-discount-button"]],outputs:{clickEvent:"onClickEvent"},standalone:!0,features:[E],decls:2,vars:0,consts:[["type","button","matTooltip","Discount / Tax","matTooltipPosition","above",1,"btn","btn-success","fs-5",3,"click"],[1,"fa-light","fa-percent"]],template:function(t,n){t&1&&(r(0,"button",0),d("click",function(){return n.onClick()}),D(1,"i",1),a())},dependencies:[O,nt,tt],styles:["button[_ngcontent-%COMP%]{border-right:.1px solid #fff;border-top-right-radius:0;border-bottom-right-radius:0;position:relative;flex:1 1 auto}"]})};var Ue=class o{store=u(P);toastr=u(Ze);dialog=u(re);updateState$=j(this.store.complete).pipe(T(e=>e.Success),k(()=>this.store.updateState(3)),R());constructor(){this.updateState$.subscribe()}onPay(){if(this.validatePayOrder()==!1)return;let t={Items:this.cartItemPreSubmission(),Order:B({},this.store.order())};this.dialog.open(Nn,{data:{transactionData:t,api:Q.SubmitEstimate}}).afterClosed().pipe(T(n=>g.IsNotEmpty(n))).subscribe(n=>{this.store.updateComplete(n)})}cartItemPreSubmission(){let e=JSON.parse(JSON.stringify(this.store.cartItems()));return e=e.map(t=>(delete t.Variant,t)),e}validatePayOrder(){let e=!0;return g.IsEmpty(this.store.outlet().ID)&&(this.toastr.error("Please select outlet before proceeding..",Se.Error),e=!1),g.IsEmpty(this.store.customer().Key)&&(this.toastr.warning("Please select a customer!",Se.Warning),e=!1),this.store.cartItems().length==0&&(this.toastr.error("You must have at least one item.",Se.Error),e=!1),g.IsEmpty(this.store.order().Number)&&(this.toastr.error("Number cannot be empty.",Se.Error),e=!1),e}static \u0275fac=function(t){return new(t||o)};static \u0275prov=N({token:o,factory:o.\u0275fac})};var yt=class o{constructor(e,t){this.dialogRef=t;this.discountAmount.set(e.discountAmount),this.discount.set(e.discount),this.tax=F(e.tax),this.currency=F(e.currency),this.taxes.set(e.taxes),this.initModalConfig()}modalConfig=new Ae;discountAmount=F(0);discount=F(0);tax;discounts=F([0,0,0]);currency;taxes=F([]);initModalConfig(){this.modalConfig.title="Discount and Tax",this.modalConfig.customWidth="400px"}onClose(){this.dialogRef.close()}onSave(){this.dialogRef.close({discountAmount:this.discountAmount(),discount:this.discount(),tax:this.tax()})}onSelectTax(e){this.tax.set(e)}onDiscountCalculatorChange(e,t){let n=this.discounts();n[t]=e,this.discounts.set(n),this.calculateDiscountCalculator()}calculateDiscountCalculator(){let e=this.discounts(),t=100;e.forEach(i=>{i&&i>0&&(t=t*(100-i)/100)});let n=100-t;this.discount.set(n)}static \u0275fac=function(t){return new(t||o)(Z(we),Z(Oe))};static \u0275cmp=M({type:o,selectors:[["app-dialog-discount"]],standalone:!0,features:[E],decls:48,vars:10,consts:[[3,"keydown.F2","onOk","onCancel","onClose","config"],[1,"container"],["matTooltipPosition","above","matTooltip","Discount","tabTitle","Discount"],[1,"row","d-flex","align-items-center","justify-content-start"],[1,"col-3"],[1,"fw-bold","d-block"],[1,"col-9"],["type","text","data-cy","discount1","autoNum","","percentage","","decimalPlaces","2",1,"form-control","d-inline-block",2,"width","100px",3,"ngModelChange","ngModel"],[1,"ms-1"],[1,"row","d-flex","align-items-center","justify-content-start","mt-6"],["type","text","data-cy","discountamount","autoNum","",1,"form-control","d-inline-block",2,"width","100px",3,"ngModelChange","ngModel"],["matTooltipPosition","above","matTooltip","Tax","tabTitle","Tax"],["bindLabel","Label","appendTo","body","bindValue","ID","placeholder","Tax","data-cy","Tax",2,"width","150px",3,"change","clearable","ngModel","items"],["matTooltipPosition","above","matTooltip","Calculation","tabTitle","Calculator"],[1,"row","mt-6","g-0","d-flex","align-items-center","justify-content-start"],[1,"col-4"],[1,"col-8","ps-4"],["type","text","data-cy","discountCal1","autoNum","","percentage","",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"],[1,"mx-2"],["type","text","data-cy","discountCal2","autoNum","","percentage","",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"],["type","text","data-cy","discountCal3","autoNum","","percentage","",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"]],template:function(t,n){if(t&1&&(r(0,"modal-material",0),d("keydown.F2",function(){return n.onSave()})("onOk",function(){return n.onSave()})("onCancel",function(){return n.onClose()})("onClose",function(){return n.onClose()}),r(1,"content")(2,"div",1)(3,"custom-tabs"),y(4),r(5,"tab",2)(6,"div",3)(7,"div",4)(8,"label",5),s(9,"Discount %"),a()(),r(10,"div",6)(11,"input",7),q("ngModelChange",function(c){return W(n.discount,c)||(n.discount=c),c}),a(),r(12,"span",8),s(13,"%"),a()()(),r(14,"div",9)(15,"div",4)(16,"label",5),s(17),a()(),r(18,"div",6)(19,"input",10),q("ngModelChange",function(c){return W(n.discountAmount,c)||(n.discountAmount=c),c}),a()()()(),h(),y(20),r(21,"tab",11)(22,"div",3)(23,"div",4)(24,"label",5),s(25,"Tax"),a()(),r(26,"div",6)(27,"ng-select",12),d("change",function(c){return n.onSelectTax(c)}),a()()()(),h(),y(28),r(29,"tab",13)(30,"div",14)(31,"div",15)(32,"label",5),s(33,"Discount Calculator"),a()(),r(34,"div",16)(35,"input",17),d("ngModelChange",function(c){return n.onDiscountCalculatorChange(c,0)}),a(),r(36,"span"),s(37," %"),a(),r(38,"span",18),s(39,"+"),a(),r(40,"input",19),d("ngModelChange",function(c){return n.onDiscountCalculatorChange(c,1)}),a(),r(41,"span"),s(42," %"),a(),r(43,"span",18),s(44,"+"),a(),r(45,"input",20),d("ngModelChange",function(c){return n.onDiscountCalculatorChange(c,2)}),a(),r(46,"span"),s(47," %"),a()()()(),h(),a()()()()),t&2){let i;m("config",n.modalConfig),l(11),L("ngModel",n.discount),l(6),S("Discount ",(i=n.currency())==null?null:i.Symbol,""),l(2),L("ngModel",n.discountAmount),l(8),m("clearable",!1)("ngModel",n.tax().ID)("items",n.taxes()),l(8),m("ngModel",n.discounts[0]),l(5),m("ngModel",n.discounts[1]),l(5),m("ngModel",n.discounts[2])}},dependencies:[O,Fe,Ve,at,lt,ct,oe,ne,K,ie,Ne,ke,fe,Ce]})};var he=class o{storeService=u(P);totalItemsQty=H(()=>this.storeService.cartItems().reduce((n,i)=>n+i.Quantity,0));totalItemsAmount=H(()=>this.storeService.cartItems().reduce((n,i)=>n+i.Total,0));taxAmount=H(()=>{let e=this.storeService.tax(),t=0;return e.Rate>0&&(e.CalculationTypeID==1?t=this.calculateTaxInclude(e):t=this.calculateTaxAdd(e)),t});totalAmount=H(()=>{let e=this.storeService.tax(),t=this.storeService.order().DiscountAmount,n=this.storeService.order().Discount,i=this.totalItemsAmount(),c=this.calculatePercentagDisc(n,i),x=i-t-c;return e.CalculationTypeID==0&&(x=x+this.taxAmount()),x});discountPercentageAmount=H(()=>{let e=this.storeService.order().Discount,t=this.totalItemsAmount();return this.calculatePercentagDisc(e,t)});calculateTaxInclude(e){let t=this.grossTotalTaxable();return e.Rate/(100+e.Rate)*t}calculateTaxAdd(e){let t=this.grossTotalTaxable();return e.Rate/100*t}grossTotalTaxable(){let e=this.taxableItems(),t=this.calculateTaxableItemsPrice(),n=this.storeService.discount();if(e.length!==0){let i=this.calculateDiscountTaxableItem();t=t*(100-n.discount)/100,t=t-i}return t}calculateDiscountTaxableItem(){let e=this.taxableItems(),t=this.totalItemsAmount(),n=this.storeService.discount().discountAmount,i=0,c=0,x=0,I=0;for(let ce of e)i=ce.getItemAfterDiscount/t,c=i*n,I=c*ce.Quantity,x+=I;return x}calculatePercentagDisc(e,t){return e/100*t}calculateTaxableItemsPrice(){return this.taxableItems().filter(n=>n.Taxable).reduce((n,i)=>n+i.Total,0)}taxableItems(){return this.storeService.cartItems().filter(t=>t.Taxable)}static \u0275fac=function(t){return new(t||o)};static \u0275prov=N({token:o,factory:o.\u0275fac})};var Ii=o=>({selected:o});function Di(o,e){if(o&1){let t=A();r(0,"div",12)(1,"span",13),s(2,"@"),a(),r(3,"input",14),q("ngModelChange",function(i){f(t);let c=p();return W(c.currency().ExchangeRate,i)||(c.currency().ExchangeRate=i),C(i)}),a()()}if(o&2){let t=p();l(3),L("ngModel",t.currency().ExchangeRate)}}function Pi(o,e){if(o&1){let t=A();r(0,"div",15)(1,"label",16)(2,"input",17),d("ngModelChange",function(){let i=f(t).$implicit,c=p();return C(c.onChangeTag(i.ID))}),a(),s(3),a()()}if(o&2){let t,n=e.$implicit,i=e.index,c=p();l(),Et("for","potype-"+i),m("ngClass",$(5,Ii,((t=c.tag())==null?null:t.ID)==n.ID)),l(),Et("id","potype-"+i),m("ngModel",c.tag().ID),l(),S(" ",n.Name," ")}}var ht=class o{constructor(e,t){this.dialogRef=t;this.initModalConfig(),this.currencies.set(e.currencies),this.tags.set(e.tags),this.tag=F(e.tag),this.currency=F(e.currency),this.defaultCurrencyId=F(e.defaultCurrencyId)}modalConfig=new Ae;currencies=F([]);tags=F([]);tag;currency;defaultCurrencyId;initModalConfig(){this.modalConfig.title="Order Note",this.modalConfig.customWidth="700px"}onChangeCurrency(e){let t=this.currencies()?.find(n=>n.ID===e);this.currency.set(t)}onChangeTag(e){let t=this.tags()?.find(n=>n.ID===e);this.tag.set(t)}onClose(){this.dialogRef.close()}onSave(){this.dialogRef.close({currency:this.currency(),tag:this.tag()})}static \u0275fac=function(t){return new(t||o)(Z(we),Z(Oe))};static \u0275cmp=M({type:o,selectors:[["app-dialog-note"]],standalone:!0,features:[E],decls:16,vars:6,consts:[[3,"keydown.F2","onOk","onCancel","onClose","config"],[1,"container"],["matTooltipPosition","above","matTooltip","Currency","tabTitle","Currency"],[1,"row","d-flex","align-items-center","justify-content-start","mt-6"],[1,"row","ms-4"],[1,"ps-0","col-sm-4"],["bindLabel","Name","bindValue","ID","placeholder","Currency","appendTo","body",3,"ngModelChange","items","clearable","ngModel"],["class","col-sm-4 d-flex",4,"ngIf"],["matTooltipPosition","above","matTooltip","Tag","tabTitle","Tag"],[1,"row"],[1,"col-12"],["class","rad-btn",4,"ngFor","ngForOf"],[1,"col-sm-4","d-flex"],[1,"pt-4"],["type","text","autoNum","",1,"border","border-light",3,"ngModelChange","ngModel"],[1,"rad-btn"],[3,"for","ngClass"],["type","radio",3,"ngModelChange","ngModel","id"]],template:function(t,n){if(t&1&&(r(0,"modal-material",0),d("keydown.F2",function(){return n.onSave()})("onOk",function(){return n.onSave()})("onCancel",function(){return n.onClose()})("onClose",function(){return n.onClose()}),r(1,"content")(2,"div",1)(3,"custom-tabs"),y(4),r(5,"tab",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"ng-select",6),d("ngModelChange",function(c){return n.onChangeCurrency(c)}),a()(),v(10,Di,4,1,"div",7),a()()(),h(),y(11),r(12,"tab",8)(13,"div",9)(14,"div",10),v(15,Pi,4,7,"div",11),a()()(),h(),a()()()()),t&2){let i;m("config",n.modalConfig),l(9),m("items",n.currencies())("clearable",!1)("ngModel",n.currency().ID),l(),m("ngIf",((i=n.currency())==null?null:i.ID)!=n.defaultCurrencyId()),l(5),m("ngForOf",n.tags())}},dependencies:[O,ee,de,G,Fe,Ve,at,lt,ct,oe,ne,Jt,K,ie,Ne,ke,fe,Ce],styles:[".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}.rad-btn[_ngcontent-%COMP%]{position:relative;display:inline-block}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #dddddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label.selected[_ngcontent-%COMP%]{background:#dcdcdc;border:1px solid #dcdcdc}"]})};var xt=class o{onClickEvent=new V;constructor(){}ngOnInit(){}onClick(){this.onClickEvent.emit()}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=M({type:o,selectors:[["app-clear-button"]],outputs:{onClickEvent:"onClickEvent"},standalone:!0,features:[E],decls:3,vars:0,consts:[["type","button",1,"btn","btn-gray","w-100","fs-3","px-0","py-6","headings-font-family",3,"click"]],template:function(t,n){t&1&&(r(0,"button",0),d("click",function(){return n.onClick()}),r(1,"span"),s(2,"Clear"),a()())},styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"]})};function Mi(o,e){if(o&1&&(y(0),r(1,"tr")(2,"th",12),s(3,"Amount"),a(),r(4,"td",13),s(5),_(6,"number"),a()(),h()),o&2){let t=p();l(5),U(b(6,1,t.calculationService==null?null:t.calculationService.totalItemsAmount()))}}function Ei(o,e){if(o&1&&(r(0,"tr")(1,"th",12),s(2),a(),r(3,"td",14),s(4),_(5,"number"),a()()),o&2){let t=p(2);l(2),S("Discount ",t.storeService==null?null:t.storeService.discount().discount,"%"),l(2),S(" ",b(5,2,t.calculationService.discountPercentageAmount()*-1),"")}}function Ti(o,e){if(o&1&&(r(0,"tr")(1,"th",12),s(2),a(),r(3,"td",14),s(4),_(5,"number"),a()()),o&2){let t,n,i=p(2);l(2),S("Discount ",(t=i.storeService.currency())==null?null:t.Symbol,""),l(2),S(" ",b(5,2,((n=i.storeService.discount())==null?null:n.discountAmount)*-1),"")}}function Oi(o,e){if(o&1&&(r(0,"tr")(1,"th",12),s(2),a(),r(3,"td",13),s(4),_(5,"number"),a()()),o&2){let t,n=p(2);l(2),U((t=n.storeService.tax())==null?null:t.Label),l(2),U(b(5,2,n.calculationService.taxAmount()))}}function wi(o,e){if(o&1&&(y(0),v(1,Ei,6,4,"tr",3)(2,Ti,6,4,"tr",3)(3,Oi,6,4,"tr",3),h()),o&2){let t,n,i=p();l(),m("ngIf",i.storeService.discount().discount!=0),l(),m("ngIf",((t=i.storeService.discount())==null?null:t.discountAmount)!=0),l(),m("ngIf",((n=i.storeService.tax())==null?null:n.Rate)!=0)}}var St=class o{storeService=u(P);orderService=u(me);roleService=u(ge);payService=u(Ue);calculationService=u(he);cartService=u(pe);dialog=u(re);taxCalculationType=it;totalItemsQty=H(()=>this.storeService.cartItems()?.length);isShowAmount=H(()=>this.storeService?.tax()?.CalculationTypeID==0&&this.storeService?.tax()?.Rate||this.storeService.discount()?.discount!=0||this.storeService.discount()?.discountAmount!=0);onOpenDialogNote(){this.dialog.open(ht,{data:{tags:this.storeService.loadForm().CustomerPOTypes,currencies:this.storeService.loadForm().Currencies,currency:this.storeService.currency(),tag:this.storeService.tag(),defaultCurrencyId:this.storeService.loadForm()?.AppConfigJSON?.CoreDefaults?.CurrencyID}}).afterClosed().pipe(T(e=>g.IsNotEmpty(e))).subscribe(e=>{this.storeService.updateCurrency(e.currency),this.storeService.updateTag(e.tag)})}onOpenDialogDiscount(){this.dialog.open(yt,{data:{discountAmount:this.storeService.order().DiscountAmount,discount:this.storeService.order().Discount,tax:this.storeService.tax(),currency:this.storeService.currency(),taxes:this.storeService.loadForm().Taxes}}).afterClosed().pipe(T(e=>g.IsNotEmpty(e))).subscribe(e=>{this.storeService.updateDiscount({discountAmount:e.discountAmount,discount:e.discount}),this.storeService.updateTax(e.tax)})}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=M({type:o,selectors:[["POS-cart-action"]],standalone:!0,features:[E],decls:13,vars:6,consts:[[1,"row","g-0","px-5","justify-content-end"],[1,"col-6",2,"padding-right","15px"],[1,"table","table-borderless"],[4,"ngIf"],[1,"row","g-0","pb-6","px-5"],[1,"col-5","d-flex","justify-content-between","pe-5",2,"column-gap","12px"],[2,"flex-grow","1",3,"onClickEvent"],[2,"flex-grow","3",3,"onClickEvent"],[1,"col-7"],[1,"btn-group","w-100"],[1,"d-inline-flex",3,"onClickEvent"],[1,"d-inline-flex","w-100",3,"onPayEvent","rolePrice","totalQuantity","totalItems","totalAmount"],[1,"text-start"],[1,"text-end","fs-5"],[1,"text-end","fs-5","text-danger"]],template:function(t,n){t&1&&(r(0,"div",0)(1,"div",1)(2,"table",2),v(3,Mi,7,3,"ng-container",3)(4,wi,4,3,"ng-container",3),a()()(),r(5,"div",4)(6,"div",5)(7,"app-note-button",6),d("onClickEvent",function(){return n.onOpenDialogNote()}),a(),r(8,"app-clear-button",7),d("onClickEvent",function(){return n.cartService.clearCart()}),a()(),r(9,"div",8)(10,"div",9)(11,"app-discount-button",10),d("onClickEvent",function(){return n.onOpenDialogDiscount()}),a(),r(12,"app-pay-button",11),d("onPayEvent",function(){return n.payService.onPay()}),a()()()()),t&2&&(l(3),m("ngIf",n.isShowAmount()),l(),m("ngIf",n.calculationService.totalItemsQty()>0),l(8),m("rolePrice",n.roleService.product.Price)("totalQuantity",n.calculationService.totalItemsQty())("totalItems",n.totalItemsQty())("totalAmount",n.calculationService.totalAmount()))},dependencies:[O,G,te,vt,_t,bt,xt]})};var Un=o=>({ID:o}),ki=()=>["/menu/Orders/Orders/Estimate/Info"],Ni=o=>({"border-top":o});function Ai(o,e){if(o&1&&(y(0),r(1,"div",28)(2,"div",29),s(3),a(),r(4,"div",29),s(5),_(6,"number"),a()(),h()),o&2){let t=e.$implicit;l(3),U(t.Name),l(2),S("",b(6,2,t.Total)," ")}}function Vi(o,e){if(o&1&&(y(0),r(1,"div",30)(2,"div",31),s(3),a(),r(4,"div",31),s(5),_(6,"number"),a()(),h()),o&2){let t,n=p();l(3),S("Amount: ",(t=n.storeService.currency())==null?null:t.Symbol,""),l(2),U(b(6,2,n.calculationService.totalItemsAmount()))}}function Fi(o,e){if(o&1&&(r(0,"div",32)(1,"div",31),s(2),_(3,"number"),a(),r(4,"div",33),s(5),_(6,"number"),a()()),o&2){let t,n=p();l(2),xe("","Discount "+b(3,3,(t=n.storeService.discount())==null?null:t.discount)+" %",": ",(t=n.storeService.currency())==null?null:t.Symbol,""),l(3),U(b(6,5,n.calculationService.discountPercentageAmount()*-1))}}function Ri(o,e){if(o&1&&(r(0,"div",32)(1,"div",31),s(2),a(),r(3,"div",33),s(4),_(5,"number"),a()()),o&2){let t,n,i=p();l(2),S("Discount: ",(t=i.storeService.currency())==null?null:t.Symbol,""),l(2),S("",b(5,2,((n=i.storeService.discount())==null?null:n.discountAmount)*-1)," ")}}function Bi(o,e){if(o&1&&(r(0,"div",32)(1,"div",31),s(2),a(),r(3,"div",31),s(4),_(5,"number"),a()()),o&2){let t,n=p();l(2),xe("",(t=n.storeService.tax())==null?null:t.Label,": ",(t=n.storeService.currency())==null?null:t.Symbol,""),l(2),U(b(5,3,n.calculationService.taxAmount()))}}var It=class o{orderService=u(me);calculationService=u(he);storeService=u(P);isShowAmount=H(()=>this.storeService?.tax()?.CalculationTypeID==0&&this.storeService?.tax()?.Rate||this.storeService.discount()?.discount!=0||this.storeService.discount()?.discountAmount!=0);handleF8(){this.orderService.newOrder()}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=M({type:o,selectors:[["POS-complete"]],hostBindings:function(t,n){t&1&&d("keydown.F8",function(c){return n.handleF8(c)},!1,Ge)},standalone:!0,features:[E],decls:40,vars:21,consts:[[1,"pt-7",2,"border-bottom","1px solid rgba(0, 0, 0, 0.1)"],[1,"ps-7","fw-normal","pb-9"],[1,"order-complete"],[1,"container-fluid","pt-8"],[1,"row"],[1,"col-8"],[1,"card"],[1,"card-header",2,"padding-bottom","15px"],[1,"fw-normal",2,"font-size","32px"],[1,"fa-solid","fa-check","me-3"],[1,"card-body"],[1,"row",2,"height","115px"],[1,"col","text-center","my-auto"],[1,"btn","btn-success","w-50",2,"font-size","20px",3,"click"],[1,"card-footer"],[1,"d-flex","justify-content-between","my-6"],["target","_blank","routerLink","/print/Estimate",1,"btn","bg-light-gray","btn-secondary",3,"queryParams"],[1,"fa-solid","fa-print","me-2"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px"],[1,"fst-italic"],["target","_blank",3,"routerLink","queryParams"],[1,"card-body","py-4"],[4,"ngFor","ngForOf"],[4,"ngIf"],["class","row justify-content-end pb-2",4,"ngIf"],[1,"row","justify-content-end","pt-4",3,"ngClass"],[1,"col-4","text-end","h5"],[1,"row","justify-content-between","border-bottom","py-2"],[1,"col","text-end"],[1,"row","justify-content-end","mt-2","pb-2"],[1,"col-4","text-end"],[1,"row","justify-content-end","pb-2"],[1,"col-4","text-end","text-danger"]],template:function(t,n){if(t&1&&(r(0,"div",0)(1,"h1",1),s(2,"Estimate"),a()(),r(3,"section",2)(4,"div",3)(5,"div",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"h1",8),D(10,"i",9),s(11,"Order Complete "),a()(),r(12,"div",10)(13,"div",11)(14,"div",12)(15,"a",13),d("click",function(){return n.orderService.newOrder()}),s(16,"New Order (F8)"),a()()()(),r(17,"div",14)(18,"div",15)(19,"a",16),D(20,"i",17),s(21,"Print Receipt"),a()()()()(),r(22,"div",18)(23,"div",6)(24,"div",19)(25,"h3",20)(26,"a",21),s(27),a()()(),r(28,"div",22),v(29,Ai,7,4,"ng-container",23)(30,Vi,7,4,"ng-container",24)(31,Fi,7,7,"div",25)(32,Ri,6,4,"div",25)(33,Bi,6,5,"div",25),r(34,"div",26)(35,"div",27),s(36),a(),r(37,"div",27),s(38),_(39,"number"),a()()()()()()()()),t&2){let i,c,x,I,ce;l(19),m("queryParams",$(14,Un,n.storeService.complete().OrderID)),l(7),m("routerLink",Je(16,ki))("queryParams",$(17,Un,n.storeService.complete().OrderID)),l(),S("Estimate #",(i=n.storeService.complete())==null?null:i.InvoiceNumber,""),l(2),m("ngForOf",n.storeService.cartItems()),l(),m("ngIf",n.isShowAmount()),l(),m("ngIf",((c=n.storeService.discount())==null?null:c.discount)>0),l(),m("ngIf",((x=n.storeService.discount())==null?null:x.discountAmount)>0),l(),m("ngIf",((I=n.storeService.tax())==null?null:I.Rate)>0),l(),m("ngClass",$(19,Ni,n.isShowAmount())),l(2),S("Total: ",(ce=n.storeService.currency())==null?null:ce.Symbol,""),l(2),U(b(39,12,n.calculationService.totalAmount()))}},dependencies:[O,ee,de,G,te,Xe,Ye,sn],styles:[".order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%]{border-bottom:1px solid rgba(0,0,0,.125);padding-bottom:.9375rem}.order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:2rem}.order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{max-width:500px;margin-top:30px;margin-bottom:30px}"]})};var Dt=class o{route=u(Ke);dialog=u(re);addItem=new V;handleF8(){this.dialog.openDialogs&&this.dialog.openDialogs.length>0||this.onAddItem()}onAddItem(){this.addItem.emit()}redirectToPrevious(){this.route.navigate(["/menu/Estimate/V1"])}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=M({type:o,selectors:[["POS-more-action"]],hostBindings:function(t,n){t&1&&d("keydown.F4",function(c){return n.handleF8(c)},!1,Ge)},outputs:{addItem:"onAddItem"},standalone:!0,features:[E],decls:14,vars:0,consts:[["id","moreMenu","data-bs-toggle","dropdown",1,"d-flex","align-items-center","cursor-pointer"],[1,"me-2"],[1,"fa-solid","fa-caret-down","fa-lg"],[1,"fs-6","headings-font-family","pb-1"],[1,"h-100","d-flex","align-items-center","justify-content-between"],["aria-labelledby","moreMenu",1,"dropdown-menu","more-actions"],[1,"d-flex"],[1,"dropdown-header","text-dark","col"],[1,"h5","mb-4"],[1,"dropdown-divider","m-0"],[1,"cursor-pointer",3,"click"],["icon","fa-circle-plus fa-solid","label","Add New"]],template:function(t,n){t&1&&(r(0,"span",0)(1,"span",1),D(2,"i",2),a(),r(3,"span",3),s(4,"More Actions"),a()(),r(5,"div",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8),s(10,"Item"),a(),D(11,"div",9),r(12,"li",10),d("click",function(){return n.onAddItem()}),D(13,"POS-dropdown-item-more-action",11),a()()()()())},dependencies:[O,wn]})};function Ui(o,e){o&1&&(y(0),D(1,"POS-complete"),h())}function ji(o,e){if(o&1){let t=A();r(0,"div",3)(1,"div",4)(2,"div",5)(3,"div",6)(4,"div",7)(5,"POS-select-outlet-form",8),_(6,"async"),d("ngModelChange",function(i){f(t);let c=p();return C(c.outletService.updateOutlet(i))}),a()(),r(7,"POS-invoice-number-form",9),_(8,"async"),d("ngModelChange",function(i){f(t);let c=p();return C(c.orderService.updateOrderNumber(i))}),a(),r(9,"POS-invoice-date",10),d("ngModelChange",function(i){f(t);let c=p();return C(c.orderService.updateOrderDate(i))}),a()()(),r(10,"div",11)(11,"div",12)(12,"div",13)(13,"POS-more-action",14),d("onAddItem",function(){f(t);let i=p();return C(i.cartItemService.onOpenAddDialog())}),a()(),r(14,"div",15)(15,"ng-select-infinite",16,1),_(17,"async"),d("selectedChange",function(i){f(t);let c=p();return C(c.orderService.updateSalesPersonId(i))}),a()()()()(),r(18,"div",17)(19,"div",18)(20,"POS-quick-key",19),_(21,"async"),d("onSelectVariant",function(i){f(t);let c=p();return C(c.cartItemService.onSelectQuickkeyItem(i))}),a()(),r(22,"div",20)(23,"div",21)(24,"div",22),D(25,"POS-variant-autocomplete",23),a(),r(26,"div",15)(27,"POS-customer-autocomplete",24),d("onCreateNewCustomer",function(){f(t);let i=p();return C(i.customerService.createNewCustomer())})("ngModelChange",function(i){f(t);let c=p();return C(c.customerService.onSelectCustomer(i))})("onClickInput",function(){f(t);let i=p();return C(i.customerService.onDeleteCustomer())}),a()()(),r(28,"POS-cart-display",25),_(29,"async"),d("onRemove",function(i){f(t);let c=p();return C(c.cartItemService.removeCartItem(i))})("onEdit",function(i){f(t);let c=p();return C(c.cartItemService.onOpenEditDialog(i))})("onDropItems",function(i){f(t);let c=p();return C(c.cartItemService.onDropItems(i))})("onPurchase",function(i){f(t);let c=p();return C(c.cartItemService.onPurchaseItem(i))})("onReturn",function(i){f(t);let c=p();return C(c.cartItemService.onReturnItem(i))}),a(),D(30,"POS-cart-action"),a()()()}if(o&2){let t,n=p();l(5),m("ngModel",n.storeService.outlet())("outlets",n.storeService.loadForm().Entities)("isOpenAfterLoad",b(6,18,n.outletService.isOpenDialog$)),l(2),m("ngModel",b(8,20,n.orderService.orderNumber$))("isEdit",n.isEditOrder()),l(2),m("ngModel",n.storeService.order().Date)("disabled",!(!(n.role==null||n.role.global==null)&&n.role.global.Date))("tooltip",!(n.role==null||n.role.global==null)&&n.role.global.Date?"":"Date role is required"),l(6),m("clearable",!0)("optionTitle",!0)("items",b(17,22,n.orderService.salesPersons$))("selected",n.storeService.order().SalesID),l(5),m("quickKey",b(21,24,n.quickkeyService.quickkeys$))("outletID",n.storeService.outlet().ID),l(5),m("formControl",n.cartItemService.variantSearchCtrl),l(2),m("ngModel",n.storeService.customer()),l(),m("cartItems",b(29,26,n.cartItemService.cartItems$))("appConfig",(t=n.storeService.loadForm())==null?null:t.AppConfigJSON)}}var jn=class o extends nn{loadFormService=u(je);storeService=u(P);role=u(ge);outletService=u(Qe);orderService=u(me);quickkeyService=u(Le);cartItemService=u(pe);customerService=u($e);intercomService=u(Kt);isCompleteOrder=H(()=>this.storeService.state()==3);isEditOrder=H(()=>this.storeService.state()==1);constructor(e){super(e),this.menuData$.subscribe(),this.intercomService.hideLauncher()}ngOnDestroy(){this.intercomService.showLauncher()}static \u0275fac=function(t){return new(t||o)(Z(on))};static \u0275cmp=M({type:o,selectors:[["POS-estimate-v2"]],standalone:!0,features:[De([P,je,Qe,me,Le,pe,$e,Ue,he,be,ye]),Lt,E],decls:3,vars:2,consts:[["NOT_COMPLETE",""],["ngSelectInfinite",""],[4,"ngIf","ngIfElse"],[1,"container-fluid"],[1,"row","header","border-bottom"],[1,"col-5","border-end"],[1,"left-toolbar-container","h-100","d-flex","align-items-center","justify-content-between"],[1,"d-flex"],[3,"ngModelChange","ngModel","outlets","isOpenAfterLoad"],["transactionType","Estimate",3,"ngModelChange","ngModel","isEdit"],[3,"ngModelChange","ngModel","disabled","tooltip"],[1,"col-7","d-flex","align-items-center"],[1,"row","flex-grow-1"],[1,"col-lg-7","col-5","d-flex","align-items-center"],[3,"onAddItem"],[1,"col-5","ps-0"],["bindValue","ID","bindLabel","Name","placeholder","Assign Sales Person",1,"sales-person","select-max-width",3,"selectedChange","clearable","optionTitle","items","selected"],[1,"row","content"],[1,"col-5","border-end","pt-1"],[3,"onSelectVariant","quickKey","outletID"],[1,"col-7","pt-5","px-0","d-flex","flex-column"],[1,"row","w-100","ms-0"],[1,"col-7","px-0"],[3,"formControl"],[3,"onCreateNewCustomer","ngModelChange","onClickInput","ngModel"],[1,"cart-display",3,"onRemove","onEdit","onDropItems","onPurchase","onReturn","cartItems","appConfig"]],template:function(t,n){if(t&1&&v(0,Ui,2,0,"ng-container",2)(1,ji,31,28,"ng-template",null,0,se),t&2){let i=J(2);m("ngIf",n.isCompleteOrder())("ngIfElse",i)}},dependencies:[O,G,Pe,Mn,Te,K,Ee,En,oe,ie,dn,pn,mn,Tn,ft,Ct,rt,st,St,It,Dt],styles:["ng-select-infinite.sales-person.select-max-width>ng-select{padding-right:10px;height:38px} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-single .ng-select-container{font-size:.75rem;border:.5px solid #d7d7d7;padding-right:6px} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-single .ng-select-container>.ng-arrow-wrapper{width:12px;padding-bottom:2px} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-single .ng-select-container>.ng-value-container{padding-left:6px} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-single .ng-select-container{min-height:38px!important;height:38px!important;border:none} ng-select-infinite.sales-person.select-max-width.offline>.ng-select.ng-select-single .ng-select-container{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-single .ng-select-container .ng-input{padding-left:5px!important} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-single .ng-select-container .ng-input>input{padding-top:5px} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-single>ng-dropdown-panel.ng-dropdown-panel{font-size:.75rem;width:95%!important} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-focused .ng-select-container{box-shadow:none!important;border-color:transparent!important}.left-toolbar-container[_ngcontent-%COMP%]{position:relative}.left-toolbar-container[_ngcontent-%COMP%] POS-invoice-number-form[_ngcontent-%COMP%]{position:absolute;top:34px;left:28px}.header[_ngcontent-%COMP%]{min-height:60px}.content[_ngcontent-%COMP%]{min-height:calc(100vh - 60px)}.supplier-more-menu[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.cart-display[_ngcontent-%COMP%]{flex-grow:1;height:0px;overflow-y:auto}input[_ngcontent-%COMP%]{width:100%;height:38px!important;border:0;border-bottom:1px solid #ced4da;padding-left:32px}input[_ngcontent-%COMP%]::placeholder{color:#ced4da}i[_ngcontent-%COMP%]{font-size:16px;top:10.6px;left:13px}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]{transition:.4s}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(1){-webkit-transform:rotate(-45deg) translate(-8px,4px);transform:rotate(-45deg) translate(-8px,4px)}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(2){opacity:0}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(3){-webkit-transform:rotate(45deg) translate(-5px,0px);transform:rotate(45deg) translate(-5px)}.mobile-button[_ngcontent-%COMP%]{display:none}@media (max-width: 990px){.mobile-button[_ngcontent-%COMP%]{display:block}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.more-actions[_ngcontent-%COMP%] div.d-flex[_ngcontent-%COMP%]{width:30rem}"]})};export{jn as EstimateV2Component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as u}from"./chunk-4G26RHGA.js";import{a as r}from"./chunk-26YXEYJK.js";import{Ib as p,la as g,ra as a}from"./chunk-H55AJAX5.js";import{a as s,b as o}from"./chunk-KW4B7WMB.js";var l=class h{control=g(u);_minLength=8;set minLength(t){r.IsEmpty(this._inputType)&&(this._minLength=t,this.initRegex())}_maxLength=10;set maxLength(t){r.IsEmpty(this._inputType)&&(this._maxLength=t,this.initRegex())}_inputType;set inputType(t){this._inputType=t,this._inputType==="phone"?(this._minLength=8,this._maxLength=13):this._inputType==="nationalId"&&(this._minLength=8,this._maxLength=16),this.initRegex()}regex;initRegex(){this.regex=new RegExp(`^[0-9]{${this._minLength},${this._maxLength}}$`)}onInput(t){let e=t.target.value;e=this.formatInput(e),this.control.control?.setValue(e,{emitEvent:!1}),this.validateMinLength(e)}onBlur(t){let n=t.target;this.validateMinLength(n.value)}validateMinLength(t){if(t.length<this._minLength&&t.length!==0)this.control.control?.setErrors(o(s({},this.control.control?.errors),{minLength:{message:this.getMessageMinLength(),requiredLength:this._minLength,actualLength:t.length}}));else{let n=s({},this.control.control?.errors);n?.minLength&&(delete n.minLength,this.control.control?.setErrors(Object.keys(n).length===0?null:n))}}getMessageMinLength(){let t="";switch(this._inputType){case"phone":t=`Phone Number must be at least ${this._minLength} digits long.`;break;case"nationalId":t=`National ID must be at least ${this._minLength} digits long.`;break;default:t=`Field must be at least ${this._minLength} digits long.`}return t}formatInput(t){return this.regex.test(t)?t:t.replace(/\D/g,"").substring(0,this._maxLength)}static \u0275fac=function(n){return new(n||h)};static \u0275dir=a({type:h,selectors:[["","numericInputOnly",""]],hostBindings:function(n,e){n&1&&p("input",function(i){return e.onInput(i)})("blur",function(i){return e.onBlur(i)})},inputs:{minLength:"minLength",maxLength:"maxLength",inputType:[0,"numericInputOnly","inputType"]},standalone:!0})};export{l as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as A}from"./chunk-YBINYTS7.js";import"./chunk-AA32I4UN.js";import"./chunk-I6YPWC52.js";import{a as K}from"./chunk-CPW6IWAB.js";import{g as z,h as J}from"./chunk-XRKZOON6.js";import"./chunk-4CBDK52E.js";import{b as q}from"./chunk-CBW7IA6S.js";import"./chunk-VPAQFQA7.js";import"./chunk-AOPKPEVH.js";import"./chunk-V4RKZMUB.js";import{Aa as k,Ba as G}from"./chunk-2FKYC63K.js";import"./chunk-2W3MAOOP.js";import"./chunk-AWGZKLLY.js";import"./chunk-DXF4M3Z6.js";import"./chunk-WK4T26FX.js";import"./chunk-BCVO66L3.js";import"./chunk-LHWN2J4H.js";import"./chunk-2FWFPV5I.js";import{C as R,h as H,n as W}from"./chunk-4G26RHGA.js";import"./chunk-R7NR3M2Q.js";import"./chunk-MA7NEQCZ.js";import"./chunk-26YXEYJK.js";import"./chunk-WG6PV6VL.js";import{a as j}from"./chunk-RRKCUSBB.js";import{$c as O,Ab as n,Fb as v,Ib as N,Kb as S,Sd as B,Ua as l,Va as c,Zb as o,Zc as L,_b as u,cc as _,cd as V,dc as b,eb as y,ec as h,gb as I,gc as F,mb as d,pa as D,qc as C,rc as T,sc as E,vb as x,wa as p,wc as P,xa as s,xb as M,yb as w,zb as i}from"./chunk-H55AJAX5.js";import"./chunk-KW4B7WMB.js";function X(r,g){if(r&1){let e=v();i(0,"div")(1,"div",9)(2,"h6"),o(3,"Outlet"),n(),i(4,"outlet-selector",10),h("ngModelChange",function(t){p(e);let m=S();return b(m.pageData.Filter.ListIDs,t)||(m.pageData.Filter.ListIDs=t),s(t)}),n()()()}if(r&2){let e=S();l(4),d("accessType",2),_("ngModel",e.pageData.Filter.ListIDs),d("multiple",!0)}}function Y(r,g){if(r&1&&(i(0,"tr")(1,"td"),o(2),n(),i(3,"td"),o(4),C(5,"number"),n(),i(6,"td"),o(7),C(8,"date"),n()()),r&2){let e=g.$implicit;l(2),u(e==null?null:e.EntityName),l(2),u(T(5,3,e==null?null:e.Number)),l(3),u(E(8,5,e==null?null:e.Modified,"dd MMM yyyy HH:mm"))}}var Q=class r extends A{constructor(e,a,t){super(e,a,"Setup/Data/TransactionInvoiceNumber",null,t);this.httpService=a}preGetList(){let e=this.pageData.Filter?.ListIDs?this.pageData.Filter?.ListIDs:[];this.pageData.Filter={ListIDs:e}}static \u0275fac=function(a){return new(a||r)(c(q),c(j),c(B))};static \u0275cmp=D({type:r,selectors:[["app-invoice-numbering"]],standalone:!0,features:[y,F],decls:19,vars:4,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","isFilterOnDropdown","hideSearchBox","filter"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],["matTooltip","Next invoice number index to be generated",2,"width","200px"],[2,"width","200px"],[1,"dialog-filter"],["placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple"]],template:function(a,t){if(a&1){let m=v();i(0,"mainpanel-cmp",1),N("onSubmit",function(){return p(m),s(t.searchFromPageOne())}),h("filterChange",function(f){return p(m),b(t.pageData.Filter,f)||(t.pageData.Filter=f),s(f)}),i(1,"filters"),I(2,X,5,3,"ng-template",null,0,P),n(),i(4,"content")(5,"div",2)(6,"div",3)(7,"table",4)(8,"thead",5)(9,"tr",6)(10,"th"),o(11,"Outlet"),n(),i(12,"th",7),o(13," Next Number "),n(),i(14,"th",8),o(15,"Modified"),n()()(),i(16,"tbody"),M(17,Y,9,8,"tr",null,x),n()()()()()()}a&2&&(d("pageData",t.menuData)("isFilterOnDropdown",!1)("hideSearchBox",!0),_("filter",t.pageData.Filter),l(17),w(t.data==null?null:t.data.Data))},dependencies:[V,O,L,J,z,K,R,H,W,G,k]})};export{Q as InvoiceNumberingComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=class{ID;Code;Name;Title;Field;Address;ContactInfo;Logo;FooterLeft;FooterRight;FooterNote;PrintMode;PrintLX300;DeliveryNote;AppendQR;ItemRenderMode;CssClass;RemoveImage;DisplayName;DisplayNameCode};export{s as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as f}from"./chunk-VPAQFQA7.js";import{b as g}from"./chunk-LHWN2J4H.js";import{Aa as d,Ab as r,Bb as l,Ua as h,eb as p,gc as c,lb as a,mb as u,pa as s,qb as m,ya as C,zb as o}from"./chunk-H55AJAX5.js";var w=(()=>{class t extends f{static \u0275fac=(()=>{let n;return function(e){return(n||(n=d(t)))(e||t)}})();static \u0275cmp=s({type:t,selectors:[["ChevronDownIcon"]],standalone:!0,features:[p,c],decls:2,vars:5,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M7.01744 10.398C6.91269 10.3985 6.8089 10.378 6.71215 10.3379C6.61541 10.2977 6.52766 10.2386 6.45405 10.1641L1.13907 4.84913C1.03306 4.69404 0.985221 4.5065 1.00399 4.31958C1.02276 4.13266 1.10693 3.95838 1.24166 3.82747C1.37639 3.69655 1.55301 3.61742 1.74039 3.60402C1.92777 3.59062 2.11386 3.64382 2.26584 3.75424L7.01744 8.47394L11.769 3.75424C11.9189 3.65709 12.097 3.61306 12.2748 3.62921C12.4527 3.64535 12.6199 3.72073 12.7498 3.84328C12.8797 3.96582 12.9647 4.12842 12.9912 4.30502C13.0177 4.48162 12.9841 4.662 12.8958 4.81724L7.58083 10.1322C7.50996 10.2125 7.42344 10.2775 7.32656 10.3232C7.22968 10.3689 7.12449 10.3944 7.01744 10.398Z","fill","currentColor"]],template:function(i,e){i&1&&(C(),o(0,"svg",0),l(1,"path",1),r()),i&2&&(m(e.getClassNames()),a("aria-label",e.ariaLabel)("aria-hidden",e.ariaHidden)("role",e.role))},encapsulation:2})}return t})();var D=(()=>{class t extends f{pathId;ngOnInit(){this.pathId="url(#"+g()+")"}static \u0275fac=(()=>{let n;return function(e){return(n||(n=d(t)))(e||t)}})();static \u0275cmp=s({type:t,selectors:[["SpinnerIcon"]],standalone:!0,features:[p,c],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M6.99701 14C5.85441 13.999 4.72939 13.7186 3.72012 13.1832C2.71084 12.6478 1.84795 11.8737 1.20673 10.9284C0.565504 9.98305 0.165424 8.89526 0.041387 7.75989C-0.0826496 6.62453 0.073125 5.47607 0.495122 4.4147C0.917119 3.35333 1.59252 2.4113 2.46241 1.67077C3.33229 0.930247 4.37024 0.413729 5.4857 0.166275C6.60117 -0.0811796 7.76026 -0.0520535 8.86188 0.251112C9.9635 0.554278 10.9742 1.12227 11.8057 1.90555C11.915 2.01493 11.9764 2.16319 11.9764 2.31778C11.9764 2.47236 11.915 2.62062 11.8057 2.73C11.7521 2.78503 11.688 2.82877 11.6171 2.85864C11.5463 2.8885 11.4702 2.90389 11.3933 2.90389C11.3165 2.90389 11.2404 2.8885 11.1695 2.85864C11.0987 2.82877 11.0346 2.78503 10.9809 2.73C9.9998 1.81273 8.73246 1.26138 7.39226 1.16876C6.05206 1.07615 4.72086 1.44794 3.62279 2.22152C2.52471 2.99511 1.72683 4.12325 1.36345 5.41602C1.00008 6.70879 1.09342 8.08723 1.62775 9.31926C2.16209 10.5513 3.10478 11.5617 4.29713 12.1803C5.48947 12.7989 6.85865 12.988 8.17414 12.7157C9.48963 12.4435 10.6711 11.7264 11.5196 10.6854C12.3681 9.64432 12.8319 8.34282 12.8328 7C12.8328 6.84529 12.8943 6.69692 13.0038 6.58752C13.1132 6.47812 13.2616 6.41667 13.4164 6.41667C13.5712 6.41667 13.7196 6.47812 13.8291 6.58752C13.9385 6.69692 14 6.84529 14 7C14 8.85651 13.2622 10.637 11.9489 11.9497C10.6356 13.2625 8.85432 14 6.99701 14Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(i,e){i&1&&(C(),o(0,"svg",0)(1,"g"),l(2,"path",1),r(),o(3,"defs")(4,"clipPath",2),l(5,"rect",3),r()()()),i&2&&(m(e.getClassNames()),a("aria-label",e.ariaLabel)("aria-hidden",e.ariaHidden)("role",e.role),h(),a("clip-path",e.pathId),h(3),u("id",e.pathId))},encapsulation:2})}return t})();export{w as a,D as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as te}from"./chunk-CW27R4N3.js";import{g as U,h as re}from"./chunk-XRKZOON6.js";import"./chunk-4CBDK52E.js";import{a as Q,b as H}from"./chunk-CBW7IA6S.js";import"./chunk-VPAQFQA7.js";import"./chunk-AOPKPEVH.js";import{L as A}from"./chunk-V4RKZMUB.js";import"./chunk-2FKYC63K.js";import{G as ie,O as ne}from"./chunk-2W3MAOOP.js";import"./chunk-BCVO66L3.js";import"./chunk-LHWN2J4H.js";import"./chunk-2FWFPV5I.js";import"./chunk-4G26RHGA.js";import"./chunk-R7NR3M2Q.js";import"./chunk-MA7NEQCZ.js";import{d as ee}from"./chunk-26YXEYJK.js";import"./chunk-WG6PV6VL.js";import{a as R}from"./chunk-RRKCUSBB.js";import{$b as f,$c as B,Ab as i,Bb as h,Cb as I,Db as D,Fb as O,Ib as y,Kb as m,Qd as q,Rc as k,Sc as L,Sd as Z,Ua as o,Va as x,Yb as T,Zb as r,Zc as j,_b as v,ac as K,ba as u,cd as Y,d as w,eb as V,gb as d,ia as M,mb as c,pa as $,qa as N,qc as _,rc as C,sc as b,tc as X,wa as g,wc as P,xa as S,zb as n}from"./chunk-H55AJAX5.js";import"./chunk-KW4B7WMB.js";function ue(t,a){if(t&1){let e=O();n(0,"a",19),y("click",function(){g(e);let l=m();return S(l.convertToCsv())}),h(1,"i",20),r(2," Export Fail"),i()}}function xe(t,a){if(t&1){let e=O();n(0,"a",21),y("click",function(){g(e);let l=m();return S(l.uploadOrders())}),h(1,"i",22),r(2," Send Transaction"),i()}}function ve(t,a){t&1&&(n(0,"th",23)(1,"i"),r(2,"Actions"),i()())}function ge(t,a){if(t&1&&(n(0,"span"),r(1),i()),t&2){let e=m().$implicit;o(),v(e==null||e.Variant==null?null:e.Variant.Name)}}function Se(t,a){if(t&1&&(n(0,"div",28),d(1,ge,2,1,"span",29),i()),t&2){let e=a.$implicit;o(),c("ngIf",e!=null)}}function he(t,a){if(t&1&&(n(0,"span"),r(1),i()),t&2){let e=m().$implicit;o(),f(" ",e==null?null:e.Quantity," ")}}function Oe(t,a){if(t&1&&(n(0,"div",30),d(1,he,2,1,"span",29),i()),t&2){let e=a.$implicit;o(),c("ngIf",e!=null)}}function ye(t,a){if(t&1&&(n(0,"span"),r(1),_(2,"number"),i()),t&2){let e=m().$implicit;o(),f(" ",C(2,1,e.Price)," ")}}function Ce(t,a){if(t&1&&(n(0,"div",30),d(1,ye,3,3,"span",29),i()),t&2){let e=a.$implicit;o(),c("ngIf",e!=null)}}function be(t,a){if(t&1&&(n(0,"span"),r(1),_(2,"number"),i()),t&2){let e=m().$implicit;o(),f(" ",C(2,1,e.Quantity*e.UnitQuantity*e.Price*(1-e.Discount/100)-e.DiscountAmount)," ")}}function Ee(t,a){if(t&1&&(n(0,"div",30),d(1,be,3,3,"span",29),i()),t&2){let e=a.$implicit;o(),c("ngIf",e!=null)}}function Ie(t,a){if(t&1){let e=O();n(0,"td",31)(1,"i",32),y("click",function(){g(e);let l=m().$implicit,p=m(2);return S(p.removeOrder(l))}),i()()}}function De(t,a){if(t&1&&(n(0,"tr")(1,"td"),r(2),i(),n(3,"td"),r(4),_(5,"date"),i(),n(6,"td"),d(7,Se,2,1,"div",25),i(),n(8,"td"),d(9,Oe,2,1,"div",26),i(),n(10,"td"),d(11,Ce,2,1,"div",26),i(),n(12,"td"),d(13,Ee,2,1,"div",26),i(),d(14,Ie,2,0,"td",27),i()),t&2){let e=a.$implicit,s=m(2);o(2),v(e.Order.Number),o(2),v(b(5,7,e.Order.Date,"dd MMM yyyy")),o(3),c("ngForOf",e.CartItems),o(2),c("ngForOf",e.CartItems),o(2),c("ngForOf",e.CartItems),o(2),c("ngForOf",e.CartItems),o(),c("ngIf",s.roleService.sell.Delete)}}function Te(t,a){if(t&1&&(I(0),d(1,De,15,10,"tr",24),D()),t&2){let e=m();o(),c("ngForOf",e.offlineOrders)}}function Pe(t,a){t&1&&(n(0,"td",33)(1,"h4",34),r(2,"There is no Offline Order"),i()())}function Fe(t,a){if(t&1&&(I(0),n(1,"span"),r(2),n(3,"strong"),r(4),i(),n(5,"strong"),r(6),_(7,"number"),i(),n(8,"strong"),r(9),_(10,"number"),i()(),D()),t&2){let e=m().$implicit;o(2),f("",e==null||e.Variant==null?null:e.Variant.Name," "),o(2),f(" ",e.Quantity+" x"," "),o(2),f(" ",C(7,4,e.Price)+" ="," "),o(3),f(" ",C(10,6,e.Quantity*e.UnitQuantity*e.Price*(1-e.Discount/100)-e.DiscountAmount)," ")}}function we(t,a){if(t&1&&(n(0,"div",40),d(1,Fe,11,8,"ng-container",29),i()),t&2){let e=a.$implicit;o(),c("ngIf",e!=null)}}function Me(t,a){if(t&1&&(n(0,"div",41),r(1),i()),t&2){let e=m().$implicit;o(),f(" ",e.Message," ")}}function $e(t,a){if(t&1){let e=O();I(0),n(1,"a",42),y("click",function(){g(e);let l=m().$implicit,p=m(2);return S(p.removeFailedOrder(l))}),h(2,"i",43),i(),D()}}function Ne(t,a){if(t&1){let e=O();n(0,"tr")(1,"td"),r(2),i(),n(3,"td"),r(4),_(5,"date"),i(),n(6,"td"),d(7,we,2,1,"div",35),i(),n(8,"td"),d(9,Me,2,1,"div",36),i(),n(10,"td",37)(11,"a",38),y("click",function(){let l=g(e).$implicit,p=m(2);return S(p.uploadFailedOrder(l))}),h(12,"i",39),i(),d(13,$e,3,0,"ng-container",29),i()()}if(t&2){let e=a.$implicit,s=m(2);o(2),v(e.Order.Number),o(2),v(b(5,5,e.Order.Date,"dd MMM yyyy")),o(3),c("ngForOf",e.CartItems),o(2),c("ngIf",e.Message),o(4),c("ngIf",s.roleService.sell.Delete)}}function Ve(t,a){if(t&1&&(I(0),d(1,Ne,14,8,"tr",24),D()),t&2){let e=m();o(),c("ngForOf",e.failedOrders)}}function ke(t,a){t&1&&(n(0,"td",44)(1,"h4",34),r(2,"There is no Failed Order"),i()())}var G=class t extends Q{constructor(e,s,l,p,E,F){super(e);this.httpService=s;this.localData=l;this.csvConverter=p;this.toastr=E;this.roleService=F;this.destroy$=new w,this.pageData={Header:"Offline Orders"}}pageData;offlineOrders=[];failedOrders=[];destroy$;ngOnInit(){this.menuData$.pipe(u(this.destroy$)).subscribe(()=>{this.getOfflineOrders(),this.getFailedOrders()})}removeOrder(e){this.localData.removeOrder(e.id).subscribe({next:()=>{this.toastr.success("Successfully removed order "+e.Order.Number,"Offline Order Deleted!"),this.getOfflineOrders()},error:s=>{this.toastr.warning("Failed to remove order "+e.Order.Number,"Failed to delete order!")}})}getOfflineOrders(){this.localData.findAllOrders().pipe(u(this.destroy$)).subscribe({next:e=>{this.offlineOrders=e},error:e=>{this.toastr.error(e.message,"Error!")}})}getFailedOrders(){this.localData.getFailedOrders().pipe(u(this.destroy$)).subscribe({next:e=>{this.failedOrders=e},error:e=>{this.toastr.error(e.message,"Error!")}})}uploadFailedOrder(e){this.localData.uploadFailedOrder(e).pipe(u(this.destroy$)).subscribe({next:()=>{this.toastr.success("Successfully uploaded order "+e.Order.Number,"Sync Successful!"),this.getFailedOrders()},error:()=>{this.toastr.error("Failed to sync failed order "+e.Order.Number,"Error!")}})}removeFailedOrder(e){this.localData.removeFailedOrder(e.id).pipe(u(this.destroy$)).subscribe({next:s=>{this.toastr.success("Success to remove failed offline order","Error!"),this.getFailedOrders()},error:s=>{this.toastr.error("Failed to remove failed offline order","Error!")}})}uploadOrders(){this.localData.uploadOrders().pipe(u(this.destroy$)).subscribe({next:e=>{e?this.getOfflineOrders():(this.getOfflineOrders(),this.getFailedOrders())},error:e=>{this.getOfflineOrders(),this.getFailedOrders()}})}convertToCsv(){this.csvConverter.convertToCSV(this.getExportData(),"Fail_Transaction.csv")}getExportData(){let e=[["Number","Date","Item","Qty","Price","Total"]];return this.failedOrders.forEach(s=>{s.Items.forEach(l=>{let p=s.Order.Number.toString(),E=s.Order.Date.toLocaleString(),F=l.Quantity.toString(),ae=l.Price.toString(),le=(l.Quantity*l.UnitQuantity*(l.Price*(1-l.Discount/100))-l.DiscountAmount).toString(),se=[p,E,l.Variant.Name,F,ae,le];e.push(se)})}),e}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(s){return new(s||t)(x(H),x(R),x(A),x(te),x(Z),x(ee))};static \u0275cmp=$({type:t,selectors:[["pos-orders"]],features:[V],decls:54,vars:10,consts:[["noOrders",""],["noFailedOrders",""],[3,"pageData","hideSearchDropdown","hideSearchBox"],["matTooltipPosition","above","matTooltip","Export","class","btn btn-outline-secondary me-6",3,"click",4,"ngIf"],["value","Send Transaction","matTooltipPosition","above","matTooltip","Send Transaction","class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"container-fluid"],[1,"row","mt-10","mb-12"],[1,"col-md"],[1,"table","mt-5"],[1,"thead-light","sticky-top-thead"],[1,"border-end",2,"width","130px"],[1,"border-end",2,"width","90px"],[1,"border-end"],[1,"border-end","text-end",2,"width","103px"],[1,"border-end","text-end",2,"width","200px"],["class","text-center","style","width: 90px",4,"ngIf"],[4,"ngIf","ngIfElse"],[1,"row","mt-12"],[1,"border-end",2,"width","102px"],["matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],["value","Send Transaction","matTooltipPosition","above","matTooltip","Send Transaction",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa","fa-paper-plane"],[1,"text-center",2,"width","90px"],[4,"ngFor","ngForOf"],["class","list-unstyled text-start",4,"ngFor","ngForOf"],["class","list-unstyled text-end",4,"ngFor","ngForOf"],["class","text-center text-danger",4,"ngIf"],[1,"list-unstyled","text-start"],[4,"ngIf"],[1,"list-unstyled","text-end"],[1,"text-center","text-danger"],[1,"fa-solid","fa-xmark","fa-2x","cursor-pointer",3,"click"],["colspan","7"],[1,"text-center","mt-2"],["class","list-inline text-start",4,"ngFor","ngForOf"],["class","text-danger",4,"ngIf"],[1,"d-flex","justify-content-center"],["matTooltipPosition","above","matTooltip","Sync",1,"ms-2","me-2","cursor-pointer",3,"click"],["aria-hidden","true",1,"fa-solid","fa-cloud-arrow-up","text-primary","fa-2x"],[1,"list-inline","text-start"],[1,"text-danger"],["matTooltipPosition","above","matTooltip","Remove",1,"ms-5","cursor-pointer",3,"click"],["aria-hidden","true",1,"fa-regular","fa-xmark-circle","text-primary","fa-2x"],["colSpan","5"]],template:function(s,l){if(s&1&&(n(0,"mainpanel-cmp",2)(1,"actions"),d(2,ue,3,0,"a",3)(3,xe,3,0,"a",4),i(),n(4,"content")(5,"div",5)(6,"div",6)(7,"div",7)(8,"h5"),r(9,"Offline Orders"),i(),n(10,"i"),r(11,"Waiting to be uploaded to the server!"),i(),n(12,"table",8)(13,"thead",9)(14,"tr")(15,"th",10),r(16,"Number"),i(),n(17,"th",11),r(18,"Date"),i(),n(19,"th",12),r(20,"item"),i(),n(21,"th",13),r(22," Qty "),i(),n(23,"th",14),r(24," Price "),i(),n(25,"th",14),r(26," Total "),i(),d(27,ve,3,0,"th",15),i()(),n(28,"tbody"),d(29,Te,2,1,"ng-container",16)(30,Pe,3,0,"ng-template",null,0,P),i()()()(),n(32,"div",17)(33,"div",7)(34,"h5"),r(35,"Synchronization Errors"),i(),n(36,"i"),r(37,"Exception occured when trying to upload these orders"),i(),n(38,"table",8)(39,"thead",9)(40,"tr")(41,"th",11),r(42,"Number"),i(),n(43,"th",11),r(44,"Date"),i(),n(45,"th",12),r(46,"item"),i(),n(47,"th",12),r(48,"Sync exception"),i(),h(49,"th",18),i()(),n(50,"tbody"),d(51,Ve,2,1,"ng-container",16)(52,ke,3,0,"ng-template",null,1,P),i()()()()()()()),s&2){let p=T(31),E=T(53);c("pageData",l.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),o(2),c("ngIf",(l.failedOrders==null?null:l.failedOrders.length)>0),o(),c("ngIf",l.offlineOrders.length>0),o(24),c("ngIf",l.roleService.sell.Delete),o(2),c("ngIf",l.offlineOrders.length>0)("ngIfElse",p),o(22),c("ngIf",l.failedOrders.length>0)("ngIfElse",E)}},dependencies:[k,L,U,B,j],styles:[".cursor-pointer[_ngcontent-%COMP%]{cursor:pointer}"]})};function Le(t,a){if(t&1&&(n(0,"div",5),h(1,"i",6),r(2),_(3,"date"),i()),t&2){let e=m();o(2),f(" ",b(3,1,e.LastSync,"dd MMM yyyy HH:mm:ss")," ")}}function je(t,a){if(t&1&&(n(0,"tr")(1,"td",15),r(2),i(),n(3,"td",16),r(4),i(),n(5,"td"),r(6),i(),n(7,"td",11),r(8),_(9,"number"),i()()),t&2){let e=a.$implicit,s=m(2);o(2),v(e.ID),o(2),v(e.Name),o(2),v(e.Code),o(2),K(" ",s.currency," ",b(9,5,e.UnitPrice,"1.0-4")," ")}}function Be(t,a){if(t&1&&(n(0,"table",7)(1,"thead",8)(2,"tr",9)(3,"th",10),r(4,"ID"),i(),n(5,"th",10),r(6,"Name"),i(),n(7,"th",10),r(8,"Code"),i(),n(9,"th",11),r(10,"Unit Price"),i()()(),n(11,"tbody"),d(12,je,10,8,"tr",12),_(13,"sortBy"),i(),n(14,"tfoot")(15,"tr",13)(16,"td",14)(17,"strong"),r(18),_(19,"number"),i()()()()()),t&2){let e=m();o(12),c("ngForOf",X(13,2,e.variantList,"asc","Name")),o(6),f("",C(19,6,e.variantList.length)," Product ")}}function Re(t,a){t&1&&(n(0,"h3",17),r(1,"Product has not been synced yet!"),i())}var z=class t extends Q{constructor(e,s,l){super(e);this.httpService=s;this._localDataService=l;this.destroy$=new w}variantList=[];OriginalList=[];LastSync;currency;destroy$;ngOnInit(){this.menuData$.subscribe(e=>{this.getVariants(),this.getSyncDate(),this.getCurrency()})}getVariants(){this._localDataService.findAllVariant().pipe(u(this.destroy$)).subscribe({next:e=>{this.OriginalList=e,this.variantList=this.OriginalList},error:e=>{console.error(e)}})}getSyncDate(){this._localDataService.getSyncTime().pipe(u(this.destroy$)).subscribe(e=>{this.LastSync=new Date(e.time)})}getCurrency(){this._localDataService.getPOSStorage().pipe(u(this.destroy$)).subscribe(e=>{e&&(this.currency=e.Currencies[0].Symbol)})}filterList(e){this.variantList=this.OriginalList.filter(s=>s.Name.includes(e))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(s){return new(s||t)(x(H),x(R),x(A))};static \u0275cmp=$({type:t,selectors:[["pos-products"]],features:[V],decls:8,vars:5,consts:[["noProduct",""],[3,"textChange","pageData","hideSearchDropdown"],["class","h5",4,"ngIf"],[1,"container-fluid","mt-5"],["id","tableGrid","class","table",4,"ngIf","ngIfElse"],[1,"h5"],[1,"fa-solid","fa-sync-alt"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-start"],[1,"text-end"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","4",1,"text-start","empty-column"],[2,"max-width","100px"],[2,"max-width","300px"],[1,"text-center","mt-4"]],template:function(s,l){if(s&1){let p=O();n(0,"mainpanel-cmp",1),y("textChange",function(F){return g(p),S(l.filterList(F))}),n(1,"actions"),d(2,Le,4,4,"div",2),i(),n(3,"content")(4,"div",3),d(5,Be,20,8,"table",4)(6,Re,2,0,"ng-template",null,0,P),i()()()}if(s&2){let p=T(7);c("pageData",l.menuData)("hideSearchDropdown",!0),o(2),c("ngIf",l.LastSync),o(3),c("ngIf",l.variantList.length>0)("ngIfElse",p)}},dependencies:[k,L,U,B,j,ie]})};var Qe=[{path:"Products",component:z},{path:"Orders",component:G},{path:"**",redirectTo:"Products",pathMatch:"full"}],W=class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=N({type:t});static \u0275inj=M({imports:[q.forChild(Qe),q]})};var oe=class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=N({type:t});static \u0275inj=M({imports:[Y,W,re,ne]})};export{oe as OfflineModule};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as M,l as u,n as _,o as h,p as T,q as O}from"./chunk-V4RKZMUB.js";import{Ab as f,Bb as p,Ib as c,Pa as d,Ua as s,Va as t,cd as g,gc as C,mb as i,pa as r,zb as a}from"./chunk-H55AJAX5.js";var y=class l{constructor(o,n){this.data=o;this.dialogRef=n;this.modalConfig=new h,this.modalConfig.title=o.title,this.modalConfig.headerType=o.headerType,this.modalConfig.okText=o.okText?o.okText:"OK",this.modalConfig.hideFooter=o.hideFooter?o.hideFooter:!1}modalConfig;onOk(){this.dialogRef.close(!0)}onClose(){this.dialogRef.close(!1)}static \u0275fac=function(n){return new(n||l)(t(u),t(M))};static \u0275cmp=r({type:l,selectors:[["app-confirmation-modal"]],standalone:!0,features:[C],decls:4,vars:2,consts:[[3,"onClose","onCancel","onOk","config"],[1,"container-fluid","modal-info"],[3,"innerHTML"]],template:function(n,e){n&1&&(a(0,"modal-material",0),c("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onOk()}),a(1,"content")(2,"div",1),p(3,"div",2),f()()()),n&2&&(i("config",e.modalConfig),s(3),i("innerHTML",e.data==null?null:e.data.message,d))},dependencies:[_,g,O,T],styles:[".modal-info[_ngcontent-%COMP%] .empty-state-img[_ngcontent-%COMP%]{width:100px}.modal-info[_ngcontent-%COMP%] .img-1x[_ngcontent-%COMP%]{width:12rem}.modal-info[_ngcontent-%COMP%] .img-2x[_ngcontent-%COMP%]{width:10rem}.modal-info[_ngcontent-%COMP%] .img-3x[_ngcontent-%COMP%]{width:8rem}"]})};export{y as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as $,F as Y,H as Z,ga as C,oa as J,pa as K,qa as X}from"./chunk-2FKYC63K.js";import{a as q}from"./chunk-4G26RHGA.js";import{Ab as N,Ba as F,Bb as b,Dc as M,Ea as c,Fb as L,Fc as l,Ia as V,Ib as h,Kb as I,Lb as j,Mb as P,Rb as U,Sb as z,Tb as S,Ua as g,Ub as x,Va as s,Yb as Q,fb as _,fc as H,ga as B,gb as O,gc as W,ia as w,ja as f,lb as u,mb as d,ob as k,pa as G,qa as R,ra as A,ub as y,wa as E,xa as D,zb as T}from"./chunk-H55AJAX5.js";var nt=["button"],it=["*"];function lt(n,m){if(n&1&&b(0,"mat-pseudo-checkbox",3),n&2){let t=I();d("disabled",t.disabled)}}function rt(n,m){if(n&1&&b(0,"mat-pseudo-checkbox",3),n&2){let t=I();d("disabled",t.disabled)}}var tt=new f("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:st});function st(){return{hideSingleSelectionIndicator:!1,hideMultipleSelectionIndicator:!1,disabledInteractive:!1}}var et=new f("MatButtonToggleGroup"),dt={provide:q,useExisting:B(()=>ct),multi:!0},at=0,p=class{constructor(m,t){this.source=m,this.value=t}},ct=(()=>{class n{get name(){return this._name}set name(t){this._name=t,this._markButtonsForCheck()}get value(){let t=this._selectionModel?this._selectionModel.selected:[];return this.multiple?t.map(a=>a.value):t[0]?t[0].value:void 0}set value(t){this._setSelectionByValue(t),this.valueChange.emit(this.value)}get selected(){let t=this._selectionModel?this._selectionModel.selected:[];return this.multiple?t:t[0]||null}get multiple(){return this._multiple}set multiple(t){this._multiple=t,this._markButtonsForCheck()}get disabled(){return this._disabled}set disabled(t){this._disabled=t,this._markButtonsForCheck()}get disabledInteractive(){return this._disabledInteractive}set disabledInteractive(t){this._disabledInteractive=t,this._markButtonsForCheck()}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(t){this._hideSingleSelectionIndicator=t,this._markButtonsForCheck()}get hideMultipleSelectionIndicator(){return this._hideMultipleSelectionIndicator}set hideMultipleSelectionIndicator(t){this._hideMultipleSelectionIndicator=t,this._markButtonsForCheck()}constructor(t,a,e){this._changeDetector=t,this._dir=e,this._multiple=!1,this._disabled=!1,this._disabledInteractive=!1,this._controlValueAccessorChangeFn=()=>{},this._onTouched=()=>{},this._name=`mat-button-toggle-group-${at++}`,this.valueChange=new c,this.change=new c,this.appearance=a&&a.appearance?a.appearance:"standard",this.hideSingleSelectionIndicator=a?.hideSingleSelectionIndicator??!1,this.hideMultipleSelectionIndicator=a?.hideMultipleSelectionIndicator??!1}ngOnInit(){this._selectionModel=new Z(this.multiple,void 0,!1)}ngAfterContentInit(){this._selectionModel.select(...this._buttonToggles.filter(t=>t.checked)),this.multiple||this._initializeTabIndex()}writeValue(t){this.value=t,this._changeDetector.markForCheck()}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t}_keydown(t){if(this.multiple||this.disabled)return;let e=t.target.id,o=this._buttonToggles.toArray().findIndex(r=>r.buttonId===e),i=null;switch(t.keyCode){case 32:case 13:i=this._buttonToggles.get(o)||null;break;case 38:i=this._getNextButton(o,-1);break;case 37:i=this._getNextButton(o,this.dir==="ltr"?-1:1);break;case 40:i=this._getNextButton(o,1);break;case 39:i=this._getNextButton(o,this.dir==="ltr"?1:-1);break;default:return}i&&(t.preventDefault(),i._onButtonClick(),i.focus())}_emitChangeEvent(t){let a=new p(t,this.value);this._rawValue=a.value,this._controlValueAccessorChangeFn(a.value),this.change.emit(a)}_syncButtonToggle(t,a,e=!1,o=!1){!this.multiple&&this.selected&&!t.checked&&(this.selected.checked=!1),this._selectionModel?a?this._selectionModel.select(t):this._selectionModel.deselect(t):o=!0,o?Promise.resolve().then(()=>this._updateModelValue(t,e)):this._updateModelValue(t,e)}_isSelected(t){return this._selectionModel&&this._selectionModel.isSelected(t)}_isPrechecked(t){return typeof this._rawValue>"u"?!1:this.multiple&&Array.isArray(this._rawValue)?this._rawValue.some(a=>t.value!=null&&a===t.value):t.value===this._rawValue}_initializeTabIndex(){if(this._buttonToggles.forEach(t=>{t.tabIndex=-1}),this.selected)this.selected.tabIndex=0;else for(let t=0;t<this._buttonToggles.length;t++){let a=this._buttonToggles.get(t);if(!a.disabled){a.tabIndex=0;break}}this._markButtonsForCheck()}_getNextButton(t,a){let e=this._buttonToggles;for(let o=1;o<=e.length;o++){let i=(t+a*o+e.length)%e.length,r=e.get(i);if(r&&!r.disabled)return r}return null}_setSelectionByValue(t){this._rawValue=t,this._buttonToggles&&(this.multiple&&t?(Array.isArray(t),this._clearSelection(),t.forEach(a=>this._selectValue(a))):(this._clearSelection(),this._selectValue(t)))}_clearSelection(){this._selectionModel.clear(),this._buttonToggles.forEach(t=>{t.checked=!1,this.multiple||(t.tabIndex=-1)})}_selectValue(t){let a=this._buttonToggles.find(e=>e.value!=null&&e.value===t);a&&(a.checked=!0,this._selectionModel.select(a),this.multiple||(a.tabIndex=0))}_updateModelValue(t,a){a&&this._emitChangeEvent(t),this.valueChange.emit(this.value)}_markButtonsForCheck(){this._buttonToggles?.forEach(t=>t._markForCheck())}static{this.\u0275fac=function(a){return new(a||n)(s(M),s(tt,8),s(Y,8))}}static{this.\u0275dir=A({type:n,selectors:[["mat-button-toggle-group"]],contentQueries:function(a,e,o){if(a&1&&U(o,ot,5),a&2){let i;S(i=x())&&(e._buttonToggles=i)}},hostAttrs:[1,"mat-button-toggle-group"],hostVars:6,hostBindings:function(a,e){a&1&&h("keydown",function(i){return e._keydown(i)}),a&2&&(u("role",e.multiple?"group":"radiogroup")("aria-disabled",e.disabled),k("mat-button-toggle-vertical",e.vertical)("mat-button-toggle-group-appearance-standard",e.appearance==="standard"))},inputs:{appearance:"appearance",name:"name",vertical:[2,"vertical","vertical",l],value:"value",multiple:[2,"multiple","multiple",l],disabled:[2,"disabled","disabled",l],disabledInteractive:[2,"disabledInteractive","disabledInteractive",l],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",l],hideMultipleSelectionIndicator:[2,"hideMultipleSelectionIndicator","hideMultipleSelectionIndicator",l]},outputs:{valueChange:"valueChange",change:"change"},exportAs:["matButtonToggleGroup"],standalone:!0,features:[H([dt,{provide:et,useExisting:n}]),_]})}}return n})(),ot=(()=>{class n{get buttonId(){return`${this.id}-button`}get tabIndex(){return this._tabIndex}set tabIndex(t){this._tabIndex=t,this._markForCheck()}get appearance(){return this.buttonToggleGroup?this.buttonToggleGroup.appearance:this._appearance}set appearance(t){this._appearance=t}get checked(){return this.buttonToggleGroup?this.buttonToggleGroup._isSelected(this):this._checked}set checked(t){t!==this._checked&&(this._checked=t,this.buttonToggleGroup&&this.buttonToggleGroup._syncButtonToggle(this,this._checked),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled||this.buttonToggleGroup&&this.buttonToggleGroup.disabled}set disabled(t){this._disabled=t}get disabledInteractive(){return this._disabledInteractive||this.buttonToggleGroup!==null&&this.buttonToggleGroup.disabledInteractive}set disabledInteractive(t){this._disabledInteractive=t}constructor(t,a,e,o,i,r){this._changeDetectorRef=a,this._elementRef=e,this._focusMonitor=o,this._checked=!1,this.ariaLabelledby=null,this._disabled=!1,this.change=new c;let v=Number(i);this.tabIndex=v||v===0?v:null,this.buttonToggleGroup=t,this.appearance=r&&r.appearance?r.appearance:"standard",this.disabledInteractive=r?.disabledInteractive??!1}ngOnInit(){let t=this.buttonToggleGroup;this.id=this.id||`mat-button-toggle-${at++}`,t&&(t._isPrechecked(this)?this.checked=!0:t._isSelected(this)!==this._checked&&t._syncButtonToggle(this,this._checked))}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){let t=this.buttonToggleGroup;this._focusMonitor.stopMonitoring(this._elementRef),t&&t._isSelected(this)&&t._syncButtonToggle(this,!1,!1,!0)}focus(t){this._buttonElement.nativeElement.focus(t)}_onButtonClick(){if(this.disabled)return;let t=this.isSingleSelector()?!0:!this._checked;if(t!==this._checked&&(this._checked=t,this.buttonToggleGroup&&(this.buttonToggleGroup._syncButtonToggle(this,this._checked,!0),this.buttonToggleGroup._onTouched())),this.isSingleSelector()){let a=this.buttonToggleGroup._buttonToggles.find(e=>e.tabIndex===0);a&&(a.tabIndex=-1),this.tabIndex=0}this.change.emit(new p(this,this.value))}_markForCheck(){this._changeDetectorRef.markForCheck()}_getButtonName(){return this.isSingleSelector()?this.buttonToggleGroup.name:this.name||null}isSingleSelector(){return this.buttonToggleGroup&&!this.buttonToggleGroup.multiple}static{this.\u0275fac=function(a){return new(a||n)(s(et,8),s(M),s(V),s($),F("tabindex"),s(tt,8))}}static{this.\u0275cmp=G({type:n,selectors:[["mat-button-toggle"]],viewQuery:function(a,e){if(a&1&&z(nt,5),a&2){let o;S(o=x())&&(e._buttonElement=o.first)}},hostAttrs:["role","presentation",1,"mat-button-toggle"],hostVars:14,hostBindings:function(a,e){a&1&&h("focus",function(){return e.focus()}),a&2&&(u("aria-label",null)("aria-labelledby",null)("id",e.id)("name",null),k("mat-button-toggle-standalone",!e.buttonToggleGroup)("mat-button-toggle-checked",e.checked)("mat-button-toggle-disabled",e.disabled)("mat-button-toggle-disabled-interactive",e.disabledInteractive)("mat-button-toggle-appearance-standard",e.appearance==="standard"))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],id:"id",name:"name",value:"value",tabIndex:"tabIndex",disableRipple:[2,"disableRipple","disableRipple",l],appearance:"appearance",checked:[2,"checked","checked",l],disabled:[2,"disabled","disabled",l],disabledInteractive:[2,"disabledInteractive","disabledInteractive",l]},outputs:{change:"change"},exportAs:["matButtonToggle"],standalone:!0,features:[_,W],ngContentSelectors:it,decls:8,vars:14,consts:[["button",""],["type","button",1,"mat-button-toggle-button","mat-focus-indicator",3,"click","id","disabled"],[1,"mat-button-toggle-label-content"],["state","checked","aria-hidden","true","appearance","minimal",1,"mat-mdc-option-pseudo-checkbox",3,"disabled"],[1,"mat-button-toggle-focus-overlay"],["matRipple","",1,"mat-button-toggle-ripple",3,"matRippleTrigger","matRippleDisabled"]],template:function(a,e){if(a&1){let o=L();j(),T(0,"button",1,0),h("click",function(){return E(o),D(e._onButtonClick())}),T(2,"span",2),O(3,lt,1,1,"mat-pseudo-checkbox",3)(4,rt,1,1,"mat-pseudo-checkbox",3),P(5),N()(),b(6,"span",4)(7,"span",5)}if(a&2){let o=Q(1);d("id",e.buttonId)("disabled",e.disabled&&!e.disabledInteractive||null),u("role",e.isSingleSelector()?"radio":"button")("tabindex",e.disabled&&!e.disabledInteractive?-1:e.tabIndex)("aria-pressed",e.isSingleSelector()?null:e.checked)("aria-checked",e.isSingleSelector()?e.checked:null)("name",e._getButtonName())("aria-label",e.ariaLabel)("aria-labelledby",e.ariaLabelledby)("aria-disabled",e.disabled&&e.disabledInteractive?"true":null),g(3),y(e.buttonToggleGroup&&e.checked&&!e.buttonToggleGroup.multiple&&!e.buttonToggleGroup.hideSingleSelectionIndicator?3:-1),g(),y(e.buttonToggleGroup&&e.checked&&e.buttonToggleGroup.multiple&&!e.buttonToggleGroup.hideMultipleSelectionIndicator?4:-1),g(3),d("matRippleTrigger",o)("matRippleDisabled",e.disableRipple||e.disabled)}},dependencies:[J,X],styles:[".mat-button-toggle-standalone,.mat-button-toggle-group{position:relative;display:inline-flex;flex-direction:row;white-space:nowrap;overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0);transform:translateZ(0);border-radius:var(--mat-legacy-button-toggle-shape)}.mat-button-toggle-standalone:not([class*=mat-elevation-z]),.mat-button-toggle-group:not([class*=mat-elevation-z]){box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12)}.cdk-high-contrast-active .mat-button-toggle-standalone,.cdk-high-contrast-active .mat-button-toggle-group{outline:solid 1px}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{border-radius:var(--mat-standard-button-toggle-shape, var(--mat-app-corner-full));border:solid 1px var(--mat-standard-button-toggle-divider-color, var(--mat-app-outline))}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard .mat-pseudo-checkbox,.mat-button-toggle-group-appearance-standard .mat-pseudo-checkbox{--mat-minimal-pseudo-checkbox-selected-checkmark-color: var(--mat-standard-button-toggle-selected-state-text-color, var(--mat-app-on-secondary-container))}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard:not([class*=mat-elevation-z]),.mat-button-toggle-group-appearance-standard:not([class*=mat-elevation-z]){box-shadow:none}.cdk-high-contrast-active .mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.cdk-high-contrast-active .mat-button-toggle-group-appearance-standard{outline:0}.mat-button-toggle-vertical{flex-direction:column}.mat-button-toggle-vertical .mat-button-toggle-label-content{display:block}.mat-button-toggle{white-space:nowrap;position:relative;color:var(--mat-legacy-button-toggle-text-color);font-family:var(--mat-legacy-button-toggle-label-text-font);font-size:var(--mat-legacy-button-toggle-label-text-size);line-height:var(--mat-legacy-button-toggle-label-text-line-height);font-weight:var(--mat-legacy-button-toggle-label-text-weight);letter-spacing:var(--mat-legacy-button-toggle-label-text-tracking);--mat-minimal-pseudo-checkbox-selected-checkmark-color: var(--mat-legacy-button-toggle-selected-state-text-color)}.mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-legacy-button-toggle-focus-state-layer-opacity)}.mat-button-toggle .mat-icon svg{vertical-align:top}.mat-button-toggle .mat-pseudo-checkbox{margin-right:12px}[dir=rtl] .mat-button-toggle .mat-pseudo-checkbox{margin-right:0;margin-left:12px}.mat-button-toggle-checked{color:var(--mat-legacy-button-toggle-selected-state-text-color);background-color:var(--mat-legacy-button-toggle-selected-state-background-color)}.mat-button-toggle-disabled{pointer-events:none;color:var(--mat-legacy-button-toggle-disabled-state-text-color);background-color:var(--mat-legacy-button-toggle-disabled-state-background-color);--mat-minimal-pseudo-checkbox-disabled-selected-checkmark-color: var(--mat-legacy-button-toggle-disabled-state-text-color)}.mat-button-toggle-disabled.mat-button-toggle-checked{background-color:var(--mat-legacy-button-toggle-disabled-selected-state-background-color)}.mat-button-toggle-disabled-interactive{pointer-events:auto}.mat-button-toggle-appearance-standard{color:var(--mat-standard-button-toggle-text-color, var(--mat-app-on-surface));background-color:var(--mat-standard-button-toggle-background-color);font-family:var(--mat-standard-button-toggle-label-text-font, var(--mat-app-label-large-font));font-size:var(--mat-standard-button-toggle-label-text-size, var(--mat-app-label-large-size));line-height:var(--mat-standard-button-toggle-label-text-line-height, var(--mat-app-label-large-line-height));font-weight:var(--mat-standard-button-toggle-label-text-weight, var(--mat-app-label-large-weight));letter-spacing:var(--mat-standard-button-toggle-label-text-tracking, var(--mat-app-label-large-tracking))}.mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:solid 1px var(--mat-standard-button-toggle-divider-color, var(--mat-app-outline))}[dir=rtl] .mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:none;border-right:solid 1px var(--mat-standard-button-toggle-divider-color, var(--mat-app-outline))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:none;border-right:none;border-top:solid 1px var(--mat-standard-button-toggle-divider-color, var(--mat-app-outline))}.mat-button-toggle-appearance-standard.mat-button-toggle-checked{color:var(--mat-standard-button-toggle-selected-state-text-color, var(--mat-app-on-secondary-container));background-color:var(--mat-standard-button-toggle-selected-state-background-color, var(--mat-app-secondary-container))}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled{color:var(--mat-standard-button-toggle-disabled-state-text-color);background-color:var(--mat-standard-button-toggle-disabled-state-background-color)}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled .mat-pseudo-checkbox{--mat-minimal-pseudo-checkbox-disabled-selected-checkmark-color: var(--mat-standard-button-toggle-disabled-selected-state-text-color)}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled.mat-button-toggle-checked{color:var(--mat-standard-button-toggle-disabled-selected-state-text-color);background-color:var(--mat-standard-button-toggle-disabled-selected-state-background-color)}.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{background-color:var(--mat-standard-button-toggle-state-layer-color, var(--mat-app-on-surface))}.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{opacity:var(--mat-standard-button-toggle-hover-state-layer-opacity, var(--mat-app-hover-state-layer-opacity))}.mat-button-toggle-appearance-standard.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-standard-button-toggle-focus-state-layer-opacity, var(--mat-app-focus-state-layer-opacity))}@media(hover: none){.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{display:none}}.mat-button-toggle-label-content{-webkit-user-select:none;user-select:none;display:inline-block;padding:0 16px;line-height:var(--mat-legacy-button-toggle-height);position:relative}.mat-button-toggle-appearance-standard .mat-button-toggle-label-content{padding:0 12px;line-height:var(--mat-standard-button-toggle-height)}.mat-button-toggle-label-content>*{vertical-align:middle}.mat-button-toggle-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;pointer-events:none;opacity:0;background-color:var(--mat-legacy-button-toggle-state-layer-color)}.cdk-high-contrast-active .mat-button-toggle-checked .mat-button-toggle-focus-overlay{border-bottom:solid 500px;opacity:.5;height:0}.cdk-high-contrast-active .mat-button-toggle-checked:hover .mat-button-toggle-focus-overlay{opacity:.6}.cdk-high-contrast-active .mat-button-toggle-checked.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{border-bottom:solid 500px}.mat-button-toggle .mat-button-toggle-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-button-toggle-button{border:0;background:none;color:inherit;padding:0;margin:0;font:inherit;outline:none;width:100%;cursor:pointer}.mat-button-toggle-disabled .mat-button-toggle-button{cursor:default}.mat-button-toggle-button::-moz-focus-inner{border:0}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard{--mat-focus-indicator-border-radius:var(--mat-standard-button-toggle-shape, var(--mat-app-corner-full))}.mat-button-toggle-group-appearance-standard .mat-button-toggle:last-of-type .mat-button-toggle-button::before{border-top-right-radius:var(--mat-standard-button-toggle-shape, var(--mat-app-corner-full));border-bottom-right-radius:var(--mat-standard-button-toggle-shape, var(--mat-app-corner-full))}.mat-button-toggle-group-appearance-standard .mat-button-toggle:first-of-type .mat-button-toggle-button::before{border-top-left-radius:var(--mat-standard-button-toggle-shape, var(--mat-app-corner-full));border-bottom-left-radius:var(--mat-standard-button-toggle-shape, var(--mat-app-corner-full))}"],encapsulation:2,changeDetection:0})}}return n})(),Vt=(()=>{class n{static{this.\u0275fac=function(a){return new(a||n)}}static{this.\u0275mod=R({type:n})}static{this.\u0275inj=w({imports:[C,K,ot,C]})}}return n})();export{ct as a,ot as b,Vt as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r=class{ID;Name;Code;UnitCost;UnitPrice;UnitExpense;Start;Finish;UnitQuantity;PriceDiscount;UnitPriceOriginal;Description;UOM;UOMName;ImageUrl;TypeID;SellPriceType;OnHand;Ordered;OrderPrice;OrderPriceDiscount;Taxable;LoyaltyPoint;LoyaltyPointRedeemable;CategoryName;CategoryID;BrandName;CategoryTypeID;Serial;PriceTypeID;PriceNote;PaymentTypeID;Config;ThumbnailUrl;Storage;DiscountAmount;ProductID;Component;PriceBook;VariantUnitQuantity;SerialNote;SalesCommission};export{r as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as b}from"./chunk-MA7NEQCZ.js";import{a as p,d as T,e as R}from"./chunk-26YXEYJK.js";import{a as k}from"./chunk-RRKCUSBB.js";import{La as d,Mc as S,Nd as v,da as h,dd as I,ha as u,ka as c}from"./chunk-H55AJAX5.js";var U=(o=>(o[o.PAID=0]="PAID",o[o.OVERDUE=1]="OVERDUE",o[o.SELL_ONLY=2]="SELL_ONLY",o[o.SUSPENDED=3]="SUSPENDED",o))(U||{});var y=(()=>{class n{constructor(e,i){this.document=e,this.platformId=i,this.documentIsAccessible=I(this.platformId)}static getCookieRegExp(e){let i=e.replace(/([\[\]{}()|=;+?,.*^$])/gi,"\\$1");return new RegExp("(?:^"+i+"|;\\s*"+i+")=(.*?)(?:;|$)","g")}static safeDecodeURIComponent(e){try{return decodeURIComponent(e)}catch{return e}}check(e){return this.documentIsAccessible?(e=encodeURIComponent(e),n.getCookieRegExp(e).test(this.document.cookie)):!1}get(e){if(this.documentIsAccessible&&this.check(e)){e=encodeURIComponent(e);let o=n.getCookieRegExp(e).exec(this.document.cookie);return o[1]?n.safeDecodeURIComponent(o[1]):""}else return""}getAll(){if(!this.documentIsAccessible)return{};let e={},i=this.document;return i.cookie&&i.cookie!==""&&i.cookie.split(";").forEach(o=>{let[a,s]=o.split("=");e[n.safeDecodeURIComponent(a.replace(/^ /,""))]=n.safeDecodeURIComponent(s)}),e}set(e,i,o,a,s,m,f,D){if(!this.documentIsAccessible)return;if(typeof o=="number"||o instanceof Date||a||s||m||f){let g={expires:o,path:a,domain:s,secure:m,sameSite:f||"Lax",partitioned:D};this.set(e,i,g);return}let l=encodeURIComponent(e)+"="+encodeURIComponent(i)+";",r=o||{};if(r.expires)if(typeof r.expires=="number"){let g=new Date(new Date().getTime()+r.expires*1e3*60*60*24);l+="expires="+g.toUTCString()+";"}else l+="expires="+r.expires.toUTCString()+";";r.path&&(l+="path="+r.path+";"),r.domain&&(l+="domain="+r.domain+";"),r.secure===!1&&r.sameSite==="None"&&(r.secure=!0,console.warn(`[ngx-cookie-service] Cookie ${e} was forced with secure flag because sameSite=None.More details : https://github.com/stevermeister/ngx-cookie-service/issues/86#issuecomment-597720130`)),r.secure&&(l+="secure;"),r.sameSite||(r.sameSite="Lax"),l+="sameSite="+r.sameSite+";",r.partitioned&&(l+="Partitioned;"),this.document.cookie=l}delete(e,i,o,a,s="Lax"){if(!this.documentIsAccessible)return;let m=new Date("Thu, 01 Jan 1970 00:00:01 GMT");this.set(e,"",{expires:m,path:i,domain:o,secure:a,sameSite:s})}deleteAll(e,i,o,a="Lax"){if(!this.documentIsAccessible)return;let s=this.getAll();for(let m in s)s.hasOwnProperty(m)&&this.delete(m,e,i,o,a)}static{this.\u0275fac=function(i){return new(i||n)(c(S),c(d))}}static{this.\u0275prov=u({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var C=class n{constructor(t,e,i,o,a,s){this.httpService=t;this.cookieService=e;this.router=i;this.roleService=o;this.intercomService=a;this.fraction=s}role=[];_returnUrl;_loginResponse;_jwtToken;set returnUrl(t){this._returnUrl=t}get returnUrl(){return this._returnUrl}login(t){return this.httpService.post("/api/Login/Web",t).pipe(h(e=>{this._loginResponse=e,e.Type=="geo"||e.Type=="totp"||this.saveLoginConfigToStorage(e)}))}loginLoader(){return this.httpService.get("/api/login/Loader")}getRedirectUrl(){let t=this.getSubscriptionStatus(),e=this.getRedirectUrlByRole();return(t==2||t==3)&&(e="/menu/Profile/Main/My_Subscription"),e}getRedirectUrlByRole(){let t,e=this.roleService;return e.dashboard.View?t="/menu/Dashboard":e.product.View?t="/menu/Products":t="/menu/Sell",t}logout(){localStorage.removeItem("ConfigData"),localStorage.removeItem("Token"),localStorage.removeItem("Roles"),localStorage.removeItem("AccountInfo"),localStorage.removeItem("CloudinaryConfig"),localStorage.removeItem("SubscriptionStatus"),this.cookieService.delete("ReportFilter","/"),this.intercomService.shutdown(),this._jwtToken=null,this.roleService.resetRoles(),this.router.navigate(["/"])}refreshToken(){this.httpService.post("/API/Authentication/RefreshToken",{}).subscribe(t=>{localStorage.removeItem("Token"),localStorage.setItem("Token",t.Token),this._jwtToken=null,this.roleService.resetRoles(),this.roleService.parseJWTRoles()})}isTokenExpired(){let t=localStorage.getItem("Token");if(t){let e=p.parseJwt(t),i=this.convertUnixTimesTamp(e.exp),o=new Date;if(i.getTime()-o.getTime()>0)return!1}return!0}isInRole(t){t.forEach(e=>e(this.role))}convertUnixTimesTamp(t){return new Date(t*1e3)}saveLoginConfigToStorage(t){localStorage.setItem("quantityFraction",JSON.stringify(t.UIConfig.Fraction.Quantity)),localStorage.setItem("amountFraction",JSON.stringify(t.UIConfig.Fraction.Amount)),this.fraction.setAmountFraction(t.UIConfig.Fraction.Amount.Minimum,t.UIConfig.Fraction.Amount.Maximum),this.fraction.setQuantityFraction(t.UIConfig.Fraction.Quantity.Minimum,t.UIConfig.Fraction.Quantity.Maximum),localStorage.setItem("AccountInfo",JSON.stringify(t?.AccountInfo)),localStorage.setItem("Token",t?.Token),localStorage.setItem("TinyMCEPlugins",t?.UIConfig.TinyMCE),this.intercomService.updateLocalStorage(t?.Intercom),localStorage.setItem("CloudinaryConfig",t?.UIConfig.CloudinaryConfig),localStorage.setItem("DataDaysRange",t?.UIConfig.DataDaysRange),localStorage.setItem("SubscriptionStatus",JSON.stringify(t?.SubscriptionStatus));let e=this.getParseToken();p.IsNotEmpty(e?.NotificationOutletID)&&localStorage.setItem("NotificationOutletID",e?.NotificationOutletID),this.roleService.parseJWTRoles(),this._loginResponse=null}getParseToken(){let t=localStorage.getItem("Token");return t&&!this._jwtToken&&(this._jwtToken=p.parseJwt(t)),this._jwtToken}get loginResponse(){return this._loginResponse}getSubscriptionStatus(){let t=localStorage.getItem("SubscriptionStatus");return t?parseInt(t):null}static \u0275fac=function(e){return new(e||n)(c(k),c(y),c(v),c(T),c(b),c(R))};static \u0275prov=u({token:n,factory:n.\u0275fac,providedIn:"root"})};export{U as a,y as b,C as c};
|