namespace General_Ledger_Service.DTOs.Reports { public class GeneralLedgerLineDto { public DateOnly EntryDate { get; set; } public string JournalNo { get; set; } = string.Empty; public string AccountCode { get; set; } = string.Empty; public string AccountName { get; set; } = string.Empty; public string? Narration { get; set; } public decimal DebitAmount { get; set; } public decimal CreditAmount { get; set; } public decimal RunningBalance { get; set; } } // Retrofit 2026-07-22 - flat, no depth/indentation (05_LKAS_Report_PDF_Templates.md Section 2). public class TrialBalanceRowDto { public string AccountCode { get; set; } = string.Empty; public string AccountName { get; set; } = string.Empty; public decimal Debit { get; set; } public decimal Credit { get; set; } } // Retrofit 2026-07-31 - restructured around accounts.balance_sheet_classification // (Accounting_System_Design_LKAS.md Section 11.3), replacing the old flat // {depth, lineItem, accountType, balance} recursive-rollup array entirely - same // leaf-rows-plus-tag pattern as ProfitAndLossLeafRowDto/income_statement_section below. public class BalanceSheetLineDto { public string AccountCode { get; set; } = string.Empty; public string AccountName { get; set; } = string.Empty; public decimal Balance { get; set; } } public class BalanceSheetSectionDto { public List Lines { get; set; } = []; public decimal Total { get; set; } } public class BalanceSheetReportDto { public DateOnly AsOfDate { get; set; } public BalanceSheetSectionDto NonCurrentAssets { get; set; } = new(); public BalanceSheetSectionDto CurrentAssets { get; set; } = new(); public BalanceSheetSectionDto UnclassifiedAssets { get; set; } = new(); public decimal TotalAssets { get; set; } public BalanceSheetSectionDto Equity { get; set; } = new(); public BalanceSheetSectionDto NonCurrentLiabilities { get; set; } = new(); public BalanceSheetSectionDto CurrentLiabilities { get; set; } = new(); public BalanceSheetSectionDto UnclassifiedLiabilities { get; set; } = new(); public decimal TotalEquityAndLiabilities { get; set; } } // Leaf-row shape for AccountRepository.GetBalanceSheetLeafRowsAsync - Balance is // already sign-adjusted per account type (debit-normal Asset vs credit-normal // Liability/Equity), same convention the old recursive-rollup query used. ReportService // groups these into BalanceSheetReportDto's sections by AccountTypeId + BalanceSheetClassification // (same raw-projection -> public-DTO split as ProfitAndLossLeafRowDto above). public class BalanceSheetLeafRowDto { public string AccountCode { get; set; } = string.Empty; public string AccountName { get; set; } = string.Empty; public short AccountTypeId { get; set; } public string? BalanceSheetClassification { get; set; } public decimal Balance { get; set; } } // Retrofit 2026-07-22 - restructured around accounts.income_statement_section // (Accounting_System_Design_LKAS.md Section 11.4), replacing the old flat // {depth, lineItem, accountType, amount} array entirely. public class ProfitAndLossLineDto { public string AccountCode { get; set; } = string.Empty; public string AccountName { get; set; } = string.Empty; public decimal Amount { get; set; } } public class ProfitAndLossSectionDto { public List Lines { get; set; } = []; public decimal Total { get; set; } } public class ProfitAndLossReportDto { public DateOnly PeriodStart { get; set; } public DateOnly PeriodEnd { get; set; } public ProfitAndLossSectionDto Sales { get; set; } = new(); public ProfitAndLossSectionDto CostOfSales { get; set; } = new(); public decimal GrossProfit { get; set; } public ProfitAndLossSectionDto OtherIncome { get; set; } = new(); public ProfitAndLossSectionDto DistributionExpenses { get; set; } = new(); public ProfitAndLossSectionDto AdministrationExpenses { get; set; } = new(); public ProfitAndLossSectionDto OtherExpenses { get; set; } = new(); public ProfitAndLossSectionDto FinancialExpenses { get; set; } = new(); public ProfitAndLossSectionDto Unclassified { get; set; } = new(); public decimal NetProfitForPeriod { get; set; } } // Leaf-row shape for AccountRepository.GetProfitAndLossLeafRowsAsync - Amount is // the unflipped credit - debit; ReportService applies the sign convention // per income_statement_section when building ProfitAndLossReportDto. public class ProfitAndLossLeafRowDto { public string AccountCode { get; set; } = string.Empty; public string AccountName { get; set; } = string.Empty; public short AccountTypeId { get; set; } public string? IncomeStatementSection { get; set; } public decimal Amount { get; set; } } // Full LKAS 7 indirect-method cash flow — Accounting_System_Design_LKAS.md Section 11.5. public class CashFlowReportDto { public DateOnly PeriodStart { get; set; } public DateOnly PeriodEnd { get; set; } public CashFlowOperatingActivitiesDto OperatingActivities { get; set; } = new(); public CashFlowInvestingActivitiesDto InvestingActivities { get; set; } = new(); public CashFlowFinancingActivitiesDto FinancingActivities { get; set; } = new(); public decimal NetIncreaseDecreaseInCash { get; set; } public decimal OpeningCashBalance { get; set; } public decimal ClosingCashBalance { get; set; } } public class CashFlowOperatingActivitiesDto { public decimal ProfitForPeriod { get; set; } public List NonCashAdjustments { get; set; } = []; public List WorkingCapitalChanges { get; set; } = []; public decimal NetCashFromOperatingActivities { get; set; } } public class CashFlowNonCashAdjustmentDto { public string Description { get; set; } = string.Empty; public decimal Amount { get; set; } } public class CashFlowWorkingCapitalChangeDto { public string AccountCode { get; set; } = string.Empty; public string AccountName { get; set; } = string.Empty; // Retrofit 2026-07-22 - the account balance's own movement ("Increase"/"Decrease"), // independent of ChangeAmount's sign (cash impact, which flips between asset/liability // accounts) - see Accounting_System_Design_LKAS.md Section 11.5's retrofit note. public string Direction { get; set; } = string.Empty; public decimal ChangeAmount { get; set; } } public class CashFlowLineDto { public string AccountCode { get; set; } = string.Empty; public string AccountName { get; set; } = string.Empty; public decimal Amount { get; set; } } public class CashFlowInvestingActivitiesDto { public List Lines { get; set; } = []; public decimal NetCashFromInvestingActivities { get; set; } } public class CashFlowFinancingActivitiesDto { public List Lines { get; set; } = []; public decimal NetCashFromFinancingActivities { get; set; } } public class BudgetVsActualRowDto { public long BudgetLineId { get; set; } public string AccountCode { get; set; } = string.Empty; public string AccountName { get; set; } = string.Empty; public int PeriodId { get; set; } public decimal BudgetedAmount { get; set; } public decimal ActualAmount { get; set; } public decimal Variance { get; set; } } // Retrofit 2026-07-22 - Accounting_System_Design_LKAS.md Section 11.7. Replaces the // 2026-07-21 VAT/WHT/NBT per-tax_code summary wholesale, under the same TaxSummary // reportType name - a full corporate Income Tax Computation, current tax only (no deferred // tax anywhere in this schema). The superseded design is kept in the design doc marked // Section 11.7 (dagger) for reference only - not implemented here. public class IncomeTaxComputationDto { public DateOnly PeriodStart { get; set; } public DateOnly PeriodEnd { get; set; } public decimal ProfitBeforeTax { get; set; } public decimal NonDeductibleExpenses { get; set; } public decimal AllowableDeductions { get; set; } public decimal AdjustedBusinessProfit { get; set; } public decimal OtherTaxableIncome { get; set; } public decimal AssessableIncome { get; set; } public decimal QualifyingPaymentsReliefs { get; set; } public decimal TaxableIncome { get; set; } public decimal TaxRatePercent { get; set; } public decimal CorporateIncomeTax { get; set; } public decimal SurchargeAmount { get; set; } public decimal GrossTaxLiability { get; set; } public decimal ApitCredit { get; set; } public decimal WhtCredit { get; set; } public decimal QuarterlyTaxPayments { get; set; } public decimal BalanceTaxPayable { get; set; } } }