"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[90034],{90034:(e,s,a)=>{a.r(s),a.d(s,{default:()=>m});var n=a(95155),l=a(12115),t=a(61659),i=a(2962),c=a(42058),r=a(5430),d=a(37328),x=a(16099);let o="flex items-center justify-center rounded border border-[#064e3b] bg-[#fcfcf7] px-4 py-3 text-base font-medium text-[#064e3b] no-underline hover:bg-[#064e3b]/5";function h(e){return`Rs. ${e.toLocaleString()}`}function m(){let[e,s]=(0,l.useState)(null),[a,m]=(0,l.useState)(!0);(0,l.useEffect)(()=>{(async()=>{try{m(!0);let e=await d.fv();s(e)}catch(e){console.error("Error fetching financial overview:",e)}finally{m(!1)}})()},[]);let f={color:r.ge.color},u=e?.profit?.today??0,p=u>=0?t.b_d:t.s2g;return(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-[28px] font-bold leading-normal text-[#333]",children:"Finance Dashboard"}),(0,n.jsx)("p",{className:"mt-1 text-lg font-medium text-[#505050]",children:"Financial overview and analytics"})]}),(0,n.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4",children:[(0,n.jsx)(c.x,{title:"Today's Revenue",value:h(e?.revenue?.today??0),changePercentVsLastMonth:null,sparkline:[],icon:(0,n.jsx)(t.DAO,{className:"h-5 w-5",style:f}),href:`${x.bw.ADMIN}/payments`,loading:a}),(0,n.jsx)(c.x,{title:"Monthly Revenue",value:h(e?.revenue?.thisMonth??0),changePercentVsLastMonth:null,sparkline:[],icon:(0,n.jsx)(t.b_d,{className:"h-5 w-5",style:f}),href:`${x.bw.ADMIN}/finance/ledger`,loading:a}),(0,n.jsx)(c.x,{title:"Today's Expenses",value:h(e?.expenses?.today??0),changePercentVsLastMonth:null,sparkline:[],icon:(0,n.jsx)(t.LUf,{className:"h-5 w-5",style:f}),href:`${x.bw.ADMIN}/expenses`,loading:a}),(0,n.jsx)(c.x,{title:"Today's Profit",value:h(u),changePercentVsLastMonth:null,sparkline:[],icon:(0,n.jsx)(p,{className:"h-5 w-5",style:f}),href:`${x.bw.ADMIN}/finance/profit-loss`,loading:a})]}),(0,n.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[(0,n.jsxs)("div",{className:`${r.PI} p-6`,children:[(0,n.jsx)("h2",{className:"mb-4 text-xl font-bold text-[#333]",children:"Revenue Overview"}),(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"flex justify-between gap-4",children:[(0,n.jsx)("span",{className:"text-[#505050]",children:"Today"}),(0,n.jsx)("span",{className:"font-bold tabular-nums text-[#333]",children:h(e?.revenue?.today??0)})]}),(0,n.jsxs)("div",{className:"flex justify-between gap-4",children:[(0,n.jsx)("span",{className:"text-[#505050]",children:"This Week"}),(0,n.jsx)("span",{className:"font-bold tabular-nums text-[#333]",children:h(e?.revenue?.thisWeek??0)})]}),(0,n.jsxs)("div",{className:"flex justify-between gap-4",children:[(0,n.jsx)("span",{className:"text-[#505050]",children:"This Month"}),(0,n.jsx)("span",{className:"font-bold tabular-nums text-[#333]",children:h(e?.revenue?.thisMonth??0)})]}),(0,n.jsxs)("div",{className:"flex justify-between gap-4",children:[(0,n.jsx)("span",{className:"text-[#505050]",children:"This Year"}),(0,n.jsx)("span",{className:"font-bold tabular-nums text-[#333]",children:h(e?.revenue?.thisYear??0)})]})]})]}),(0,n.jsxs)("div",{className:`${r.PI} p-6`,children:[(0,n.jsx)("h2",{className:"mb-4 text-xl font-bold text-[#333]",children:"Pending Payments"}),(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"flex justify-between gap-4",children:[(0,n.jsx)("span",{className:"text-[#505050]",children:"Pending Salaries"}),(0,n.jsx)("span",{className:"font-bold tabular-nums text-[#333]",children:h(e?.pendingSalaries??0)})]}),(0,n.jsxs)("div",{className:"flex justify-between gap-4",children:[(0,n.jsx)("span",{className:"text-[#505050]",children:"Pending Expenses"}),(0,n.jsx)("span",{className:"font-bold tabular-nums text-[#333]",children:h(e?.pendingExpenses??0)})]}),(0,n.jsxs)("div",{className:"flex justify-between gap-4 border-t border-[#eeeceb] pt-4",children:[(0,n.jsx)("span",{className:"font-semibold text-[#505050]",children:"Total Pending"}),(0,n.jsx)("span",{className:"font-bold tabular-nums text-[#333]",children:h(e?.pendingExpenses??0)})]})]})]})]}),(0,n.jsxs)("div",{className:`${r.PI} p-6`,children:[(0,n.jsx)("h2",{className:"mb-4 text-xl font-bold text-[#333]",children:"Quick Actions"}),(0,n.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[(0,n.jsx)(i.u,{href:`${x.bw.ADMIN}/finance/ledger`,className:o,children:"Transaction Ledger"}),(0,n.jsx)(i.u,{href:`${x.bw.ADMIN}/finance/profit-loss`,className:o,children:"View Profit/Loss Statement"}),(0,n.jsx)(i.u,{href:`${x.bw.ADMIN}/expenses`,className:o,children:"Manage Expenses"}),(0,n.jsx)(i.u,{href:`${x.bw.ADMIN}/finance/salaries`,className:o,children:"Manage Salaries"})]})]})]})}}}]);