PageSourceSearch

https://app.myautogms.com/static/js/3433.c49f0940.chunk.js

js myautogms.com collected 2026-10-04 03:53:24 UTC 17,071 bytes, 2 lines download raw bytes

1/*! For license information please see 3433.c49f0940.chunk.js.LICENSE.txt */
2"use strict";(self.webpackChunkgarage_management_frontend=self.webpackChunkgarage_management_frontend||[]).push([[3433],{25889:(e,a,s)=>{s.d(a,{DT:()=>i,Fu:()=>d,Ji:()=>l,UR:()=>c,jq:()=>r,lF:()=>o});var t=s(16255),n=s(44414);const i=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"AED";if(null==e)return"\u2014";const s=Number(e);if(Number.isNaN(s))return"\u2014";const t=new Intl.NumberFormat("en-US",{style:"currency",currency:a,minimumFractionDigits:2}).format(Math.abs(s));return s<0?`(${t})`:t},l=e=>{let{label:a,amount:s,currency:t,sublabel:l,indent:o}=e;const r=Number(s)<0;return(0,n.jsxs)("div",{className:["flex items-baseline justify-between gap-4 py-2.5",o?"pl-5":""].join(" "),children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("span",{className:"text-[15px] text-gray-700",children:a}),l&&(0,n.jsx)("span",{className:"block text-xs text-gray-400 mt-0.5",children:l})]}),(0,n.jsx)("span",{className:["text-[15px] tabular-nums whitespace-nowrap",r?"text-red-600":"text-gray-900"].join(" "),children:i(s,t)})]})},o=e=>{let{label:a,amount:s,currency:t,sublabel:l}=e;const o=Number(s)<0;return(0,n.jsx)("div",{className:"mt-1 pt-2 border-t border-gray-300",children:(0,n.jsxs)("div",{className:"flex items-baseline justify-between gap-4 py-2",children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("span",{className:"text-[15px] font-semibold text-gray-900",children:a}),l&&(0,n.jsx)("span",{className:"block text-xs text-gray-500 mt-0.5",children:l})]}),(0,n.jsx)("span",{className:["text-[15px] tabular-nums font-semibold whitespace-nowrap",o?"text-red-600":"text-gray-900"].join(" "),children:i(s,t)})]})})},r=e=>{let{label:a,amount:s,currency:t,sublabel:l}=e;const o=Number(s)<0;return(0,n.jsx)("div",{className:"mt-3 pt-2 border-t-2 border-gray-900",children:(0,n.jsxs)("div",{className:"flex items-baseline justify-between gap-4 py-1 border-b-2 border-gray-900",children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("span",{className:"text-[15px] font-bold text-gray-900",children:a}),l&&(0,n.jsx)("span",{className:"block text-xs text-gray-500 mt-0.5",children:l})]}),(0,n.jsx)("span",{className:["text-[15px] tabular-nums font-bold whitespace-nowrap",o?"text-red-600":"text-gray-900"].join(" "),children:i(s,t)})]})})},c=e=>{let{children:a}=e;return(0,n.jsx)("div",{className:"pt-5 pb-1.5",children:(0,n.jsx)("span",{className:"text-[15px] font-bold text-gray-800",children:a})})},d=e=>{let{title:a,subtitle:s,headerNote:i,footer:l,children:o}=e;return(0,n.jsxs)(t.Zp,{className:"rounded-sm overflow-hidden",children:[(0,n.jsxs)("div",{className:"px-6 pt-6 pb-4 text-center bg-gray-50 border-b border-gray-200",children:[(0,n.jsx)("h2",{className:"text-base font-bold text-gray-900 tracking-tight",children:a}),s&&(0,n.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:s}),i&&(0,n.jsx)("div",{className:"mt-3",children:i})]}),(0,n.jsx)("div",{className:"px-6 py-5",children:o}),l&&(0,n.jsx)("div",{className:"px-6 py-3 border-t border-gray-100 bg-gray-50/50",children:(0,n.jsx)("p",{className:"text-[11px] text-gray-400 text-center",children:l})})]})}},3433:(e,a,s)=>{s.r(a),s.d(a,{default:()=>A});var t=s(9950),n=s(28429),i=s(42074),l=s(45530),o=s(32033),r=s(49248),c=s(12838),d=s(41465),m=s(95413),h=s(66987),u=s(58406),x=s(51107),p=s(6890),g=s(96958),b=s(15924),w=s(17276),y=s(25889),v=s(55030),j=s(22998),F=s(93651),f=s(37351),N=s(25137),C=s(44414);const D=["summary","operating","investing","financing"],A=(0,j.A)((()=>{var e,a,s,j,A,k,E,R,S;const{garageId:M}=(0,n.g)(),[L,P]=(0,i.ok)(),{t:q,i18n:T}=(0,v.Bd)("reports"),O=L.get("tab"),$=D.includes(O)?O:"summary",J=(0,t.useMemo)((()=>({startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),1),endDate:new Date,preset:"thisMonth"})),[]),I=(0,t.useMemo)((()=>(0,N.xb)(L,J)),[J,L]),[U,z]=(0,t.useState)(!1),{data:_,isLoading:B,isFetching:H,isError:V,refresh:G}=(0,F.Fq)(M,{startDate:(0,N.CT)(I.startDate),endDate:(0,N.CT)(I.endDate),preset:I.preset}),K=(null===_||void 0===_||null===(e=_.currency)||void 0===e?void 0:e.code)||"AED",W=(0,t.useMemo)((()=>(0,N.TL)(_,I)),[I,_]),Y=(0,t.useMemo)((()=>{const e=(0,N.VS)(W.startDate),a=(0,N.VS)(W.endDate);return e&&a?`${e.toLocaleDateString(T.language,{day:"numeric",month:"long",year:"numeric"})} \u2013 ${a.toLocaleDateString(T.language,{day:"numeric",month:"long",year:"numeric"})}`:W.label}),[T.language,W]),Z=(0,t.useMemo)((()=>{var e;return(null===_||void 0===_||null===(e=_.data)||void 0===e?void 0:e.summary)||{}}),[null===_||void 0===_||null===(a=_.data)||void 0===a?void 0:a.summary]),Q=(null===_||void 0===_||null===(s=_.data)||void 0===s?void 0:s.operating)||{},X=(null===_||void 0===_||null===(j=_.data)||void 0===j?void 0:j.investing)||{},ee=(null===_||void 0===_||null===(A=_.data)||void 0===A?void 0:A.financing)||{},ae=(0,t.useMemo)((()=>{var e;if(null===_||void 0===_||null===(e=_.data)||void 0===e||!e.summary)return[];const a=Z.netOperatingCash||0,s=Z.netInvestingCash||0,t=Z.netFinancingCash||0,n=Z.netCashFlow||0,i=[],l=(0,f.lb)((0,f.lb)(a,s),t);return(0,f.r$)(n,l,"Cash Flow Check")||i.push(`Net Cash Flow Mismatch: Reported ${(0,f.vv)(n,K)} \u2260 Calculated ${(0,f.vv)(l,K)} (Operating + Investing + Financing)`),i}),[null===_||void 0===_||null===(k=_.data)||void 0===k?void 0:k.summary,Z,K]);
2if(B)return(0,C.jsxs)(r.A,{className:"CashFlow",children:[(0,C.jsx)(c.A,{title:q("cashFlow.title"),description:q("cashFlow.description",{period:"..."})}),(0,C.jsx)(m.kt,{fullPage:!0,message:q("cashFlow.loading","Loading Cash Flow..."),"aria-label":q("cashFlow.loading","Loading Cash Flow...")})]});if(V)return(0,C.jsxs)(r.A,{className:"CashFlow",children:[(0,C.jsx)(c.A,{title:q("cashFlow.title"),description:q("cashFlow.description",{period:q("common.selectedPeriod","selected period")})}),(0,C.jsxs)("div",{className:"mt-6 p-6 bg-rose-50 border border-rose-200 rounded-lg",children:[(0,C.jsx)("p",{className:"text-rose-800 mb-4",children:q("cashFlow.errors.loadFailed","Failed to load cash flow statement. Please try again.")}),(0,C.jsxs)("button",{onClick:G,className:"px-4 py-2 bg-rose-600 text-white rounded-md hover:bg-rose-700 flex items-center gap-2",children:[(0,C.jsx)(h.A,{className:"h-4 w-4"}),q("common.retry","Retry")]})]})]});const se=[{id:"summary",label:q("cashFlow.tabs.summary"),icon:(0,C.jsx)(u.A,{className:"h-4 w-4"})},{id:"operating",label:q("cashFlow.tabs.operating"),icon:(0,C.jsx)(x.A,{className:"h-4 w-4"})},{id:"investing",label:q("cashFlow.tabs.investing"),icon:(0,C.jsx)(p.A,{className:"h-4 w-4"})},{id:"financing",label:q("cashFlow.tabs.financing","Financing"),icon:(0,C.jsx)(g.A,{className:"h-4 w-4"})}],te=[{field:"category",label:q("cashFlow.columns.category"),renderCell:e=>(0,C.jsx)("span",{className:"font-medium",children:e.category})},{field:"amount",label:q("cashFlow.columns.amount"),className:"text-right",renderCell:e=>(0,C.jsx)("span",{className:e.amount>=0?"text-emerald-600":"text-rose-600",children:(0,f.vv)(e.amount,K)})}],ne=[{category:q("cashFlow.data.receivedFromCustomers"),amount:Q.cashReceived||0},{category:q("cashFlow.data.refundsPaidToCustomers"),amount:-(Q.customerRefunds||0)},{category:q("cashFlow.data.paidToSuppliers"),amount:-(Q.cashPaidToSuppliers||0)},{category:q("cashFlow.data.paidForExpenses"),amount:-(Q.cashPaidForExpenses||0)}],ie=[{category:q("cashFlow.data.equipmentPurchase"),amount:-(X.equipmentPurchases||0)}],le=[{category:q("cashFlow.data.ownerContributions","Owner contributions"),amount:ee.ownerContributions||0},{category:q("cashFlow.data.ownerDrawings","Owner drawings"),amount:-(ee.ownerDrawings||0)},{category:q("cashFlow.data.loanRepayments","Loan repayments"),amount:-(ee.loanRepayments||0)}];return(0,C.jsxs)(r.A,{className:"CashFlow",children:[(0,C.jsx)(c.A,{title:q("cashFlow.title"),description:q("cashFlow.description",{period:(null===_||void 0===_||null===(E=_.data)||void 0===E||null===(R=E.period)||void 0===R?void 0:R.label)||(null===_||void 0===_||null===(S=_.period)||void 0===S?void 0:S.label)||q("common.selectedPeriod","selected period")}),tabs:se,activeTab:$,onTabChange:e=>{P({tab:e})},dateRange:I,onDateRangeChange:e=>{null!==e&&void 0!==e&&e.startDate&&null!==e&&void 0!==e&&e.endDate&&P((0,N.r9)(L,{startDate:e.startDate,endDate:e.endDate,preset:e.preset||null}),{replace:!0})},showDatePicker:!0,onExport:()=>(async e=>{try{const a=W.isResolved?{startDate:W.startDate,endDate:W.endDate}:I,s=await l.default.get(`/api/financial/${M}/cash-flow/export`,{params:{...(0,N.yT)(a),format:e},responseType:"blob"}),t=window.URL.createObjectURL(new Blob([s.data])),n=document.createElement("a");n.href=t,n.setAttribute("download",`cash-flow.${"excel"===e?"xlsx":e}`),document.body.appendChild(n),n.click(),n.remove()}catch(a){o.o.error(q("common.exportFailed","Export failed"))}})("excel"),titleActions:(0,C.jsx)(w.q,{onClick:()=>z(!0),label:q("cashFlow.methodology.title","Methodology")})}),H&&!B&&(0,C.jsxs)("div",{className:"flex items-center gap-2 text-sm text-slate-500 mt-4",children:[(0,C.jsx)(m.kt,{size:"sm"}),q("common.refreshingData","Refreshing data...")]}),ae.length>0&&(0,C.jsxs)("div",{className:"mb-6 p-4 bg-rose-50 border border-rose-200 rounded-md",children:[(0,C.jsxs)("h4",{className:"text-sm font-bold text-rose-800 mb-2 flex items-center gap-2",children:[(0,C.jsx)(b.A,{className:"h-4 w-4"}),q("profitAndLoss.summary.integrityWarning")]}),(0,C.jsx)("ul",{className:"list-disc list-inside text-sm text-rose-700",children:ae.map(((e,a)=>(0,C.jsx)("li",{children:e},a)))})]}),(0,C.jsxs)("div",{className:"space-y-6 mt-6",children:["summary"===$&&(0,C.jsxs)(y.Fu,{title:q("cashFlow.title"),subtitle:Y,footer:q("common.currency",{currency:K}),children:[(0,C.jsx)(y.UR,{children:q("cashFlow.summary.operatingActivities")}),(0,C.jsx)(y.Ji,{label:q("cashFlow.data.receivedFromCustomers"),amount:Q.cashReceived||0,currency:K,indent:!0}),(0,C.jsx)(y.Ji,{label:q("cashFlow.data.refundsPaidToCustomers"),amount:-(Q.customerRefunds||0),currency:K,indent:!0}),(0,C.jsx)(y.Ji,{label:q("cashFlow.data.paidToSuppliers"),amount:-(Q.cashPaidToSuppliers||0),currency:K,indent:!0}),(0,C.jsx)(y.Ji,{label:q("cashFlow.data.paidForExpenses"),amount:-(Q.cashPaidForExpenses||0),currency:K,indent:!0}),(0,C.jsx)(y.lF,{label:q("cashFlow.data.netOperating"),amount:Z.netOperatingCash||0,currency:K}),(0,C.jsx)(y.UR,{children:q("cashFlow.summary.investingActivities")}),(0,C.jsx)(y.Ji,{label:q("cashFlow.data.equipmentPurchase"),amount:-(X.equipmentPurchases||0),currency:K,indent:!0}),(0,C.jsx)(y.lF,{label:q("cashFlow.summary.investingActivities"),amount:Z.netInvestingCash||0,currency:K}),(0,C.jsx)(y.UR,{children:q("cashFlow.summary.financingActivities","Financing Activities")}),(0,C.jsx)(y.Ji,{label:q("cashFlow.data.ownerContributions","Owner contributions"),amount:ee.ownerContributions||0,currency:K,indent:!0}),(0,C.jsx)(y.Ji,{label:q("cashFlow.data.ownerDrawings","Owner drawings"),amount:-(ee.ownerDrawings||0),currency:K,indent:!0}),(0,C.jsx)(y.Ji,{label:q("cashFlow.data.loanRepayments","Loan repayments"),amount:-(ee.loanRepayments||0),currency:K,indent:!0}),(0,C.jsx)(y.lF,{label:q("cashFlow.summary.financingActivities","Financing Activities"),amount:Z.netFinancingCash||0,currency:K}),(0,C.jsx)(y.jq,{label:q("cashFlow.summary.netCashFlow"),amount:Z.netCashFlow||0,currency:K})]}),"operating"===$&&(0,C.jsx)(d.A,{title:q("cashFlow.tabs.operating"),data:ne,columns:te,isLoading:H,pagination:{enabled:!0,pageSize:10}}),"investing"===$&&(0,C.jsx)(d.A,{title:q("cashFlow.tabs.investing"),data:ie,columns:te,isLoading:H,pagination:{enabled:!0,pageSize:10}}),"financing"===$&&(0,C.jsx)(d.A,{title:q("cashFlow.tabs.financing","Financing"),data:le,columns:te,isLoading:H,pagination:{enabled:!0,pageSize:10}})]}),(0,C.jsx)(w.A,{open:U,onOpenChange:z,title:q("cashFlow.methodology.title","Report Methodology"),children:(0,C.jsxs)("div",{className:"space-y-4",children:[(0,C.jsxs)("ul",{className:"space-y-3",children:[(0,C.jsxs)("li",{children:[(0,C.jsx)("div",{className:"font-medium text-slate-900 mb-1",children:q("cashFlow.data.receivedFromCustomers")}),(0,C.jsxs)("div",{className:"text-xs text-slate-500 mb-1",children:[q("common.source","Source:")," ",(0,C.jsx)("span",{className:"font-mono text-slate-700",children:q("cashFlow.sources.bookings","Bookings")})]}),(0,C.jsx)("div",{children:q("cashFlow.methodology.operating.receivedDesc")})]}),(0,C.jsxs)("li",{children:[(0,C.jsx)("div",{className:"font-medium text-slate-900 mb-1",children:q("cashFlow.data.paidToSuppliers")}),(0,C.jsxs)("div",{className:"text-xs text-slate-500 mb-1",children:[q("common.source","Source:")," ",(0,C.jsx)("span",{className:"font-mono text-slate-700",children:q("cashFlow.sources.expenses","Expenses")})," ",q("cashFlow.sources.categoryCogs","(Category: COGS)")]}),(0,C.jsx)("div",{children:q("cashFlow.methodology.operating.suppliersDesc")})]}),(0,C.jsxs)("li",{children:[(0,C.jsx)("div",{className:"font-medium text-slate-900 mb-1",children:q("cashFlow.data.paidForExpenses")}),(0,C.jsxs)("div",{className:"text-xs text-slate-500 mb-1",children:[q("common.source","Source:")," ",(0,C.jsx)("span",{className:"font-mono text-slate-700",children:q("cashFlow.sources.expenses","Expenses")})," ",q("cashFlow.sources.otherCategories","(Other Categories)")]}),(0,C.jsx)("div",{children:q("cashFlow.methodology.operating.expensesDesc")})]})]}),(0,C.jsxs)("div",{className:"border-t border-slate-100 pt-3",children:[(0,C.jsx)("h5",{className:"font-medium text-slate-900 mb-2",children:q("cashFlow.methodology.investing.title")}),(0,C.jsx)("ul",{className:"space-y-3",children:(0,C.jsxs)("li",{children:[(0,C.jsx)("div",{className:"font-medium text-slate-900 mb-1",children:q("cashFlow.data.equipmentPurchase")}),(0,C.jsxs)("div",{className:"text-xs text-slate-500 mb-1",children:[q("common.source","Source:")," ",(0,C.jsx)("span",{className:"font-mono text-slate-700",children:q("cashFlow.sources.expenses","Expenses")})," ",q("cashFlow.sources.categoryEquipment","(Category: Equipment/Assets)")]}),(0,C.jsx)("div",{children:q("cashFlow.methodology.investing.equipmentDesc")})]})})]}),(0,C.jsxs)("div",{className:"border-t border-slate-100 pt-3",children:[(0,C.jsx)("h5",{className:"font-medium text-slate-900 mb-2",children:q("cashFlow.methodology.financing.t
2itle","Financing activities")}),(0,C.jsxs)("ul",{className:"space-y-3",children:[(0,C.jsxs)("li",{children:[(0,C.jsx)("div",{className:"font-medium text-slate-900 mb-1",children:q("cashFlow.data.ownerContributions","Owner contributions")}),(0,C.jsxs)("div",{className:"text-xs text-slate-500 mb-1",children:[q("common.source","Source:")," ",(0,C.jsx)("span",{className:"font-mono text-slate-700",children:q("cashFlow.sources.financialEntries","Financial Entries")})," ",q("cashFlow.sources.capitalContribution","(Capital Contribution)")]}),(0,C.jsx)("div",{children:q("cashFlow.methodology.financing.contributionsDesc","Capital introduced by the owner is treated as financing cash inflow, not operating revenue.")})]}),(0,C.jsxs)("li",{children:[(0,C.jsx)("div",{className:"font-medium text-slate-900 mb-1",children:q("cashFlow.data.loanRepayments","Loan repayments")}),(0,C.jsxs)("div",{className:"text-xs text-slate-500 mb-1",children:[q("common.source","Source:")," ",(0,C.jsx)("span",{className:"font-mono text-slate-700",children:q("cashFlow.sources.financialEntries","Financial Entries")})]}),(0,C.jsx)("div",{children:q("cashFlow.methodology.financing.repaymentsDesc","Financing repayments reduce cash without affecting operating profit.")})]})]})]})]})})]})}))},37351:(e,a,s)=>{s.d(a,{K4:()=>l,lb:()=>n,qk:()=>i,r$:()=>o,vv:()=>t});const t=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"AED";return new Intl.NumberFormat("en-AE",{style:"currency",currency:a,minimumFractionDigits:2,maximumFractionDigits:2}).format(e||0)},n=(e,a)=>{const s=Number(e)||0,t=Number(a)||0;return Number((s+t).toFixed(2))},i=(e,a)=>{const s=Number(e)||0,t=Number(a)||0;return Number((s-t).toFixed(2))},l=(e,a)=>Array.isArray(e)?e.reduce(((e,s)=>n(e,s[a])),0):0,o=function(e,a){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Equation";const t=Math.abs(i(e,a)),n=t<.01;return n||console.warn(`[Financial Integrity Check Failed] ${s}: Left=${e}, Right=${a}, Diff=${t}`),n}},58406:(e,a,s)=>{s.d(a,{A:()=>t});const t=(0,s(44489).A)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]])},51107:(e,a,s)=>{s.d(a,{A:()=>t});const t=(0,s(44489).A)("arrow-right-left",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]])},96958:(e,a,s)=>{s.d(a,{A:()=>t});const t=(0,s(44489).A)("wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]])}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.