• Mahmoud Aglan's avatar
    fix(accounting): balance sheet did not balance — accumulated profit was omitted · e06900e1
    Mahmoud Aglan authored
    Assets came to 124,051,895.29 against liabilities + equity of 84,950,136.58.
    Out by 39,101,758.71 — a balance sheet that does not balance.
    
    Cause: the sheet added only the CURRENT fiscal year's net income to equity. No
    year-end closing entry has ever been posted here (period_closings is empty), so
    the revenue and expense accounts still carry all-time balances and retained
    earnings has never absorbed prior years. The earlier years' profit therefore sat
    in the income accounts and appeared nowhere on the sheet.
    
    Verified against the live ledger:
      liabilities                     79,821,436.63
      revenue - expenses (all time)   44,230,458.66   (80,820,684.83 - 36,590,226.17)
                                     ---------------
                                     124,051,895.29 = total assets, exactly
    
    Accumulated profit now runs from the first posted entry rather than the fiscal
    year start. This stays correct after closing entries begin: a closing entry moves
    the profit into retained earnings and zeroes the income accounts, so the figure
    then covers only post-closing activity while the closed profit sits in the equity
    accounts. The current fiscal year's slice is still returned separately, as
    current_period_net_income, because that is what the board asks about.
    
    Note for the chart: there are no accounts typed 'equity' at all — capital (2101)
    and retained earnings (210201) are typed 'liability'. That is why total_equity
    consists solely of the accumulated-profit line. The sheet balances either way,
    but the classification is worth revisiting with the accountants.
    Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
    e06900e1
Name
Last commit
Last update
..
Reports Loading commit data...
Revenue Loading commit data...
AccountStatementService.php Loading commit data...
AccountingIntegrationService.php Loading commit data...
BankLoanService.php Loading commit data...
BankReconciliationService.php Loading commit data...
BudgetService.php Loading commit data...
CheckLifecycleService.php Loading commit data...
CrossEntitySettlementService.php Loading commit data...
DailyCashMovementService.php Loading commit data...
DailyTransactionService.php Loading commit data...
DocumentaryCreditService.php Loading commit data...
FinancialReportService.php Loading commit data...
GLSyncService.php Loading commit data...
JournalService.php Loading commit data...
LedgerService.php Loading commit data...
LetterOfGuaranteeService.php Loading commit data...
MultiCurrencyService.php Loading commit data...
PeriodClosingService.php Loading commit data...
StatementIntegrationService.php Loading commit data...