import type { FinancialStatement } from "../../../../types/financials"; import type { FinancialSubTab } from "./model"; function financialRatio( numerator: number | undefined, denominator: number | undefined, ): number | undefined { if (numerator == null || denominator == null || denominator === 0) return undefined; return numerator / denominator; } const LOWER_IS_BETTER = "lower" as const; const NEUTRAL_GROWTH = "neutral" as const; export const FINANCIAL_SUB_TABS: FinancialSubTab[] = [ { name: "Income", key: "income", rows: [ { kind: "group", id: "income:revenue", label: "Revenue", summaryKey: "totalRevenue", defaultExpanded: true, children: [ { label: "Operating Revenue", key: "operatingRevenue", format: "compact" }, { label: "Cost of Revenue", key: "costOfRevenue", format: "compact", growthDirection: LOWER_IS_BETTER }, { label: "Gross Profit", key: "grossProfit", format: "compact" }, ], }, { kind: "group", id: "income:operating", label: "Operating Inc", summaryKey: "operatingIncome", defaultExpanded: true, children: [ { label: "R&D", key: "researchAndDevelopment", format: "compact", growthDirection: LOWER_IS_BETTER }, { label: "SG&A", key: "sellingGeneralAndAdministration", format: "compact", growthDirection: LOWER_IS_BETTER }, { // Only the D&A presented as its own operating expense line; most // companies carry the rest in cost of revenue. Total D&A is on the // cash flow statement. label: "D&A in OpEx", key: "depreciationAndAmortizationInIncomeStatement", format: "compact", growthDirection: LOWER_IS_BETTER, }, { label: "Operating Exp", key: "operatingExpense", format: "compact", growthDirection: LOWER_IS_BETTER }, { label: "Total Expenses", key: "totalExpenses", format: "compact", growthDirection: LOWER_IS_BETTER }, { label: "EBITDA", key: "ebitda", format: "compact" }, ], }, { kind: "group", id: "income:net", label: "Net Income", summaryKey: "netIncome", defaultExpanded: true, children: [ { label: "Other Income/Exp", key: "otherIncomeExpense", format: "compact", growthDirection: NEUTRAL_GROWTH }, { label: "Other Non-Op", key: "otherNonOperatingIncomeExpenses", format: "compact", growthDirection: NEUTRAL_GROWTH }, { label: "Interest Exp", key: "interestExpense", format: "compact", growthDirection: LOWER_IS_BETTER }, { label: "Pretax Income", key: "pretaxIncome", format: "compact" }, { label: "Tax Provision", key: "taxProvision", format: "compact", growthDirection: LOWER_IS_BETTER }, { label: "Income Common", key: "netIncomeCommonStockholders", format: "compact" }, { label: "Income incl. NCI", key: "netIncomeIncludingNoncontrollingInterests", format: "compact" }, { label: "Continuing Ops", key: "netIncomeContinuousOperations", format: "compact" }, { label: "Normalized Inc", key: "normalizedIncome", format: "compact" }, ], }, { kind: "group", id: "income:margins", label: "Margins", defaultExpanded: true, children: [ { label: "Gross Margin", id: "gross-margin", compute: (statement) => financialRatio(statement.grossProfit, statement.totalRevenue), format: "percent", }, { label: "Operating Margin", id: "operating-margin", compute: (statement) => financialRatio(statement.operatingIncome, statement.totalRevenue), format: "percent", }, { label: "Net Margin", id: "net-margin", compute: (statement) => financialRatio(statement.netIncome, statement.totalRevenue), format: "percent", }, { label: "R&D / Revenue", id: "rd-revenue", compute: (statement) => financialRatio(statement.researchAndDevelopment, statement.totalRevenue), format: "percent", growthDirection: LOWER_IS_BETTER, }, { label: "SG&A / Revenue", id: "sga-revenue", compute: (statement) => financialRatio(statement.sellingGeneralAndAdministration, statement.totalRevenue), format: "percent", growthDirection: LOWER_IS_BETTER, }, ], }, { kind: "group", id: "income:per-share", label: "Per Share", summaryKey: "eps", format: "eps", children: [ { label: "Basic EPS", key: "basicEps", format: "eps" }, { label: "Diluted EPS", key: "eps", format: "eps" }, { label: "Avg Basic Shares", key: "basicShares", format: "compact", growthDirection: LOWER_IS_BETTER }, { label: "Avg Diluted Shares", key: "dilutedShares", format: "compact", growthDirection: LOWER_IS_BETTER }, ], }, ], }, { name: "Cash Flow", key: "cashflow", rows: [ { kind: "group", id: "cashflow:free-cash-flow", label: "Free Cash Flow", summaryKey: "freeCashFlow", defaultExpanded: true, children: [ { label: "Operating CF", key: "operatingCashFlow", format: "compact" }, { label: "CapEx", key: "capitalExpenditure", format: "compact" }, ], }, { kind: "group", id: "cashflow:operating", label: "Operating", summaryKey: "operatingCashFlow", defaultExpanded: true, children: [ { label: "Net Income", key: "netIncome", format: "compact" }, { label: "D&A", key: "depreciationAndAmortization", format: "compact" }, { label: "Depreciation", key: "depreciation", format: "compact" }, { label: "D&A Depletion", key: "depreciationAmortizationDepletion", format: "compact" }, { label: "Deferred Tax", id: "cashflow:deferred-tax", compute: (statement) => statement.deferredIncomeTax ?? statement.deferredTax, format: "compact", }, { label: "Stock-Based Comp", key: "stockBasedCompensation", format: "compact" }, { label: "Other Noncash", key: "otherNonCashItems", format: "compact" }, { kind: "group", id: "cashflow:working-capital", label: "Working Capital", summaryKey: "changeInWorkingCapital", children: [ { label: "Receivables", key: "changeInReceivables", format: "compact" }, { label: "Inventory", key: "changeInInventory", format: "compact" }, { label: "Payables", key: "changeInPayable", format: "compact" }, { label: "Acct Payable", key: "changeInAccountPayable", format: "compact" }, { label: "Other Working Cap", key: "changeInOtherWorkingCapital", format: "compact" }, ], }, { label: "Continuing Op CF", key: "cashFlowFromContinuingOperatingActivities", format: "compact" }, { label: "Interest Paid", key: "interestPaidSupplementalData", format: "compact" }, { label: "Tax Paid", key: "incomeTaxPaidSupplementalData", format: "compact" }, ], }, { kind: "group", id: "cashflow:investing", label: "Investing", summaryKey: "investingCashFlow", defaultExpanded: true, children: [ { label: "Purchase PPE", key: "purchaseOfPPE", format: "compact" }, { label: "Sale PPE", key: "saleOfPPE", format: "compact" }, { label: "Net PPE", key: "netPPEPurchaseAndSale", format: "compact" }, { label: "Acquisitions", key: "purchaseOfBusiness", format: "compact" }, { label: "Business Sales", key: "saleOfBusiness", format: "compact" }, { label: "Net Business", key: "netBusinessPurchaseAndSale", format: "compact" }, { label: "Buy Investments", key: "purchaseOfInvestment", format: "compact" }, { label: "Sell Investments", key: "saleOfInvestment", format: "compact" }, { label: "Net Investments", key: "netInvestmentPurchaseAndSale", format: "compact" }, { label: "Other Investing", key: "netOtherInvestingChanges", format: "compact" }, { label: "Continuing Inv CF", key: "cashFlowFromContinuingInvestingActivities", format: "compact" }, ], }, { kind: "group", id: "cashflow:financing", label: "Financing", summaryKey: "financingCashFlow", defaultExpanded: true, children: [ { label: "Debt Issuance", key: "issuanceOfDebt", format: "compact" }, { label: "Debt Repayment", key: "repaymentOfDebt", format: "compact" }, { label: "Net Debt", key: "netIssuancePaymentsOfDebt", format: "compact" }, { label: "LT Debt Issuance", key: "longTermDebtIssuance", format: "compact" }, { label: "LT Debt Payments", key: "longTermDebtPayments", format: "compact" }, { label: "Net LT Debt", key: "netLongTermDebtIssuance", format: "compact" }, { label: "ST Debt Issuance", key: "shortTermDebtIssuance", format: "compact" }, { label: "ST Debt Payments", key: "shortTermDebtPayments", format: "compact" }, { label: "Net ST Debt", key: "netShortTermDebtIssuance", format: "compact" }, { label: "Buybacks", key: "repurchaseOfCapitalStock", format: "compact" }, { label: "Stock Issuance", key: "commonStockIssuance", format: "compact" }, { label: "Stock Payments", key: "commonStockPayments", format: "compact" }, { label: "Net Stock", key: "netCommonStockIssuance", format: "compact" }, { label: "Dividends Paid", key: "cashDividendsPaid", format: "compact" }, { label: "Common Dividends", key: "commonStockDividendPaid", format: "compact" }, { label: "Other Financing", key: "netOtherFinancingCharges", format: "compact" }, { label: "Continuing Fin CF", key: "cashFlowFromContinuingFinancingActivities", format: "compact" }, ], }, { kind: "group", id: "cashflow:cash-position", label: "Cash Position", summaryKey: "endCashPosition", defaultExpanded: true, children: [ { label: "Beginning Cash", key: "beginningCashPosition", format: "compact" }, { label: "Change in Cash", key: "changesInCash", format: "compact" }, { label: "FX Effect", key: "effectOfExchangeRateChanges", format: "compact" }, ], }, ], }, { name: "Balance Sheet", key: "balance", rows: [ { kind: "group", id: "balance:assets", label: "Total Assets", summaryKey: "totalAssets", defaultExpanded: true, children: [ { kind: "group", id: "balance:current-assets", label: "Current Assets", summaryKey: "currentAssets", defaultExpanded: true, children: [ { label: "Cash & Equiv", key: "cashAndCashEquivalents", format: "compact" }, { label: "Cash + ST Inv", key: "cashCashEquivalentsAndShortTermInvestments", format: "compact" }, { label: "ST Investments", key: "otherShortTermInvestments", format: "compact" }, { label: "Receivables", key: "receivables", format: "compact" }, { label: "Accounts Rec", key: "accountsReceivable", format: "compact" }, { label: "Inventory", key: "inventory", format: "compact" }, { label: "Prepaids", key: "prepaidAssets", format: "compact" }, { label: "Other Current", key: "otherCurrentAssets", format: "compact" }, ], }, { kind: "group", id: "balance:non-current-assets", label: "Non-Current Assets", summaryKey: "totalNonCurrentAssets", children: [ { label: "Net PPE", key: "netPPE", format: "compact" }, { label: "Gross PPE", key: "grossPPE", format: "compact" }, { label: "Accum Deprec", key: "accumulatedDepreciation", format: "compact" }, { label: "Goodwill + Intang", key: "goodwillAndOtherIntangibleAssets", format: "compact" }, { label: "Goodwill", key: "goodwill", format: "compact" }, { label: "Other Intang", key: "otherIntangibleAssets", format: "compact" }, { label: "Investments", key: "investmentsAndAdvances", format: "compact" }, { label: "LT Investments", key: "longTermEquityInvestment", format: "compact" }, { label: "Other Non-Current", key: "otherNonCurrentAssets", format: "compact" }, ], }, ], }, { kind: "group", id: "balance:liabilities", label: "Total Liab", summaryKey: "totalLiabilities", growthDirection: LOWER_IS_BETTER, defaultExpanded: true, children: [ { kind: "group", id: "balance:current-liabilities", label: "Current Liab", summaryKey: "currentLiabilities", growthDirection: LOWER_IS_BETTER, defaultExpanded: true, children: [ { label: "Accounts Pay", key: "accountsPayable", format: "compact", growthDirection: LOWER_IS_BETTER }, { label: "Payables", key: "payables", format: "compact", growthDirection: LOWER_IS_BETTER }, { label: "Payables + Accr", key: "payablesAndAccruedExpenses", format: "compact", growthDirection: LOWER_IS_BETTER, }, { label: "Accrued Exp", key: "currentAccruedExpenses", format: "compact", growthDirection: LOWER_IS_BETTER }, { label: "Deferred Rev", key: "currentDeferredRevenue", format: "compact", growthDirection: NEUTRAL_GROWTH }, { label: "Deferred Liab", key: "currentDeferredLiabilities", format: "compact", growthDirection: LOWER_IS_BETTER }, { label: "Current Debt", key: "currentDebt", format: "compact", growthDirection: LOWER_IS_BETTER }, { label: "Curr Debt+Lease", key: "currentDebtAndCapitalLeaseObligation", format: "compact", growthDirection: LOWER_IS_BETTER, }, { label: "Other Current", key: "otherCurrentLiabilities", format: "compact", growthDirection: LOWER_IS_BETTER }, ], }, { kind: "group", id: "balance:non-current-liabilities", label: "Non-Current Liab", summaryKey: "totalNonCurrentLiabilities", growthDirection: LOWER_IS_BETTER, children: [ { label: "Long-Term Debt", key: "longTermDebt", format: "compact", growthDirection: LOWER_IS_BETTER }, { label: "LT Debt+Lease", key: "longTermDebtAndCapitalLeaseObligation", format: "compact", growthDirection: LOWER_IS_BETTER, }, { label: "LT Lease", key: "longTermCapitalLeaseObligation", format: "compact", growthDirection: LOWER_IS_BETTER }, { label: "Deferred Liab", key: "nonCurrentDeferredLiabilities", format: "compact", growthDirection: LOWER_IS_BETTER }, { label: "Deferred Tax Liab", key: "nonCurrentDeferredTaxesLiabilities", format: "compact", growthDirection: LOWER_IS_BETTER, }, { label: "Other Non-Current", key: "otherNonCurrentLiabilities", format: "compact", growthDirection: LOWER_IS_BETTER }, ], }, { label: "Total Debt", key: "totalDebt", format: "compact", growthDirection: LOWER_IS_BETTER }, { label: "Lease Obligations", key: "capitalLeaseObligations", format: "compact", growthDirection: LOWER_IS_BETTER }, { label: "Total Capitalization", key: "totalCapitalization", format: "compact" }, ], }, { kind: "group", id: "balance:equity-capital", label: "Equity", summaryKey: "totalEquity", defaultExpanded: true, children: [ { label: "Retained Earn", key: "retainedEarnings", format: "compact" }, { label: "Common Equity", key: "commonStockEquity", format: "compact" }, { label: "Common Stock", key: "commonStock", format: "compact" }, { label: "Capital Stock", key: "capitalStock", format: "compact" }, { label: "APIC", key: "additionalPaidInCapital", format: "compact" }, { label: "Treasury Stock", key: "treasuryStock", format: "compact" }, { label: "AOCI", key: "gainsLossesNotAffectingRetainedEarnings", format: "compact" }, { label: "Other Equity Adj", key: "otherEquityAdjustments", format: "compact" }, { label: "Equity + Minority", key: "totalEquityGrossMinorityInterest", format: "compact" }, { label: "Working Capital", key: "workingCapital", format: "compact" }, { label: "Invested Capital", key: "investedCapital", format: "compact" }, { label: "Net Tangible", key: "netTangibleAssets", format: "compact" }, { label: "Tangible Book", key: "tangibleBookValue", format: "compact" }, { label: "Shares Issued", key: "shareIssued", format: "compact" }, { label: "Ordinary Shares", key: "ordinarySharesNumber", format: "compact" }, { label: "Treasury Shares", key: "treasurySharesNumber", format: "compact" }, ], }, { label: "Liab + Equity", id: "balance:liabilities-equity", compute: (statement) => { if (statement.totalLiabilities == null || statement.totalEquityGrossMinorityInterest == null) return undefined; return statement.totalLiabilities + statement.totalEquityGrossMinorityInterest; }, format: "compact", }, ], }, ];