dealpos 25.49.4 → 25.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{chunk-WYRHUSXS.js → chunk-2ENLMKGR.js} +1 -1
- package/browser/{chunk-QS32TZGB.js → chunk-2FJNMKCN.js} +1 -1
- package/browser/{chunk-OYEU5L3I.js → chunk-2ITJBRJU.js} +1 -1
- package/browser/{chunk-34X4ZZD5.js → chunk-2KI73XNT.js} +1 -1
- package/browser/{chunk-T4E5A3KH.js → chunk-2SZZVWQD.js} +11 -11
- package/browser/{chunk-JZFX4FNK.js → chunk-3AZAILT2.js} +1 -1
- package/browser/{chunk-INWLOCX3.js → chunk-3CUT73ZP.js} +1 -1
- package/browser/{chunk-D2OMTDKS.js → chunk-3ZWJMFYL.js} +1 -1
- package/browser/{chunk-SY463GX6.js → chunk-4KYROBKJ.js} +1 -1
- package/browser/{chunk-IFKUMLMD.js → chunk-4MQZXTMM.js} +1 -1
- package/browser/{chunk-KWFL5YOV.js → chunk-4YZVDERU.js} +1 -1
- package/browser/{chunk-F3YWM4BJ.js → chunk-5SIEW7SH.js} +1 -1
- package/browser/{chunk-FTZZHFXM.js → chunk-7L5VMLEF.js} +1 -1
- package/browser/{chunk-P2R2O6GD.js → chunk-7MJWZXSK.js} +2 -2
- package/browser/{chunk-ROVDZJVT.js → chunk-A5CTHLE4.js} +1 -1
- package/browser/{chunk-C777CYT4.js → chunk-A6Z5ZHVO.js} +1 -1
- package/browser/{chunk-SFXDXOSB.js → chunk-B7BVEOOI.js} +1 -1
- package/browser/{chunk-LNZY3GKF.js → chunk-BFNGPKGX.js} +1 -1
- package/browser/{chunk-52ONOTHS.js → chunk-BLEJLNEO.js} +1 -1
- package/browser/{chunk-QOCGWG6L.js → chunk-BQ7QT5RB.js} +1 -1
- package/browser/chunk-BZ3GMUQ7.js +14 -0
- package/browser/{chunk-Y4XWHUVX.js → chunk-CB6QEEJX.js} +1 -1
- package/browser/{chunk-ASHEF37H.js → chunk-CCJ6SHBL.js} +1 -1
- package/browser/{chunk-7V6NCJRQ.js → chunk-COL56R4A.js} +1 -1
- package/browser/chunk-CXWICNFP.js +1 -0
- package/browser/{chunk-TLLI6Z5X.js → chunk-CZHWPDAM.js} +1 -1
- package/browser/{chunk-XOQUXJ6S.js → chunk-DYBRYTEM.js} +1 -1
- package/browser/{chunk-SO3RL6QR.js → chunk-EAEOJMTA.js} +1 -1
- package/browser/{chunk-LI6G74I7.js → chunk-F765TCAS.js} +1 -1
- package/browser/{chunk-RGO36X34.js → chunk-FMKY4THI.js} +1 -1
- package/browser/{chunk-KJ5BS7KR.js → chunk-FSOHJLXB.js} +1 -1
- package/browser/{chunk-APHRANVH.js → chunk-FV4MYFQI.js} +1 -1
- package/browser/{chunk-7V2CY4DW.js → chunk-G3DZI5XK.js} +1 -1
- package/browser/{chunk-YTXYAEFO.js → chunk-G5JGQBAG.js} +1 -1
- package/browser/{chunk-BVMFVFGN.js → chunk-GBSRXCWH.js} +1 -1
- package/browser/{chunk-BSV3Y4MG.js → chunk-GDQGP7DV.js} +1 -1
- package/browser/{chunk-TAVEJBKL.js → chunk-GESNWWTD.js} +2 -2
- package/browser/{chunk-3Y2TKGP4.js → chunk-GRLVYPPM.js} +1 -1
- package/browser/{chunk-WZWXE6GT.js → chunk-HFDJ5XSI.js} +1 -1
- package/browser/{chunk-NTCQH6TH.js → chunk-HFOJZ3B5.js} +1 -1
- package/browser/{chunk-ADQOH7YA.js → chunk-HFZ437GH.js} +1 -1
- package/browser/{chunk-OXMLRZZ4.js → chunk-IPPIH4F4.js} +1 -1
- package/browser/{chunk-RULBTV6L.js → chunk-ISN5K6K2.js} +1 -1
- package/browser/{chunk-V45WTUQ2.js → chunk-ISQHQTAS.js} +1 -1
- package/browser/chunk-JCLYKROE.js +1 -0
- package/browser/chunk-KUF3JPB2.js +1 -0
- package/browser/{chunk-743523SK.js → chunk-KZBVWICA.js} +1 -1
- package/browser/{chunk-CLO7U3RB.js → chunk-LIX7XJ55.js} +1 -1
- package/browser/{chunk-ZEI66KM2.js → chunk-LIXEWT4U.js} +3 -3
- package/browser/{chunk-XTU3LHA6.js → chunk-M2HEFQUY.js} +1 -1
- package/browser/{chunk-HOZ6XJ4Z.js → chunk-MFJH22SW.js} +1 -1
- package/browser/{chunk-NFODKKJI.js → chunk-MZSJCSUV.js} +2 -2
- package/browser/{chunk-6H5XBM35.js → chunk-O3ENARQZ.js} +1 -1
- package/browser/{chunk-QE5OFO56.js → chunk-OZ3MKU4C.js} +1 -1
- package/browser/chunk-PHYDJ3P5.js +1 -0
- package/browser/{chunk-HCMW3RC5.js → chunk-PIAQ4TBN.js} +1 -1
- package/browser/{chunk-N7M4OSQZ.js → chunk-PLR55YR2.js} +1 -1
- package/browser/{chunk-CD6ZWSFG.js → chunk-PMDFKXZY.js} +1 -1
- package/browser/{chunk-XFJYJSZU.js → chunk-PV4YHZX5.js} +1 -1
- package/browser/chunk-PVBS6SYW.js +3 -0
- package/browser/{chunk-WFSJDUCV.js → chunk-PXIMA665.js} +2 -2
- package/browser/{chunk-OETRAGYY.js → chunk-Q3DS2RLM.js} +1 -1
- package/browser/chunk-QWB3USYP.js +3 -0
- package/browser/{chunk-K3V25WUQ.js → chunk-QZRMHLML.js} +1 -1
- package/browser/{chunk-XWXXETJY.js → chunk-RE6SQEP6.js} +1 -1
- package/browser/{chunk-GT5IX3D6.js → chunk-S4D5UGSM.js} +1 -1
- package/browser/{chunk-IQ5KAZ7I.js → chunk-S65MPEJS.js} +1 -1
- package/browser/{chunk-46D5QBZT.js → chunk-SBTTKQ4L.js} +1 -1
- package/browser/{chunk-UJ63ZNAO.js → chunk-SK6Y77W4.js} +4 -4
- package/browser/{chunk-XBRNDXDZ.js → chunk-SOW7VMSU.js} +1 -1
- package/browser/{chunk-R2Y4JAXW.js → chunk-T3ZHKT2K.js} +1 -1
- package/browser/{chunk-WP2FVSCM.js → chunk-T7PBUS2H.js} +1 -1
- package/browser/{chunk-FD7ICK7T.js → chunk-TTCSYFRX.js} +1 -1
- package/browser/{chunk-3YFVIHNY.js → chunk-UZN4OKOJ.js} +2 -2
- package/browser/{chunk-TBBZ7RAN.js → chunk-WXYXGYFH.js} +1 -1
- package/browser/{chunk-H4U5GDQZ.js → chunk-X2GHGFH2.js} +2 -2
- package/browser/{chunk-LX26RD3F.js → chunk-XFAV2VZL.js} +1 -1
- package/browser/{chunk-YZY45SFB.js → chunk-XSZJISVJ.js} +1 -1
- package/browser/{chunk-5DNDULL7.js → chunk-Y5DX5U5Q.js} +1 -1
- package/browser/{chunk-GNIF2YD2.js → chunk-Y7KCHRMM.js} +1 -1
- package/browser/{chunk-3RQ35Y7Q.js → chunk-YBUERVXV.js} +1 -1
- package/browser/{chunk-V3KYBOFM.js → chunk-YLEKN2EU.js} +1 -1
- package/browser/{chunk-QVI22QDX.js → chunk-YUILNWDI.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-DAVMX2B6.js → main-4PHVOJ3C.js} +2 -2
- package/package.json +1 -1
- package/browser/chunk-3PJCCDIY.js +0 -14
- package/browser/chunk-6LSNTX2C.js +0 -1
- package/browser/chunk-FQVYXDHS.js +0 -3
- package/browser/chunk-KJF3M7DY.js +0 -1
- package/browser/chunk-N6JQHXKN.js +0 -3
- package/browser/chunk-NZBKYR7R.js +0 -1
- package/browser/chunk-OWK34F6X.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u}from"./chunk-
|
|
1
|
+
import{c as u}from"./chunk-KZBVWICA.js";import{b as s}from"./chunk-WFQIMZGL.js";import{Pd as a,pa as e}from"./chunk-IEVGW2RT.js";var g=(t,c)=>{let r=e(a),i=e(u);if(i.isTokenExpired())return i.returnUrl=c.url,r.navigate(["/"]),!1;let d=e(s),o=t.data?.roles;if(o){let n=t.data?.unauthorizedRedirect;if(!o.some(l=>d.isUserHasRole(l)))return n?r.navigate([n]):r.navigate(["menu/Unauthorized/Main/Unauthorized"]),!1}return!0};export{g as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as P}from"./chunk-
|
|
1
|
+
import{a as P}from"./chunk-HFOJZ3B5.js";import{a as w}from"./chunk-BFNGPKGX.js";import{a as C}from"./chunk-6P2ASCNY.js";import{a as A}from"./chunk-JCLYKROE.js";import{a as I}from"./chunk-ZTD4APMR.js";import{a as l}from"./chunk-2FWFPV5I.js";import{a as c}from"./chunk-WUV22SZ4.js";import{fa as y,pa as f,t as L,z as S}from"./chunk-IEVGW2RT.js";import{a as F}from"./chunk-SNAKHGZS.js";var g=class{enabledDragItem;constructor(){this.enabledDragItem=!1}drop(o,t){C(t.Data,o.previousIndex,o.currentIndex)}toggleEnabledDragItem(){}onSaveDragAndDrop(o,t){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||t.postListID(o,t.data.Data)}onPutSaveDragAndDrop(o,t){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||t.putListID(o,t.data.Data)}};var u=class{constructor(o){this.httpService=o}exportCSV(o,t,e,i){e.pageData.Filter.Export=!0,e.pageData.Filter.FormatType=0,i=i||"export.csv",this.httpService.post(`/api/${t}`,e.pageData.Filter).subscribe(r=>{o.convertToCSV(r,i),e.pageData.Filter.Export=!1})}convertToCSV(o,t=!1,e){let i=this.ExportDataFromUI2(t);o.convertToCSV(i,e)}ExportDataFromUI2(o=!1){let t=document.getElementById("tableGrid"),e=[];return c.IsNotEmpty(t)&&t.querySelectorAll("tr").forEach(r=>{let a=new Object,s=0;r.querySelectorAll("th, td").forEach(n=>{s++;let b=parseInt(n.getAttribute("colspan"));for(let h=1;h<b;h++)a["column"+s]="",s++;let m=n.innerText,v=m.toString().split("");if(o&&v[0]==="0"&&v.length>1){let h="'"+m.trim();a["column"+s]=h}else a["column"+s]=m.trim()}),e.push(a)}),e}};var d=class{listTotal;pageSize;show;constructor(){this.listTotal=0,this.pageSize=0,this.show=!1}changePaginationData(o){this.pageSize=o.pageData.Filter.RowCount,this.listTotal=o.data?.ListTotal??o.data?.Data?.total?.value,this.show=this.pageSize<=this.listTotal}changePage(o,t,e){t.Filter.PageNumber=o.pageIndex+1,e.getListData()}};var x=class extends A{constructor(t,e,i,r,a,s,p){super(t);this.httpService=e;this.dataAPI=i;this.pageAPI=r;this.toastrService=a;this.route=s;this.initOpenDialog=p;this.exportHandler=new u(e),r?(s&&(this.loaderPayload=F({ListIDs:this.reportFilterService?.initOutletFilter()},s.snapshot.queryParams)),this.preInitLoader(),S([this.menuData$,this.httpService.post("/api/"+this.pageAPI,this.loaderPayload)]).pipe(L(([n,b])=>b)).pipe(I()).subscribe(n=>{this.pageData=n,this.pageData.Filter||(this.pageData.Filter={},this.pageData.Filter.RowCount=20),this.pageData.Filter.PageNumber=1,this.pageData.Filter.ID=this.loaderPayload.ID,this.preInitList(),p?this.openDialogFilter.openDialog():this.getListData()})):(this.pageData.Filter.RowCount=20,this.pageData.Filter.PageNumber=1,this.preInitList(),S({menuData:this.menuData$,listData:this.getListData$()}).pipe(I()).subscribe())}openDialogFilter=f(w);reportFilterService=f(P);pageData={Filter:{},Options:{},Roles:{},Config:{}};data;pagination=new d;dragDrop=new g;exportHandler;comparation=0;loaderPayload={};preInitLoader(){}preInitList(){}getListData(t){this.preGetList(),this.dataAPI&&this.httpService.post("/api/"+this.dataAPI,this.pageData.Filter).subscribe(e=>{this.data=e,this.postInit(e),this.pagination.changePaginationData(this),t&&(this.pageData.HideStoreApiCount=!1)})}getListData$(t){return this.preGetList(),this.httpService.post("/api/"+this.dataAPI,this.pageData.Filter).pipe(y(e=>{this.data=e,this.postInit(e),this.pagination.changePaginationData(this),t&&(this.pageData.HideStoreApiCount=!1)}))}searchFromPageOne(){this.preSearchFromPageOne(),this.pageData.Filter.PageNumber=1,this.getListData("filterMode")}postInit(t){t.PageTitle!=null&&(this.menuData.H=t.PageTitle)}preGetList(){this.pageData.Filter.From==null&&(this.pageData.Filter.From=c.MinDate),this.pageData.Filter.To==null&&(this.pageData.Filter.To=c.MinDate)}preSearchFromPageOne(){}onPaginationChange(t){this.pagination.changePage(t,this.pageData,this)}onSelectAllData(t){this.data.Data=this.data.Data.map(e=>(e.selected=t,e))}getSelectedData(){let t=[];return this.data&&(t=this.data.Data.filter(e=>e.selected)),t}httpPostListID(t,e,i){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.postListID(t,r,i)}httpPutListID(t,e,i){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.putListID(t,r,i)}httpDeleteListID(t,e,i){if(e||(e="Are you sure you want to delete selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.DeleteListID(t,r,i)}onSaveDragAndDrop(t){this.dragDrop.onSaveDragAndDrop(t,this)}onPutSaveDragAndDrop(t){this.dragDrop.onPutSaveDragAndDrop(t,this)}postListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.post(`/api/${t}`,r,1e6,!0).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,l.Success),this.getListData()},a=>{let s=a.status+" "+a.statusText;this.toastrService.error(a.error.Message!=""?a.error.Message:"An unknown error has occured!",s,{enableHtml:!0})})}putListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.put(`/api/${t}`,r).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,l.Success),this.afterPutListSuccess(),this.getListData()})}afterPutListSuccess(){}DeleteListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.delete(`/api/${t}`,{body:r}).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,l.Success),this.getListData()})}postData(t,e){this.httpService.post("/API/"+t,e).subscribe(i=>{this.getListData(),this.toastrService.success(i.Message?i.Message:i,l.Success)})}compare(t,e,i){return(t<e?-1:1)*(i?1:-1)}exportCSV(t,e,i){this.exportHandler.exportCSV(t,e,this,i)}s2ab(t){for(var e=new ArrayBuffer(t.length),i=new Uint8Array(e),r=0;r!=t.length;++r)i[r]=t.charCodeAt(r)&255;return e}exportXlsx(t,e){this.pageData.Filter.FormatType=1,this.pageData.Filter.Export=!0,this.httpService.post(`/api/${t}`,this.pageData.Filter).subscribe(i=>{e=decodeURI(e);let r=window.URL.createObjectURL(new Blob([this.s2ab(atob(i))],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"})),a=document.createElement("a");a.href=r,a.setAttribute("download",e),document.body.appendChild(a),a.click(),window.URL.revokeObjectURL(r),a.remove()})}convertToCSV(t,e=!1,i){let r=this.exportHandler.ExportDataFromUI2(e);t.convertToCSV(r,i)}OnCompare(t){let e=t?this.data[t]:this.data;if(e.length<1)return;let i=Object.assign({},this.pageData.Filter);i.From=new Date(new Date(this.pageData.Filter.From).getFullYear(),new Date(this.pageData.Filter.From).getMonth()-1,1),i.To=new Date(new Date(this.pageData.Filter.To).getFullYear(),new Date(this.pageData.Filter.To).getMonth(),0).toDateString(),this.httpService.post("/API/"+this.dataAPI,i).subscribe(r=>{let a=t?r[t]:r;this.comparation=0,e.forEach(s=>{s.PrevIndex="-",s.CurrentIndex="-",s.Increase="-";let p=a.filter(n=>n.EntityID==s.EntityID);if(s.CurrentIndex=s.Rank,p.length>0){let n=p[0];s.PrevIndex=n.Rank,n.SalesNet?s.Increase=(s.SalesNet-n.SalesNet)/n.SalesNet*100:n.Sales&&(s.Increase=(s.Sales-n.Sales)/n.Sales*100),s.IsPositive=s.Increase>0,s.IsNegative=s.Increase<0,this.comparation+=s.Increase}})})}};export{x as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as O,b as Ve}from"./chunk-PS7477UG.js";import"./chunk-GDRHD33K.js";import{c as Fe}from"./chunk-NSNUUKNK.js";import{c as Ee}from"./chunk-SFXDXOSB.js";import"./chunk-L6PKNRWO.js";import"./chunk-SIQZO2WM.js";import{e as Oe,f as Pe}from"./chunk-LNZY3GKF.js";import"./chunk-7V2CY4DW.js";import"./chunk-7YUPYNWQ.js";import"./chunk-2CL5FM3P.js";import"./chunk-QPAUI5EG.js";import"./chunk-45E6XCHN.js";import"./chunk-SIDUUVNA.js";import"./chunk-QE5OFO56.js";import{a as Te,b as ve}from"./chunk-KJF3M7DY.js";import"./chunk-R2GUMKAU.js";import"./chunk-BT7NN7PT.js";import"./chunk-26YFRPR2.js";import{b as ye,c as Se}from"./chunk-JBS5UYZC.js";import{N as we}from"./chunk-TEGIL5RZ.js";import"./chunk-B7AC4RMR.js";import"./chunk-EQLHPWVB.js";import"./chunk-ZTD4APMR.js";import"./chunk-7P3L3ODB.js";import"./chunk-S7FOJJP2.js";import"./chunk-FU2ZGMX4.js";import"./chunk-2FWFPV5I.js";import"./chunk-SLX34TWD.js";import{F as xe,h as De,o as be}from"./chunk-DWZ5JTI2.js";import"./chunk-743523SK.js";import"./chunk-46D5QBZT.js";import"./chunk-36GWLMZX.js";import{b as Z}from"./chunk-WFQIMZGL.js";import{a as fe}from"./chunk-WUV22SZ4.js";import"./chunk-SO3RL6QR.js";import"./chunk-LGOSIAUC.js";import{$ as Y,Ab as u,Ac as he,Cb as de,Db as pe,Eb as ce,Fb as p,Fc as c,Gb as o,Gc as v,Ha as re,Hb as r,Hc as _,Ib as y,Lc as w,Ob as B,Pb as T,Qd as Ce,Sb as V,Sd as ge,Tc as ue,Ub as d,Xa as l,Y as P,Ya as le,aa as E,cc as g,eb as F,gd as j,hc as s,ib as A,ic as W,jc as C,kc as me,mb as se,mc as Q,nc as X,nd as L,ob as S,oc as ee,od as M,pb as k,qd as _e,sd as G,t as D,ta as b,tb as R,ua as x,ub as N,vd as $,wc as U,xc as f,yb as h,yc as I,zc as te}from"./chunk-IEVGW2RT.js";import"./chunk-WFMAM73Y.js";import{a as ne,b as oe}from"./chunk-SNAKHGZS.js";var H=class{Cost;Profit;Sales;SalesWithTax;Tax;Count;TopOutlet};var ae=t=>({"border-bottom":t}),ie=()=>["/menu/Reports/Sales_Report/Standard/Summary"],Be=(t,a,e)=>({From:t,To:a,ListIDs:e}),Le=t=>({today:t}),We=(t,a)=>({From:t,To:a});function $e(t,a){if(t&1){let e=T();o(0,"div",6)(1,"a",15),s(2),r(),o(3,"ul",16)(4,"li")(5,"a",17),V("click",function(){b(e);let n=d();return n.isTodayFilter=!n.isTodayFilter,x(n.onChangeFilterPeriod())}),s(6),r()()()()}if(t&2){let e=d();l(2),C(" ",e.isTodayFilter?"Today":"Last 7 Days"," "),l(),p("ngClass",I(3,Le,!e.isTodayFilter)),l(3),C(" ",e.isTodayFilter?"Last 7 Days":"Today"," ")}}function He(t,a){t&1&&(o(0,"span",7),s(1,"Today"),r())}function Ye(t,a){if(t&1&&(o(0,"div",18)(1,"a",9),c(2,"date"),c(3,"date"),o(4,"div",10),s(5,"Tax"),r(),o(6,"div",19)(7,"small",20),s(8),r(),o(9,"h2",11),s(10),c(11,"number"),r()()()(),o(12,"div",8)(13,"a",9),c(14,"date"),c(15,"date"),o(16,"div",10),s(17,"Sales + Tax"),r(),o(18,"div",19)(19,"small",20),s(20),r(),o(21,"h2",11),s(22),c(23,"number"),r()()()()),t&2){let e=d();l(),p("routerLink",f(27,ie))("queryParams",te(28,We,_(2,9,e.isTodayFilter?e.today:e.chartData==null?null:e.chartData.From,"yyyy-MM-dd"),_(3,12,e.isTodayFilter?e.today:e.dateTo,"yyyy-MM-dd"))),l(7),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(11,15,e.salesData==null?null:e.salesData.Tax,"1.0-0")," "),l(2),p("ngClass",I(31,ae,e.role.product.Cost)),l(),p("routerLink",f(33,ie))("queryParams",te(34,We,_(14,18,e.isTodayFilter?e.today:e.chartData==null?null:e.chartData.From,"yyyy-MM-dd"),_(15,21,e.isTodayFilter?e.today:e.dateTo,"yyyy-MM-dd"))),l(7),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(23,24,e.salesData==null?null:e.salesData.SalesWithTax,"1.0-0")," ")}}function Ue(t,a){if(t&1&&(o(0,"div",8)(1,"div")(2,"div",21),s(3,"Cost"),r(),o(4,"div",19)(5,"small",20),s(6),r(),o(7,"h2",11),s(8),c(9,"number"),r()()()()),t&2){let e=d();p("ngClass",I(6,ae,e.role.report.Profit)),l(6),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(9,3,e.salesData==null?null:e.salesData.Cost,"1.0-0")," ")}}function je(t,a){if(t&1&&(o(0,"div",12)(1,"div")(2,"div",22),s(3),r(),o(4,"div",23)(5,"small",20),s(6),r(),o(7,"h2",11),s(8),c(9,"number"),r()()()()),t&2){let e=d();l(3),C(" ",e.includeTax?"Gross Profit":"Profit"," "),l(3),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(9,3,e.salesData==null?null:e.salesData.Profit,"1.0-0")," ")}}var K=class t{constructor(a,e){this.dashboardService=a;this.role=e;this.chartConfig=this.dashboardService.getLineChartConfig()}chartData;salesData;dashboardConfig;filterSalesWidget=new le;chartConfig;todaySalesData;weeklySalesData;isTodayFilter=!0;showPeriodFilter;includeTax;today=new Date;dateTo;filterByOutletIds=ue([]);ngOnChanges(a){if(a.chartData&&a.chartData.currentValue){this.initSalesData();let e=a?.chartData?.currentValue?.Series;e=this.setChartLineColor(e),e=this.setSalesTaxLegend(e),this.chartConfig=oe(ne({},this.chartConfig),{series:e}),this.chartConfig=this.dashboardService.setSeriesPointStart(this.chartData.From,this.chartConfig),this.initPeriodFilter(e),this.getDateTo()}}initPeriodFilter(a){this.showPeriodFilter=a[0]?.data?.length>=7}initSalesData(){this.salesData=new H,this.includeTax=this.isIncludeTax(),this.salesData.Sales=this.dashboardService.getTotalData("Sales",this.chartData.Series,1),this.salesData.SalesWithTax=this.dashboardService.getTotalData("Sales + Tax",this.chartData.Series,1),this.salesData.Cost=this.dashboardService.getTotalData("Cost",this.chartData.Series,1),this.salesData.Tax=this.salesData.SalesWithTax-this.salesData.Sales,this.salesData.Profit=(this.includeTax?this.salesData.SalesWithTax:this.salesData.Sales)-this.salesData.Cost,this.salesData.Count=this.dashboardService.getTotalData("Count",this.chartData.Series,1),this.todaySalesData=Fe(H,this.salesData)}setChartLineColor(a=[]){return a?.map(e=>(e.name=="Sales"&&(e.color="rgb(44, 175, 254)",e.fillColor=this.dashboardService.getLinierGradient("rgb(44, 175, 254)")),e.name=="Cost"&&(e.color="#fb404b",e.fillColor=this.dashboardService.getLinierGradient("#fb404b")),e.name=="Sales + Tax"&&(e.color="#2ECC71",e.fillColor=this.dashboardService.getLinierGradient("#2ECC71")),e))}onChangeFilterPeriod(){this.isTodayFilter?this.salesData=this.todaySalesData:(this.generateWeeklySalesData(),this.salesData=this.weeklySalesData),this.filterSalesWidget.emit({period:this.isTodayFilter?"TODAY":"WEEKLY"})}getDateTo(){let a=new Date,e=new Date(this.chartData.From);a.setDate(e.getDate()+7),this.dateTo=a}generateWeeklySalesData(){if(fe.IsEmpty(this.weeklySalesData)){let a=this.dashboardService.getTotalData("Sales",this.chartData.Series,7),e=this.dashboardService.getTotalData("Sales + Tax",this.chartData.Series,7),i=this.dashboardService.getTotalData("Cost",this.chartData.Series,7),n=this.dashboardService.getTotalData("Count",this.chartData.Series,7),m=e-a,z=(this.includeTax?e:a)-i;this.weeklySalesData=this.weeklySalesData?this.weeklySalesData:new H,this.weeklySalesData.Sales=a,this.weeklySalesData.SalesWithTax=e,this.weeklySalesData.Cost=i,this.weeklySalesData.Profit=z,this.weeklySalesData.Tax=m,this.weeklySalesData.Count=n}}isIncludeTax(){let a=this.chartData.Series;return this.dashboardService.filterSeriesByName("Sales + Tax",a).visible}setSalesTaxLegend(a){return a=a.map(e=>(e.name=="Sales + Tax"&&(e.showInLegend=this.salesData.Tax>0),e)),a}static \u0275fac=function(e){return new(e||t)(F(O),F(Z))};static \u0275cmp=A({type:t,selectors:[["app-sales-widget"]],inputs:{chartData:"chartData",dashboardConfig:"dashboardConfig",filterByOutletIds:[1,"filterByOutletIds"]},outputs:{filterSalesWidget:"onFilter"},features:[U([O]),re],decls:25,vars:30,consts:[[1,"d-flex","flex-row","flex-wrap","mt-8","justify-content-between"],[1,"chart-widget"],["containerId","salesChart",3,"config"],[1,"sales-card-widget"],[1,"border","rounded","rounded-bottom-0","px-8","py-4","w-100","h-auto"],[1,"border-bottom","d-flex","align-items-center","justify-content-end",2,"height","42px"],[1,"btn-group"],[1,"link-dark","fs-2","headings-font-family"],[1,"text-end","card-row","d-flex","align-items-center","justify-content-end",3,"ngClass"],["target","_blank",1,"link-dark",3,"routerLink","queryParams"],[1,"fs-5"],[1,"fw-normal"],[1,"text-end","d-flex","align-items-center","justify-content-end","card-row"],[1,"card-footer","border","rounded-bottom","border-top-0","text-end","p-3"],["routerLink","/menu/Setup/Configuration/Application"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"dropdown-toggle","link-dark","fs-2","headings-font-family"],[1,"dropdown-menu","p-0",2,"position","absolute","right","20px !important",3,"ngClass"],["role","button",1,"dropdown-item","fs-4",3,"click"],[1,"text-end","border-bottom","card-row","d-flex","align-items-center","justify-content-end"],[1,"d-flex","align-items-center","justify-content-end"],[1,"me-2"],[1,"fs-5","text-danger"],[1,"fs-5","text-success"],[1,"d-flex","align-items-center"]],template:function(e,i){e&1&&(o(0,"div",0)(1,"div",1),y(2,"app-chart-container",2),r(),o(3,"div",3)(4,"div",4)(5,"div",5),h(6,$e,7,5,"div",6)(7,He,2,0,"span",7),r(),o(8,"div",8)(9,"a",9),c(10,"date"),c(11,"date"),o(12,"div",10),s(13,"Order"),r(),o(14,"h2",11),s(15),c(16,"number"),r()()(),h(17,Ye,24,37),h(18,Ue,10,8,"div",8),h(19,je,10,6,"div",12),r(),o(20,"div",13)(21,"a",14)(22,"small"),s(23),c(24,"date"),r()()()()()),e&2&&(l(2),p("config",i.chartConfig),l(4),u(!(i.role==null||i.role.dashboard==null)&&i.role.dashboard.View&&i.showPeriodFilter?6:7),l(2),p("ngClass",I(23,ae,(i.salesData==null?null:i.salesData.Tax)||i.role.product.Cost)),l(),p("routerLink",f(25,ie))("queryParams",he(26,Be,_(10,11,i.isTodayFilter?i.today:i.chartData==null?null:i.chartData.From,"yyyy-MM-dd"),_(11,14,i.isTodayFilter?i.today:i.dateTo,"yyyy-MM-dd"),i.filterByOutletIds())),l(6),W(_(16,17,i.salesData==null?null:i.salesData.Count,"1.0-0")),l(2),u((i.salesData==null?null:i.salesData.Tax)>0?17:-1),l(),u(i.role.product.Cost?18:-1),l(),u(i.role.report.Profit&&i.role.product.Cost?19:-1),l(4),me("",_(24,20,i.dashboardConfig==null?null:i.dashboardConfig.SpanConfigTime,"dd MMM HH:mm")," ",i.dashboardConfig==null?null:i.dashboardConfig.SmallTimeZone))},dependencies:[$,j,Ve,ge,Ce,we,G,_e],styles:[".chart-widget[_ngcontent-%COMP%]{width:80%}.link-dark[_ngcontent-%COMP%]{color:#333!important}.dropdown-menu.show.today[_ngcontent-%COMP%]{inset:0 auto auto -34px!important}.sales-card-widget[_ngcontent-%COMP%]{width:19%}.sales-card-widget[_ngcontent-%COMP%] .card-row[_ngcontent-%COMP%]{height:64px}@media only screen and (max-width: 767px){.chart-widget[_ngcontent-%COMP%]{width:100%}.sales-card-widget[_ngcontent-%COMP%]{width:100%;margin-top:12px}}@media only screen and (min-width: 768px) and (max-width: 991px){.chart-widget[_ngcontent-%COMP%]{width:100%}.sales-card-widget[_ngcontent-%COMP%]{width:100%;margin-top:12px}}"]})};var Ge=t=>({active:t});function Ze(t,a){if(t&1&&(o(0,"div",1),s(1),r(),o(2,"div",2)(3,"small",3),s(4),r(),o(5,"h2",4),s(6),r()()),t&2){let e=d();l(),W(e.title),l(3),W(e.currencySymbol),l(2),W(e.value)}}function Ke(t,a){if(t&1&&(o(0,"div",1),s(1),r(),o(2,"h2",4),s(3,"-"),r()),t&2){let e=d();l(),W(e.title)}}var q=class t{title;isActive;currencySymbol;value;showValue;constructor(){}ngOnInit(){}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=A({type:t,selectors:[["app-card-widget"]],inputs:{title:"title",isActive:"isActive",currencySymbol:"currencySymbol",value:"value",showValue:"showValue"},decls:3,vars:4,consts:[[1,"card-widget","pe-0",3,"ngClass"],[1,"fs-4","headings-font-family"],[1,"d-flex","justify-content-start","align-items-center"],[1,"fw-normal","me-2"],[1,"fw-normal"]],template:function(e,i){e&1&&(o(0,"div",0),h(1,Ze,7,3)(2,Ke,4,1),r()),e&2&&(p("ngClass",I(2,Ge,i.isActive)),l(),u(i.showValue?1:2))},dependencies:[$,j],styles:[".card-widget[_ngcontent-%COMP%]{padding:20px;border-radius:6px;min-height:95px;border:.5px solid #e4e4e4;width:100%}.active[_ngcontent-%COMP%]{background-color:#f0f0f0}@media only screen and (max-width: 767px){.card-widget[_ngcontent-%COMP%]{width:200px}}@media only screen and (min-width: 768px) and (max-width: 991px){.card-widget[_ngcontent-%COMP%]{width:200px}}"]})};var qe=()=>[L,import("./chunk-VZUPDSBH.js").then(t=>t.PaymentWidgetComponent),M],ze=()=>[L,import("./chunk-3CSCTT6I.js").then(t=>t.PurchaseWidgetComponent),M],Je=()=>[L,import("./chunk-PQ6W7KXC.js").then(t=>t.DebtWidgetComponent),M],Qe=()=>[L,import("./chunk-2MPRVJXH.js").then(t=>t.ProductWidgetComponent),M],Xe=()=>[L,import("./chunk-WM2DGNWH.js").then(t=>t.InventoryWidgetComponent),M],et=()=>({role:"Payment View Role"}),tt=()=>({role:"Buy Report Role"}),it=()=>({role:"Debt View Role"}),at=()=>({role:"Report View Role"}),nt=()=>({role:"Inventory View Role"});function ot(t,a){if(t&1){let e=T();o(0,"div",13)(1,"h6"),s(2,"Outlet"),r(),o(3,"outlet-selector",14),ee("ngModelChange",function(n){b(e);let m=d();return X(m.dashboardFilter.Outlets,n)||(m.dashboardFilter.Outlets=n),x(n)}),r()()}if(t&2){let e=d();l(3),p("multiple",!0)("accessType",e.outletAccess),Q("ngModel",e.dashboardFilter.Outlets)}}function rt(t,a){if(t&1){let e=T();o(0,"div",19),V("click",function(){let n=b(e).$implicit,m=d(2);return x(m.onClickCardWidget(n))}),y(1,"app-card-widget",20),c(2,"number"),r()}if(t&2){let e=a.$implicit,i=d(),n=d();l(),p("title",e.title)("matTooltip",e.tooltip)("currencySymbol",i==null||i.ConfigData==null?null:i.ConfigData.CurrencySymbol)("value",e.value==null?"-":_(2,6,e.value,"1.0-0"))("showValue",e.showValue)("isActive",e.id==n.activeTab)}}function lt(t,a){if(t&1){let e=T();o(0,"app-sales-widget",21),V("onFilter",function(n){b(e);let m=d(2);return x(m.onFilterSalesWidget(n))}),r()}if(t&2){let e=d(),i=d();p("dashboardConfig",e==null?null:e.ConfigData)("chartData",e==null?null:e.HighChartData)("filterByOutletIds",i.dashboardFilter.Outlets)}}function st(t,a){t&1&&B(0)}function dt(t,a){if(t&1){let e=T();o(0,"app-payment-widget",23),c(1,"async"),V("onFilter",function(n){b(e);let m=d(4);return x(m.onFilterPaymentWidget(n))}),r()}if(t&2){let e,i=d(3),n=d();p("dashboardConfig",i==null?null:i.ConfigData)("chartData",(e=v(1,2,n.paymentData$))==null?null:e.Data)}}function pt(t,a){if(t&1&&S(0,st,1,0,"ng-container",22)(1,dt,2,4,"ng-template",null,2,w),t&2){let e=g(2),i=d(3),n=g(12);p("ngTemplateOutlet",i.role.payment.View?e:n)("ngTemplateOutletContext",f(2,et))}}function ct(t,a){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function mt(t,a){t&1&&(k(0,pt,3,3)(1,ct,2,0),R(2,0,qe,null,1),N(0,-1))}function ht(t,a){t&1&&B(0)}function ut(t,a){if(t&1&&(y(0,"app-purchase-widget",18),c(1,"async")),t&2){let e,i=d(3),n=d();p("dashboardConfig",i==null?null:i.ConfigData)("chartData",(e=v(1,3,n.purchaseData$))==null?null:e.HighChartData)("filterByOutletIds",n.dashboardFilter.Outlets)}}function _t(t,a){if(t&1&&S(0,ht,1,0,"ng-container",22)(1,ut,2,5,"ng-template",null,3,w),t&2){let e=g(2),i=d(3),n=g(12);p("ngTemplateOutlet",i.role.buy.Report?e:n)("ngTemplateOutletContext",f(2,tt))}}function Ct(t,a){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function gt(t,a){t&1&&(k(0,_t,3,3)(1,Ct,2,0),R(2,0,ze,null,1),N(0,-1))}function ft(t,a){t&1&&B(0)}function Dt(t,a){if(t&1&&(y(0,"app-debt-widget",25),c(1,"async")),t&2){let e,i=d(3),n=d();p("dashboardConfig",i==null?null:i.ConfigData)("debtData",(e=v(1,2,n.debtData$))==null?null:e.PageData)}}function bt(t,a){if(t&1&&S(0,ft,1,0,"ng-container",22)(1,Dt,2,4,"ng-template",null,4,w),t&2){let e=g(2),i=d(3),n=g(12);p("ngTemplateOutlet",i.role.debt.View?e:n)("ngTemplateOutletContext",f(2,it))}}function xt(t,a){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function yt(t,a){t&1&&(k(0,bt,3,3)(1,xt,2,0),R(2,0,Je,null,1),N(0,-1))}function St(t,a){t&1&&B(0)}function Tt(t,a){if(t&1&&(y(0,"app-product-widget",26),c(1,"async")),t&2){let e,i=d(3),n=d();p("dashboardConfig",i==null?null:i.ConfigData)("productData",(e=v(1,2,n.productData$))==null?null:e.PageData)}}function vt(t,a){if(t&1&&S(0,St,1,0,"ng-container",22)(1,Tt,2,4,"ng-template",null,5,w),t&2){let e=g(2),i=d(3),n=g(12);p("ngTemplateOutlet",i.role.report.View?e:n)("ngTemplateOutletContext",f(2,at))}}function wt(t,a){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function Ot(t,a){t&1&&(k(0,vt,3,3)(1,wt,2,0),R(2,0,Qe,null,1),N(0,-1))}function Pt(t,a){t&1&&B(0)}function Et(t,a){if(t&1&&(y(0,"app-inventory-widget",27),c(1,"async")),t&2){let e,i=d(3),n=d();p("dashboardConfig",i==null?null:i.ConfigData)("inventoryData",(e=v(1,2,n.inventoryData$))==null?null:e.PageData)}}function Ft(t,a){if(t&1&&S(0,Pt,1,0,"ng-container",22)(1,Et,2,4,"ng-template",null,6,w),t&2){let e=g(2),i=d(3),n=g(12);p("ngTemplateOutlet",i.role.inventory.View?e:n)("ngTemplateOutletContext",f(2,nt))}}function Vt(t,a){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function Wt(t,a){t&1&&(k(0,Ft,3,3)(1,Vt,2,0),R(2,0,Xe,null,1),N(0,-1))}function It(t,a){if(t&1&&(o(0,"div",12)(1,"div",15)(2,"div",16),pe(3,rt,3,9,"div",17,de),c(5,"async"),r(),h(6,lt,1,3,"app-sales-widget",18),h(7,mt,4,0),h(8,gt,4,0),h(9,yt,4,0),h(10,Ot,4,0),h(11,Wt,4,0),r()()),t&2){let e=d();l(3),ce(v(5,6,e.cardWidget$)),l(3),u(e.activeTab=="SALES"?6:-1),l(),u(e.activeTab=="PAYMENT"?7:-1),l(),u(e.activeTab=="PURCHASE"?8:-1),l(),u(e.activeTab=="DEBT"?9:-1),l(),u(e.activeTab=="PRODUCT"?10:-1),l(),u(e.activeTab=="INVENTORY"?11:-1)}}function Mt(t,a){if(t&1&&(o(0,"div",24)(1,"div",28)(2,"div"),y(3,"img",29),r(),o(4,"h1",30),s(5,"You are not authorized"),r(),o(6,"p"),s(7," This page requires role "),o(8,"span",31),s(9),r(),s(10," to be accessed. Please contact your Administrator to gain access! "),r()()()),t&2){let e=a.role;l(9),C("[",e,"]")}}var ke=class t extends Te{constructor(e,i,n){super(e);this.dashboardService=i;this.role=n;this.menuData$.subscribe(),this.initSalesData(),this.initCardWidget(),this.initPaymentData(),this.initPurchaseData(),this.initInventoryData(),this.initDebtData(),this.initProductData()}cardWidget$;outletAccess=2;dashboardFilter={Outlets:[]};salesData$;paymentData$;purchaseData$;debtData$;productData$;inventoryData$;activeTab="SALES";initSalesData(){this.salesData$=this.dashboardService.getDashboardSales(this.dashboardFilter).pipe(P(1))}initPaymentData(){this.paymentData$=this.dashboardService.getDashboardPayment(this.dashboardFilter).pipe(P(1))}initPurchaseData(){this.purchaseData$=this.dashboardService.getDashboardPurchase(this.dashboardFilter).pipe(P(1))}initDebtData(){this.debtData$=this.dashboardService.getDashboardDebt(this.dashboardFilter).pipe(P(1))}initProductData(){this.productData$=this.dashboardService.getDashboardProduct(this.dashboardFilter).pipe(P(1))}initInventoryData(){this.inventoryData$=this.dashboardService.getDashboardInventory(this.dashboardFilter).pipe(P(1))}initCardWidget(){switch(this.activeTab){case"SALES":this.cardWidget$=this.salesData$.pipe(D(e=>this.dashboardService.getTotalData("Sales",e.HighChartData.Series,1)),Y(0),E(e=>this.dashboardService.setWidgetData(e,this.activeTab)));break;case"PAYMENT":this.cardWidget$=this.paymentData$.pipe(D(e=>this.dashboardService.getTotalData("All",e.Data.Series,1)),Y(0),E(e=>this.dashboardService.setWidgetData(e,this.activeTab)));break;case"PURCHASE":this.cardWidget$=this.purchaseData$.pipe(D(e=>this.dashboardService.getTotalData("Purchase",e.HighChartData.Series,1)),Y(0),E(e=>this.dashboardService.setWidgetData(e,this.activeTab)));break;case"DEBT":this.cardWidget$=this.debtData$.pipe(D(e=>e.PageData.Receivable),Y(0),E(e=>this.dashboardService.setWidgetData(e,this.activeTab)));break}}onFilterByOutlet(){switch(this.activeTab){case"SALES":this.initSalesData(),this.initCardWidget();break;case"PURCHASE":this.initPurchaseData(),this.initCardWidget();break;case"DEBT":this.initDebtData(),this.initCardWidget();break;case"PRODUCT":this.initProductData();break;case"INVENTORY":this.initInventoryData();break;case"PAYMENT":this.initPaymentData();break}}onClickCardWidget(e){this.activeTab=e.id,this.initCardWidget()}onFilterSalesWidget(e){this.cardWidget$=this.salesData$.pipe(D(i=>e.period=="WEEKLY"?this.dashboardService.getTotalData("Sales",i.HighChartData.Series,7):this.dashboardService.getTotalData("Sales",i.HighChartData.Series,1)),E(i=>(this.dashboardService.setWidgetData(i,"SALES"),this.dashboardService.widgets$)),D(i=>i.map(n=>(n.id=="SALES"&&(n.tooltip=e.period=="TODAY"?"Total Sales Today":"Total Sales last 7 days"),n))))}onFilterPaymentWidget(e){this.cardWidget$=this.paymentData$.pipe(D(i=>e.period=="WEEKLY"?this.dashboardService.getTotalData("All",i.Data.Series,7):this.dashboardService.getTotalData("All",i.Data.Series,1)),E(i=>(this.dashboardService.setWidgetData(i,"PAYMENT"),this.dashboardService.widgets$)),D(i=>i.map(n=>(n.id=="PAYMENT"&&(n.tooltip=e.period=="TODAY"?"Total Payment Today":"Total Payment last 7 days"),n))))}static \u0275fac=function(i){return new(i||t)(F(ve),F(O),F(Z))};static \u0275cmp=A({type:t,selectors:[["POS-dashboard-v2"]],features:[U([O]),se],decls:13,vars:7,consts:[["pageFilterTemplate",""],["NOT_AUTHORIZED",""],["PAYMENT",""],["BUY",""],["DEBT",""],["PRODUCT",""],["INVENTORY",""],[3,"onSubmit","filterChange","hideSearchBox","pageData","isFilterOnDropdown","filter"],[1,"content"],[1,"container-fluid","bg-light-gray","p-8"],[1,"row"],[1,"col-12"],[1,"card","mb-0"],[1,"dialog-filter"],["appendTo","body","placeholder","Select Outlets",3,"ngModelChange","multiple","accessType","ngModel"],[1,"card-body"],[1,"d-flex","flex-row","flex-nowrap","justify-content-between","align-items-center","overflow-auto",2,"column-gap","18px"],[1,"cursor-pointer","card-widget-tab"],[3,"dashboardConfig","chartData","filterByOutletIds"],[1,"cursor-pointer","card-widget-tab",3,"click"],["matTooltipPosition","above",3,"title","matTooltip","currencySymbol","value","showValue","isActive"],[3,"onFilter","dashboardConfig","chartData","filterByOutletIds"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"onFilter","dashboardConfig","chartData"],[1,"d-flex","align-items-center","justify-content-center","mt-8",2,"height","350px"],[3,"dashboardConfig","debtData"],[3,"dashboardConfig","productData"],[3,"dashboardConfig","inventoryData"],[1,"text-center"],["src","https://cdn.dealpos.xyz/web-image/locked.svg",2,"width","160px"],[1,"mt-2","mb-6"],[1,"fw-bold"]],template:function(i,n){if(i&1){let m=T();o(0,"mainpanel-cmp",7),V("onSubmit",function(){return b(m),x(n.onFilterByOutlet())}),ee("filterChange",function(J){return b(m),X(n.dashboardFilter,J)||(n.dashboardFilter=J),x(J)}),o(1,"filters"),S(2,ot,4,3,"ng-template",null,0,w),r(),o(4,"content")(5,"div",8)(6,"div",9)(7,"div",10)(8,"div",11),h(9,It,12,8,"div",12),c(10,"async"),r()()()()()(),S(11,Mt,11,1,"ng-template",null,1,w)}if(i&2){let m;p("hideSearchBox",!0)("pageData",n.menuData)("isFilterOnDropdown",!1),Q("filter",n.dashboardFilter),l(9),u((m=v(10,5,n.salesData$))?9:-1,m)}},dependencies:[$,Pe,Oe,xe,De,be,K,q,Ee,Se,ye,M,G],styles:[".card-widget-tab[_ngcontent-%COMP%]{flex:1 1 0px}@media only screen and (max-width: 767px){.card-widget-tab[_ngcontent-%COMP%]{margin-right:1rem;margin-top:.5rem;width:auto}}@media only screen and (min-width: 768px) and (max-width: 991px){.card-widget-tab[_ngcontent-%COMP%]{margin-right:1rem;margin-top:.5rem;width:auto}}"]})};export{ke as DashboardV2Component};
|
|
1
|
+
import{a as O,b as Ve}from"./chunk-PS7477UG.js";import"./chunk-GDRHD33K.js";import{c as Fe}from"./chunk-NSNUUKNK.js";import{c as Ee}from"./chunk-B7BVEOOI.js";import"./chunk-L6PKNRWO.js";import"./chunk-SIQZO2WM.js";import{e as Oe,f as Pe}from"./chunk-BFNGPKGX.js";import"./chunk-G3DZI5XK.js";import"./chunk-7YUPYNWQ.js";import"./chunk-2CL5FM3P.js";import"./chunk-QPAUI5EG.js";import"./chunk-45E6XCHN.js";import"./chunk-SIDUUVNA.js";import"./chunk-OZ3MKU4C.js";import{a as Te,b as ve}from"./chunk-JCLYKROE.js";import"./chunk-R2GUMKAU.js";import"./chunk-BT7NN7PT.js";import"./chunk-26YFRPR2.js";import{b as ye,c as Se}from"./chunk-JBS5UYZC.js";import{N as we}from"./chunk-TEGIL5RZ.js";import"./chunk-B7AC4RMR.js";import"./chunk-EQLHPWVB.js";import"./chunk-ZTD4APMR.js";import"./chunk-7P3L3ODB.js";import"./chunk-S7FOJJP2.js";import"./chunk-FU2ZGMX4.js";import"./chunk-2FWFPV5I.js";import"./chunk-SLX34TWD.js";import{F as xe,h as De,o as be}from"./chunk-DWZ5JTI2.js";import"./chunk-KZBVWICA.js";import"./chunk-SBTTKQ4L.js";import"./chunk-36GWLMZX.js";import{b as Z}from"./chunk-WFQIMZGL.js";import{a as fe}from"./chunk-WUV22SZ4.js";import"./chunk-EAEOJMTA.js";import"./chunk-LGOSIAUC.js";import{$ as Y,Ab as u,Ac as he,Cb as de,Db as pe,Eb as ce,Fb as p,Fc as c,Gb as o,Gc as v,Ha as re,Hb as r,Hc as _,Ib as y,Lc as w,Ob as B,Pb as T,Qd as Ce,Sb as V,Sd as ge,Tc as ue,Ub as d,Xa as l,Y as P,Ya as le,aa as E,cc as g,eb as F,gd as j,hc as s,ib as A,ic as W,jc as C,kc as me,mb as se,mc as Q,nc as X,nd as L,ob as S,oc as ee,od as M,pb as k,qd as _e,sd as G,t as D,ta as b,tb as R,ua as x,ub as N,vd as $,wc as U,xc as f,yb as h,yc as I,zc as te}from"./chunk-IEVGW2RT.js";import"./chunk-WFMAM73Y.js";import{a as ne,b as oe}from"./chunk-SNAKHGZS.js";var H=class{Cost;Profit;Sales;SalesWithTax;Tax;Count;TopOutlet};var ae=t=>({"border-bottom":t}),ie=()=>["/menu/Reports/Sales_Report/Standard/Summary"],Be=(t,a,e)=>({From:t,To:a,ListIDs:e}),Le=t=>({today:t}),We=(t,a)=>({From:t,To:a});function $e(t,a){if(t&1){let e=T();o(0,"div",6)(1,"a",15),s(2),r(),o(3,"ul",16)(4,"li")(5,"a",17),V("click",function(){b(e);let n=d();return n.isTodayFilter=!n.isTodayFilter,x(n.onChangeFilterPeriod())}),s(6),r()()()()}if(t&2){let e=d();l(2),C(" ",e.isTodayFilter?"Today":"Last 7 Days"," "),l(),p("ngClass",I(3,Le,!e.isTodayFilter)),l(3),C(" ",e.isTodayFilter?"Last 7 Days":"Today"," ")}}function He(t,a){t&1&&(o(0,"span",7),s(1,"Today"),r())}function Ye(t,a){if(t&1&&(o(0,"div",18)(1,"a",9),c(2,"date"),c(3,"date"),o(4,"div",10),s(5,"Tax"),r(),o(6,"div",19)(7,"small",20),s(8),r(),o(9,"h2",11),s(10),c(11,"number"),r()()()(),o(12,"div",8)(13,"a",9),c(14,"date"),c(15,"date"),o(16,"div",10),s(17,"Sales + Tax"),r(),o(18,"div",19)(19,"small",20),s(20),r(),o(21,"h2",11),s(22),c(23,"number"),r()()()()),t&2){let e=d();l(),p("routerLink",f(27,ie))("queryParams",te(28,We,_(2,9,e.isTodayFilter?e.today:e.chartData==null?null:e.chartData.From,"yyyy-MM-dd"),_(3,12,e.isTodayFilter?e.today:e.dateTo,"yyyy-MM-dd"))),l(7),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(11,15,e.salesData==null?null:e.salesData.Tax,"1.0-0")," "),l(2),p("ngClass",I(31,ae,e.role.product.Cost)),l(),p("routerLink",f(33,ie))("queryParams",te(34,We,_(14,18,e.isTodayFilter?e.today:e.chartData==null?null:e.chartData.From,"yyyy-MM-dd"),_(15,21,e.isTodayFilter?e.today:e.dateTo,"yyyy-MM-dd"))),l(7),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(23,24,e.salesData==null?null:e.salesData.SalesWithTax,"1.0-0")," ")}}function Ue(t,a){if(t&1&&(o(0,"div",8)(1,"div")(2,"div",21),s(3,"Cost"),r(),o(4,"div",19)(5,"small",20),s(6),r(),o(7,"h2",11),s(8),c(9,"number"),r()()()()),t&2){let e=d();p("ngClass",I(6,ae,e.role.report.Profit)),l(6),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(9,3,e.salesData==null?null:e.salesData.Cost,"1.0-0")," ")}}function je(t,a){if(t&1&&(o(0,"div",12)(1,"div")(2,"div",22),s(3),r(),o(4,"div",23)(5,"small",20),s(6),r(),o(7,"h2",11),s(8),c(9,"number"),r()()()()),t&2){let e=d();l(3),C(" ",e.includeTax?"Gross Profit":"Profit"," "),l(3),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(9,3,e.salesData==null?null:e.salesData.Profit,"1.0-0")," ")}}var K=class t{constructor(a,e){this.dashboardService=a;this.role=e;this.chartConfig=this.dashboardService.getLineChartConfig()}chartData;salesData;dashboardConfig;filterSalesWidget=new le;chartConfig;todaySalesData;weeklySalesData;isTodayFilter=!0;showPeriodFilter;includeTax;today=new Date;dateTo;filterByOutletIds=ue([]);ngOnChanges(a){if(a.chartData&&a.chartData.currentValue){this.initSalesData();let e=a?.chartData?.currentValue?.Series;e=this.setChartLineColor(e),e=this.setSalesTaxLegend(e),this.chartConfig=oe(ne({},this.chartConfig),{series:e}),this.chartConfig=this.dashboardService.setSeriesPointStart(this.chartData.From,this.chartConfig),this.initPeriodFilter(e),this.getDateTo()}}initPeriodFilter(a){this.showPeriodFilter=a[0]?.data?.length>=7}initSalesData(){this.salesData=new H,this.includeTax=this.isIncludeTax(),this.salesData.Sales=this.dashboardService.getTotalData("Sales",this.chartData.Series,1),this.salesData.SalesWithTax=this.dashboardService.getTotalData("Sales + Tax",this.chartData.Series,1),this.salesData.Cost=this.dashboardService.getTotalData("Cost",this.chartData.Series,1),this.salesData.Tax=this.salesData.SalesWithTax-this.salesData.Sales,this.salesData.Profit=(this.includeTax?this.salesData.SalesWithTax:this.salesData.Sales)-this.salesData.Cost,this.salesData.Count=this.dashboardService.getTotalData("Count",this.chartData.Series,1),this.todaySalesData=Fe(H,this.salesData)}setChartLineColor(a=[]){return a?.map(e=>(e.name=="Sales"&&(e.color="rgb(44, 175, 254)",e.fillColor=this.dashboardService.getLinierGradient("rgb(44, 175, 254)")),e.name=="Cost"&&(e.color="#fb404b",e.fillColor=this.dashboardService.getLinierGradient("#fb404b")),e.name=="Sales + Tax"&&(e.color="#2ECC71",e.fillColor=this.dashboardService.getLinierGradient("#2ECC71")),e))}onChangeFilterPeriod(){this.isTodayFilter?this.salesData=this.todaySalesData:(this.generateWeeklySalesData(),this.salesData=this.weeklySalesData),this.filterSalesWidget.emit({period:this.isTodayFilter?"TODAY":"WEEKLY"})}getDateTo(){let a=new Date,e=new Date(this.chartData.From);a.setDate(e.getDate()+7),this.dateTo=a}generateWeeklySalesData(){if(fe.IsEmpty(this.weeklySalesData)){let a=this.dashboardService.getTotalData("Sales",this.chartData.Series,7),e=this.dashboardService.getTotalData("Sales + Tax",this.chartData.Series,7),i=this.dashboardService.getTotalData("Cost",this.chartData.Series,7),n=this.dashboardService.getTotalData("Count",this.chartData.Series,7),m=e-a,z=(this.includeTax?e:a)-i;this.weeklySalesData=this.weeklySalesData?this.weeklySalesData:new H,this.weeklySalesData.Sales=a,this.weeklySalesData.SalesWithTax=e,this.weeklySalesData.Cost=i,this.weeklySalesData.Profit=z,this.weeklySalesData.Tax=m,this.weeklySalesData.Count=n}}isIncludeTax(){let a=this.chartData.Series;return this.dashboardService.filterSeriesByName("Sales + Tax",a).visible}setSalesTaxLegend(a){return a=a.map(e=>(e.name=="Sales + Tax"&&(e.showInLegend=this.salesData.Tax>0),e)),a}static \u0275fac=function(e){return new(e||t)(F(O),F(Z))};static \u0275cmp=A({type:t,selectors:[["app-sales-widget"]],inputs:{chartData:"chartData",dashboardConfig:"dashboardConfig",filterByOutletIds:[1,"filterByOutletIds"]},outputs:{filterSalesWidget:"onFilter"},features:[U([O]),re],decls:25,vars:30,consts:[[1,"d-flex","flex-row","flex-wrap","mt-8","justify-content-between"],[1,"chart-widget"],["containerId","salesChart",3,"config"],[1,"sales-card-widget"],[1,"border","rounded","rounded-bottom-0","px-8","py-4","w-100","h-auto"],[1,"border-bottom","d-flex","align-items-center","justify-content-end",2,"height","42px"],[1,"btn-group"],[1,"link-dark","fs-2","headings-font-family"],[1,"text-end","card-row","d-flex","align-items-center","justify-content-end",3,"ngClass"],["target","_blank",1,"link-dark",3,"routerLink","queryParams"],[1,"fs-5"],[1,"fw-normal"],[1,"text-end","d-flex","align-items-center","justify-content-end","card-row"],[1,"card-footer","border","rounded-bottom","border-top-0","text-end","p-3"],["routerLink","/menu/Setup/Configuration/Application"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"dropdown-toggle","link-dark","fs-2","headings-font-family"],[1,"dropdown-menu","p-0",2,"position","absolute","right","20px !important",3,"ngClass"],["role","button",1,"dropdown-item","fs-4",3,"click"],[1,"text-end","border-bottom","card-row","d-flex","align-items-center","justify-content-end"],[1,"d-flex","align-items-center","justify-content-end"],[1,"me-2"],[1,"fs-5","text-danger"],[1,"fs-5","text-success"],[1,"d-flex","align-items-center"]],template:function(e,i){e&1&&(o(0,"div",0)(1,"div",1),y(2,"app-chart-container",2),r(),o(3,"div",3)(4,"div",4)(5,"div",5),h(6,$e,7,5,"div",6)(7,He,2,0,"span",7),r(),o(8,"div",8)(9,"a",9),c(10,"date"),c(11,"date"),o(12,"div",10),s(13,"Order"),r(),o(14,"h2",11),s(15),c(16,"number"),r()()(),h(17,Ye,24,37),h(18,Ue,10,8,"div",8),h(19,je,10,6,"div",12),r(),o(20,"div",13)(21,"a",14)(22,"small"),s(23),c(24,"date"),r()()()()()),e&2&&(l(2),p("config",i.chartConfig),l(4),u(!(i.role==null||i.role.dashboard==null)&&i.role.dashboard.View&&i.showPeriodFilter?6:7),l(2),p("ngClass",I(23,ae,(i.salesData==null?null:i.salesData.Tax)||i.role.product.Cost)),l(),p("routerLink",f(25,ie))("queryParams",he(26,Be,_(10,11,i.isTodayFilter?i.today:i.chartData==null?null:i.chartData.From,"yyyy-MM-dd"),_(11,14,i.isTodayFilter?i.today:i.dateTo,"yyyy-MM-dd"),i.filterByOutletIds())),l(6),W(_(16,17,i.salesData==null?null:i.salesData.Count,"1.0-0")),l(2),u((i.salesData==null?null:i.salesData.Tax)>0?17:-1),l(),u(i.role.product.Cost?18:-1),l(),u(i.role.report.Profit&&i.role.product.Cost?19:-1),l(4),me("",_(24,20,i.dashboardConfig==null?null:i.dashboardConfig.SpanConfigTime,"dd MMM HH:mm")," ",i.dashboardConfig==null?null:i.dashboardConfig.SmallTimeZone))},dependencies:[$,j,Ve,ge,Ce,we,G,_e],styles:[".chart-widget[_ngcontent-%COMP%]{width:80%}.link-dark[_ngcontent-%COMP%]{color:#333!important}.dropdown-menu.show.today[_ngcontent-%COMP%]{inset:0 auto auto -34px!important}.sales-card-widget[_ngcontent-%COMP%]{width:19%}.sales-card-widget[_ngcontent-%COMP%] .card-row[_ngcontent-%COMP%]{height:64px}@media only screen and (max-width: 767px){.chart-widget[_ngcontent-%COMP%]{width:100%}.sales-card-widget[_ngcontent-%COMP%]{width:100%;margin-top:12px}}@media only screen and (min-width: 768px) and (max-width: 991px){.chart-widget[_ngcontent-%COMP%]{width:100%}.sales-card-widget[_ngcontent-%COMP%]{width:100%;margin-top:12px}}"]})};var Ge=t=>({active:t});function Ze(t,a){if(t&1&&(o(0,"div",1),s(1),r(),o(2,"div",2)(3,"small",3),s(4),r(),o(5,"h2",4),s(6),r()()),t&2){let e=d();l(),W(e.title),l(3),W(e.currencySymbol),l(2),W(e.value)}}function Ke(t,a){if(t&1&&(o(0,"div",1),s(1),r(),o(2,"h2",4),s(3,"-"),r()),t&2){let e=d();l(),W(e.title)}}var q=class t{title;isActive;currencySymbol;value;showValue;constructor(){}ngOnInit(){}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=A({type:t,selectors:[["app-card-widget"]],inputs:{title:"title",isActive:"isActive",currencySymbol:"currencySymbol",value:"value",showValue:"showValue"},decls:3,vars:4,consts:[[1,"card-widget","pe-0",3,"ngClass"],[1,"fs-4","headings-font-family"],[1,"d-flex","justify-content-start","align-items-center"],[1,"fw-normal","me-2"],[1,"fw-normal"]],template:function(e,i){e&1&&(o(0,"div",0),h(1,Ze,7,3)(2,Ke,4,1),r()),e&2&&(p("ngClass",I(2,Ge,i.isActive)),l(),u(i.showValue?1:2))},dependencies:[$,j],styles:[".card-widget[_ngcontent-%COMP%]{padding:20px;border-radius:6px;min-height:95px;border:.5px solid #e4e4e4;width:100%}.active[_ngcontent-%COMP%]{background-color:#f0f0f0}@media only screen and (max-width: 767px){.card-widget[_ngcontent-%COMP%]{width:200px}}@media only screen and (min-width: 768px) and (max-width: 991px){.card-widget[_ngcontent-%COMP%]{width:200px}}"]})};var qe=()=>[L,import("./chunk-VZUPDSBH.js").then(t=>t.PaymentWidgetComponent),M],ze=()=>[L,import("./chunk-3CSCTT6I.js").then(t=>t.PurchaseWidgetComponent),M],Je=()=>[L,import("./chunk-PQ6W7KXC.js").then(t=>t.DebtWidgetComponent),M],Qe=()=>[L,import("./chunk-2MPRVJXH.js").then(t=>t.ProductWidgetComponent),M],Xe=()=>[L,import("./chunk-WM2DGNWH.js").then(t=>t.InventoryWidgetComponent),M],et=()=>({role:"Payment View Role"}),tt=()=>({role:"Buy Report Role"}),it=()=>({role:"Debt View Role"}),at=()=>({role:"Report View Role"}),nt=()=>({role:"Inventory View Role"});function ot(t,a){if(t&1){let e=T();o(0,"div",13)(1,"h6"),s(2,"Outlet"),r(),o(3,"outlet-selector",14),ee("ngModelChange",function(n){b(e);let m=d();return X(m.dashboardFilter.Outlets,n)||(m.dashboardFilter.Outlets=n),x(n)}),r()()}if(t&2){let e=d();l(3),p("multiple",!0)("accessType",e.outletAccess),Q("ngModel",e.dashboardFilter.Outlets)}}function rt(t,a){if(t&1){let e=T();o(0,"div",19),V("click",function(){let n=b(e).$implicit,m=d(2);return x(m.onClickCardWidget(n))}),y(1,"app-card-widget",20),c(2,"number"),r()}if(t&2){let e=a.$implicit,i=d(),n=d();l(),p("title",e.title)("matTooltip",e.tooltip)("currencySymbol",i==null||i.ConfigData==null?null:i.ConfigData.CurrencySymbol)("value",e.value==null?"-":_(2,6,e.value,"1.0-0"))("showValue",e.showValue)("isActive",e.id==n.activeTab)}}function lt(t,a){if(t&1){let e=T();o(0,"app-sales-widget",21),V("onFilter",function(n){b(e);let m=d(2);return x(m.onFilterSalesWidget(n))}),r()}if(t&2){let e=d(),i=d();p("dashboardConfig",e==null?null:e.ConfigData)("chartData",e==null?null:e.HighChartData)("filterByOutletIds",i.dashboardFilter.Outlets)}}function st(t,a){t&1&&B(0)}function dt(t,a){if(t&1){let e=T();o(0,"app-payment-widget",23),c(1,"async"),V("onFilter",function(n){b(e);let m=d(4);return x(m.onFilterPaymentWidget(n))}),r()}if(t&2){let e,i=d(3),n=d();p("dashboardConfig",i==null?null:i.ConfigData)("chartData",(e=v(1,2,n.paymentData$))==null?null:e.Data)}}function pt(t,a){if(t&1&&S(0,st,1,0,"ng-container",22)(1,dt,2,4,"ng-template",null,2,w),t&2){let e=g(2),i=d(3),n=g(12);p("ngTemplateOutlet",i.role.payment.View?e:n)("ngTemplateOutletContext",f(2,et))}}function ct(t,a){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function mt(t,a){t&1&&(k(0,pt,3,3)(1,ct,2,0),R(2,0,qe,null,1),N(0,-1))}function ht(t,a){t&1&&B(0)}function ut(t,a){if(t&1&&(y(0,"app-purchase-widget",18),c(1,"async")),t&2){let e,i=d(3),n=d();p("dashboardConfig",i==null?null:i.ConfigData)("chartData",(e=v(1,3,n.purchaseData$))==null?null:e.HighChartData)("filterByOutletIds",n.dashboardFilter.Outlets)}}function _t(t,a){if(t&1&&S(0,ht,1,0,"ng-container",22)(1,ut,2,5,"ng-template",null,3,w),t&2){let e=g(2),i=d(3),n=g(12);p("ngTemplateOutlet",i.role.buy.Report?e:n)("ngTemplateOutletContext",f(2,tt))}}function Ct(t,a){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function gt(t,a){t&1&&(k(0,_t,3,3)(1,Ct,2,0),R(2,0,ze,null,1),N(0,-1))}function ft(t,a){t&1&&B(0)}function Dt(t,a){if(t&1&&(y(0,"app-debt-widget",25),c(1,"async")),t&2){let e,i=d(3),n=d();p("dashboardConfig",i==null?null:i.ConfigData)("debtData",(e=v(1,2,n.debtData$))==null?null:e.PageData)}}function bt(t,a){if(t&1&&S(0,ft,1,0,"ng-container",22)(1,Dt,2,4,"ng-template",null,4,w),t&2){let e=g(2),i=d(3),n=g(12);p("ngTemplateOutlet",i.role.debt.View?e:n)("ngTemplateOutletContext",f(2,it))}}function xt(t,a){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function yt(t,a){t&1&&(k(0,bt,3,3)(1,xt,2,0),R(2,0,Je,null,1),N(0,-1))}function St(t,a){t&1&&B(0)}function Tt(t,a){if(t&1&&(y(0,"app-product-widget",26),c(1,"async")),t&2){let e,i=d(3),n=d();p("dashboardConfig",i==null?null:i.ConfigData)("productData",(e=v(1,2,n.productData$))==null?null:e.PageData)}}function vt(t,a){if(t&1&&S(0,St,1,0,"ng-container",22)(1,Tt,2,4,"ng-template",null,5,w),t&2){let e=g(2),i=d(3),n=g(12);p("ngTemplateOutlet",i.role.report.View?e:n)("ngTemplateOutletContext",f(2,at))}}function wt(t,a){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function Ot(t,a){t&1&&(k(0,vt,3,3)(1,wt,2,0),R(2,0,Qe,null,1),N(0,-1))}function Pt(t,a){t&1&&B(0)}function Et(t,a){if(t&1&&(y(0,"app-inventory-widget",27),c(1,"async")),t&2){let e,i=d(3),n=d();p("dashboardConfig",i==null?null:i.ConfigData)("inventoryData",(e=v(1,2,n.inventoryData$))==null?null:e.PageData)}}function Ft(t,a){if(t&1&&S(0,Pt,1,0,"ng-container",22)(1,Et,2,4,"ng-template",null,6,w),t&2){let e=g(2),i=d(3),n=g(12);p("ngTemplateOutlet",i.role.inventory.View?e:n)("ngTemplateOutletContext",f(2,nt))}}function Vt(t,a){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function Wt(t,a){t&1&&(k(0,Ft,3,3)(1,Vt,2,0),R(2,0,Xe,null,1),N(0,-1))}function It(t,a){if(t&1&&(o(0,"div",12)(1,"div",15)(2,"div",16),pe(3,rt,3,9,"div",17,de),c(5,"async"),r(),h(6,lt,1,3,"app-sales-widget",18),h(7,mt,4,0),h(8,gt,4,0),h(9,yt,4,0),h(10,Ot,4,0),h(11,Wt,4,0),r()()),t&2){let e=d();l(3),ce(v(5,6,e.cardWidget$)),l(3),u(e.activeTab=="SALES"?6:-1),l(),u(e.activeTab=="PAYMENT"?7:-1),l(),u(e.activeTab=="PURCHASE"?8:-1),l(),u(e.activeTab=="DEBT"?9:-1),l(),u(e.activeTab=="PRODUCT"?10:-1),l(),u(e.activeTab=="INVENTORY"?11:-1)}}function Mt(t,a){if(t&1&&(o(0,"div",24)(1,"div",28)(2,"div"),y(3,"img",29),r(),o(4,"h1",30),s(5,"You are not authorized"),r(),o(6,"p"),s(7," This page requires role "),o(8,"span",31),s(9),r(),s(10," to be accessed. Please contact your Administrator to gain access! "),r()()()),t&2){let e=a.role;l(9),C("[",e,"]")}}var ke=class t extends Te{constructor(e,i,n){super(e);this.dashboardService=i;this.role=n;this.menuData$.subscribe(),this.initSalesData(),this.initCardWidget(),this.initPaymentData(),this.initPurchaseData(),this.initInventoryData(),this.initDebtData(),this.initProductData()}cardWidget$;outletAccess=2;dashboardFilter={Outlets:[]};salesData$;paymentData$;purchaseData$;debtData$;productData$;inventoryData$;activeTab="SALES";initSalesData(){this.salesData$=this.dashboardService.getDashboardSales(this.dashboardFilter).pipe(P(1))}initPaymentData(){this.paymentData$=this.dashboardService.getDashboardPayment(this.dashboardFilter).pipe(P(1))}initPurchaseData(){this.purchaseData$=this.dashboardService.getDashboardPurchase(this.dashboardFilter).pipe(P(1))}initDebtData(){this.debtData$=this.dashboardService.getDashboardDebt(this.dashboardFilter).pipe(P(1))}initProductData(){this.productData$=this.dashboardService.getDashboardProduct(this.dashboardFilter).pipe(P(1))}initInventoryData(){this.inventoryData$=this.dashboardService.getDashboardInventory(this.dashboardFilter).pipe(P(1))}initCardWidget(){switch(this.activeTab){case"SALES":this.cardWidget$=this.salesData$.pipe(D(e=>this.dashboardService.getTotalData("Sales",e.HighChartData.Series,1)),Y(0),E(e=>this.dashboardService.setWidgetData(e,this.activeTab)));break;case"PAYMENT":this.cardWidget$=this.paymentData$.pipe(D(e=>this.dashboardService.getTotalData("All",e.Data.Series,1)),Y(0),E(e=>this.dashboardService.setWidgetData(e,this.activeTab)));break;case"PURCHASE":this.cardWidget$=this.purchaseData$.pipe(D(e=>this.dashboardService.getTotalData("Purchase",e.HighChartData.Series,1)),Y(0),E(e=>this.dashboardService.setWidgetData(e,this.activeTab)));break;case"DEBT":this.cardWidget$=this.debtData$.pipe(D(e=>e.PageData.Receivable),Y(0),E(e=>this.dashboardService.setWidgetData(e,this.activeTab)));break}}onFilterByOutlet(){switch(this.activeTab){case"SALES":this.initSalesData(),this.initCardWidget();break;case"PURCHASE":this.initPurchaseData(),this.initCardWidget();break;case"DEBT":this.initDebtData(),this.initCardWidget();break;case"PRODUCT":this.initProductData();break;case"INVENTORY":this.initInventoryData();break;case"PAYMENT":this.initPaymentData();break}}onClickCardWidget(e){this.activeTab=e.id,this.initCardWidget()}onFilterSalesWidget(e){this.cardWidget$=this.salesData$.pipe(D(i=>e.period=="WEEKLY"?this.dashboardService.getTotalData("Sales",i.HighChartData.Series,7):this.dashboardService.getTotalData("Sales",i.HighChartData.Series,1)),E(i=>(this.dashboardService.setWidgetData(i,"SALES"),this.dashboardService.widgets$)),D(i=>i.map(n=>(n.id=="SALES"&&(n.tooltip=e.period=="TODAY"?"Total Sales Today":"Total Sales last 7 days"),n))))}onFilterPaymentWidget(e){this.cardWidget$=this.paymentData$.pipe(D(i=>e.period=="WEEKLY"?this.dashboardService.getTotalData("All",i.Data.Series,7):this.dashboardService.getTotalData("All",i.Data.Series,1)),E(i=>(this.dashboardService.setWidgetData(i,"PAYMENT"),this.dashboardService.widgets$)),D(i=>i.map(n=>(n.id=="PAYMENT"&&(n.tooltip=e.period=="TODAY"?"Total Payment Today":"Total Payment last 7 days"),n))))}static \u0275fac=function(i){return new(i||t)(F(ve),F(O),F(Z))};static \u0275cmp=A({type:t,selectors:[["POS-dashboard-v2"]],features:[U([O]),se],decls:13,vars:7,consts:[["pageFilterTemplate",""],["NOT_AUTHORIZED",""],["PAYMENT",""],["BUY",""],["DEBT",""],["PRODUCT",""],["INVENTORY",""],[3,"onSubmit","filterChange","hideSearchBox","pageData","isFilterOnDropdown","filter"],[1,"content"],[1,"container-fluid","bg-light-gray","p-8"],[1,"row"],[1,"col-12"],[1,"card","mb-0"],[1,"dialog-filter"],["appendTo","body","placeholder","Select Outlets",3,"ngModelChange","multiple","accessType","ngModel"],[1,"card-body"],[1,"d-flex","flex-row","flex-nowrap","justify-content-between","align-items-center","overflow-auto",2,"column-gap","18px"],[1,"cursor-pointer","card-widget-tab"],[3,"dashboardConfig","chartData","filterByOutletIds"],[1,"cursor-pointer","card-widget-tab",3,"click"],["matTooltipPosition","above",3,"title","matTooltip","currencySymbol","value","showValue","isActive"],[3,"onFilter","dashboardConfig","chartData","filterByOutletIds"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"onFilter","dashboardConfig","chartData"],[1,"d-flex","align-items-center","justify-content-center","mt-8",2,"height","350px"],[3,"dashboardConfig","debtData"],[3,"dashboardConfig","productData"],[3,"dashboardConfig","inventoryData"],[1,"text-center"],["src","https://cdn.dealpos.xyz/web-image/locked.svg",2,"width","160px"],[1,"mt-2","mb-6"],[1,"fw-bold"]],template:function(i,n){if(i&1){let m=T();o(0,"mainpanel-cmp",7),V("onSubmit",function(){return b(m),x(n.onFilterByOutlet())}),ee("filterChange",function(J){return b(m),X(n.dashboardFilter,J)||(n.dashboardFilter=J),x(J)}),o(1,"filters"),S(2,ot,4,3,"ng-template",null,0,w),r(),o(4,"content")(5,"div",8)(6,"div",9)(7,"div",10)(8,"div",11),h(9,It,12,8,"div",12),c(10,"async"),r()()()()()(),S(11,Mt,11,1,"ng-template",null,1,w)}if(i&2){let m;p("hideSearchBox",!0)("pageData",n.menuData)("isFilterOnDropdown",!1),Q("filter",n.dashboardFilter),l(9),u((m=v(10,5,n.salesData$))?9:-1,m)}},dependencies:[$,Pe,Oe,xe,De,be,K,q,Ee,Se,ye,M,G],styles:[".card-widget-tab[_ngcontent-%COMP%]{flex:1 1 0px}@media only screen and (max-width: 767px){.card-widget-tab[_ngcontent-%COMP%]{margin-right:1rem;margin-top:.5rem;width:auto}}@media only screen and (min-width: 768px) and (max-width: 991px){.card-widget-tab[_ngcontent-%COMP%]{margin-right:1rem;margin-top:.5rem;width:auto}}"]})};export{ke as DashboardV2Component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as X}from"./chunk-COA4UL2V.js";import"./chunk-32QBWLTN.js";import{d as se,e as ge}from"./chunk-WMZLH4YK.js";import"./chunk-72RZBOHX.js";import"./chunk-3RK6DDJD.js";import"./chunk-M3DKYPGC.js";import"./chunk-6WATOQG3.js";import"./chunk-VM4K4MNV.js";import"./chunk-XTCEZONP.js";import"./chunk-LNDHYAFW.js";import"./chunk-ZZBF7AOW.js";import{a as me,b as ce}from"./chunk-4W3WYXI2.js";import{b as ie}from"./chunk-VXPORXGI.js";import{a as Z}from"./chunk-
|
|
1
|
+
import{b as X}from"./chunk-COA4UL2V.js";import"./chunk-32QBWLTN.js";import{d as se,e as ge}from"./chunk-WMZLH4YK.js";import"./chunk-72RZBOHX.js";import"./chunk-3RK6DDJD.js";import"./chunk-M3DKYPGC.js";import"./chunk-6WATOQG3.js";import"./chunk-VM4K4MNV.js";import"./chunk-XTCEZONP.js";import"./chunk-LNDHYAFW.js";import"./chunk-ZZBF7AOW.js";import{a as me,b as ce}from"./chunk-4W3WYXI2.js";import{b as ie}from"./chunk-VXPORXGI.js";import{a as Z}from"./chunk-T3ZHKT2K.js";import"./chunk-HFOJZ3B5.js";import{a as ae}from"./chunk-J6M7UWVR.js";import{e as pe,f as le}from"./chunk-BFNGPKGX.js";import"./chunk-IKKPP4JS.js";import"./chunk-KZFNI67M.js";import"./chunk-4BXCIT62.js";import"./chunk-D4FCXEV4.js";import"./chunk-6P2ASCNY.js";import"./chunk-OZ3MKU4C.js";import{b as ne}from"./chunk-JCLYKROE.js";import"./chunk-R2GUMKAU.js";import"./chunk-BT7NN7PT.js";import"./chunk-26YFRPR2.js";import"./chunk-JBS5UYZC.js";import{G as oe,N as re}from"./chunk-TEGIL5RZ.js";import{d as ee,e as te}from"./chunk-THT6CY5E.js";import{g as $}from"./chunk-ZTD4APMR.js";import"./chunk-7P3L3ODB.js";import"./chunk-FU2ZGMX4.js";import"./chunk-2FWFPV5I.js";import"./chunk-SLX34TWD.js";import{F as Y,h as K,o as U}from"./chunk-DWZ5JTI2.js";import"./chunk-KZBVWICA.js";import"./chunk-SBTTKQ4L.js";import"./chunk-36GWLMZX.js";import{b as Q}from"./chunk-WFQIMZGL.js";import"./chunk-WUV22SZ4.js";import"./chunk-EAEOJMTA.js";import{p as q,s as z}from"./chunk-LGOSIAUC.js";import{Bb as V,Db as L,Eb as A,Fb as c,Fc as b,Gb as n,Hb as i,Hc as v,Ib as F,Jd as R,Lc as j,Mb as y,Nb as h,Pb as D,Qd as H,Sb as I,Sd as J,Ub as m,Xa as p,Zc as B,eb as C,hc as l,ib as E,ic as f,jc as W,jd as N,mb as P,mc as _,nc as d,ob as x,oc as u,pa as w,ta as s,ua as g,vd as G,xc as k,yc as O}from"./chunk-IEVGW2RT.js";import"./chunk-WFMAM73Y.js";import{a as T,b as M}from"./chunk-SNAKHGZS.js";var ue=()=>["/menu/Contacts/Contact/Customers/Info"],Se=o=>({ID:o});function Ce(o,S){if(o&1){let e=D();n(0,"button",9),I("click",function(){s(e);let t=m(2);return g(t.openExportModal())}),F(1,"i",10),l(2," Export "),i()}}function xe(o,S){if(o&1){let e=D();n(0,"div")(1,"div",11)(2,"h6"),l(3,"Status"),i(),n(4,"ng-select",12),u("ngModelChange",function(t){s(e);let a=m(2);return d(a.contactState,t)||(a.contactState=t),g(t)}),i(),n(5,"h6"),l(6,"Outlet Sign Up"),i(),n(7,"ng-select",13),u("ngModelChange",function(t){s(e);let a=m(2);return d(a.pageData.Filter.CreatorEntityID,t)||(a.pageData.Filter.CreatorEntityID=t),g(t)}),i(),n(8,"h6"),l(9,"Group"),i(),n(10,"ng-select",14),u("ngModelChange",function(t){s(e);let a=m(2);return d(a.pageData.Filter.GroupID,t)||(a.pageData.Filter.GroupID=t),g(t)}),i(),n(11,"h6"),l(12,"Join Date Range"),i(),n(13,"div")(14,"datepicker",15),u("dateChange",function(t){s(e);let a=m(2);return d(a.pageData.Filter.From,t)||(a.pageData.Filter.From=t),g(t)}),i()(),n(15,"div",16)(16,"datepicker",17),u("dateChange",function(t){s(e);let a=m(2);return d(a.pageData.Filter.To,t)||(a.pageData.Filter.To=t),g(t)}),i()(),n(17,"h6"),l(18,"Sign In Date Range"),i(),n(19,"div")(20,"datepicker",15),u("dateChange",function(t){s(e);let a=m(2);return d(a.pageData.Filter.SignFrom,t)||(a.pageData.Filter.SignFrom=t),g(t)}),i()(),n(21,"div",16)(22,"datepicker",17),u("dateChange",function(t){s(e);let a=m(2);return d(a.pageData.Filter.SignTo,t)||(a.pageData.Filter.SignTo=t),g(t)}),i()()()()}if(o&2){let e=m(2);p(4),_("ngModel",e.contactState),c("items",e.pageData.Options.ContactStates)("clearable",!1),p(3),_("ngModel",e.pageData.Filter.CreatorEntityID),c("items",e.pageData.Options.Entities),p(3),_("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options.Groups),p(4),c("isFloatingLabel",!1),_("date",e.pageData.Filter.From),p(2),c("isFloatingLabel",!1),_("date",e.pageData.Filter.To),p(4),c("isFloatingLabel",!1),_("date",e.pageData.Filter.SignFrom),p(2),c("isFloatingLabel",!1),_("date",e.pageData.Filter.SignTo)}}function fe(o,S){if(o&1&&(n(0,"tr")(1,"th")(2,"a",28),l(3),i()(),n(4,"td"),l(5),i(),n(6,"td"),l(7),i(),n(8,"td"),l(9),i(),n(10,"td"),l(11),b(12,"IsMinDate"),i(),n(13,"td"),l(14),b(15,"IsMinDate"),i()()),o&2){let e=S.$implicit;p(2),c("routerLink",k(14,ue))("queryParams",O(15,Se,e.ID)),p(),f(e.Name),p(2),f(e.Code),p(2),f(e.Mobile),p(2),f(e.Email),p(2),f(v(12,8,e.JoinDate,"dd MMM yyyy")),p(3),W(" ",v(15,11,e.AppLastSignIn,"dd MMM yyyy HH:mm")," ")}}function De(o,S){if(o&1){let e=D();n(0,"div",29)(1,"POS-complex-pagination",30),I("jumpToPage",function(){s(e);let t=m(3);return g(t.getListData())})("previousPage",function(){s(e);let t=m(3);return g(t.getListData())})("nextPage",function(){s(e);let t=m(3);return g(t.getListData())}),i()()}if(o&2){let e=m(3);p(),c("total",e.data.Data.length)("pageData",e.pageData)}}function ye(o,S){if(o&1&&(y(0,18),n(1,"div",19)(2,"div",20)(3,"table",21)(4,"thead",22)(5,"tr",23)(6,"th"),l(7,"Name"),i(),n(8,"th",24),l(9,"Code"),i(),n(10,"th",24),l(11,"Mobile"),i(),n(12,"th",25),l(13,"Email"),i(),n(14,"th",26),l(15,"Join Date"),i(),n(16,"th",24),l(17,"Last Sign In"),i()()(),n(18,"tbody"),L(19,fe,16,17,"tr",null,V),i()()(),x(21,De,2,2,"div",27),i(),h()),o&2){let e=m(2);p(19),A(e.data.Data),p(2),c("ngIf",e.pageData.Filter)}}function he(o,S){if(o&1){let e=D();n(0,"mainpanel-cmp",2),u("textChange",function(t){s(e);let a=m();return d(a.pageData.Filter.Text,t)||(a.pageData.Filter.Text=t),g(t)}),I("onSubmit",function(){s(e);let t=m();return g(t.searchFromPageOne())}),u("filterChange",function(t){s(e);let a=m();return d(a.pageData.Filter,t)||(a.pageData.Filter=t),g(t)}),y(1,3),n(2,"a",4),F(3,"i",5),l(4,"Get Your Brand Loyalty App "),i(),x(5,Ce,3,0,"button",6),h(),y(6,7),x(7,xe,23,15,"ng-template",null,0,j),h(),x(9,ye,22,1,"ng-container",8),i()}if(o&2){let e=m();c("pageData",e.menuData),_("text",e.pageData.Filter.Text),c("isFilterOnDropdown",!1),_("filter",e.pageData.Filter),p(5),c("ngIf",e.role.global.Export),p(4),c("ngIf",e.data&&e.data.Data)}}var _e=class o extends Z{constructor(e,r,t,a,de,Ie){super(e,r,"Contact/CustomerAppSignInList","ContactLoader/CustomerList",de);this.httpService=r;this.csvConverter=t;this.matDialog=a;this.role=Ie}cdr=w(B);title=w(R);contactState;ngOnInit(){let e=JSON.parse(localStorage.getItem("AccountInfo"));this.title.setTitle(e.BrandName+" POS | App Sign In")}postInit(e){this.menuData.H="App Sign In",this.cdr.markForCheck()}preInitList(){this.contactState=this.pageData.Filter.ContactStateID,this.pageData.Options.ContactStates=[{Key:0,Value:"All"},...this.pageData.Options.ContactStates],this.pageData.Filter=M(T({},this.pageData.Filter),{SignFrom:this.pageData.Filter.SignFrom?this.pageData.Filter.SignFrom:"0001-01-01T00:00:00",SignTo:this.pageData.Filter.SignTo?this.pageData.Filter.SignTo:"0001-01-01T00:00:00"})}openExportModal(){this.matDialog.open(ie,{data:{title:"Loyalty App Last Sign In",exportTypes:[{ID:"ContactExport/LoyaltyLastSignIn",Value:"Default",FileName:"LoyaltyAppLastSignIn"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.ContactStateID=this.contactState==0?null:this.contactState}static \u0275fac=function(r){return new(r||o)(C(ne),C(z),C(ae),C($),C(q),C(Q))};static \u0275cmp=E({type:o,selectors:[["pos-app-sign-in"]],features:[P],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["ngProjectAs","actions",5,["actions"]],["target","_blank","href","https://www.dealpos.co.id/tour/customer-loyalty-program",1,"btn","btn-outline-secondary"],[1,"fa-solid","fa-mobile","me-1"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],["ngProjectAs","filters",5,["filters"]],["ngProjectAs","content",5,["content"],4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Value","bindValue","Key","placeholder","Choose Status",3,"ngModelChange","ngModel","items","clearable"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose an Outlet...",3,"ngModelChange","ngModel","items"],["bindLabel","Name","bindValue","ID","placeholder","Choose a Group...",3,"ngModelChange","ngModel","items"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],[1,"mt-4"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["ngProjectAs","content",5,["content"]],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","150px"],[2,"width","200px"],[2,"width","100px"],["class","mt-2",4,"ngIf"],[1,"fw-normal",3,"routerLink","queryParams"],[1,"mt-2"],["api","Contact/CustomerAppSignInCount",3,"jumpToPage","previousPage","nextPage","total","pageData"]],template:function(r,t){r&1&&x(0,he,10,6,"mainpanel-cmp",1),r&2&&c("ngIf",t.pageData.Filter)},dependencies:[G,N,le,pe,ge,se,Y,K,U,J,H,X,te,ee,ce,me,re,oe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{_e as AppSignInComponent};
|