dealpos 26.41.4 → 26.41.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{chunk-PVB7GBSK.js → chunk-2AKYO4GZ.js} +1 -1
- package/browser/{chunk-YFHXJ2BM.js → chunk-2BACEKDZ.js} +1 -1
- package/browser/{chunk-VJDEKNQQ.js → chunk-2ELV3LDO.js} +1 -1
- package/browser/{chunk-L3XA3HBF.js → chunk-2IP3F5XP.js} +1 -1
- package/browser/{chunk-JKC4ZMXV.js → chunk-2NAZFAYN.js} +1 -1
- package/browser/{chunk-F44EJ47F.js → chunk-2RZKETI4.js} +1 -1
- package/browser/{chunk-EVO3VNAM.js → chunk-2SG53Q43.js} +1 -1
- package/browser/{chunk-PX2UKSKC.js → chunk-2XORXKYO.js} +1 -1
- package/browser/{chunk-WONVJLUQ.js → chunk-32LNIRMN.js} +1 -1
- package/browser/{chunk-BJYPJUNI.js → chunk-3MAFXHW3.js} +1 -1
- package/browser/{chunk-6JAF5RJ6.js → chunk-3MCZBFHR.js} +1 -1
- package/browser/{chunk-DU5PMK3P.js → chunk-42YQ2PFO.js} +1 -1
- package/browser/{chunk-PTTVOMAJ.js → chunk-432I5J2T.js} +1 -1
- package/browser/{chunk-7DKWMBFI.js → chunk-45KD4HJY.js} +1 -1
- package/browser/{chunk-HENCOWSS.js → chunk-57LMHHGB.js} +2 -2
- package/browser/{chunk-5O3ISRPQ.js → chunk-64QRNZHO.js} +1 -1
- package/browser/{chunk-LAP45GC2.js → chunk-6APYO45H.js} +1 -1
- package/browser/{chunk-Z65PSS2C.js → chunk-6GGSQ6MP.js} +1 -1
- package/browser/{chunk-PIO3QSF3.js → chunk-6HKNEUQ5.js} +1 -1
- package/browser/{chunk-DI7GWKOM.js → chunk-6MSCTU7Z.js} +1 -1
- package/browser/{chunk-DUDJZAAO.js → chunk-6XXUTFHL.js} +1 -1
- package/browser/{chunk-XEFYOHD5.js → chunk-75I3FJC4.js} +1 -1
- package/browser/{chunk-SMGKMTZM.js → chunk-A4BTJW7Z.js} +1 -1
- package/browser/{chunk-3KXXQZKR.js → chunk-AHPAB33J.js} +2 -2
- package/browser/{chunk-56HCUKXV.js → chunk-AISCWJVA.js} +1 -1
- package/browser/{chunk-67NJBLG2.js → chunk-B4G56FJH.js} +1 -1
- package/browser/{chunk-ON6CLASB.js → chunk-B6A3RRHC.js} +1 -1
- package/browser/{chunk-FX6KWPGY.js → chunk-BCB4PB2R.js} +1 -1
- package/browser/{chunk-UBEUGILQ.js → chunk-BJP2GNEV.js} +1 -1
- package/browser/{chunk-2VVXEJG5.js → chunk-BQVRKFWF.js} +1 -1
- package/browser/{chunk-I34LO4DC.js → chunk-BSDR5YM6.js} +1 -1
- package/browser/{chunk-B5JKALPE.js → chunk-CDXLJGOC.js} +1 -1
- package/browser/{chunk-HKSAQ4M2.js → chunk-CNEAJBRO.js} +1 -1
- package/browser/{chunk-Y3AUHJUM.js → chunk-CTZXNRAU.js} +1 -1
- package/browser/{chunk-IPO5WHEB.js → chunk-CXDLYBGP.js} +1 -1
- package/browser/{chunk-WYV2VGE6.js → chunk-DEFD5I5E.js} +1 -1
- package/browser/{chunk-XDA3HAB3.js → chunk-DFPN7QGR.js} +1 -1
- package/browser/{chunk-IWZEF2TO.js → chunk-DHW3P6PM.js} +1 -1
- package/browser/{chunk-VRNI2HOL.js → chunk-DMEQIB2S.js} +1 -1
- package/browser/{chunk-Z3POHU6P.js → chunk-DNMSPTAB.js} +2 -2
- package/browser/{chunk-MARB3TY7.js → chunk-EK3BQKYX.js} +1 -1
- package/browser/{chunk-B3IVCH2X.js → chunk-ELDCSNML.js} +1 -1
- package/browser/{chunk-MH2FTMDJ.js → chunk-F3YHBT2Z.js} +1 -1
- package/browser/{chunk-OT5JCDNW.js → chunk-FODNYWHH.js} +1 -1
- package/browser/{chunk-G4XJ2JEK.js → chunk-FQS3KLPN.js} +1 -1
- package/browser/{chunk-CAO2GTOG.js → chunk-G4ROBE5U.js} +1 -1
- package/browser/{chunk-R3CJAQKG.js → chunk-GS3ECGRS.js} +1 -1
- package/browser/{chunk-RGXXTPXX.js → chunk-HMYJE2VW.js} +1 -1
- package/browser/{chunk-OMFZXXGP.js → chunk-IAEJU5EG.js} +1 -1
- package/browser/{chunk-SOGFUBUN.js → chunk-INPCMEMO.js} +1 -1
- package/browser/{chunk-BBEXAIFV.js → chunk-JK73R7EQ.js} +1 -1
- package/browser/{chunk-JJOUD4SD.js → chunk-JOP777HW.js} +1 -1
- package/browser/{chunk-W2E4NMUY.js → chunk-KIXF7LBE.js} +1 -1
- package/browser/{chunk-Z7YC4KTU.js → chunk-KPVM5PAP.js} +1 -1
- package/browser/{chunk-WQDU4NSB.js → chunk-L2JNNJWN.js} +1 -1
- package/browser/{chunk-FFURNSSE.js → chunk-LBCQY4YC.js} +1 -1
- package/browser/{chunk-ZUNFOLLT.js → chunk-LIVT2BU4.js} +1 -1
- package/browser/{chunk-JMQTA3D2.js → chunk-LNFIAPEN.js} +1 -1
- package/browser/{chunk-YPPJTBH7.js → chunk-LVRTG3B7.js} +2 -2
- package/browser/{chunk-6WFNZOKR.js → chunk-M3WXEMKM.js} +1 -1
- package/browser/{chunk-KC6TKKFJ.js → chunk-MOJGPFVF.js} +1 -1
- package/browser/{chunk-56JJXOJF.js → chunk-NQNFOVEV.js} +1 -1
- package/browser/{chunk-HF2NQ4W3.js → chunk-NWZVMCVN.js} +1 -1
- package/browser/{chunk-R7CVOFVR.js → chunk-O7CMQBDZ.js} +1 -1
- package/browser/{chunk-TNZBTARX.js → chunk-OWGK5K6J.js} +1 -1
- package/browser/{chunk-4VU6ZIZK.js → chunk-PEDF6ZIW.js} +1 -1
- package/browser/{chunk-SEHJNQXN.js → chunk-POZOXX4R.js} +1 -1
- package/browser/{chunk-KA5UQNW5.js → chunk-PVURXJZD.js} +1 -1
- package/browser/{chunk-UJOEQFEY.js → chunk-QSRCNEZF.js} +1 -1
- package/browser/{chunk-GW5YES7Q.js → chunk-QYHKFM2T.js} +1 -1
- package/browser/{chunk-AS6YJL6K.js → chunk-RIQV4NL7.js} +1 -1
- package/browser/{chunk-5KIJ6ZVL.js → chunk-RTPEP5LZ.js} +1 -1
- package/browser/{chunk-4NJMYXX4.js → chunk-SHUTRO6Q.js} +2 -2
- package/browser/{chunk-PS4QURQQ.js → chunk-SPWW6SM2.js} +1 -1
- package/browser/{chunk-HGQ4GVFH.js → chunk-SUHFAH2Q.js} +1 -1
- package/browser/{chunk-DIZQ3IYW.js → chunk-SUQYJQ6R.js} +1 -1
- package/browser/{chunk-NBR7TUHP.js → chunk-TN5RPHT6.js} +2 -2
- package/browser/{chunk-6VFC6FPO.js → chunk-TNECVRMA.js} +1 -1
- package/browser/{chunk-SX5WJCES.js → chunk-TUFQQAPS.js} +1 -1
- package/browser/{chunk-QGRO3YRJ.js → chunk-TWIM3F7F.js} +1 -1
- package/browser/{chunk-Q7FVOX6K.js → chunk-TYVJSFTU.js} +1 -1
- package/browser/{chunk-DNMHFWF5.js → chunk-UJS2Z7JX.js} +1 -1
- package/browser/{chunk-RGBM5FRL.js → chunk-UNIXEWE2.js} +1 -1
- package/browser/{chunk-LFLAHKM7.js → chunk-VIS2PENF.js} +1 -1
- package/browser/{chunk-N4UH64HL.js → chunk-VQTJH2CF.js} +2 -2
- package/browser/{chunk-QN3744VG.js → chunk-WP3XNCII.js} +1 -1
- package/browser/{chunk-AKDTDTPW.js → chunk-WXBD3T44.js} +1 -1
- package/browser/{chunk-TZVEBVWQ.js → chunk-XHT7BRAY.js} +1 -1
- package/browser/{chunk-6AFXHDIK.js → chunk-XPR6UL3K.js} +1 -1
- package/browser/{chunk-P423UVHY.js → chunk-XRJZS2M5.js} +1 -1
- package/browser/{chunk-CMNMTQF6.js → chunk-XS6A3YLT.js} +1 -1
- package/browser/{chunk-JPC7NZ4Y.js → chunk-XWGVCAWH.js} +1 -1
- package/browser/{chunk-IWNQJE4F.js → chunk-YCEEADVB.js} +1 -1
- package/browser/{chunk-KQTVJW3K.js → chunk-Z3JNX32U.js} +1 -1
- package/browser/{chunk-HMHZ5BDZ.js → chunk-Z42YI4P6.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-W3R4WJHA.js → main-ZHR65HJX.js} +1 -1
- package/browser/ngsw-config.json +1 -1
- package/browser/ngsw.json +495 -495
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ye}from"./chunk-XOO5457U.js";import"./chunk-QQUWUBWQ.js";import{a as re}from"./chunk-52U2QQ43.js";import{b as ae}from"./chunk-P2NWTCME.js";import"./chunk-Q7FVOX6K.js";import"./chunk-F76MWCWQ.js";import"./chunk-XX7AIWP2.js";import{p as Ce}from"./chunk-SCH7M36Q.js";import"./chunk-7TQOVQ3O.js";import"./chunk-G53IMHKY.js";import"./chunk-3EAA4CUP.js";import"./chunk-5U2B2SGN.js";import"./chunk-YJV74F2X.js";import"./chunk-WPCHBRKW.js";import{a as _e,b as ge}from"./chunk-WUR7UGG2.js";import{a as ue}from"./chunk-WHKDTNK2.js";import"./chunk-WM2CE23W.js";import{d as ce}from"./chunk-M43FFEY2.js";import"./chunk-5VC2XYC5.js";import{a as te}from"./chunk-MH2FTMDJ.js";import"./chunk-ROZU3QVN.js";import"./chunk-DUDJZAAO.js";import"./chunk-ONECCHQ5.js";import"./chunk-GKGUNK27.js";import{a as oe}from"./chunk-G56UPMKR.js";import"./chunk-QSFZAHQ2.js";import"./chunk-TGQEO6S3.js";import"./chunk-ONKLHHM3.js";import"./chunk-X2OQT5MH.js";import"./chunk-XTOFMSDQ.js";import"./chunk-ZM456L6A.js";import"./chunk-F5JDPCBG.js";import"./chunk-LN7LGRLI.js";import"./chunk-EP7SKSJT.js";import"./chunk-LAQZXTBX.js";import{f as de,g as se}from"./chunk-JMQTA3D2.js";import"./chunk-RGXXTPXX.js";import{a as le}from"./chunk-4VU6ZIZK.js";import"./chunk-3DC26I3D.js";import"./chunk-UHM2XEMM.js";import{c as pe,d as me}from"./chunk-WJOBIYMD.js";import"./chunk-4BITXMRY.js";import"./chunk-2AOZZW2I.js";import"./chunk-TM2I5PAG.js";import"./chunk-JXEPD3CF.js";import"./chunk-PPMQE2JW.js";import"./chunk-UI32X6QC.js";import"./chunk-OVCNCVGF.js";import"./chunk-PWMMCY25.js";import"./chunk-OKQYRKDJ.js";import{d as ne}from"./chunk-BUIP3UCE.js";import"./chunk-SIAVPMSP.js";import"./chunk-N5VS2V7L.js";import{c as ie}from"./chunk-3V6FZIJD.js";import"./chunk-DEJ5V3PF.js";import"./chunk-T45W4CQR.js";import"./chunk-OK7LFGGQ.js";import"./chunk-VGLTFO5N.js";import"./chunk-UTSVZMZD.js";import"./chunk-BP6PECKT.js";import{a as Q}from"./chunk-GNDUQZGK.js";import"./chunk-7KKUTTZ3.js";import"./chunk-ZS4XLRDB.js";import"./chunk-TYEI4SD2.js";import"./chunk-BKOMMH62.js";import"./chunk-7ESJNFN4.js";import"./chunk-JTDKDDTJ.js";import"./chunk-3TKWEWIY.js";import"./chunk-SXVOKLC4.js";import{F as ee,c as Y,h as Z,p as $}from"./chunk-AJDQZ346.js";import"./chunk-KA5UQNW5.js";import"./chunk-WONVJLUQ.js";import"./chunk-YY6WVNU4.js";import{b as J}from"./chunk-KLHHVIRS.js";import{a as z}from"./chunk-PPTZHIIZ.js";import"./chunk-QGRO3YRJ.js";import{q as X}from"./chunk-QGYXJUX3.js";import{$a as E,Ba as M,Bb as O,Cb as W,Db as u,Eb as o,Fb as i,Fc as f,Gb as R,Gc as H,Hc as b,Lc as B,Pb as P,Sb as S,Sd as G,Ua as l,Ub as d,Ud as K,db as V,gc as k,hc as p,ib as N,ic as D,jb as T,jc as w,mc as C,nc as y,nd as U,oa as v,oc as x,ra as s,sa as c,sd as A,ud as j,wb as _,xc as I,xd as q,yb as g,yc as F,zb as L}from"./chunk-7D344CRC.js";import"./chunk-NF7PG5F2.js";var fe=()=>["/menu/Orders/Advanced/Reprint/History"],xe=a=>({ID:a}),Pe=()=>["/menu/Contacts/Contact/Customers/Info"],Se=a=>({"text-danger":a});function De(a,m){if(a&1){let e=P();o(0,"button",15),S("click",function(){s(e);let t=d();return c(t.openExportModal())}),R(1,"i",16),p(2," Export "),i()}}function we(a,m){if(a&1){let e=P();o(0,"h6"),p(1,"Last Reprint By (User)"),i(),o(2,"autocompleteV2",28),x("ngModelChange",function(t){s(e);let r=d(2);return y(r.pageData().Filter.UserID,t)||(r.pageData().Filter.UserID=t),c(t)}),i()}if(a&2){let e=d(2);l(2),C("ngModel",e.pageData().Filter.UserID)}}function be(a,m){if(a&1){let e=P();o(0,"div",17)(1,"h6"),p(2,"Outlets"),i(),o(3,"outlet-selector",18),x("ngModelChange",function(t){s(e);let r=d();return y(r.pageData().Filter.ListOutletID,t)||(r.pageData().Filter.ListOutletID=t),c(t)}),i(),o(4,"h6"),p(5,"Customer"),i(),o(6,"autocompleteV2",19),x("ngModelChange",function(t){s(e);let r=d();return y(r.pageData().Filter.CustomerID,t)||(r.pageData().Filter.CustomerID=t),c(t)}),i(),o(7,"h6"),p(8,"From - To"),i(),o(9,"div",20)(10,"div",21)(11,"datepicker",22),x("dateChange",function(t){s(e);let r=d();return y(r.pageData().Filter.From,t)||(r.pageData().Filter.From=t),c(t)}),i()(),o(12,"div",23)(13,"datepicker",24),x("dateChange",function(t){s(e);let r=d();return y(r.pageData().Filter.To,t)||(r.pageData().Filter.To=t),c(t)}),i()()(),o(14,"h6"),p(15,"Number Filter Comparator"),i(),o(16,"ng-select",25),x("ngModelChange",function(t){s(e);let r=d();return y(r.pageData().Filter.NumberFilterComparator,t)||(r.pageData().Filter.NumberFilterComparator=t),c(t)}),S("ngModelChange",function(t){s(e);let r=d();return c(r.updateSearchPlaceholder(t))}),i(),o(17,"h6"),p(18,"Printed"),i(),o(19,"radio-options",26),x("modelChange",function(t){s(e);let r=d();return y(r.pageData().Filter.Printed,t)||(r.pageData().Filter.Printed=t),c(t)}),i(),_(20,we,3,1),o(21,"h6"),p(22,"Page Size"),i(),o(23,"div")(24,"input",27),x("ngModelChange",function(t){s(e);let r=d();return y(r.pageData().Filter.RowCount,t)||(r.pageData().Filter.RowCount=t),c(t)}),i()()()}if(a&2){let e=d();l(3),C("ngModel",e.pageData().Filter.ListOutletID),u("multiple",!0),l(3),C("ngModel",e.pageData().Filter.CustomerID),l(5),u("isFloatingLabel",!1),C("date",e.pageData().Filter.From),l(2),u("isFloatingLabel",!1),C("date",e.pageData().Filter.To),l(3),C("ngModel",e.pageData().Filter.NumberFilterComparator),u("items",e.pageData().Options.SearchComparatorTypeOption)("clearable",!1),l(3),C("model",e.pageData().Filter.Printed),u("options",e.pageData().Options.PrintedOptions),l(),g(e.pageData().Filter.Printed!==0?20:-1),l(4),C("ngModel",e.pageData().Filter.RowCount)}}function Fe(a,m){a&1&&(o(0,"th",10),p(1,"Last Reprint By"),i())}function ve(a,m){a&1&&(o(0,"th",7),p(1,"Date"),i())}function Me(a,m){a&1&&(o(0,"th",11),p(1,"Time"),i())}function Ee(a,m){a&1&&(o(0,"th",13),p(1,"Count"),i())}function Te(a,m){if(a&1&&(o(0,"td"),p(1),i()),a&2){let e=d().$implicit;l(),D(e.CreatorName)}}function Ie(a,m){if(a&1&&(o(0,"td"),p(1),f(2,"date"),i()),a&2){let e=d().$implicit;l(),w(" ",e.Created==="0001-01-01T00:00:00"?"":b(2,1,e.Created,"dd MMM yyyy")," ")}}function He(a,m){if(a&1&&(o(0,"td"),p(1),f(2,"date"),i()),a&2){let e=d().$implicit;l(),w(" ",e.Created==="0001-01-01T00:00:00"?"":b(2,1,e.Created,"HH:mm:ss")," ")}}function Ve(a,m){if(a&1&&(o(0,"td",33),p(1),f(2,"amountFraction"),i()),a&2){let e=d().$implicit;k(F(5,Se,e.InvoiceAmount<0)),l(),w(" ",H(2,3,e.InvoiceAmount)," ")}}function Ne(a,m){if(a&1){let e=P();o(0,"td",34),S("click",function(){s(e);let t=d().$implicit,r=d();return c(r.onInvoiceCountClick(t))}),p(1),f(2,"number"),i()}if(a&2){let e=d().$implicit;l(),w(" ",H(2,1,e.Count)," ")}}function Le(a,m){if(a&1&&(o(0,"tr")(1,"td"),p(2),i(),o(3,"td")(4,"a",29),p(5),i()(),o(6,"td")(7,"a",30),p(8),i()(),o(9,"td"),p(10),f(11,"date"),i(),o(12,"td"),p(13),f(14,"date"),i(),_(15,Te,2,1,"td"),_(16,Ie,3,4,"td"),_(17,He,3,4,"td"),T(18,Ve,3,7,"td",31),_(19,Ne,3,3,"td",32),i()),a&2){let e=m.$implicit,n=d();l(2),D(e.EntityName),l(2),u("queryParams",F(19,xe,e.InvoiceID)),l(),D(e.Number),l(2),u("routerLink",I(21,Pe))("queryParams",F(22,xe,e.CustomerID)),l(),w(" ",e.CustomerName," "),l(2),D(b(11,13,e.InvoiceDate,"dd MMM yyyy")),l(3),D(b(14,16,e.InvoiceDueDate,"dd MMM")),l(2),g(n.isNotUnprintedOnly()?15:-1),l(),g(n.isNotUnprintedOnly()?16:-1),l(),g(n.isNotUnprintedOnly()?17:-1),l(),u("ngIf",n.roleService.sell.PriceVisible),l(),g(n.isNotUnprintedOnly()?19:-1)}}var he=class a extends te{roleService=v(J);dialog=v(ie);isNotUnprintedOnly=M(!0);searchBoxPlaceholder=M(null);constructor(m,e){super(m,e,"invoice/GetPrintHistoryList","invoiceLoader/GetPrintHistoryList")}preInitList(){this.updateSearchPlaceholder(this.pageData().Filter.NumberFilterComparator)}updateSearchPlaceholder(m){let e=this.pageData().Options.SearchComparatorTypeOption?.find(t=>t.Key===m),n=z.IsNotEmpty(e)?`Number ${e?.Value}`:"Number Starts With";this.searchBoxPlaceholder.set(n)}openExportModal(){this.pageData().Filter.Export=!0,this.dialog.open(ae,{data:{title:"Reprint History (Aggregate)",exportTypes:[{ID:"invoice/GetPrintHistoryList",Value:"Default",FileName:"Reprint History (Aggregate)"}],filterExport:this.pageData().Filter,pagination:!0}}).afterClosed().subscribe(()=>{this.pageData().Filter.Export=!1})}onSubmit(){let m=this.pageData().Filter.Printed!==0;this.isNotUnprintedOnly.set(m),this.getListData()}onInvoiceCountClick(m){let e=`${Q.InvoicePrintHistory}/${m.InvoiceID}`;this.httpService.get(e).subscribe(n=>{this.dialog.open(ye,{data:n?.Data})})}static \u0275fac=function(e){return new(e||a)(E(le),E(X))};static \u0275cmp=V({type:a,selectors:[["app-print-history"]],features:[N],decls:34,vars:15,consts:[["pageFilterTemplate",""],[3,"onSubmit","textChange","pageData","isFilterOnDropdown","searchBoxPlaceholder","text"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"btn","btn-outline-secondary","ms-3"],[1,"container-fluid","mt-5"],["matSort","",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","100px"],[2,"width","200px"],[2,"width","80px"],[2,"width","120px"],[2,"width","70px"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","30px"],[3,"jumpToPage","previousPage","nextPage","reloadRowCountChange","total","totalAllData","pageData","reloadRowCount"],[1,"btn","btn-outline-secondary","ms-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload","me-1"],[1,"dialog-filter"],[3,"ngModelChange","ngModel","multiple"],["name","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"row"],[1,"col-6","pe-2"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],[1,"col-6","ps-2"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose an Comparator",3,"ngModelChange","ngModel","items","clearable"],[3,"modelChange","model","options"],["type","text","placeholder","Page Size","autoNum","",1,"form-control",3,"ngModelChange","ngModel"],["requestUrl","/API/AC/GetUserSuggestion",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",1,"link-primary","cursor-pointer",3,"queryParams"],[1,"link-primary","cursor-pointer",3,"routerLink","queryParams"],["class","text-end",3,"class",4,"ngIf"],[1,"cursor-pointer","text-end","link-primary"],[1,"text-end"],[1,"cursor-pointer","text-end","link-primary",3,"click"]],template:function(e,n){if(e&1){let t=P();o(0,"mainpanel-cmp",1),S("onSubmit",function(){return n.onSubmit()}),x("textChange",function(h){return s(t),y(n.pageData().Filter.Number,h)||(n.pageData().Filter.Number=h),c(h)}),o(1,"actions")(2,"a",2)(3,"span"),p(4,"Flat View"),i()(),_(5,De,3,0,"button",3),i(),o(6,"filters"),T(7,be,25,14,"ng-template",null,0,B),i(),o(9,"content")(10,"div",4)(11,"table",5)(12,"thead",6)(13,"tr")(14,"th",7),p(15,"Outlet"),i(),o(16,"th",8),p(17,"Number"),i(),o(18,"th"),p(19,"Customer"),i(),o(20,"th",7),p(21,"Date"),i(),o(22,"th",9),p(23,"Due"),i(),_(24,Fe,2,0,"th",10),_(25,ve,2,0,"th",7),_(26,Me,2,0,"th",11),o(27,"th",12),p(28,"Amount"),i(),_(29,Ee,2,0,"th",13),i()(),o(30,"tbody"),O(31,Le,20,24,"tr",null,L),i()(),o(33,"POS-complex-pagination",14),S("jumpToPage",function(){return n.getListData()})("previousPage",function(){return n.getListData()})("nextPage",function(){return n.getListData()}),x("reloadRowCountChange",function(h){return s(t),y(n.reloadRowCount,h)||(n.reloadRowCount=h),c(h)}),i()()()()}if(e&2){let t,r,h;u("pageData",n.menuData())("isFilterOnDropdown",!1)("searchBoxPlaceholder",n.searchBoxPlaceholder()),C("text",n.pageData().Filter.Number),l(2),u("routerLink",I(14,fe)),l(3),g(n.roleService.global.Export?5:-1),l(19),g(n.isNotUnprintedOnly()?24:-1),l(),g(n.isNotUnprintedOnly()?25:-1),l(),g(n.isNotUnprintedOnly()?26:-1),l(3),g(n.isNotUnprintedOnly()?29:-1),l(2),W((t=n.data())==null?null:t.Data),l(2),u("total",(r=n.data())==null||r.Data==null?null:r.Data.length)("totalAllData",(h=n.data())==null?null:h.ListTotal)("pageData",n.pageData()),C("reloadRowCount",n.reloadRowCount)}},dependencies:[q,U,se,de,ue,ee,Y,Z,$,Ce,ge,_e,oe,K,G,me,pe,ce,ne,j,A,re],encapsulation:2,changeDetection:0})};export{he as PrintHistoryComponent};
|
|
1
|
+
import{a as ye}from"./chunk-XOO5457U.js";import"./chunk-QQUWUBWQ.js";import{a as re}from"./chunk-52U2QQ43.js";import{b as ae}from"./chunk-P2NWTCME.js";import"./chunk-TYVJSFTU.js";import"./chunk-F76MWCWQ.js";import"./chunk-XX7AIWP2.js";import{p as Ce}from"./chunk-SCH7M36Q.js";import"./chunk-7TQOVQ3O.js";import"./chunk-G53IMHKY.js";import"./chunk-3EAA4CUP.js";import"./chunk-5U2B2SGN.js";import"./chunk-YJV74F2X.js";import"./chunk-WPCHBRKW.js";import{a as _e,b as ge}from"./chunk-WUR7UGG2.js";import{a as ue}from"./chunk-WHKDTNK2.js";import"./chunk-WM2CE23W.js";import{d as ce}from"./chunk-M43FFEY2.js";import"./chunk-5VC2XYC5.js";import{a as te}from"./chunk-F3YHBT2Z.js";import"./chunk-ROZU3QVN.js";import"./chunk-6XXUTFHL.js";import"./chunk-ONECCHQ5.js";import"./chunk-GKGUNK27.js";import{a as oe}from"./chunk-G56UPMKR.js";import"./chunk-QSFZAHQ2.js";import"./chunk-TGQEO6S3.js";import"./chunk-ONKLHHM3.js";import"./chunk-X2OQT5MH.js";import"./chunk-XTOFMSDQ.js";import"./chunk-ZM456L6A.js";import"./chunk-F5JDPCBG.js";import"./chunk-LN7LGRLI.js";import"./chunk-EP7SKSJT.js";import"./chunk-LAQZXTBX.js";import{f as de,g as se}from"./chunk-LNFIAPEN.js";import"./chunk-HMYJE2VW.js";import{a as le}from"./chunk-PEDF6ZIW.js";import"./chunk-3DC26I3D.js";import"./chunk-UHM2XEMM.js";import{c as pe,d as me}from"./chunk-WJOBIYMD.js";import"./chunk-4BITXMRY.js";import"./chunk-2AOZZW2I.js";import"./chunk-TM2I5PAG.js";import"./chunk-JXEPD3CF.js";import"./chunk-PPMQE2JW.js";import"./chunk-UI32X6QC.js";import"./chunk-OVCNCVGF.js";import"./chunk-PWMMCY25.js";import"./chunk-OKQYRKDJ.js";import{d as ne}from"./chunk-BUIP3UCE.js";import"./chunk-SIAVPMSP.js";import"./chunk-N5VS2V7L.js";import{c as ie}from"./chunk-3V6FZIJD.js";import"./chunk-DEJ5V3PF.js";import"./chunk-T45W4CQR.js";import"./chunk-OK7LFGGQ.js";import"./chunk-VGLTFO5N.js";import"./chunk-UTSVZMZD.js";import"./chunk-BP6PECKT.js";import{a as Q}from"./chunk-GNDUQZGK.js";import"./chunk-7KKUTTZ3.js";import"./chunk-ZS4XLRDB.js";import"./chunk-TYEI4SD2.js";import"./chunk-BKOMMH62.js";import"./chunk-7ESJNFN4.js";import"./chunk-JTDKDDTJ.js";import"./chunk-3TKWEWIY.js";import"./chunk-SXVOKLC4.js";import{F as ee,c as Y,h as Z,p as $}from"./chunk-AJDQZ346.js";import"./chunk-PVURXJZD.js";import"./chunk-32LNIRMN.js";import"./chunk-YY6WVNU4.js";import{b as J}from"./chunk-KLHHVIRS.js";import{a as z}from"./chunk-PPTZHIIZ.js";import"./chunk-TWIM3F7F.js";import{q as X}from"./chunk-QGYXJUX3.js";import{$a as E,Ba as M,Bb as O,Cb as W,Db as u,Eb as o,Fb as i,Fc as f,Gb as R,Gc as H,Hc as b,Lc as B,Pb as P,Sb as S,Sd as G,Ua as l,Ub as d,Ud as K,db as V,gc as k,hc as p,ib as N,ic as D,jb as T,jc as w,mc as C,nc as y,nd as U,oa as v,oc as x,ra as s,sa as c,sd as A,ud as j,wb as _,xc as I,xd as q,yb as g,yc as F,zb as L}from"./chunk-7D344CRC.js";import"./chunk-NF7PG5F2.js";var fe=()=>["/menu/Orders/Advanced/Reprint/History"],xe=a=>({ID:a}),Pe=()=>["/menu/Contacts/Contact/Customers/Info"],Se=a=>({"text-danger":a});function De(a,m){if(a&1){let e=P();o(0,"button",15),S("click",function(){s(e);let t=d();return c(t.openExportModal())}),R(1,"i",16),p(2," Export "),i()}}function we(a,m){if(a&1){let e=P();o(0,"h6"),p(1,"Last Reprint By (User)"),i(),o(2,"autocompleteV2",28),x("ngModelChange",function(t){s(e);let r=d(2);return y(r.pageData().Filter.UserID,t)||(r.pageData().Filter.UserID=t),c(t)}),i()}if(a&2){let e=d(2);l(2),C("ngModel",e.pageData().Filter.UserID)}}function be(a,m){if(a&1){let e=P();o(0,"div",17)(1,"h6"),p(2,"Outlets"),i(),o(3,"outlet-selector",18),x("ngModelChange",function(t){s(e);let r=d();return y(r.pageData().Filter.ListOutletID,t)||(r.pageData().Filter.ListOutletID=t),c(t)}),i(),o(4,"h6"),p(5,"Customer"),i(),o(6,"autocompleteV2",19),x("ngModelChange",function(t){s(e);let r=d();return y(r.pageData().Filter.CustomerID,t)||(r.pageData().Filter.CustomerID=t),c(t)}),i(),o(7,"h6"),p(8,"From - To"),i(),o(9,"div",20)(10,"div",21)(11,"datepicker",22),x("dateChange",function(t){s(e);let r=d();return y(r.pageData().Filter.From,t)||(r.pageData().Filter.From=t),c(t)}),i()(),o(12,"div",23)(13,"datepicker",24),x("dateChange",function(t){s(e);let r=d();return y(r.pageData().Filter.To,t)||(r.pageData().Filter.To=t),c(t)}),i()()(),o(14,"h6"),p(15,"Number Filter Comparator"),i(),o(16,"ng-select",25),x("ngModelChange",function(t){s(e);let r=d();return y(r.pageData().Filter.NumberFilterComparator,t)||(r.pageData().Filter.NumberFilterComparator=t),c(t)}),S("ngModelChange",function(t){s(e);let r=d();return c(r.updateSearchPlaceholder(t))}),i(),o(17,"h6"),p(18,"Printed"),i(),o(19,"radio-options",26),x("modelChange",function(t){s(e);let r=d();return y(r.pageData().Filter.Printed,t)||(r.pageData().Filter.Printed=t),c(t)}),i(),_(20,we,3,1),o(21,"h6"),p(22,"Page Size"),i(),o(23,"div")(24,"input",27),x("ngModelChange",function(t){s(e);let r=d();return y(r.pageData().Filter.RowCount,t)||(r.pageData().Filter.RowCount=t),c(t)}),i()()()}if(a&2){let e=d();l(3),C("ngModel",e.pageData().Filter.ListOutletID),u("multiple",!0),l(3),C("ngModel",e.pageData().Filter.CustomerID),l(5),u("isFloatingLabel",!1),C("date",e.pageData().Filter.From),l(2),u("isFloatingLabel",!1),C("date",e.pageData().Filter.To),l(3),C("ngModel",e.pageData().Filter.NumberFilterComparator),u("items",e.pageData().Options.SearchComparatorTypeOption)("clearable",!1),l(3),C("model",e.pageData().Filter.Printed),u("options",e.pageData().Options.PrintedOptions),l(),g(e.pageData().Filter.Printed!==0?20:-1),l(4),C("ngModel",e.pageData().Filter.RowCount)}}function Fe(a,m){a&1&&(o(0,"th",10),p(1,"Last Reprint By"),i())}function ve(a,m){a&1&&(o(0,"th",7),p(1,"Date"),i())}function Me(a,m){a&1&&(o(0,"th",11),p(1,"Time"),i())}function Ee(a,m){a&1&&(o(0,"th",13),p(1,"Count"),i())}function Te(a,m){if(a&1&&(o(0,"td"),p(1),i()),a&2){let e=d().$implicit;l(),D(e.CreatorName)}}function Ie(a,m){if(a&1&&(o(0,"td"),p(1),f(2,"date"),i()),a&2){let e=d().$implicit;l(),w(" ",e.Created==="0001-01-01T00:00:00"?"":b(2,1,e.Created,"dd MMM yyyy")," ")}}function He(a,m){if(a&1&&(o(0,"td"),p(1),f(2,"date"),i()),a&2){let e=d().$implicit;l(),w(" ",e.Created==="0001-01-01T00:00:00"?"":b(2,1,e.Created,"HH:mm:ss")," ")}}function Ve(a,m){if(a&1&&(o(0,"td",33),p(1),f(2,"amountFraction"),i()),a&2){let e=d().$implicit;k(F(5,Se,e.InvoiceAmount<0)),l(),w(" ",H(2,3,e.InvoiceAmount)," ")}}function Ne(a,m){if(a&1){let e=P();o(0,"td",34),S("click",function(){s(e);let t=d().$implicit,r=d();return c(r.onInvoiceCountClick(t))}),p(1),f(2,"number"),i()}if(a&2){let e=d().$implicit;l(),w(" ",H(2,1,e.Count)," ")}}function Le(a,m){if(a&1&&(o(0,"tr")(1,"td"),p(2),i(),o(3,"td")(4,"a",29),p(5),i()(),o(6,"td")(7,"a",30),p(8),i()(),o(9,"td"),p(10),f(11,"date"),i(),o(12,"td"),p(13),f(14,"date"),i(),_(15,Te,2,1,"td"),_(16,Ie,3,4,"td"),_(17,He,3,4,"td"),T(18,Ve,3,7,"td",31),_(19,Ne,3,3,"td",32),i()),a&2){let e=m.$implicit,n=d();l(2),D(e.EntityName),l(2),u("queryParams",F(19,xe,e.InvoiceID)),l(),D(e.Number),l(2),u("routerLink",I(21,Pe))("queryParams",F(22,xe,e.CustomerID)),l(),w(" ",e.CustomerName," "),l(2),D(b(11,13,e.InvoiceDate,"dd MMM yyyy")),l(3),D(b(14,16,e.InvoiceDueDate,"dd MMM")),l(2),g(n.isNotUnprintedOnly()?15:-1),l(),g(n.isNotUnprintedOnly()?16:-1),l(),g(n.isNotUnprintedOnly()?17:-1),l(),u("ngIf",n.roleService.sell.PriceVisible),l(),g(n.isNotUnprintedOnly()?19:-1)}}var he=class a extends te{roleService=v(J);dialog=v(ie);isNotUnprintedOnly=M(!0);searchBoxPlaceholder=M(null);constructor(m,e){super(m,e,"invoice/GetPrintHistoryList","invoiceLoader/GetPrintHistoryList")}preInitList(){this.updateSearchPlaceholder(this.pageData().Filter.NumberFilterComparator)}updateSearchPlaceholder(m){let e=this.pageData().Options.SearchComparatorTypeOption?.find(t=>t.Key===m),n=z.IsNotEmpty(e)?`Number ${e?.Value}`:"Number Starts With";this.searchBoxPlaceholder.set(n)}openExportModal(){this.pageData().Filter.Export=!0,this.dialog.open(ae,{data:{title:"Reprint History (Aggregate)",exportTypes:[{ID:"invoice/GetPrintHistoryList",Value:"Default",FileName:"Reprint History (Aggregate)"}],filterExport:this.pageData().Filter,pagination:!0}}).afterClosed().subscribe(()=>{this.pageData().Filter.Export=!1})}onSubmit(){let m=this.pageData().Filter.Printed!==0;this.isNotUnprintedOnly.set(m),this.getListData()}onInvoiceCountClick(m){let e=`${Q.InvoicePrintHistory}/${m.InvoiceID}`;this.httpService.get(e).subscribe(n=>{this.dialog.open(ye,{data:n?.Data})})}static \u0275fac=function(e){return new(e||a)(E(le),E(X))};static \u0275cmp=V({type:a,selectors:[["app-print-history"]],features:[N],decls:34,vars:15,consts:[["pageFilterTemplate",""],[3,"onSubmit","textChange","pageData","isFilterOnDropdown","searchBoxPlaceholder","text"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"btn","btn-outline-secondary","ms-3"],[1,"container-fluid","mt-5"],["matSort","",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","100px"],[2,"width","200px"],[2,"width","80px"],[2,"width","120px"],[2,"width","70px"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","30px"],[3,"jumpToPage","previousPage","nextPage","reloadRowCountChange","total","totalAllData","pageData","reloadRowCount"],[1,"btn","btn-outline-secondary","ms-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload","me-1"],[1,"dialog-filter"],[3,"ngModelChange","ngModel","multiple"],["name","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"row"],[1,"col-6","pe-2"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],[1,"col-6","ps-2"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose an Comparator",3,"ngModelChange","ngModel","items","clearable"],[3,"modelChange","model","options"],["type","text","placeholder","Page Size","autoNum","",1,"form-control",3,"ngModelChange","ngModel"],["requestUrl","/API/AC/GetUserSuggestion",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",1,"link-primary","cursor-pointer",3,"queryParams"],[1,"link-primary","cursor-pointer",3,"routerLink","queryParams"],["class","text-end",3,"class",4,"ngIf"],[1,"cursor-pointer","text-end","link-primary"],[1,"text-end"],[1,"cursor-pointer","text-end","link-primary",3,"click"]],template:function(e,n){if(e&1){let t=P();o(0,"mainpanel-cmp",1),S("onSubmit",function(){return n.onSubmit()}),x("textChange",function(h){return s(t),y(n.pageData().Filter.Number,h)||(n.pageData().Filter.Number=h),c(h)}),o(1,"actions")(2,"a",2)(3,"span"),p(4,"Flat View"),i()(),_(5,De,3,0,"button",3),i(),o(6,"filters"),T(7,be,25,14,"ng-template",null,0,B),i(),o(9,"content")(10,"div",4)(11,"table",5)(12,"thead",6)(13,"tr")(14,"th",7),p(15,"Outlet"),i(),o(16,"th",8),p(17,"Number"),i(),o(18,"th"),p(19,"Customer"),i(),o(20,"th",7),p(21,"Date"),i(),o(22,"th",9),p(23,"Due"),i(),_(24,Fe,2,0,"th",10),_(25,ve,2,0,"th",7),_(26,Me,2,0,"th",11),o(27,"th",12),p(28,"Amount"),i(),_(29,Ee,2,0,"th",13),i()(),o(30,"tbody"),O(31,Le,20,24,"tr",null,L),i()(),o(33,"POS-complex-pagination",14),S("jumpToPage",function(){return n.getListData()})("previousPage",function(){return n.getListData()})("nextPage",function(){return n.getListData()}),x("reloadRowCountChange",function(h){return s(t),y(n.reloadRowCount,h)||(n.reloadRowCount=h),c(h)}),i()()()()}if(e&2){let t,r,h;u("pageData",n.menuData())("isFilterOnDropdown",!1)("searchBoxPlaceholder",n.searchBoxPlaceholder()),C("text",n.pageData().Filter.Number),l(2),u("routerLink",I(14,fe)),l(3),g(n.roleService.global.Export?5:-1),l(19),g(n.isNotUnprintedOnly()?24:-1),l(),g(n.isNotUnprintedOnly()?25:-1),l(),g(n.isNotUnprintedOnly()?26:-1),l(3),g(n.isNotUnprintedOnly()?29:-1),l(2),W((t=n.data())==null?null:t.Data),l(2),u("total",(r=n.data())==null||r.Data==null?null:r.Data.length)("totalAllData",(h=n.data())==null?null:h.ListTotal)("pageData",n.pageData()),C("reloadRowCount",n.reloadRowCount)}},dependencies:[q,U,se,de,ue,ee,Y,Z,$,Ce,ge,_e,oe,K,G,me,pe,ce,ne,j,A,re],encapsulation:2,changeDetection:0})};export{he as PrintHistoryComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Oe}from"./chunk-DNMHFWF5.js";import{a as _e}from"./chunk-AO63R3DI.js";import{a as Me}from"./chunk-6VFC6FPO.js";import{a as Te}from"./chunk-DUDJZAAO.js";import{a as Ce}from"./chunk-3DC26I3D.js";import{a as Pe,b as ye}from"./chunk-JXEPD3CF.js";import"./chunk-PPMQE2JW.js";import{a as fe}from"./chunk-PWMMCY25.js";import"./chunk-OKQYRKDJ.js";import"./chunk-N5VS2V7L.js";import"./chunk-DEJ5V3PF.js";import"./chunk-UTSVZMZD.js";import"./chunk-BP6PECKT.js";import"./chunk-GNDUQZGK.js";import{F as be,b as he,h as ge,p as ve}from"./chunk-AJDQZ346.js";import{a as w,c as h}from"./chunk-KA5UQNW5.js";import{a as Se}from"./chunk-WONVJLUQ.js";import"./chunk-YY6WVNU4.js";import{b as S}from"./chunk-KLHHVIRS.js";import{a as P}from"./chunk-PPTZHIIZ.js";import{a as de}from"./chunk-QGRO3YRJ.js";import{n as me}from"./chunk-QGYXJUX3.js";import{$ as Y,$a as g,Ab as D,Bb as F,Cb as V,Db as v,E,Eb as a,Fb as p,Fc as re,Gb as d,Hc as oe,Od as le,Pa as W,Qd as ce,Rd as b,Sb as _,Sd as pe,Td as ue,Ua as u,Ub as K,Ud as G,ca as j,db as Q,dc as X,e as q,eb as I,ec as ee,gc as $,hc as f,ic as B,jc as z,ka as m,kd as ae,la as x,na as y,oa as c,sb as Z,tc as te,xd as se,yc as ie,zc as ne}from"./chunk-7D344CRC.js";import{a as J}from"./chunk-NF7PG5F2.js";var r=class e{constructor(n,t,i){this.authService=n;this.router=t;this.roleService=i}authService;router;roleService;canLoad(n,t){let s=t.some(l=>{let C=typeof l=="string"?l:l?.path;return typeof C=="string"&&C.toLowerCase()==="sell"})&&this.authService.hasOfflineSession();return this.authService.isTokenExpired()&&!s?(this.authService.returnUrl=this.getUrlRedirect(t),this.router.navigate(["/"]),!1):s&&!this.roleService.sell?.Create?(this.authService.endOfflineSession(),this.roleService.resetRoles(),this.router.navigate(["/menu/Unauthorized/Main/Unauthorized"]),!1):!0}getUrlRedirect(n){let t="/menu";n.forEach(o=>t+=`/${o.path}`);let i=this.router.currentNavigation().extractedUrl.queryParams;return Object.keys(i).forEach((o,l)=>{l==0?t=`${t}?${o}=${i[o]}`:t=`${t}&${o}=${i[o]}`}),t}static \u0275fac=function(t){return new(t||e)(y(h),y(b),y(S))};static \u0275prov=m({token:e,factory:e.\u0275fac,providedIn:"root"})};var k=class e{constructor(n){this.toastrService=n;this.initPermissionToastr=!1}toastrService;isPermissionGranted;initPermissionToastr;initPermission(){try{this.initPermissionToastr||Notification.requestPermission().then(t=>{this.isPermissionGranted=!1,t=="granted"&&(this.isPermissionGranted=!0),this.initPermissionToastr=!0})}catch(n){console.error(n)}}showAlert(n,t,i,s){let o=6e4;if(this.isPermissionGranted)try{let l=new Notification(t,{body:n,icon:s});l.onerror=(C=>{this.toastrService.info(this.setBody(n,i),t,{timeOut:o,enableHtml:this.hasUrl(i)})})}catch(l){console.error(l)}else this.toastrService.info(this.setBody(n,i),t,{timeOut:o,enableHtml:this.hasUrl(i)})}setBody(n,t){return this.hasUrl(t)&&(n=`<a href="${t}" target="_blank" class="ps-0">${n}</a>`),n}hasUrl(n){return!!(n&&n.length!==0)}static \u0275fac=function(t){return new(t||e)(y(me))};static \u0275prov=m({token:e,factory:e.\u0275fac,providedIn:"root"})};var xe=[{T:"Dashboard",U:"/menu/Dashboard",I:"fa-solid fa-chart-pie"},{T:"Products",U:"/menu/Products",I:"fa-solid fa-tag"},{T:"Estimate",U:"/menu/Estimate",I:"fa-solid fa-clipboard"},{T:"Sell",U:"/menu/Sell",I:"fa-solid fa-cart-shopping"},{T:"Shift",U:"/menu/Shift/",I:"fa-solid fa-user-clock"},{T:"Reports",U:"/menu/Reports",I:"fa-solid fa-chart-area"},{T:"Contacts",U:"/menu/Contacts",I:"fas fa-address-book"},{T:"Orders",U:"/menu/Orders",I:"fas fa-file-invoice"},{T:"Payment",U:"/menu/Payment",I:"fas fa-money-bill-alt"},{T:"Debt",U:"/menu/Debt",I:"fas fa-dollar-sign"},{T:"Inventory",U:"/menu/Inventory",I:"fas fa-archive"},{T:"Adjustment",U:"/menu/Adjustment",I:"fas fa-scanner-gun"},{T:"Buy",U:"/menu/Buy",I:"fa-solid fa-cart-arrow-down"},{T:"Logistics",U:"/menu/Logistics",I:"fas fa-truck"},{T:"Fulfillment",U:"/menu/Fulfillment",I:"fas fa-dolly"},{T:"Manufacture",U:"/menu/Manufacture",I:"fas fa-industry"},{T:"Prepaid Package",U:"/menu/Prepaid_Package",I:"fa-solid fa-id-card"},{T:"Promotion",U:"/menu/Promotion",I:"fas fa-bullhorn"},{T:"Users",U:"/menu/Users",I:"fas fa-user"},{T:"Outlets",U:"/menu/Outlets",I:"fas fa-map-marker-alt"},{T:"Setup",U:"/menu/Setup",I:"fas fa-gear"},{T:"Settings",U:"/menu/Settings",I:"fas fa-sliders"},{T:"Developer",U:"/menu/Developer",I:"fas fa-code"}];var R=class e{role=c(S);authService=c(h);menu=xe;filteredMenu=[];initFilteredMenu(){let n=this.menu.map(i=>J({},i)),t=n.findIndex(i=>i.T==="Reports");if(t!==-1){let i=!!this.role.report?.View,s=!!this.role.report?.Advanced,o=!!this.role.report?.Periodic,l=!!this.role.buy?.Report;i?n[t].U="/menu/Reports":s?n[t].U="/menu/Reports/Sales_Report/Standard/Top_Customers":o?n[t].U="/menu/Reports/Sales_Report/Standard/Daily":l?n[t].U="/menu/Reports/Purchases_Report/Product":n[t].U="/menu/Reports"}this.filteredMenu=n.filter(i=>i.T==="Dashboard"?this.role.dashboard.View:i.T==="Products"?this.role.product.View:i.T==="Estimate"?this.role.estimate.Create:i.T==="Sell"?this.role.sell.Create:i.T==="Shift"?this.role.sell.Create:i.T==="Reports"?!!this.role.report?.View||!!this.role.report?.Advanced||!!this.role.report?.Periodic||!!this.role.buy?.Report:i.T==="Contacts"?this.role.contact.View:i.T==="Orders"?this.role.order.View:i.T==="Payment"?this.role.payment.View:i.T==="Debt"?this.role.debt.View:i.T==="Inventory"?this?.role?.inventory?.View||this?.role?.inventory?.Advanced:i.T==="Adjustment"?this.role.adjustment.View:i.T==="Buy"?this.role.buy.Create:i.T==="Logistics"?this.role.logistic.View:i.T==="Manufacture"?this.role.manufacture.View:i.T==="Fulfillment"?this.role.fulfillment.View:i.T==="Prepaid Package"?this.role.prepaidPackage.View:i.T==="Promotion"?this.role.promotion.View:i.T==="Users"?this.role.users.View:i.T==="Outlets"?this.role.outlets.View:i.T==="Setup"||i.T==="Settings"?this.role.setup.View:i.T==="Developer"?this.role.developer.View:!0),this.filterBySubscriptionStatus()}filterBySubscriptionStatus(){let n=this.authService.getSubscriptionStatus();this.filteredMenu=this.filteredMenu.filter(t=>{switch(n){case 2:return t.T=="Sell"||t.T=="Shift";case 3:return!1;default:return!0}})}static \u0275fac=function(t){return new(t||e)};static \u0275prov=m({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ie=[{T:"My Profile",U:"Profile/Main/My_Profile",I:"fas fa-user"},{T:"My Subscription",U:"Profile/Main/My_Subscription",I:"fa-solid fa-credit-card"},{T:"Notification",U:"Profile/Notification/Push",I:"fas fa-bell"},{T:"My Sales",U:"Profile/Main/My_Sales",I:"fas fa-history"}];var A=class e{role=c(S);authService=c(h);filteredMenu=[];initFilteredMenu(){let n=this.authService.getSubscriptionStatus();this.filteredMenu=Ie.filter(t=>t.T=="My Profile"?this.role.profile.View:t.T=="My Subscription"?this.role.profile.Subscription:t.T=="Notification"?this.role.profile.Notification&&n!=2&&n!=3:t.T=="My Sales"?n!=2&&n!=3:!0)}static \u0275fac=function(t){return new(t||e)};static \u0275prov=m({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ee=(e,n)=>({"full-container":e,"subscription-bar-visible":n}),je=e=>[e];function De(e,n){if(e&1&&(a(0,"a",11),d(1,"i",35),a(2,"span"),f(3),p()()),e&2){let t=n.$implicit;v("routerLink",t==null?null:t.U),u(),$((t==null?null:t.I)+" me-2"),u(2),B(t==null?null:t.T)}}function Fe(e,n){if(e&1&&(a(0,"li",33,0)(2,"a",36),d(3,"i"),a(4,"p"),f(5),p()()()),e&2){let t=n.$implicit,i=K();v("routerLinkActiveOptions",i.isActiveMatchOptions),Z("data-cy",t==null?null:t.T),u(2),v("matTooltip",i.toggleSideMenu?t==null?null:t.T:"")("routerLink",ie(7,je,t==null?null:t.U)),u(),$(t==null?null:t.I),u(2),B(t==null?null:t.T)}}var O=class e{constructor(n,t,i,s,o,l,C,H,Ge){this.toggleSidebar=n;this.signalRClientService=t;this.notificationAlertService=i;this.router=s;this.authService=o;this.intercomService=l;this.firebaseAuthService=Ge;C.initFilteredMenu(),H.initFilteredMenu(),this.leftSidebarMenu=C.filteredMenu,this.topMenu=H.filteredMenu,this.accountInfo=JSON.parse(localStorage.getItem("AccountInfo")),this.toggleSidebar.toggleState$.subscribe(ke=>this.isNavOpen=ke),this.destroy$=new q,this.initNotificationPermission()}toggleSidebar;signalRClientService;notificationAlertService;router;authService;intercomService;firebaseAuthService;isActiveMatchOptions={matrixParams:"subset",queryParams:"subset",paths:"subset",fragment:"exact"};toggleSideMenu=!1;isNavOpen;destroy$;activeMenu;appVersion=de.version;currentSubStatus;subsStatusEnum=w;isFullContainer=!1;isSettingsPage=!1;isHideIntercomLauncher;leftSidebarMenu;topMenu;accountInfo;ngOnInit(){this.subscribeToPushNotification(),this.getCurrentSubscriptionStatus(),this.initFullContainer()}initFullContainer(){this.router.events.pipe(E(n=>n instanceof le),Y(null),j(this.destroy$)).subscribe(n=>{this.isFullContainer=!1,(this.router.url.includes("Sell")&&!this.router.url.includes("v2")&&!this.router.url.includes("Offline")||this.router.url.includes("Buy")||this.router.url.includes("menu/Estimate")||this.router.url.includes("Transfer_Order/Form")&&!this.router.url.includes("Setup/Tag/Transfer_Order/Form")||this.router.url.includes("Adjustment/Archive/Form")||this.router.url.includes("Job_Order/Archive/Form")||this.router.url.includes("/menu/Debt/Debt/Join_Invoice/Form")||this.router.url.includes("/menu/Debt/Debt/Join_Bill/New_Join_Bill")||this.router.url.includes("/menu/Settings"))&&(this.isFullContainer=!0),this.router.url.includes("Settings")&&(this.isSettingsPage=!0);let t=document.querySelector("#full-container");t&&t.classList.toggle("full-container",this.isFullContainer)})}initNotificationPermission(){this.notificationAlertService.initPermission()}getCurrentSubscriptionStatus(){this.currentSubStatus=this.authService.getSubscriptionStatus()}subscribeToPushNotification(){let n=localStorage.getItem("NotificationOutletID");P.IsNotEmpty(n)&&P.isGuid(n)?this.signalRClientService.SubscribeGroup(n):this.signalRClientService.startConnection(),this.signalRClientService.OnReceivePushNotification.pipe(j(this.destroy$),E(t=>P.IsNotEmpty(t))).subscribe(t=>{if(P.IsNotEmpty(t)){let i=JSON.parse(t),s="https://cdn.dealpos.xyz/web-image/info-new.png";P.IsNotEmpty(i.Icon)&&(s=i.Icon),this.notificationAlertService.showAlert(i.Body,i.Header,i.URL,s)}})}ngAfterViewInit(){this.intercomService.inititalizeIntercom()}toggleMenu(){this.toggleSideMenu=!this.toggleSideMenu}logout(){this.authService.logout(),this.firebaseAuthService.logout()}isNotEmpty(n){return P.IsNotEmpty(n)}onShowDropdown(){this.isHideIntercomLauncher=this.intercomService.isHideLauncher()}chatToggleChange(){this.isHideIntercomLauncher==!1?this.intercomService.hideLauncher():this.intercomService.showLauncher(),this.onShowDropdown()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(t){return new(t||e)(g(Ce),g(fe),g(k),g(b),g(h),g(Se),g(R),g(A),g(Me))};static \u0275cmp=Q({type:e,selectors:[["POS-menu-master"]],standalone:!1,decls:54,vars:19,consts:[["rla","routerLinkActive"],[1,"wrapper"],["data-color","blue",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-lg-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fa-solid",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-cy","companyName","data-bs-toggle","dropdown","aria-expanded","false","matTooltipPosition","above",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center",2,"cursor","pointer",3,"click","matTooltip"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],[1,"dropdown-item","h5",3,"routerLink"],[1,"dropdown-item","h5",2,"cursor","pointer"],[1,"d-flex","align-items-center","justify-content-between"],[1,"fa-solid","fa-comment-dots","me-2"],[1,"checkbox_toggle","ms-3",3,"click"],["type","checkbox","id","chatToggle","name","ChatToggle",3,"ngModelChange","ngModel"],["for","chatToggle",1,"position-relative","rounded-pill","pointer"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fa-solid","fa-sign-out-alt","me-2"],[1,"divider"],[1,"dropdown-header","border-top"],["target","_blank",1,"dropdown-item","h5","changelog",3,"href"],["aria-hidden","true",1,"fa-solid","fa-sparkles","me-2"],[1,"fa-solid","fa-circle-exclamation","ms-2",2,"font-size","16px"],["target","_blank","href","http://support.dealpos.com",1,"dropdown-item","h5"],["aria-hidden","true",1,"fa-solid","fa-book","me-2"],["target","_blank","href","https://www.dealpos.app/",1,"dropdown-item","h5"],["aria-hidden","true",1,"fa-solid","fa-table-cells-large","me-2"],["target","_blank","href","http://blog.dealpos.com",1,"dropdown-item","h5"],["aria-hidden","true",1,"fa-brands","fa-blogger","me-2"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active",3,"routerLinkActiveOptions"],["id","full-container",1,"main-panel",3,"ngClass"],["aria-hidden","true"],["matTooltipPosition","above",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"]],template:function(t,i){t&1&&(a(0,"div",1)(1,"div",2)(2,"button",3),_("click",function(){return i.toggleMenu()}),d(3,"i",4),p(),a(4,"div",5)(5,"div",6)(6,"a",7),_("click",function(){return i.onShowDropdown()}),f(7),re(8,"limitText"),p(),a(9,"div",8)(10,"div",9),f(11),p(),d(12,"div",10),F(13,De,4,4,"a",11,D),a(15,"a",12)(16,"div",13)(17,"div"),d(18,"i",14),a(19,"span"),f(20,"Chat Support"),p()(),a(21,"div",15),_("click",function(o){return o.stopPropagation()}),a(22,"input",16),_("ngModelChange",function(){return i.chatToggleChange()}),p(),d(23,"label",17),p()()(),a(24,"a",18),_("click",function(){return i.logout()}),d(25,"i",19),a(26,"span"),f(27,"Log Out"),p()(),d(28,"div",20),a(29,"div",21),f(30," Links "),p(),a(31,"a",22),d(32,"i",23),a(33,"span"),f(34,"What's New"),d(35,"i",24),p()(),a(36,"a",25),d(37,"i",26),a(38,"span"),f(39,"Help Center"),p()(),a(40,"a",27),d(41,"i",28),a(42,"span"),f(43,"App Store"),p()(),a(44,"a",29),d(45,"i",30),a(46,"span"),f(47,"Company Blog"),p()()()()(),a(48,"div",31)(49,"ul",32),F(50,Fe,6,9,"li",33,D),p()()(),a(52,"div",34),d(53,"router-outlet"),p()()),t&2&&(ee("nav-open",i.isNavOpen),u(),v("ngClass",i.toggleSideMenu?"collapses":""),u(2),v("ngClass",i.toggleSideMenu?"fa-angle-left cursor":"fa-angle-right cursor"),u(3),v("matTooltip",i.accountInfo==null?null:i.accountInfo.BrandName),u(),z(" ",oe(8,13,i.accountInfo==null?null:i.accountInfo.BrandName,12)," "),u(4),z("",i.accountInfo==null?null:i.accountInfo.UserName," "),u(2),V(i.topMenu),u(9),v("ngModel",!i.isHideIntercomLauncher),u(9),v("href",te("https://changelog.dealpos.com/?categories=cat_gAZdRhBYU7QVl&view=complete&v=",i.appVersion),W),u(19),V(i.leftSidebarMenu),u(2),X("background-color",(i.isSettingsPage,"")),v("ngClass",ne(16,Ee,i.isFullContainer,i.isNotEmpty(i.currentSubStatus)&&i.currentSubStatus!==i.subsStatusEnum.PAID)))},dependencies:[Pe,ce,pe,ue,he,ge,ve,ae,_e],styles:['.sidebar[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%], body[_ngcontent-%COMP%] > .navbar-collapse[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important}.sidebar-wrapper[_ngcontent-%COMP%]{max-height:calc(100% - 61px)!important;min-height:calc(100% - 61px)!important}@media(max-width:991px){.sidebar-wrapper[_ngcontent-%COMP%]{overflow-y:scroll!important}}@media(pointer:coarse){.sidebar-wrapper[_ngcontent-%COMP%]{overflow-y:scroll!important}}@media(max-width:468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width:992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}}.full-container[_ngcontent-%COMP%]{padding-top:0!important}.changelog[_ngcontent-%COMP%]{color:#0006b1!important}.changelog[_ngcontent-%COMP%]:visited{color:#2e2e2e!important}.changelog[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{position:relative}.changelog[_ngcontent-%COMP%] span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fe3a00!important;position:absolute;top:-4px;right:-18px}.changelog[_ngcontent-%COMP%]:visited span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fff!important;position:absolute;top:-4px;right:-18px}.changelog[_ngcontent-%COMP%]:visited:hover span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#e9ecef!important;position:absolute;top:-4px;right:-18px}.subscription-bar-visible[_ngcontent-%COMP%]{padding-top:98px}.checkbox_toggle[_ngcontent-%COMP%]{position:relative}.checkbox_toggle[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#868686;display:inline-block;padding-right:38px}.checkbox_toggle[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{width:23px;height:14px;background-color:#ccc;top:2.2px;right:0}.checkbox_toggle[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{display:none}.checkbox_toggle[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background-color:#1f77d0}.checkbox_toggle[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]:after{left:10px}.checkbox_toggle[_ngcontent-%COMP%] label[_ngcontent-%COMP%]:after{content:"";width:12px;height:12px;border-radius:50%;position:absolute;top:.8px;left:1px;transition:all .1s;background-color:#fff}']})};function Ve(e){let n=c(b),t="/menu";e.forEach(o=>t+=`/${o.path}`);let i=n.currentNavigation().extractedUrl.queryParams;return Object.keys(i).forEach((o,l)=>{l==0?t=`${t}?${o}=${i[o]}`:t=`${t}&${o}=${i[o]}`}),t}var $e=e=>{let n=(e??"").toLowerCase();return n==="sell"||n.startsWith("sell")},T=(e,n)=>{let t=c(h),i=t.isTokenExpired(),s=c(b),o=c(S);if(i)return t.returnUrl=Ve(n),s.navigate(["/"]),!1;{let l=e.path;if(l=="Dashboard")return Be();if($e(l)&&!o.sell?.Create)return t.hasOfflineSession()&&(t.endOfflineSession(),o.resetRoles()),s.navigate(["/menu/Unauthorized/Main/Unauthorized"]),!1}return!0};function Be(){let e=c(b),n=c(h),t=!1,i=n.getRedirectUrl();return t=i.includes("Dashboard"),t==!1&&e.navigate([i]),t}var U=class e{paymentStorageService=c(Oe);canActivate(n,t){return this.paymentStorageService.clear(),!0}static \u0275fac=function(t){return new(t||e)};static \u0275prov=m({token:e,factory:e.\u0275fac,providedIn:"root"})};var L=class e{reportService=c(Te);canActivate(n,t){return this.reportService.resetFilter(),!0}static \u0275fac=function(t){return new(t||e)};static \u0275prov=m({token:e,factory:e.\u0275fac,providedIn:"root"})};var ze=[{path:"",component:O,children:[{path:"Inventory",loadChildren:()=>import("./chunk-B5JKALPE.js").then(e=>e.InventoryModule),canLoad:[r]},{path:"Reports",loadChildren:()=>import("./chunk-P423UVHY.js").then(e=>e.ReportsModule),canLoad:[r],canActivate:[L]},{path:"Sell",loadChildren:()=>import("./chunk-Z3POHU6P.js").then(e=>e.routes),canLoad:[r]},{path:"Print",loadChildren:()=>import("./chunk-OS4JEDHC.js").then(e=>e.PrintModule),canLoad:[r]},{path:"Buy",loadComponent:()=>import("./chunk-W2E4NMUY.js").then(e=>e.BuyV2Component),canMatch:[T]},{path:"Sell/V2",loadComponent:()=>import("./chunk-B3IVCH2X.js").then(e=>e.SellV2Component),canMatch:[T]},{path:"Dashboard",loadComponent:()=>import("./chunk-IWZEF2TO.js").then(e=>e.DashboardV2Component),canMatch:[T],data:{preload:!0}},{path:"Products",loadChildren:()=>import("./chunk-3KXXQZKR.js").then(e=>e.ProductModule),canLoad:[r]},{path:"Shift",loadChildren:()=>import("./chunk-G4XJ2JEK.js").then(e=>e.ShiftModule),canLoad:[r]},{path:"Debt",loadChildren:()=>import("./chunk-WQDU4NSB.js").then(e=>e.DebtModule),canLoad:[r]},{path:"Logistics",loadChildren:()=>import("./chunk-YPPJTBH7.js").then(e=>e.DeliveryModule),canLoad:[r]},{path:"Users",loadChildren:()=>import("./chunk-N4UH64HL.js").then(e=>e.UsersModule),canLoad:[r]},{path:"Setup",loadChildren:()=>import("./chunk-NBR7TUHP.js").then(e=>e.SetupModule),canLoad:[r]},{path:"Settings",loadChildren:()=>import("./chunk-IOZWCEUL.js").then(e=>e.routes),canLoad:[r]},{path:"Developer",loadChildren:()=>import("./chunk-IPO5WHEB.js").then(e=>e.DeveloperModule),canLoad:[r]},{path:"Contacts",loadChildren:()=>import("./chunk-67NJBLG2.js").then(e=>e.ContactsModule),canLoad:[r]},{path:"Outlets",loadChildren:()=>import("./chunk-4NJMYXX4.js").then(e=>e.OutletsModule),canLoad:[r]},{path:"Orders",loadChildren:()=>import("./chunk-HENCOWSS.js").then(e=>e.OrdersModule),canLoad:[r]},{path:"Profile",loadChildren:()=>import("./chunk-JKC4ZMXV.js").then(e=>e.ProfileModule),canLoad:[r]},{path:"Estimate",loadComponent:()=>import("./chunk-Z7YC4KTU.js").then(e=>e.EstimateV2Component),canMatch:[T]},{path:"Adjustment",loadChildren:()=>import("./chunk-MARB3TY7.js").then(e=>e.AdjustmentModule),canLoad:[r]},{path:"Payment",loadChildren:()=>import("./chunk-5KIJ6ZVL.js").then(e=>e.PaymentModule),canLoad:[r],canActivate:[U]},{path:"Promotion",loadChildren:()=>import("./chunk-PS4QURQQ.js").then(e=>e.PromotionModule),canLoad:[r]},{path:"Manufacture",loadChildren:()=>import("./chunk-6AFXHDIK.js").then(e=>e.ManufactureModule),canLoad:[r]},{path:"Prepaid_Package",loadChildren:()=>import("./chunk-JJOUD4SD.js").then(e=>e.PrepaidPackageModule),canLoad:[r]},{path:"Fulfillment",loadChildren:()=>import("./chunk-KC6TKKFJ.js").then(e=>e.FulfillmentModule),canLoad:[r]},{path:"Unauthorized",loadChildren:()=>import("./chunk-WYV2VGE6.js").then(e=>e.UnauthorizedModule),canLoad:[r]},{path:"Not_Found",loadChildren:()=>import("./chunk-DU5PMK3P.js").then(e=>e.NotFoundModule),canLoad:[r]},{path:"",redirectTo:"/menu/Dashboard",pathMatch:"full"},{path:"**",redirectTo:"Not_Found"}]}],N=class e{static \u0275fac=function(t){return new(t||e)};static \u0275mod=I({type:e});static \u0275inj=x({imports:[G.forChild(ze),G]})};var we=class e{constructor(){}static \u0275fac=function(t){return new(t||e)};static \u0275mod=I({type:e,bootstrap:[O]});static \u0275inj=x({imports:[ye,N,be,se]})};export{we as MenuMasterModule};
|
|
1
|
+
import{a as Oe}from"./chunk-UJS2Z7JX.js";import{a as _e}from"./chunk-AO63R3DI.js";import{a as Me}from"./chunk-TNECVRMA.js";import{a as Te}from"./chunk-6XXUTFHL.js";import{a as Ce}from"./chunk-3DC26I3D.js";import{a as Pe,b as ye}from"./chunk-JXEPD3CF.js";import"./chunk-PPMQE2JW.js";import{a as fe}from"./chunk-PWMMCY25.js";import"./chunk-OKQYRKDJ.js";import"./chunk-N5VS2V7L.js";import"./chunk-DEJ5V3PF.js";import"./chunk-UTSVZMZD.js";import"./chunk-BP6PECKT.js";import"./chunk-GNDUQZGK.js";import{F as be,b as he,h as ge,p as ve}from"./chunk-AJDQZ346.js";import{a as w,c as h}from"./chunk-PVURXJZD.js";import{a as Se}from"./chunk-32LNIRMN.js";import"./chunk-YY6WVNU4.js";import{b as S}from"./chunk-KLHHVIRS.js";import{a as P}from"./chunk-PPTZHIIZ.js";import{a as de}from"./chunk-TWIM3F7F.js";import{n as me}from"./chunk-QGYXJUX3.js";import{$ as Y,$a as g,Ab as D,Bb as F,Cb as V,Db as v,E,Eb as a,Fb as p,Fc as re,Gb as d,Hc as oe,Od as le,Pa as W,Qd as ce,Rd as b,Sb as _,Sd as pe,Td as ue,Ua as u,Ub as K,Ud as G,ca as j,db as Q,dc as X,e as q,eb as I,ec as ee,gc as $,hc as f,ic as B,jc as z,ka as m,kd as ae,la as x,na as y,oa as c,sb as Z,tc as te,xd as se,yc as ie,zc as ne}from"./chunk-7D344CRC.js";import{a as J}from"./chunk-NF7PG5F2.js";var r=class e{constructor(n,t,i){this.authService=n;this.router=t;this.roleService=i}authService;router;roleService;canLoad(n,t){let s=t.some(l=>{let C=typeof l=="string"?l:l?.path;return typeof C=="string"&&C.toLowerCase()==="sell"})&&this.authService.hasOfflineSession();return this.authService.isTokenExpired()&&!s?(this.authService.returnUrl=this.getUrlRedirect(t),this.router.navigate(["/"]),!1):s&&!this.roleService.sell?.Create?(this.authService.endOfflineSession(),this.roleService.resetRoles(),this.router.navigate(["/menu/Unauthorized/Main/Unauthorized"]),!1):!0}getUrlRedirect(n){let t="/menu";n.forEach(o=>t+=`/${o.path}`);let i=this.router.currentNavigation().extractedUrl.queryParams;return Object.keys(i).forEach((o,l)=>{l==0?t=`${t}?${o}=${i[o]}`:t=`${t}&${o}=${i[o]}`}),t}static \u0275fac=function(t){return new(t||e)(y(h),y(b),y(S))};static \u0275prov=m({token:e,factory:e.\u0275fac,providedIn:"root"})};var k=class e{constructor(n){this.toastrService=n;this.initPermissionToastr=!1}toastrService;isPermissionGranted;initPermissionToastr;initPermission(){try{this.initPermissionToastr||Notification.requestPermission().then(t=>{this.isPermissionGranted=!1,t=="granted"&&(this.isPermissionGranted=!0),this.initPermissionToastr=!0})}catch(n){console.error(n)}}showAlert(n,t,i,s){let o=6e4;if(this.isPermissionGranted)try{let l=new Notification(t,{body:n,icon:s});l.onerror=(C=>{this.toastrService.info(this.setBody(n,i),t,{timeOut:o,enableHtml:this.hasUrl(i)})})}catch(l){console.error(l)}else this.toastrService.info(this.setBody(n,i),t,{timeOut:o,enableHtml:this.hasUrl(i)})}setBody(n,t){return this.hasUrl(t)&&(n=`<a href="${t}" target="_blank" class="ps-0">${n}</a>`),n}hasUrl(n){return!!(n&&n.length!==0)}static \u0275fac=function(t){return new(t||e)(y(me))};static \u0275prov=m({token:e,factory:e.\u0275fac,providedIn:"root"})};var xe=[{T:"Dashboard",U:"/menu/Dashboard",I:"fa-solid fa-chart-pie"},{T:"Products",U:"/menu/Products",I:"fa-solid fa-tag"},{T:"Estimate",U:"/menu/Estimate",I:"fa-solid fa-clipboard"},{T:"Sell",U:"/menu/Sell",I:"fa-solid fa-cart-shopping"},{T:"Shift",U:"/menu/Shift/",I:"fa-solid fa-user-clock"},{T:"Reports",U:"/menu/Reports",I:"fa-solid fa-chart-area"},{T:"Contacts",U:"/menu/Contacts",I:"fas fa-address-book"},{T:"Orders",U:"/menu/Orders",I:"fas fa-file-invoice"},{T:"Payment",U:"/menu/Payment",I:"fas fa-money-bill-alt"},{T:"Debt",U:"/menu/Debt",I:"fas fa-dollar-sign"},{T:"Inventory",U:"/menu/Inventory",I:"fas fa-archive"},{T:"Adjustment",U:"/menu/Adjustment",I:"fas fa-scanner-gun"},{T:"Buy",U:"/menu/Buy",I:"fa-solid fa-cart-arrow-down"},{T:"Logistics",U:"/menu/Logistics",I:"fas fa-truck"},{T:"Fulfillment",U:"/menu/Fulfillment",I:"fas fa-dolly"},{T:"Manufacture",U:"/menu/Manufacture",I:"fas fa-industry"},{T:"Prepaid Package",U:"/menu/Prepaid_Package",I:"fa-solid fa-id-card"},{T:"Promotion",U:"/menu/Promotion",I:"fas fa-bullhorn"},{T:"Users",U:"/menu/Users",I:"fas fa-user"},{T:"Outlets",U:"/menu/Outlets",I:"fas fa-map-marker-alt"},{T:"Setup",U:"/menu/Setup",I:"fas fa-gear"},{T:"Settings",U:"/menu/Settings",I:"fas fa-sliders"},{T:"Developer",U:"/menu/Developer",I:"fas fa-code"}];var R=class e{role=c(S);authService=c(h);menu=xe;filteredMenu=[];initFilteredMenu(){let n=this.menu.map(i=>J({},i)),t=n.findIndex(i=>i.T==="Reports");if(t!==-1){let i=!!this.role.report?.View,s=!!this.role.report?.Advanced,o=!!this.role.report?.Periodic,l=!!this.role.buy?.Report;i?n[t].U="/menu/Reports":s?n[t].U="/menu/Reports/Sales_Report/Standard/Top_Customers":o?n[t].U="/menu/Reports/Sales_Report/Standard/Daily":l?n[t].U="/menu/Reports/Purchases_Report/Product":n[t].U="/menu/Reports"}this.filteredMenu=n.filter(i=>i.T==="Dashboard"?this.role.dashboard.View:i.T==="Products"?this.role.product.View:i.T==="Estimate"?this.role.estimate.Create:i.T==="Sell"?this.role.sell.Create:i.T==="Shift"?this.role.sell.Create:i.T==="Reports"?!!this.role.report?.View||!!this.role.report?.Advanced||!!this.role.report?.Periodic||!!this.role.buy?.Report:i.T==="Contacts"?this.role.contact.View:i.T==="Orders"?this.role.order.View:i.T==="Payment"?this.role.payment.View:i.T==="Debt"?this.role.debt.View:i.T==="Inventory"?this?.role?.inventory?.View||this?.role?.inventory?.Advanced:i.T==="Adjustment"?this.role.adjustment.View:i.T==="Buy"?this.role.buy.Create:i.T==="Logistics"?this.role.logistic.View:i.T==="Manufacture"?this.role.manufacture.View:i.T==="Fulfillment"?this.role.fulfillment.View:i.T==="Prepaid Package"?this.role.prepaidPackage.View:i.T==="Promotion"?this.role.promotion.View:i.T==="Users"?this.role.users.View:i.T==="Outlets"?this.role.outlets.View:i.T==="Setup"||i.T==="Settings"?this.role.setup.View:i.T==="Developer"?this.role.developer.View:!0),this.filterBySubscriptionStatus()}filterBySubscriptionStatus(){let n=this.authService.getSubscriptionStatus();this.filteredMenu=this.filteredMenu.filter(t=>{switch(n){case 2:return t.T=="Sell"||t.T=="Shift";case 3:return!1;default:return!0}})}static \u0275fac=function(t){return new(t||e)};static \u0275prov=m({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ie=[{T:"My Profile",U:"Profile/Main/My_Profile",I:"fas fa-user"},{T:"My Subscription",U:"Profile/Main/My_Subscription",I:"fa-solid fa-credit-card"},{T:"Notification",U:"Profile/Notification/Push",I:"fas fa-bell"},{T:"My Sales",U:"Profile/Main/My_Sales",I:"fas fa-history"}];var A=class e{role=c(S);authService=c(h);filteredMenu=[];initFilteredMenu(){let n=this.authService.getSubscriptionStatus();this.filteredMenu=Ie.filter(t=>t.T=="My Profile"?this.role.profile.View:t.T=="My Subscription"?this.role.profile.Subscription:t.T=="Notification"?this.role.profile.Notification&&n!=2&&n!=3:t.T=="My Sales"?n!=2&&n!=3:!0)}static \u0275fac=function(t){return new(t||e)};static \u0275prov=m({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ee=(e,n)=>({"full-container":e,"subscription-bar-visible":n}),je=e=>[e];function De(e,n){if(e&1&&(a(0,"a",11),d(1,"i",35),a(2,"span"),f(3),p()()),e&2){let t=n.$implicit;v("routerLink",t==null?null:t.U),u(),$((t==null?null:t.I)+" me-2"),u(2),B(t==null?null:t.T)}}function Fe(e,n){if(e&1&&(a(0,"li",33,0)(2,"a",36),d(3,"i"),a(4,"p"),f(5),p()()()),e&2){let t=n.$implicit,i=K();v("routerLinkActiveOptions",i.isActiveMatchOptions),Z("data-cy",t==null?null:t.T),u(2),v("matTooltip",i.toggleSideMenu?t==null?null:t.T:"")("routerLink",ie(7,je,t==null?null:t.U)),u(),$(t==null?null:t.I),u(2),B(t==null?null:t.T)}}var O=class e{constructor(n,t,i,s,o,l,C,H,Ge){this.toggleSidebar=n;this.signalRClientService=t;this.notificationAlertService=i;this.router=s;this.authService=o;this.intercomService=l;this.firebaseAuthService=Ge;C.initFilteredMenu(),H.initFilteredMenu(),this.leftSidebarMenu=C.filteredMenu,this.topMenu=H.filteredMenu,this.accountInfo=JSON.parse(localStorage.getItem("AccountInfo")),this.toggleSidebar.toggleState$.subscribe(ke=>this.isNavOpen=ke),this.destroy$=new q,this.initNotificationPermission()}toggleSidebar;signalRClientService;notificationAlertService;router;authService;intercomService;firebaseAuthService;isActiveMatchOptions={matrixParams:"subset",queryParams:"subset",paths:"subset",fragment:"exact"};toggleSideMenu=!1;isNavOpen;destroy$;activeMenu;appVersion=de.version;currentSubStatus;subsStatusEnum=w;isFullContainer=!1;isSettingsPage=!1;isHideIntercomLauncher;leftSidebarMenu;topMenu;accountInfo;ngOnInit(){this.subscribeToPushNotification(),this.getCurrentSubscriptionStatus(),this.initFullContainer()}initFullContainer(){this.router.events.pipe(E(n=>n instanceof le),Y(null),j(this.destroy$)).subscribe(n=>{this.isFullContainer=!1,(this.router.url.includes("Sell")&&!this.router.url.includes("v2")&&!this.router.url.includes("Offline")||this.router.url.includes("Buy")||this.router.url.includes("menu/Estimate")||this.router.url.includes("Transfer_Order/Form")&&!this.router.url.includes("Setup/Tag/Transfer_Order/Form")||this.router.url.includes("Adjustment/Archive/Form")||this.router.url.includes("Job_Order/Archive/Form")||this.router.url.includes("/menu/Debt/Debt/Join_Invoice/Form")||this.router.url.includes("/menu/Debt/Debt/Join_Bill/New_Join_Bill")||this.router.url.includes("/menu/Settings"))&&(this.isFullContainer=!0),this.router.url.includes("Settings")&&(this.isSettingsPage=!0);let t=document.querySelector("#full-container");t&&t.classList.toggle("full-container",this.isFullContainer)})}initNotificationPermission(){this.notificationAlertService.initPermission()}getCurrentSubscriptionStatus(){this.currentSubStatus=this.authService.getSubscriptionStatus()}subscribeToPushNotification(){let n=localStorage.getItem("NotificationOutletID");P.IsNotEmpty(n)&&P.isGuid(n)?this.signalRClientService.SubscribeGroup(n):this.signalRClientService.startConnection(),this.signalRClientService.OnReceivePushNotification.pipe(j(this.destroy$),E(t=>P.IsNotEmpty(t))).subscribe(t=>{if(P.IsNotEmpty(t)){let i=JSON.parse(t),s="https://cdn.dealpos.xyz/web-image/info-new.png";P.IsNotEmpty(i.Icon)&&(s=i.Icon),this.notificationAlertService.showAlert(i.Body,i.Header,i.URL,s)}})}ngAfterViewInit(){this.intercomService.inititalizeIntercom()}toggleMenu(){this.toggleSideMenu=!this.toggleSideMenu}logout(){this.authService.logout(),this.firebaseAuthService.logout()}isNotEmpty(n){return P.IsNotEmpty(n)}onShowDropdown(){this.isHideIntercomLauncher=this.intercomService.isHideLauncher()}chatToggleChange(){this.isHideIntercomLauncher==!1?this.intercomService.hideLauncher():this.intercomService.showLauncher(),this.onShowDropdown()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(t){return new(t||e)(g(Ce),g(fe),g(k),g(b),g(h),g(Se),g(R),g(A),g(Me))};static \u0275cmp=Q({type:e,selectors:[["POS-menu-master"]],standalone:!1,decls:54,vars:19,consts:[["rla","routerLinkActive"],[1,"wrapper"],["data-color","blue",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-lg-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fa-solid",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-cy","companyName","data-bs-toggle","dropdown","aria-expanded","false","matTooltipPosition","above",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center",2,"cursor","pointer",3,"click","matTooltip"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],[1,"dropdown-item","h5",3,"routerLink"],[1,"dropdown-item","h5",2,"cursor","pointer"],[1,"d-flex","align-items-center","justify-content-between"],[1,"fa-solid","fa-comment-dots","me-2"],[1,"checkbox_toggle","ms-3",3,"click"],["type","checkbox","id","chatToggle","name","ChatToggle",3,"ngModelChange","ngModel"],["for","chatToggle",1,"position-relative","rounded-pill","pointer"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fa-solid","fa-sign-out-alt","me-2"],[1,"divider"],[1,"dropdown-header","border-top"],["target","_blank",1,"dropdown-item","h5","changelog",3,"href"],["aria-hidden","true",1,"fa-solid","fa-sparkles","me-2"],[1,"fa-solid","fa-circle-exclamation","ms-2",2,"font-size","16px"],["target","_blank","href","http://support.dealpos.com",1,"dropdown-item","h5"],["aria-hidden","true",1,"fa-solid","fa-book","me-2"],["target","_blank","href","https://www.dealpos.app/",1,"dropdown-item","h5"],["aria-hidden","true",1,"fa-solid","fa-table-cells-large","me-2"],["target","_blank","href","http://blog.dealpos.com",1,"dropdown-item","h5"],["aria-hidden","true",1,"fa-brands","fa-blogger","me-2"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active",3,"routerLinkActiveOptions"],["id","full-container",1,"main-panel",3,"ngClass"],["aria-hidden","true"],["matTooltipPosition","above",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"]],template:function(t,i){t&1&&(a(0,"div",1)(1,"div",2)(2,"button",3),_("click",function(){return i.toggleMenu()}),d(3,"i",4),p(),a(4,"div",5)(5,"div",6)(6,"a",7),_("click",function(){return i.onShowDropdown()}),f(7),re(8,"limitText"),p(),a(9,"div",8)(10,"div",9),f(11),p(),d(12,"div",10),F(13,De,4,4,"a",11,D),a(15,"a",12)(16,"div",13)(17,"div"),d(18,"i",14),a(19,"span"),f(20,"Chat Support"),p()(),a(21,"div",15),_("click",function(o){return o.stopPropagation()}),a(22,"input",16),_("ngModelChange",function(){return i.chatToggleChange()}),p(),d(23,"label",17),p()()(),a(24,"a",18),_("click",function(){return i.logout()}),d(25,"i",19),a(26,"span"),f(27,"Log Out"),p()(),d(28,"div",20),a(29,"div",21),f(30," Links "),p(),a(31,"a",22),d(32,"i",23),a(33,"span"),f(34,"What's New"),d(35,"i",24),p()(),a(36,"a",25),d(37,"i",26),a(38,"span"),f(39,"Help Center"),p()(),a(40,"a",27),d(41,"i",28),a(42,"span"),f(43,"App Store"),p()(),a(44,"a",29),d(45,"i",30),a(46,"span"),f(47,"Company Blog"),p()()()()(),a(48,"div",31)(49,"ul",32),F(50,Fe,6,9,"li",33,D),p()()(),a(52,"div",34),d(53,"router-outlet"),p()()),t&2&&(ee("nav-open",i.isNavOpen),u(),v("ngClass",i.toggleSideMenu?"collapses":""),u(2),v("ngClass",i.toggleSideMenu?"fa-angle-left cursor":"fa-angle-right cursor"),u(3),v("matTooltip",i.accountInfo==null?null:i.accountInfo.BrandName),u(),z(" ",oe(8,13,i.accountInfo==null?null:i.accountInfo.BrandName,12)," "),u(4),z("",i.accountInfo==null?null:i.accountInfo.UserName," "),u(2),V(i.topMenu),u(9),v("ngModel",!i.isHideIntercomLauncher),u(9),v("href",te("https://changelog.dealpos.com/?categories=cat_gAZdRhBYU7QVl&view=complete&v=",i.appVersion),W),u(19),V(i.leftSidebarMenu),u(2),X("background-color",(i.isSettingsPage,"")),v("ngClass",ne(16,Ee,i.isFullContainer,i.isNotEmpty(i.currentSubStatus)&&i.currentSubStatus!==i.subsStatusEnum.PAID)))},dependencies:[Pe,ce,pe,ue,he,ge,ve,ae,_e],styles:['.sidebar[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%], body[_ngcontent-%COMP%] > .navbar-collapse[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important}.sidebar-wrapper[_ngcontent-%COMP%]{max-height:calc(100% - 61px)!important;min-height:calc(100% - 61px)!important}@media(max-width:991px){.sidebar-wrapper[_ngcontent-%COMP%]{overflow-y:scroll!important}}@media(pointer:coarse){.sidebar-wrapper[_ngcontent-%COMP%]{overflow-y:scroll!important}}@media(max-width:468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width:992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}}.full-container[_ngcontent-%COMP%]{padding-top:0!important}.changelog[_ngcontent-%COMP%]{color:#0006b1!important}.changelog[_ngcontent-%COMP%]:visited{color:#2e2e2e!important}.changelog[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{position:relative}.changelog[_ngcontent-%COMP%] span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fe3a00!important;position:absolute;top:-4px;right:-18px}.changelog[_ngcontent-%COMP%]:visited span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fff!important;position:absolute;top:-4px;right:-18px}.changelog[_ngcontent-%COMP%]:visited:hover span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#e9ecef!important;position:absolute;top:-4px;right:-18px}.subscription-bar-visible[_ngcontent-%COMP%]{padding-top:98px}.checkbox_toggle[_ngcontent-%COMP%]{position:relative}.checkbox_toggle[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#868686;display:inline-block;padding-right:38px}.checkbox_toggle[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{width:23px;height:14px;background-color:#ccc;top:2.2px;right:0}.checkbox_toggle[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{display:none}.checkbox_toggle[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background-color:#1f77d0}.checkbox_toggle[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]:after{left:10px}.checkbox_toggle[_ngcontent-%COMP%] label[_ngcontent-%COMP%]:after{content:"";width:12px;height:12px;border-radius:50%;position:absolute;top:.8px;left:1px;transition:all .1s;background-color:#fff}']})};function Ve(e){let n=c(b),t="/menu";e.forEach(o=>t+=`/${o.path}`);let i=n.currentNavigation().extractedUrl.queryParams;return Object.keys(i).forEach((o,l)=>{l==0?t=`${t}?${o}=${i[o]}`:t=`${t}&${o}=${i[o]}`}),t}var $e=e=>{let n=(e??"").toLowerCase();return n==="sell"||n.startsWith("sell")},T=(e,n)=>{let t=c(h),i=t.isTokenExpired(),s=c(b),o=c(S);if(i)return t.returnUrl=Ve(n),s.navigate(["/"]),!1;{let l=e.path;if(l=="Dashboard")return Be();if($e(l)&&!o.sell?.Create)return t.hasOfflineSession()&&(t.endOfflineSession(),o.resetRoles()),s.navigate(["/menu/Unauthorized/Main/Unauthorized"]),!1}return!0};function Be(){let e=c(b),n=c(h),t=!1,i=n.getRedirectUrl();return t=i.includes("Dashboard"),t==!1&&e.navigate([i]),t}var U=class e{paymentStorageService=c(Oe);canActivate(n,t){return this.paymentStorageService.clear(),!0}static \u0275fac=function(t){return new(t||e)};static \u0275prov=m({token:e,factory:e.\u0275fac,providedIn:"root"})};var L=class e{reportService=c(Te);canActivate(n,t){return this.reportService.resetFilter(),!0}static \u0275fac=function(t){return new(t||e)};static \u0275prov=m({token:e,factory:e.\u0275fac,providedIn:"root"})};var ze=[{path:"",component:O,children:[{path:"Inventory",loadChildren:()=>import("./chunk-CDXLJGOC.js").then(e=>e.InventoryModule),canLoad:[r]},{path:"Reports",loadChildren:()=>import("./chunk-XRJZS2M5.js").then(e=>e.ReportsModule),canLoad:[r],canActivate:[L]},{path:"Sell",loadChildren:()=>import("./chunk-DNMSPTAB.js").then(e=>e.routes),canLoad:[r]},{path:"Print",loadChildren:()=>import("./chunk-OS4JEDHC.js").then(e=>e.PrintModule),canLoad:[r]},{path:"Buy",loadComponent:()=>import("./chunk-KIXF7LBE.js").then(e=>e.BuyV2Component),canMatch:[T]},{path:"Sell/V2",loadComponent:()=>import("./chunk-ELDCSNML.js").then(e=>e.SellV2Component),canMatch:[T]},{path:"Dashboard",loadComponent:()=>import("./chunk-DHW3P6PM.js").then(e=>e.DashboardV2Component),canMatch:[T],data:{preload:!0}},{path:"Products",loadChildren:()=>import("./chunk-AHPAB33J.js").then(e=>e.ProductModule),canLoad:[r]},{path:"Shift",loadChildren:()=>import("./chunk-FQS3KLPN.js").then(e=>e.ShiftModule),canLoad:[r]},{path:"Debt",loadChildren:()=>import("./chunk-L2JNNJWN.js").then(e=>e.DebtModule),canLoad:[r]},{path:"Logistics",loadChildren:()=>import("./chunk-LVRTG3B7.js").then(e=>e.DeliveryModule),canLoad:[r]},{path:"Users",loadChildren:()=>import("./chunk-VQTJH2CF.js").then(e=>e.UsersModule),canLoad:[r]},{path:"Setup",loadChildren:()=>import("./chunk-TN5RPHT6.js").then(e=>e.SetupModule),canLoad:[r]},{path:"Settings",loadChildren:()=>import("./chunk-IOZWCEUL.js").then(e=>e.routes),canLoad:[r]},{path:"Developer",loadChildren:()=>import("./chunk-CXDLYBGP.js").then(e=>e.DeveloperModule),canLoad:[r]},{path:"Contacts",loadChildren:()=>import("./chunk-B4G56FJH.js").then(e=>e.ContactsModule),canLoad:[r]},{path:"Outlets",loadChildren:()=>import("./chunk-SHUTRO6Q.js").then(e=>e.OutletsModule),canLoad:[r]},{path:"Orders",loadChildren:()=>import("./chunk-57LMHHGB.js").then(e=>e.OrdersModule),canLoad:[r]},{path:"Profile",loadChildren:()=>import("./chunk-2NAZFAYN.js").then(e=>e.ProfileModule),canLoad:[r]},{path:"Estimate",loadComponent:()=>import("./chunk-KPVM5PAP.js").then(e=>e.EstimateV2Component),canMatch:[T]},{path:"Adjustment",loadChildren:()=>import("./chunk-EK3BQKYX.js").then(e=>e.AdjustmentModule),canLoad:[r]},{path:"Payment",loadChildren:()=>import("./chunk-RTPEP5LZ.js").then(e=>e.PaymentModule),canLoad:[r],canActivate:[U]},{path:"Promotion",loadChildren:()=>import("./chunk-SPWW6SM2.js").then(e=>e.PromotionModule),canLoad:[r]},{path:"Manufacture",loadChildren:()=>import("./chunk-XPR6UL3K.js").then(e=>e.ManufactureModule),canLoad:[r]},{path:"Prepaid_Package",loadChildren:()=>import("./chunk-JOP777HW.js").then(e=>e.PrepaidPackageModule),canLoad:[r]},{path:"Fulfillment",loadChildren:()=>import("./chunk-MOJGPFVF.js").then(e=>e.FulfillmentModule),canLoad:[r]},{path:"Unauthorized",loadChildren:()=>import("./chunk-DEFD5I5E.js").then(e=>e.UnauthorizedModule),canLoad:[r]},{path:"Not_Found",loadChildren:()=>import("./chunk-42YQ2PFO.js").then(e=>e.NotFoundModule),canLoad:[r]},{path:"",redirectTo:"/menu/Dashboard",pathMatch:"full"},{path:"**",redirectTo:"Not_Found"}]}],N=class e{static \u0275fac=function(t){return new(t||e)};static \u0275mod=I({type:e});static \u0275inj=x({imports:[G.forChild(ze),G]})};var we=class e{constructor(){}static \u0275fac=function(t){return new(t||e)};static \u0275mod=I({type:e,bootstrap:[O]});static \u0275inj=x({imports:[ye,N,be,se]})};export{we as MenuMasterModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"./chunk-PPTZHIIZ.js";import{a as i}from"./chunk-
|
|
1
|
+
import{a as o}from"./chunk-PPTZHIIZ.js";import{a as i}from"./chunk-TWIM3F7F.js";import{Ed as h,Id as d,aa as u,ka as m,oa as g,s}from"./chunk-7D344CRC.js";var c=class n{http=g(d);uploadFile(t,e){o.IsEmpty(e)&&(e="testfolder");let r=new h({"Cache-Control":"no-cache"});return this.http.put(`${i.uppy.storageHost}/api/upload/binary/${e}/${t.name}`,t,{headers:r})}uploadFileThroughPreSignedUrl(t,e,r=!0,a){o.IsEmpty(e)&&(e="testfolder");let l=new File([t],t.name.replace(/ /g,"_"),{type:t.type});return a=a||(r?"small":void 0),this.generatePreSignedURL(l,e,a).pipe(u(p=>this.http.put(p.Authorization,l).pipe(s(()=>({url:p.URL,thumbnail:p.Thumbnail})))))}uploadFileToServer(t,e){return this.uploadFile(t,e).pipe(s(r=>r.URL))}uploadWithSignedUrl(t,e){return this.http.put(t,e)}generatePreSignedURL(t,e,r){return this.http.get(`${i.uppy.storageHost}/api/GeneratePresigned/${e}/${t.name}${r?`?thumbnail=${r}`:""}`)}deleteImageInBucket(t,e){return this.http.delete(`${i.uppy.storageHost}/api/Upload/Delete/${e}/${t}`)}uploadRemoteURLToCloudflare(t){return this.http.post(`${i.uppy.storageHost}/api/upload/MultiURL`,t)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=m({token:n,factory:n.\u0275fac,providedIn:"root"})};export{c as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ii}from"./chunk-UV5WBOB6.js";import{a as ft}from"./chunk-GGDW5WFA.js";import{a as Jo}from"./chunk-L6DNET2E.js";import{a as ko,b as tr}from"./chunk-RCI6QZX7.js";import{d as Ko}from"./chunk-24DKEEAF.js";import{b as xi,c as Ao,d as Vo,f as jo,h as $o,i as Go,j as zo}from"./chunk-
|
|
1
|
+
import{a as ii}from"./chunk-UV5WBOB6.js";import{a as ft}from"./chunk-GGDW5WFA.js";import{a as Jo}from"./chunk-L6DNET2E.js";import{a as ko,b as tr}from"./chunk-RCI6QZX7.js";import{d as Ko}from"./chunk-24DKEEAF.js";import{b as xi,c as Ao,d as Vo,f as jo,h as $o,i as Go,j as zo}from"./chunk-XS6A3YLT.js";import{a as Nt,b as Ie}from"./chunk-LDJX34VR.js";import{a as Xo}from"./chunk-PFTNYBDL.js";import{e as Bo}from"./chunk-XNTQF53Y.js";import{d as Ho,f as Uo}from"./chunk-3X4S7S7G.js";import{a as hr}from"./chunk-QITV5CIL.js";import{a as Oi,b as Wo,c as qo}from"./chunk-X55I2643.js";import{a as No,b as Yo}from"./chunk-CLLDQFXD.js";import{a as Fo}from"./chunk-H7JNNBL2.js";import{a as go}from"./chunk-AO63R3DI.js";import{b as Lo}from"./chunk-ZPIILEA6.js";import{a as Qo}from"./chunk-2LD4VKHV.js";import{a as er}from"./chunk-OTOJ3MGJ.js";import{a as bt}from"./chunk-AN77J6Q5.js";import{a as Io,c as ut,d as Mi,f as Pe,g as Pn,i as wo,j as L,k as J,l as de}from"./chunk-XHT7BRAY.js";import{c as Ee}from"./chunk-B53CZMGZ.js";import{b as ti,c as ce}from"./chunk-I3WUTJXX.js";import{a as kt,b as Ae}from"./chunk-PJHXZWSV.js";import{a as Eo}from"./chunk-3JPAA6YB.js";import{g as Ro}from"./chunk-53CYOKMD.js";import{a as Zo}from"./chunk-QJ6NG2KJ.js";import{a as yo}from"./chunk-52U2QQ43.js";import{a as To}from"./chunk-OY6GIZXH.js";import{l as Co,p as xo}from"./chunk-SCH7M36Q.js";import{c as ho}from"./chunk-3EAA4CUP.js";import{c as Mo,d as Oo}from"./chunk-PZSSTNYS.js";import{a as Et}from"./chunk-G56UPMKR.js";import{h as _o}from"./chunk-LN7LGRLI.js";import{d as Po,f as Do}from"./chunk-WJOBIYMD.js";import{a as Tt,b as vt}from"./chunk-JXEPD3CF.js";import{F as Di,M as bo,O as So,n as Pi,t as vo}from"./chunk-UI32X6QC.js";import{a as mt}from"./chunk-PWMMCY25.js";import{a as Zn,c as eo}from"./chunk-OKQYRKDJ.js";import{d as Rt}from"./chunk-BUIP3UCE.js";import{a as to,b as oe,c as io,f as _e,g as Z}from"./chunk-N5VS2V7L.js";import{a as z,b as le,c as be}from"./chunk-3V6FZIJD.js";import{K as yi,O as vi,P as bi,R as Si,o as fo}from"./chunk-UTSVZMZD.js";import{a as $,b as Be,c as ei}from"./chunk-BP6PECKT.js";import{a as te}from"./chunk-GNDUQZGK.js";import{a as ie,b as G,c as ee}from"./chunk-BKOMMH62.js";import{A as co,B as mo,E as po,F as wt,G as uo,c as ye,e as _i,h as ve,i as no,l as oo,m as it,o as ro,p as xe,q as ao,t as pt,y as so,z as lo}from"./chunk-AJDQZ346.js";import{b as Ci}from"./chunk-KLHHVIRS.js";import{a as h}from"./chunk-PPTZHIIZ.js";import{n as F,q as Oe}from"./chunk-QGYXJUX3.js";import{$ as ci,$a as O,Ab as qe,B as Ln,Ba as M,Bb as X,Cb as Y,Da as jn,Db as g,E as Ce,Eb as a,Fb as s,Fc as D,Gb as S,Gc as w,Hb as Fe,Hc as se,I as Ue,Ib as Le,Ic as gi,Id as Jn,Jb as st,Kb as Jt,L as xt,Lb as Kt,Lc as $n,M as Ne,Mb as mi,Md as Kn,Oc as B,P as It,Pa as zt,Pb as x,Qb as pi,R as li,Rd as Xn,S as vn,Sb as _,Sc as ze,Sd as hi,Tb as ui,Tc as tt,Ua as c,Ub as m,Ud as Yn,Y as We,Yb as lt,Yc as Sn,Zb as Ye,_b as Ze,aa as ne,b as An,ca as ge,cc as ae,da as Bn,db as N,dc as fi,e as ue,ea as re,eb as Un,ec as et,f as Ve,ga as Qn,gb as di,gc as Ge,hc as d,ic as R,j as Mt,jb as De,jc as T,k as He,ka as k,kc as Xt,kd as Je,l as fe,la as Hn,m as Ot,mc as j,md as qn,na as C,nc as U,o as si,oa as b,oc as W,od as Gn,pc as Yt,pd as zn,q as Vn,qc as Zt,qd as Ke,r as Gt,ra as y,rc as ct,s as q,sa as v,sb as bn,sd as Xe,t as je,u as Fn,ud as K,wb as p,xb as Wn,xc as dt,xd as pe,yb as u,yc as V,zb as $e,zc as Me}from"./chunk-7D344CRC.js";import{a as Dt,b as Nn,g as gr,j as at}from"./chunk-NF7PG5F2.js";var ni=class{ID;Code;EntityID;Name;Description;Start;StartDisplay;State;Open;CashierID;OpeningCash;EntityName;LoginID;Active;CustomerDisplayEnabled;OvoConfigurationID;CustomerDisplayID;ListImage;Suspended};var Ii=class o{odsConfigType=M(0);setODSConfig(e){this.odsConfigType.set(e)}isEnabled(){return this.odsConfigType()>0}static \u0275fac=function(t){return new(t||o)};static \u0275prov=k({token:o,factory:o.\u0275fac,providedIn:"root"})};var yr=["searchInputRef"],vr=o=>({active:o}),br=o=>({gray:o});function Sr(o,e){if(o&1){let t=x();a(0,"span",16),_("click",function(n){y(t);let r=m().$implicit;return m(2).closeRegister(r),v(n.stopPropagation())}),s()}}function Pr(o,e){o&1&&(a(0,"div")(1,"span",17),d(2,"VACANT"),s()())}function Dr(o,e){if(o&1&&(a(0,"div")(1,"span",18),S(2,"i",19),a(3,"span",20),d(4),s()(),a(5,"span",21),S(6,"i",22),a(7,"span",20),d(8),s()()()),o&2){let t=m().$implicit;c(4),R(t.LoginID),c(4),T("",t.StartDisplay.split(" ")[3]," - Now")}}function Mr(o,e){if(o&1){let t=x();a(0,"div",9)(1,"div",10)(2,"div",11)(3,"h5",12),_("click",function(){let n=y(t).$implicit,r=m(2);return v(r.select(n))}),a(4,"span"),S(5,"i",13),d(6),D(7,"limitTo"),s(),p(8,Sr,1,0,"span",14),s(),a(9,"div",15),_("click",function(){let n=y(t).$implicit,r=m(2);return v(r.select(n))}),p(10,Pr,3,0,"div")(11,Dr,9,2,"div"),s()()()()}if(o&2){let t,i=e.$implicit,n=m(2);c(),g("ngClass",i.Active?"active":""),c(),g("ngClass",V(9,vr,(i==null?null:i.ID)==(n.selectedRegister==null?null:n.selectedRegister.ID))),c(),g("ngClass",V(11,br,i!=n.selectedRegister)),c(3),R(se(7,6,i.Name,15)),c(2),u(i.State!="Close"?8:-1),c(2),u((t=i.State)==="Close"?10:t==="Open"?11:-1)}}function Or(o,e){if(o&1&&(a(0,"div",8),X(1,Mr,12,13,"div",9,qe),D(3,"FilterByName"),s()),o&2){let t=m();c(),Y(se(3,0,t.registers,t.searchInput))}}function xr(o,e){o&1&&(a(0,"div"),S(1,"POS-no-outlet-access-warning"),s())}var wi=class o{constructor(e,t,i,n,r,l,f){this._dialogRef=e;this._outletService=t;this._posService=i;this._userRoleService=n;this.router=r;this.httpService=l;this._odsService=f}_dialogRef;_outletService;_posService;_userRoleService;router;httpService;_odsService;searchInputRef;originalSelectedRegister=null;registers;searchInput="";selectedRegister=new ni;modalConfig=M(new G);role;get AppConfigJSON(){return this._posService.Data.AppConfigJSON}destroy$=new ue;onlineStatusService=b(Z);localDataService=b(_e);outletRegisterActiveService=b(H);ngOnInit(){this.initModalConfig(),this.subscribeToObsChanges()}ngAfterViewInit(){this.searchInputRef&&this._dialogRef.afterOpened().subscribe(()=>{setTimeout(()=>{this.searchInputRef.nativeElement.focus()},200)})}subscribeToObsChanges(){this.outletRegisterActiveService.Data$.pipe(To("active")).subscribe(),this._posService.Data$.pipe(ge(this.destroy$)).subscribe(e=>{this.registers=e.Registers,(!this.registers||this.registers.length===0)&&this.initModalConfig(!1)}),this._outletService.Data$.pipe(ge(this.destroy$)).subscribe(e=>{this.selectedRegister=this.findOutletRegisterById(e.RegisterID),this.originalSelectedRegister=this.selectedRegister?Dt({},this.selectedRegister):null,this.initModalConfig(!1)}),this._userRoleService.Data$.pipe(ge(this.destroy$)).subscribe(e=>{this.role=e})}findOutletRegisterById(e){let t=this.registers.find(i=>i.ID===e);return t||new ni}initModalConfig(e=!0){this.modalConfig.update(t=>(t.hideFooter=!0,t.hideScrollbar=!0,t.hideClose=e,t.title="Choose an outlet",t))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}onClose(){this._dialogRef.close()}select(e){if(this.AppConfigJSON.ModuleShift.Closure.Enabled)if(this.selectedRegister.ID!=null&&this.selectedRegister.Open&&e.CashierID==null)confirm("You already have an active register with "+this.selectedRegister.Name+`!
|
|
2
2
|
Do you want to end your session?`)&&(this.onClose(),this.router.navigate(["menu/Shift/Main/My_Shift"],{queryParams:{RegisterID:e.ID}}));else if(!e.Open||this.selectedRegister.ID==e.ID)this.selectedRegister=e,this.onSubmitSelectedRegister();else{if(this.role.SellEditor==!1){alert("You cannot end shift for Register "+e.Name+" - Unauthorized Access");return}alert("This Register has already active register, Are you sure you want to end this register?"),this.onClose(),this.router.navigate(["/menu/Shift/Main/My_Shift"],{queryParams:{RegisterID:e.ID}})}else this.selectedRegister=e,this.onSubmitSelectedRegister()}onSubmitSelectedRegister(){if(this.selectedRegister.ID==null){alert("Please select a register first!");return}this._outletService.pushNewRegister(this.selectedRegister),this.loadOdsConfig(this.selectedRegister.EntityID),this._dialogRef.close({selectedRegister:this.selectedRegister,openStartingCashDialog:this.selectedRegister.ID!=this.originalSelectedRegister?.ID})}closeRegister(e){let t=this.selectedRegister.ID;if(this.role.SellEditor==!1){alert("You cannot end shift for Register "+e.Name+" - Unauthorized Access");return}t==e.ID?this.router.navigate(["/menu/Shift/Main/My_Shift"]):this.router.navigate(["/menu/Shift/Main/My_Shift"],{queryParams:{RegisterID:e.ID}}),this.onClose()}loadOdsConfig(e){this.httpService.get(`/api/outlet/GetOrderDisplayBroadcastMode?EntityID=${e}`).pipe(re(t=>{this._odsService.setODSConfig(t.form.OrderDisplayBroadcastMode)})).subscribe()}static \u0275fac=function(t){return new(t||o)(O(z),O(H),O(J),O(Ie),O(Xn),O(Oe),O(Ii))};static \u0275cmp=N({type:o,selectors:[["pos-modal-register"]],viewQuery:function(t,i){if(t&1&<(yr,5),t&2){let n;Ye(n=Ze())&&(i.searchInputRef=n.first)}},standalone:!1,decls:11,vars:6,consts:[["searchInputRef",""],[3,"onClose","config"],[1,"ms-0","mb-8","search-container",3,"hidden"],[1,"input-group","mb-3","rounded-start-1"],[1,"input-group-text","txtFilter","rounded-end-0"],["aria-hidden","true",1,"fa","fa-magnifying-glass"],["data-cy","SearchOutlet","type","text","placeholder","Filter by Name","aria-label","Search",1,"txtFilter","form-control","border-start-0","rounded-1","rounded-start-0",3,"ngModelChange","ngModel"],[1,"container","custom-scroll"],[1,"row","w-100"],["data-cy","registers",1,"col-4"],[1,"card","border-0","mb-0",3,"ngClass"],[1,"card-body","p-0",3,"ngClass"],[1,"card-title","mb-0",3,"click","ngClass"],[1,"fa-solid","fa-house","pe-1","fs-6"],[1,"fa","fa-xmark-circle","fa-lg","position-absolute",2,"text-shadow","0 1px 0 #afafaf","right","5px","top","16px"],[1,"card-text","px-0","py-2",3,"click"],[1,"fa","fa-xmark-circle","fa-lg","position-absolute",2,"text-shadow","0 1px 0 #afafaf","right","5px","top","16px",3,"click"],[1,"idle"],[1,"cashier"],["aria-hidden","true",1,"fa","fa-user","pe-2"],[1,"d-inline"],[1,"open"],["aria-hidden","true",1,"fa-regular","fa-clock","pe-2"]],template:function(t,i){if(t&1){let n=x();a(0,"modal-material",1),_("onClose",function(){return i.onClose()}),a(1,"content")(2,"div",2)(3,"div",3)(4,"span",4),S(5,"i",5),s(),a(6,"input",6,0),W("ngModelChange",function(l){return y(n),U(i.searchInput,l)||(i.searchInput=l),v(l)}),s()()(),a(8,"div",7),p(9,Or,4,3,"div",8)(10,xr,2,0,"div"),s()()()}t&2&&(g("config",i.modalConfig()),c(2),g("hidden",i.registers.length<=6),c(4),j("ngModel",i.searchInput),c(2),fi("padding-right",!i.registers||i.registers.length===0?0:8,"px"),c(),u(i.registers&&i.registers.length>0?9:10))},dependencies:[Je,ye,ve,xe,ee,ko,Pi,vo],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.search-container[_ngcontent-%COMP%]{transition:all .3s ease;width:97%}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]{position:relative;transition:all .3s ease;height:2.3rem}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover, .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within{box-shadow:0 0 0 2px #89b03e4d,0 0 8px 4px #89b03e33;border-radius:4px}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .txtFilter.form-control[_ngcontent-%COMP%]{transition:all .3s ease;border-left:none!important}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .txtFilter.form-control[_ngcontent-%COMP%]:focus{box-shadow:none!important;border-color:#ced4da!important}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .input-group-text[_ngcontent-%COMP%]{transition:all .3s ease;background-color:#fff;border-right:none!important}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover .input-group-text[_ngcontent-%COMP%], .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within .input-group-text[_ngcontent-%COMP%]{background-color:#89b03e1a;border-color:#84cc16!important}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .fa-magnifying-glass[_ngcontent-%COMP%]{transition:all .3s ease}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover .fa-magnifying-glass[_ngcontent-%COMP%], .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within .fa-magnifying-glass[_ngcontent-%COMP%]{color:#84cc16!important}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within{box-shadow:0 0 0 2px #89b03e66,0 0 12px 6px #89b03e40!important}.custom-scroll[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px}.custom-scroll[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#f1f1f1;border-radius:3px}.custom-scroll[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#89b03e;border-radius:3px}.custom-scroll[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#7a9e37}.container[_ngcontent-%COMP%]{overflow-y:auto;overflow-x:hidden;max-height:260px;min-height:150px;padding-left:0}.row[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:17px;margin-left:0;margin-right:0}.search-container[_ngcontent-%COMP%]{width:100%}.col-4[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;width:auto;max-width:none}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%]{width:100%;min-width:0;min-height:95px;position:relative}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%]{display:block;outline:0;border:1px solid #b1aaaa;border-radius:5px;cursor:pointer}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{height:30px;border-radius:4px;padding:5px 10px;color:#fff;background:#b1aaaa;overflow:hidden}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] h5[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:5px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%]:hover, .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.active[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.vacant[_ngcontent-%COMP%]{background:#ffffe1;border:1px solid #89b03e}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%]:hover > h5[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.active[_ngcontent-%COMP%] > h5[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.vacant[_ngcontent-%COMP%] > h5[_ngcontent-%COMP%]{background:#89b03e}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%]:hover{border:1px solid #c9302c}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%] > h6[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%]:hover > h6[_ngcontent-%COMP%]{background:#c9302c!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%] span.alias[_ngcontent-%COMP%]{background:#c9302c}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%]:hover{background:#fff}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%]{border:1px solid #f6a828}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%] > h6[_ngcontent-%COMP%]{background:#f6a828!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%]:hover{border:1px solid #f6a828;background:#fff}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%]:hover > strong[_ngcontent-%COMP%]{background:#f6a828!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%] span.alias[_ngcontent-%COMP%]{background:#f6a828}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%] div[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.75rem!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{height:80px;padding:15px 10px;position:relative}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;font-weight:400;font-size:.875rem;width:100%;margin-bottom:5px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-child{margin-top:-10px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:last-child{margin-bottom:0}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span.alias[_ngcontent-%COMP%]{text-align:center;position:absolute;bottom:0;right:0;width:auto;background-color:#b1aaaa;border-radius:3px;padding:2px 5px;color:#fff;display:none!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span.idle[_ngcontent-%COMP%]{display:block;font-size:1.25rem;text-align:center}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{position:absolute;width:27px;height:28px;cursor:pointer;top:5px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#000}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:last-of-type{right:-5px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:nth-last-of-type(2){right:15px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{bottom:20px;right:5px;position:absolute}.col-4[_ngcontent-%COMP%] .duration[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{border:1px solid!important;position:absolute;bottom:-3px;left:58px;background:#fff;border-radius:5px}@media(max-width:992px)and (min-width:600px){[_nghost-%COMP%] .modal-material.modal-material{width:min(640px,80vw)!important}}@media(min-width:993px){[_nghost-%COMP%] .modal-material.modal-material{width:660px!important}}@media(max-width:599px){[_nghost-%COMP%] .modal-material.modal-material{width:80vw!important}}"]})};var Ir=["inputCash"],Ri=class o{constructor(e,t,i){this.dialogRef=e;this.data=t;this.focusMonitor=i;this.generateModalTitle$.subscribe()}dialogRef;data;focusMonitor;registerService=b(H);loadPOSService=b(J);register=this.registerService.Data;username=this.loadPOSService?.Data?.UserName;amount=M(0);config=new G;currentRegisterName;generateModalTitle$=this.registerService.Data$.pipe(Ce(e=>h.IsNotEmpty(e)),re(()=>{let e=this.registerService.getOutletRegister(),t=e?.Name?.length>18?`${e?.Name?.substring(0,18)}...`:e?.Name;this.config.title="Open Shift",this.currentRegisterName=t}),$());today=new Date;inputCashEl;ngOnInit(){this.config.customWidth="350px",this.config.hideCancel=!0}ngAfterViewInit(){this.focusInput(),this.dialogRef.afterOpened().subscribe(()=>{this.focusInput()})}focusInput(){let e=this.inputCashEl?.nativeElement;e&&(this.focusMonitor.focusVia(e,"program"),e.addEventListener("blur",()=>{this.dialogRef.getState()===0&&this.focusMonitor.focusVia(e,"program")}))}onOk(){this.dialogRef.close({amount:this.amount()})}static \u0275fac=function(t){return new(t||o)(O(z),O(le),O(fo))};static \u0275cmp=N({type:o,selectors:[["POS-modal-opening-cash"]],viewQuery:function(t,i){if(t&1&<(Ir,5),t&2){let n;Ye(n=Ze())&&(i.inputCashEl=n.first)}},standalone:!1,decls:25,vars:8,consts:[["inputCash",""],[3,"onOk","onCancel","onClose","config"],[1,"table","fs-5","text"],[1,"py-3"],[1,"text-end","pe-3"],[1,"py-4"],[1,"text-end"],["data-cy","InputCash","autoNum","",1,"border","form-control-lg","text-end","w-100",3,"ngModelChange","ngModel"]],template:function(t,i){if(t&1){let n=x();a(0,"modal-material",1),_("onOk",function(){return i.onOk()})("onCancel",function(){return i.dialogRef.close()})("onClose",function(){return i.dialogRef.close()}),a(1,"content")(2,"table",2)(3,"tr")(4,"td",3),d(5,"Outlet Register"),s(),a(6,"td",4),d(7),s()(),a(8,"tr")(9,"td",5),d(10,"Current User"),s(),a(11,"td",4),d(12),s()(),a(13,"tr")(14,"td",5),d(15,"Starting Time"),s(),a(16,"td",4),d(17),D(18,"date"),s()(),a(19,"tr")(20,"td",3),d(21,"Starting Cash"),s(),a(22,"td",6)(23,"input",7,0),W("ngModelChange",function(l){return y(n),U(i.amount,l)||(i.amount=l),v(l)}),s()()()()()()}t&2&&(g("config",i.config),c(7),R(i.currentRegisterName),c(5),R(i.username),c(5),R(se(18,5,i.today,"EEEE, HH:mm")),c(6),j("ngModel",i.amount))},dependencies:[ye,ve,xe,ee,Et,Xe],styles:[".table-title-width[_ngcontent-%COMP%]{width:120px}"]})};var Ei=class{OrderNumberElement;InvoiceNumberElement;NewOrderID};var At=class o{constructor(e,t,i){this._httpService=e;this._onlineStatusService=t;this._localDataService=i;this._onlineStatusService.getOnlineStatus$().subscribe(n=>{this.isOnline=n})}_httpService;_onlineStatusService;_localDataService;isOnline;GenerateNumber(e,t){if(this.isOnline)return this._httpService.get(te.GenerateNumber,[{key:"EntityID",value:e},{key:"TypeID",value:1}]);{let i=new Ei;return h.IsNotEmpty(t.NumberElement)&&(t.NumberElement.Seed+=1),h.IsNotEmpty(t.InvoiceNumberElement)&&(t.InvoiceNumberElement.Seed+=1),i.InvoiceNumberElement=t.InvoiceNumberElement,i.OrderNumberElement=t.NumberElement,i.NewOrderID=io(),fe(i)}}findRegisterById(e){return new Promise(t=>{this._onlineStatusService.isConfigFromServer().subscribe(i=>{i?this._httpService.get(te.GetRegisterInfo,[{key:"RegisterID",value:e}]).subscribe(n=>{t(n)}):this._localDataService.getRegister().then(n=>{t(n)})})})}recordOpeningCash(e){return si(this._httpService.post("/API/POS/RecordOpeningCash",e))}static \u0275fac=function(t){return new(t||o)(C(Oe),C(Z),C(_e))};static \u0275prov=k({token:o,factory:o.\u0275fac,providedIn:"root"})};var H=class o{constructor(e,t,i,n,r,l,f,P){this._signalRClientService=e;this._matDialog=t;this._posHttpResponseService=i;this._CoreHttpService=n;this._toastrService=r;this._roleService=l;this.localDataService=f;this.onlineStatusService=P}_signalRClientService;_matDialog;_posHttpResponseService;_CoreHttpService;_toastrService;_roleService;localDataService;onlineStatusService;datePipe=b(Xe);_Data=new Ve(null);Data$=this._Data.asObservable().pipe(Ce(e=>e!==null),It());get Data(){return this._Data.value}getSalesname(e){return this.Data&&this.Data.ListSales?this._Data.value?.ListSales?.find(t=>t.ID==e)?.Name:""}setActiveRegisterFromOptions(e,t){let n=this._posHttpResponseService.Data.AppConfigJSON.ModuleShift.Closure.Enabled;if(this.onlineStatusService.isOnline){if(e.length>1){let l=e.find(f=>f.LoginID==t);if(l)this.pushNewRegister(l);else{let f=this.getOutletRegisterFromLocalStorage(),P=this.Data?.RegisterID?this.Data.RegisterID:f?.ID;e.some(Q=>Q.ID==P)?n?this.openChooseRegisterModal():this.initRegisterFromLocalStorage():this.openChooseRegisterModal()}}e.length==1&&(this.pushNewRegister(e[0]),h.IsEmpty(e[0].LoginID)&&h.IsEmpty(e[0].CashierID)&&this.openOpeningCashModal(e[0].ID)),e.length==0&&this._toastrService.warning("You do not have access to any OUTLET","Warning")}else this.handleOfflineOrder()}handleOfflineOrder(){this.localDataService.getRegister().then(e=>{e&&this.pushNewValue(e)})}openChooseRegisterModal(){this._matDialog.open(wi,{id:"registerModal",disableClose:!0}).afterClosed().pipe(Ce(e=>h.IsNotEmpty(e?.selectedRegister))).subscribe(e=>{e.selectedRegister&&this.openOpeningCashModal(e.selectedRegister.ID)})}openOpeningCashModal(e){this._posHttpResponseService.Data.AppConfigJSON.ModuleShift.Closure.Enabled&&this._matDialog.open(Ri,{disableClose:!0,id:"openingCashModal"}).afterClosed().pipe(Ce(n=>h.IsNotEmpty(n))).subscribe(n=>{let r={RegisterID:e,OpAmount:n.amount};this._CoreHttpService.recordOpeningCash(r).then(()=>{this.updateRegisterList(r),this.initCursorFocus(e)})})}updateRegisterList(e){let i=this._posHttpResponseService.Data.Registers.map(r=>r.ID==e.RegisterID?this.mapRegisterAsActiveRegister(r,e):r),n=this._posHttpResponseService.Data;n.Registers=i,this._posHttpResponseService.pushNewValue(n)}mapRegisterAsActiveRegister(e,t){let i=localStorage.getItem("AccountInfo");if(i){let r=JSON.parse(i);e.LoginID=r.UserName}e.OpeningCash=t.OpAmount,e.Open=!0,e.State="Open";let n=this.datePipe.transform(new Date,"dd MM yyyy HH:mm");return e.StartDisplay=n,e}initRegisterFromLocalStorage(){if(this._roleService.Data.DeleteItem==!1){let t=this.getOutletRegisterFromLocalStorage();t&&this.pushNewRegister(t)}}pushNewRegister(e){let t=this._Data.value,i=t?t.RegisterID:null;i!=e.ID&&this._CoreHttpService.findRegisterById(e.ID).then(n=>{n.RegisterCode=e.Code,n.DefaultPrintTemplate=n.PrintTemplate,n.SplitPaymentEnabled=this.findSplitPaymentConfig(n.EntityID),this._signalRClientService.SubscribeGroup(n.RegisterID,i),this.saveOutletRegisterToLocalStorage(e),this.syncSelectedRegisterToIndexedDB(n),this.pushNewValue(n)})}getOutletRegister(){let e=this.Data.RegisterID;return this._posHttpResponseService.Data.Registers.find(n=>n.ID==e)}pushNewValue(e){this._Data.next(e)}saveOutletRegisterToLocalStorage(e){if(this._roleService.Data.DeleteItem==!1){let i=JSON.stringify(e);localStorage.setItem("outlet_register",i)}}syncSelectedRegisterToIndexedDB(e){this.localDataService.syncRegister(e).then(()=>{},()=>{})}getOutletRegisterFromLocalStorage(){let e=this._roleService.Data.DeleteItem,t=localStorage.getItem("outlet_register"),i=null;return t&&(e?localStorage.removeItem("outlet_register"):i=JSON.parse(t)),i}findOutletRegisterById(e){return this._posHttpResponseService.Data.Registers.find(n=>n.ID===e)}findSplitPaymentConfig(e){let i=this._posHttpResponseService.Data.Entities.find(n=>n.ID===e);return i?i.SplitPaymentEnabled:!1}initCursorFocus(e){let t=document.getElementById("product");t&&h.IsNotEmpty(e)&&t.focus()}static \u0275fac=function(t){return new(t||o)(C(mt),C(be),C(J),C(At),C(F),C(Ie),C(_e),C(Z))};static \u0275prov=k({token:o,factory:o.\u0275fac,providedIn:"root"})};var Vt=class{CommissionID;ReturNumber;parkTemporaryItem;posState;InputTextValue;constructor(){this.posState=0,this.CommissionID="",this.ReturNumber="",this.parkTemporaryItem=[],this.InputTextValue=""}};var ki=class{RegisterID;RegisterCode;EntityID;EntityName;NumberElement;InvoiceNumberElement;ListSales;QuickKeyPack;PrintTemplate;DefaultSalesOrderTag;DefaultTaxType;DefaultWarehouse;MemberPoint;ParkLayoutPack;Promotion;DefaultPrintTemplate;NewOrderID;Payments;SplitPaymentEnabled;constructor(){this.RegisterID=null,this.RegisterCode=null,this.EntityID=null,this.EntityName=null,this.NumberElement=new bt,this.InvoiceNumberElement=new bt,this.Promotion=[],this.SplitPaymentEnabled=!0}};var Lt=(l=>(l.Amount="Amount",l.Percentage="Percentage",l.Return="Return",l.ParkedDeletion="ParkedDeletion",l.DeleteItem="DeleteItem",l.FullAccess="FullAccess",l))(Lt||{});var Ni=class o{constructor(e,t,i){this._promotionEventService=e;this._dialogRef=t;this.data=i;this.modalConfig=new G,this.modalConfig.hideCancel=!0,this.modalConfig.hideClose=!0,this.modalConfig.headerType=ie.Warning,this.modalConfig.title="Promotion Requirement unfulfilled!",this.modalConfig.customWidth="350px",this.modalConfig.okText="Ok",this.selectedPromotion=e.selectedPromotion}_promotionEventService;_dialogRef;data;modalConfig;selectedPromotion;onOk(){this._promotionEventService.restoreOrder(),this._dialogRef.close()}static \u0275fac=function(t){return new(t||o)(O(we),O(z),O(le))};static \u0275cmp=N({type:o,selectors:[["POS-modal-promotion-confirm"]],standalone:!1,decls:9,vars:4,consts:[[3,"onOk","config"],[1,"fst-italic","text-danger","mb-3"],[1,"mb-0"]],template:function(t,i){t&1&&(a(0,"modal-material",0),_("onOk",function(){return i.onOk()}),a(1,"content")(2,"div")(3,"h5"),d(4),s(),a(5,"p",1),d(6),s(),a(7,"p",2),d(8),s()()()()),t&2&&(g("config",i.modalConfig),c(4),R(i.selectedPromotion==null?null:i.selectedPromotion.Name),c(2),R(i.selectedPromotion==null?null:i.selectedPromotion.Description),c(2),R(i.data==null?null:i.data.message))},dependencies:[ee],encapsulation:2})};var Ai=class extends Ee{};var Vi=class{Code;Provider;OutletID;Customer;ShoppingCart};var Qt=class o{salesOrderService=b(L);registerService=b(H);customerService=b(Ae);orderCalculator=b(de);generateRedeemCouponDto(e,t){let i=new Vi,n=this.registerService.Data?.EntityID;return i.Code=e,i.Provider=t,i.ShoppingCart={Amount:this.orderCalculator.Data,Items:this.generateItems()},i.OutletID=n,i.Customer=this.generateCustomer(t),i}generateItems(){return this.salesOrderService.Data.CartItems.map(i=>({ItemTemporaryID:i.ItemTemporaryID,Price:i.Price,Quantity:i.Quantity,VariantID:i.VariantID,Code:i?.Variant?.Code,Discount:i.Discount,DiscountAmount:i.DiscountAmount,PriceBookID:i.PriceBookID,UnitPriceOriginal:i.UnitPriceOriginal,UnitPrice:i.UnitPrice,CategoryID:i?.Variant?.CategoryID}))}generateCustomer(e){let t=this.customerService.Data,i=this.salesOrderService?.Data?.Order?.CustomerID,n=null;return h.IsNotEmpty(i)&&(n={Phone:t.Mobile,Email:t.Email},e==="Internal"&&(n=Dt({ID:i},n))),n}static \u0275fac=function(t){return new(t||o)};static \u0275prov=k({token:o,factory:o.\u0275fac,providedIn:"root"})};function Tr(o,e){if(o&1&&(a(0,"span",5),d(1),D(2,"number"),s()),o&2){let t=m().$implicit;c(),T("",w(2,1,t.Amount),"%")}}function Rr(o,e){if(o&1&&(a(0,"span",5),d(1),D(2,"number"),s()),o&2){let t=m().$implicit;c(),T(" -",w(2,1,t.Amount)," ")}}function Er(o,e){}function kr(o,e){if(o&1){let t=x();a(0,"button",8),_("click",function(){y(t);let n=m().$implicit,r=m();return v(r.onApplyCouponDiscount(n))}),d(1," Apply "),s()}}function Nr(o,e){if(o&1&&(a(0,"tr")(1,"td"),d(2),s(),a(3,"td"),d(4),s(),a(5,"td",4),d(6),D(7,"number"),s(),a(8,"td",4),p(9,Tr,3,3,"span",5)(10,Rr,3,3,"span",5),s(),a(11,"td",6),p(12,Er,0,0)(13,kr,2,0,"button",7),s()()),o&2){let t=e.$implicit,i=m();c(2),R(t==null?null:t.Name),c(2),R(t==null?null:t.Code),c(2),R(w(7,5,t==null?null:t.Price)),c(3),u((i.coupon==null?null:i.coupon.Type)==i.couponType.Percentage?9:10),c(3),u((t==null?null:t.CouponDiscount)>0?12:13)}}var Fi=class o{dialogRef=b(z);coupon=b(le);salesOrderModelService=b(L);config;couponType=Lt;itemsOptions=B(()=>{let e=this.salesOrderModelService?.Data?.CartItems,t=this.coupon?.ApplyToProduct??[];return t=t.filter(n=>n.UserOption),t.map(n=>{let r=e.find(l=>l.Variant.ID===n.ID);return r&&(n.Name=r.Variant?.Name,n.Price=r.Variant?.UnitPrice),n})});ngOnInit(){this.initModalConfig()}initModalConfig(){this.config=new G,this.config.title="Choose Item to Apply Discount",this.config.hideFooter=!0}onApplyCouponDiscount(e){this.dialogRef.close(e)}onClose(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=N({type:o,selectors:[["app-modal-selected-coupon-item-v2"]],decls:17,vars:1,consts:[[3,"onCancel","onClose","config"],[1,"table","table-bordered"],[1,"thead-light"],["scope","col"],[1,"text-end"],[1,"text-danger"],[1,"text-center"],[1,"btn","btn-sm","btn-success"],[1,"btn","btn-sm","btn-success",3,"click"]],template:function(t,i){t&1&&(a(0,"modal-material",0),_("onCancel",function(){return i.onClose()})("onClose",function(){return i.onClose()}),a(1,"content")(2,"table",1)(3,"thead",2)(4,"tr")(5,"th",3),d(6,"Name"),s(),a(7,"th",3),d(8,"Code"),s(),a(9,"th",3),d(10,"Price"),s(),a(11,"th",3),d(12,"Discount"),s(),S(13,"th",3),s()(),a(14,"tbody"),X(15,Nr,14,7,"tr",null,$e),s()()()()),t&2&&(g("config",i.config),c(15),Y(i.itemsOptions()))},dependencies:[pe,Do,K],encapsulation:2})};var Ht=class o{httpService=b(Oe);promotionCouponFactoryService=b(Qt);salesOrderService=b(L);userRoleService=b(Ie);dialog=b(be);posConfig=b(J);calculatorService=b(de);toastr=b(F);separateQuantityToNewRow=B(()=>this.posConfig.Data?.AppConfigJSON?.ModuleSell?.PromotionCouponSeparateQuantityToNewRow);_appliedCoupon=M(null);appliedCoupon=B(()=>this._appliedCoupon());salesOrderBeforePromotion=M(null);originalRoleData=B(()=>ce(Nt,this.userRoleService.Data));redeemCoupon(e,t){e=this.trimInputCoupon(e);let i=this.promotionCouponFactoryService.generateRedeemCouponDto(e,"Internal");return this.httpService.post(te.ValidateInternalCouponV2,i).pipe(re(n=>{n.Note=t||"",n.Code=e,this.copyOriginalSalesOrder(),this.applyCoupon(n)}))}trimInputCoupon(e){return h.IsNotEmpty(e)&&(e=e.trim()),e}applyCoupon(e){switch(e.Type){case"Percentage":this.applyDiscountPercentage(e);break;case"Amount":this.applyDiscountAmount(e);break;case"Return":this.handleCouponReturnAccess(e);break;case"DeleteItem":this.handleDeleteItemAccess(e);break;case"ParkedDeletion":this.handleCouponParkedDeletionAccess(e);break;case"FullAccess":this.handleFullAccess(e);break}this._appliedCoupon.set(e)}applyDiscountPercentage(e){let t=e.ApplyToProduct??[];t.some(n=>h.IsNotEmpty(n.UserOption))?this.openDialogSelectItem(e):t.length>0?this.applyDiscountToProduct(e,t):this.applyDiscountToOrder(e)}applyDiscountAmount(e){let t=e.ApplyToProduct??[];t.some(n=>h.IsNotEmpty(n.UserOption))?this.openDialogSelectItem(e):t.length>0?this.applyDiscountToProduct(e,t):this.applyDiscountToOrder(e)}openDialogSelectItem(e){this.dialog.open(Fi,{data:e}).afterClosed().pipe(Ce(t=>h.IsNotEmpty(t))).subscribe(t=>{this.applyDiscountToSelectedItem(e,t)})}applyDiscountToSelectedItem(e,t){this._appliedCoupon.update(i=>(i.ApplyToProduct=i.ApplyToProduct.map(n=>(t.ID==n.ID&&(n.SelectedItem=!0),n)),i)),this.applyDiscountToProduct(e,[t])}applyDiscountToOrder(e){let t=this.salesOrderService.Data;switch(e.Type){case"Amount":t.Order.DiscountAmount=e.Amount;break;case"Percentage":let i=this.calculateMaxDiscountInvoice(e);i.type=="amount"?t.Order.DiscountAmount=i.discount:t.Order.Discount=i.discount;break}t.Order.PromotionCoupon=e.Code,t.Order.PromotionNote=e.Note,t.Order.CouponType=1,this.salesOrderService.pushNewValue(t),this.showToastrAppliedCoupon(e)}calculateMaxDiscountInvoice(e){if(e.MaxDiscount>0){let t=e.Amount;return this.calculatorService.Data*t/100>e.MaxDiscount?{discount:e.MaxDiscount,type:"amount"}:{discount:e.Amount,type:"percentage"}}else return{discount:e.Amount,type:"percentage"}}applyDiscountToProduct(e,t){let i=this.salesOrderService.Data,n=i.CartItems,r=[];n=n.map(l=>{let f=this.findPromotionItemByVariantID(l,t);if(f.isMatch){let P=t[f.index];if(this.separateQuantityToNewRow()&&l.Quantity>1&&P.OneFirstOption){let I=this.separateItemQuantityToNewRow(P,l,e);l=I.originalItem,I.separatedItem&&r.push(I.separatedItem)}else{let I=this.calculateOneOfFirstDisc(P,l.Quantity);P.Amount=I,l=this.applyDiscountToItem(l,P,e)}}return l}),n=n.concat(r),i.CartItems=n,i.Order.PromotionCoupon=e.Code,i.Order.PromotionNote=e.Note,i.Order.CouponType=1,this.salesOrderService.pushNewValue(i),this.showToastrAppliedCoupon(e)}separateItemQuantityToNewRow(e,t,i){let n=t.Quantity,r=ce(Ee,t);return n>1?(t.Quantity=n-1,r.Quantity=1,r=this.applyDiscountToItem(r,e,i)):t=this.applyDiscountToItem(t,e,i),{originalItem:t,separatedItem:r}}calculateOneOfFirstDisc(e,t){let i=e.Amount;return e.OneFirstOption&&(i=e.Amount/t),i}applyDiscountToItem(e,t,i){switch(i.Type){case"Amount":e.DiscountAmount=t.Amount;break;case"Percentage":if(i.MaxDiscount>0)if(this.calculateDiscountItem(e,t.Amount)>i.MaxDiscount){let r=i.MaxDiscount/e.Quantity;e.DiscountAmount=r}else e.Discount=t.Amount;else e.Discount=t.Amount;break}return e}calculateDiscountItem(e,t){return e.Price*e.Quantity*t/100}findPromotionItemByVariantID(e,t){let i=t.findIndex(n=>n.ID==e.VariantID&&n.ItemTemporaryID==e.ItemTemporaryID);return{isMatch:i>-1,index:i}}handleCouponReturnAccess(e){let t=ce(Nt,this.originalRoleData());t.Return=!0,this.userRoleService.pushNewValue(t),this.applyCouponToSalesOrder(e)}handleDeleteItemAccess(e){let t=ce(Nt,this.originalRoleData());t.DeleteItem=!0,this.userRoleService.pushNewValue(t),this.applyCouponToSalesOrder(e)}handleCouponParkedDeletionAccess(e){let t=ce(Nt,this.originalRoleData());t.ParkedDeletionAuthorized=!0,this.userRoleService.pushNewValue(t),this.applyCouponToSalesOrder(e)}handleFullAccess(e){let t=ce(Nt,this.originalRoleData());t.UnitPriceEditor=!0,t.Discount=!0,t.Return=!0,t.Tax=!0,t.NumberEditor=!0,t.DateEditor=!0,t.PricebookSelector=!0,t.DeleteItem=!0,t.ParkedDeletionAuthorized=!0,this.userRoleService.pushNewValue(t),this.applyCouponToSalesOrder(e)}resetCouponOnNewTransaction(){this.userRoleService.pushNewValue(this.originalRoleData()),this._appliedCoupon.set(null)}setCouponOnEdit(e){e&&h.IsNotEmpty(e?.Type)&&(this._appliedCoupon.set(e),this.generateOriginalSalesOrderOnEdit())}generateOriginalSalesOrderOnEdit(){let e=ce(Pe,this.salesOrderService.Data);e.Order.PromotionCoupon=null,e.Order.PromotionNote=null,e.Order.Discount=0,e.Order.DiscountAmount=0,this.salesOrderBeforePromotion.set(e)}removeAppliedCoupon(){this.salesOrderService.pushNewValue(this.salesOrderBeforePromotion()),this.appliedCoupon().Type!="Amount"&&this.appliedCoupon().Type!="Percentage"&&this.userRoleService.pushNewValue(this.originalRoleData()),this._appliedCoupon.set(null),this.salesOrderBeforePromotion.set(null)}copyOriginalSalesOrder(){let e=ce(Pe,this.salesOrderService.Data);this.salesOrderBeforePromotion.set(e)}applyCouponToSalesOrder(e){let t=this.salesOrderService.Data;t.Order.PromotionCoupon=e.Code,t.Order.PromotionNote=e.Note,t.Order.CouponType=1,this.salesOrderService.pushNewValue(t),this.showToastrAppliedCoupon(e)}showToastrAppliedCoupon(e){e.Notification?this.toastr.success(e.Notification,"Coupon Applied"):this.toastr.success("Coupon applied successfully!","Coupon Applied")}static \u0275fac=function(t){return new(t||o)};static \u0275prov=k({token:o,factory:o.\u0275fac,providedIn:"root"})};var Ct=class o{constructor(e,t,i,n,r,l,f,P,I,Q){this.variantService=e;this._posService=t;this._orderDataService=i;this.toastr=n;this._orderProcessorService=r;this._customerHttpService=l;this.promotionCouponServiceV2=f;this.promotionCouponExternalService=P;this.userRoleService=I;this.decimalPipe=Q;this.subscribeToObservable()}variantService;_posService;_orderDataService;toastr;_orderProcessorService;_customerHttpService;promotionCouponServiceV2;promotionCouponExternalService;userRoleService;decimalPipe;dialog=b(be);salesOrderData;appConfigJson;entityID;audio=new Audio;_cartItemsState=new ue;cartItemsState$=this._cartItemsState.asObservable();priceMinimumRestrictionWarning=M("");subscribeToObservable(){this._posService.Data$.pipe($()).subscribe(e=>{this.appConfigJson=e.AppConfigJSON}),this._orderDataService.Data$.pipe($()).subscribe(e=>{this.salesOrderData=e,this.entityID=e.Order.EntityID}),this._orderProcessorService.Data$.pipe($()).subscribe(e=>{e.posState==3&&this.clearCartItemsInLocalStorage()})}addCartItemById(e,t,i=!0){return new Promise((n,r)=>{this.variantService.findVariantByID(e,this.entityID,i).then(l=>{this.isShoppingCartLockedByPromotionCoupon()==!1&&this.createNewCartItem(l,t),n(l)}).catch(l=>{r(l)})})}addCartItemByCode(e){return new Promise((t,i)=>{let n=this.appConfigJson.ModuleSell.DigitalScale;n.Digit>0&&h.IsNotEmpty(n.Regex)&&e.length==n.Digit?this.parseDigitalScaleBarcodeWithRegex(e,n).then(l=>{l||(this.toastr.info("Matching Regex Rule to Barcode","Digital Scale"),this.findVariantByCode(e).then(f=>t(f)).catch(f=>i(f)))}):this.findVariantByCode(e).then(l=>t(l)).catch(l=>i(l))})}findVariantByCode(e){let t=this.appConfigJson.ModuleSell.BarcodeSerialEnabled;return new Promise((i,n)=>{this.variantService.findVariantByCode(e,this.entityID,t).then(r=>{i(r),this.isShoppingCartLockedByPromotionCoupon()==!1&&this.createNewCartItem(r)}).catch(r=>{this.playBellRing(),n(r)})})}addItemBySerial(e){this.variantService.findVariantBySerial(e,this.entityID).subscribe(t=>{let i=this.salesOrderData.CartItems;if(i.length>0){let n,r=[],l=i.findIndex(f=>f.Variant.ID==t.ID);r=[],l!==-1?(n=i[l].Serial?.findIndex(f=>f.Number==e),r=[...i[l].Serial?i[l].Serial:[]],n==-1?(r.push({Number:e,Quantity:1}),i[l].Quantity=r.length):r.length>0?r[n].Quantity+=1:(r=[{Number:e,Quantity:1}],this.addNewSerials(t,e)),i[l].Serial=[...r],i[l].Quantity=i[l].calculateSerialQty(),this.updateCartItem(i[l],l)):this.addNewSerials(t,e)}else this.addNewSerials(t,e)})}addNewSerials(e,t){e.Serial=[{Number:t,Quantity:1}],this.createNewCartItem(e)}playBellRing(){this.audio.src="https://cdn.dealpos.xyz/web-audio/bell_ring.mp3",this.audio.load(),this.audio.play()}updateCartItem(e,t){this.isShoppingCartLockedByPromotionCoupon()==!1&&(this.salesOrderData.CartItems[t]=e,this._orderDataService.pushNewValue(this.salesOrderData),this.applyCustomerPoint(),this.saveItemsToLocalStorage())}deleteCartItem(e){this.isShoppingCartLockedByPromotionCoupon()==!1&&(this.salesOrderData.CartItems=this.salesOrderData.CartItems.filter(t=>t!==e),this._orderDataService.pushNewValue(this.salesOrderData),this.applyCustomerPoint())}parseDigitalScaleBarcodeWithRegex(e,t){return new Promise(i=>{let n=this.appConfigJson.ModuleSell.BarcodeSerialEnabled,r=new RegExp(t.Regex),l=e.match(r);if(console.log(l),h.IsNotEmpty(l)){let f=l[1],P=parseFloat(l[2]);console.log(P,"productQuantity"),P=P/t.QuantityDivider,this.variantService.findVariantByCode(f,this.entityID,n).then(I=>{this.createNewCartItem(I,null,P),i(!0)}).catch(()=>{i(!1)})}else i(!1)})}createNewCartItem(e,t,i){let n=new Ee,r=this.appConfigJson.ModuleSell.ProductNotes.CopyProductDescription,l=this.appConfigJson.ModuleSell.ProductNotes.CopyPromotionName;n.patchByVariant(e,r,l),n=this.addLandedCostToCartItem(n),n=this.applyReward(n,t),h.IsEmpty(t)&&(n=this.applyPriceBook(n)),this.validateCartItem(n)&&(n.Quantity=i||n.Quantity,t?.PromotionType==2?this.handlingPromotionQuantity(n):this.pushNewItemToArray(n,n.PromotionGift),this.applyCustomerPoint(),this._cartItemsState.next(this.salesOrderData.CartItems)),this.addAvailableComponent(n)}addLandedCostToCartItem(e){return this.appConfigJson.ModuleSell.Cost.LandedCostEnabled&&(e.Cost+=e.LandedCost!=null&&e.LandedCost!=null?e.LandedCost:e.Cost),e}applyCustomerPoint(){let e=this.salesOrderData.Order.CustomerID,t=h.IsEmpty(e);this._orderProcessorService.reedemPointToDiscount(t)}handlingPromotionQuantity(e){let t=ce(Ee,this.salesOrderData.CartItems),i=t.findIndex(n=>n.VariantID==e.VariantID&&n.PromotionGift);i!==-1?t[i].Quantity+=e.Quantity?e.Quantity:1:t=[...t,e],this.salesOrderData.CartItems=t,this._orderDataService.pushNewValue(this.salesOrderData)}applyPromotionProduct(e){let t=e.Variant.DiscountAmount;return t&&(e.Price=e.UnitPriceOriginal-t),e}applyReward(e,t){if(t){let i=this.appConfigJson.ModuleSell.ProductNotes.CopyPromotionName;e.Discount=t.Discount,e.Price=t.OriginalPrice;let n=t.OriginalPrice-t.UnitPrice;e.Price=e.UnitPriceOriginal-n,e.UnitPrice=e.UnitPriceOriginal-n,e.PromotionGift=!0,e.PromotionID=t.PromotionID,e.Quantity=t.Quantity?t.Quantity:1,e.PriceTypeID=3,e.Cost+=t.ExtraCost,e.UnitCost+=t.ExtraCost,e.PriceNote=t.PromotionName,i&&(e.Note=`${e.Note?e.Note:""} ${t.PromotionName} `)}return e}addAvailableComponent(e){let t=e.Price!=0,i=this.appConfigJson.ModuleSell.SellProductComponentDefaultPrice,n=e.Variant;if(n.Component!=null&&n.Component.length>0)for(let r of n.Component){let l=new Ai;l.patchByVariant(r),l.Quantity=e.Quantity*r.Quantity,t&&!i&&(r.UnitPrice=0),l.Price=r.UnitPrice,this.pushNewItemToArray(l)}}pushNewItemToArray(e,t=!1){if(this.isShoppingCartLockedByPromotionCoupon()==!1){let i=this.salesOrderData.CartItems.findIndex(n=>n.VariantID==e.VariantID);if(e=this.applyPromotionProduct(e),i==-1||t){let n=this.salesOrderData.CartItems.length;e.ItemTemporaryID=n,this.salesOrderData.CartItems.push(e)}else{let n=this.appConfigJson.ModuleSell.QuickKey.NewRowBehaviour;if(n==2){let r=this.salesOrderData.CartItems.length;e.ItemTemporaryID=r,this.salesOrderData.CartItems.push(e)}else if(n==1)this._orderProcessorService.Data.posState==4?this.salesOrderData.CartItems.push(e):this.addingQuantityItem(i,e);else{if(!this.validatePrepaidPackage(e,i)){this.toastr.error("This prepaid package is already in the cart while editing. Please remove it first before adding again.","Cannot Add Item");return}this.addingQuantityItem(i,e)}}this._orderDataService.pushNewValue(this.salesOrderData),this.saveItemsToLocalStorage()}}saveItemsToLocalStorage(){let e=this.userRoleService.Data.DeleteItem,t=this._orderProcessorService.Data?.posState;if(!e&&t!==4){let i=this._orderDataService.Data,n=i?.Order?.Number,r=i.CartItems,l={Number:n,CartItems:r};try{localStorage.setItem("cart_items",JSON.stringify(l))}catch(f){console.error("Error saving cart items to localStorage:",f)}}}clearCartItemsInLocalStorage(){localStorage.getItem("cart_items")&&(this.userRoleService.Data?.DeleteItem?this.clearCartItemsBasedOnCoupon():this.clearCartItemsStorage())}clearCartItemsBasedOnCoupon(){let e=this.promotionCouponServiceV2?.appliedCoupon();e&&(e?.Type=="FullAccess"||e?.Type=="DeleteItem")&&this.clearCartItemsStorage()}clearCartItemsStorage(){try{localStorage.removeItem("cart_items")}catch(e){console.error("Error clearing cart items from localStorage:",e)}}validatePrepaidPackage(e,t){let i=this.salesOrderData.CartItems[t],n=this._orderProcessorService.Data.posState,r=e.Variant.TypeID==10,l=h.IsNotEmpty(i.ID),f=!0;return n==2&&r&&l&&(f=!1),f}addingQuantityItem(e,t){let i=this.salesOrderData.CartItems.filter(f=>f.VariantID==t.VariantID),n=i.length,r=i.find(f=>!f.PromotionGift);this.salesOrderData.CartItems[e].PromotionGift&&n==1?this.salesOrderData.CartItems.push(t):(r.Quantity+=t.Quantity,r=this.applyPromotionProduct(r)),r&&(r=this.applyPriceBook(r))}validateCartItem(e){return e.Variant.CategoryTypeID==-1?(this.toastr.info(e.Variant.Name+" cannot be sold, check Category "+e.Variant.CategoryName+" settings","info"),!1):!!this.validateSerialItem(e)}validatePriceMinimum(e){let t=this.checkPriceMinimumRestriction(e);if(t)this.priceMinimumRestrictionWarning.set("");else{let i=this.appConfigJson.ModuleSell?.ProductDialog?.MinimumPriceIncludeDiscount,n=this.getPriceMinimum(e),r=this.generateMinimumPriceWarningMessage(i,n,e);this.priceMinimumRestrictionWarning.set(r)}return t}checkPriceMinimumRestriction(e){let t=!0,i=this.userRoleService.Data.PriceMinimum,r=this.appConfigJson.ModuleSell?.ProductDialog?.MinimumPriceIncludeDiscount?e.TotalAfterDiscountPerQuantity:e.Price;if(i){let l=this.getPriceMinimum(e);r<l?t=!1:t=!0}return t}getPriceMinimum(e){let t=this.appConfigJson.ModuleSell.ProductDialog?.PriceMinimumTypeID,i=0;switch(t){case 1:i=e.Variant?.UnitPrice;break;case 2:i=e.Variant?.UnitCost;break;case 3:i=e.Variant?.UnitPriceMinimum;break}return i}generateMinimumPriceWarningMessage(e,t,i){let n="",r=i.Discount,l=i.DiscountAmount;return e&&(r>0||l>0)?n=h.StringFormat(`<span><i class='fa-solid fa-triangle-exclamation me-2 d-inline'></i>Item net price is <h5 class='d-inline m-0'>{0}</h5></span>
|
|
3
3
|
after item discount, you cannot sell lower than <h5 class='d-inline m-0'>{1}</h5></span>`,this.decimalPipe.transform(i.TotalAfterDiscountPerQuantity),this.decimalPipe.transform(t)):n=h.StringFormat("<span><i class='fa-solid fa-triangle-exclamation me-2 d-inline'></i>Cannot sell lower than <h5 class='d-inline m-0'>{0}</h5></span>",this.decimalPipe.transform(t)),n}validateSerialItem(e){let t=!0;if(e?.Serial?.length>0&&e.Variant.TypeID==4&&e.Quantity>0){let i=0;e?.Serial?.forEach(n=>{i+=n.Quantity}),i!=e.Quantity&&(this.toastr.error("Serial must be equal with the quantity","Error"),t=!1)}return t}isShoppingCartLockedByPromotionCoupon(){let e=this.promotionCouponServiceV2.appliedCoupon(),t=this.promotionCouponExternalService.coupon,i=!1;if((h.IsNotEmpty(e)||h.IsNotEmpty(t))&&this.isNonAuthorizedCouponType){i=!0;let r=this._orderDataService.Data.Order.PromotionCoupon;this.dialog.open(Oi,{id:"ShoppingCartLocked",data:{title:"Shopping Cart Locked",message:`
|
|
4
4
|
<div class="d-flex justify-content-center my-4">
|