• 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
..
Academies Loading commit data...
AcademyContracts Loading commit data...
AccessMatrix Loading commit data...
Accounting Loading commit data...
Achievements Loading commit data...
ActivitySubscriptions Loading commit data...
Alerts Loading commit data...
Archive Loading commit data...
Audit Loading commit data...
Auth Loading commit data...
Branches Loading commit data...
Carnets Loading commit data...
Cashier Loading commit data...
Children Loading commit data...
Coaches Loading commit data...
Dashboard Loading commit data...
Death Loading commit data...
Disciplines Loading commit data...
Divorce Loading commit data...
Documents Loading commit data...
Facilities Loading commit data...
FacilityDashboards Loading commit data...
FacilityGrids Loading commit data...
Fines Loading commit data...
Foreign Loading commit data...
Forms Loading commit data...
HR Loading commit data...
Honorary Loading commit data...
Installments Loading commit data...
Interviews Loading commit data...
Inventory Loading commit data...
MatchCenter Loading commit data...
MedicalBoard Loading commit data...
Members Loading commit data...
News Loading commit data...
Notifications Loading commit data...
ParentPortal Loading commit data...
Payments Loading commit data...
PlayerAffairs Loading commit data...
PlayerApi Loading commit data...
PlayerAuth Loading commit data...
PlaygroundAdmin Loading commit data...
PoolManagement Loading commit data...
Pricing Loading commit data...
Procurement Loading commit data...
Receipts Loading commit data...
Rentals Loading commit data...
Reports Loading commit data...
Reservations Loading commit data...
Roles Loading commit data...
Rules Loading commit data...
Sales Loading commit data...
Scheduling Loading commit data...
Seasonal Loading commit data...
ServiceCatalog Loading commit data...
Sessions Loading commit data...
Settings Loading commit data...
Sports Loading commit data...
SportsActivity Loading commit data...
SportsDashboard Loading commit data...
Spouses Loading commit data...
Subscriptions Loading commit data...
Support Loading commit data...
Temporary Loading commit data...
Tournaments Loading commit data...
TrainerPortal Loading commit data...
Training Loading commit data...
TrainingGroups Loading commit data...
Transfers Loading commit data...
Treasury Loading commit data...
Tutorials Loading commit data...
Users Loading commit data...
Waiver Loading commit data...
Workflow Loading commit data...