# ORION ACCOUNTS ERP (New Separate Project)

This is a brand-new project folder and does **not** replace the old dashboard.

## Location
`orion_accounts_erp`

## Features
- New branding and logo (`public/assets/logo.svg`)
- Admin/user login with role-based access
- Multi-company support (admin can switch company context)
- Generic CRUD pages for all accounting modules
- XLSX/CSV import for any module
- Auto-seeded demo dataset (target: 5 records per module)
- Full school chart of accounts seed (multi-level tree)
- Auto journal posting from Sales Invoices, Purchase Bills, and Payments
- Sales/Purchase tax toggle (`Taxable`) with automatic tax and grand total calculation
- Inline collection/payment inside Sales/Purchase entry with:
  - payment method
  - selected cash/bank account
  - separate tracking for in-entry paid amount vs linked payment vouchers
- Tax code selection from `Tax Rates` (auto-applies selected tax percentage)
- Linked accounting flow:
  - Invoice/Bill updates receivable/payable postings automatically
  - Payment updates linked invoice/bill paid status automatically
- Accounting Reports page:
  - Sidebar dropdown with separate report links:
    - Account Statement (Ledger)
    - Journal Book (account name, description, debit, credit)
    - Trial Balance
    - Income Statement
    - Balance Sheet
    - Cash Flow snapshot
- Direct navigation links:
  - From Sales/Purchase/Payments rows to the related journal entry
  - From journal entry rows back to source transaction
- Auto numbering for key movement documents when number field is left empty
- Report Designer:
  - Add multiple sections
  - Per section choose module, label column, and multiple comparison columns
  - Per section controls: Top N, sort mode, optional date column + date range
  - Save templates and render them on dashboard
  - Dashboard output supports multiple styles: bar, line, pie, and doughnut
- Floating print button
- Print stylesheet for A4 landscape

## Modules Included
- Companies
- Users
- Chart of Accounts
- Contacts
- Tax Rates
- Products
- Bank Accounts
- Cost Centers
- Projects
- Budgets
- Journal Entries
- Journal Entry Lines (auto-generated from source transactions)
- Sales Invoices
- Purchase Bills
- Payments
- Fixed Assets
- Employees
- Payroll Runs
- Inventory Movements
- Report Templates (managed from `reports.php`)

## Setup
1. Put the folder under your web server root (example: `htdocs/orion_accounts_erp`).
2. Edit database settings in:
   - `app/config.php`
3. Open:
- `http://localhost/orion_accounts_erp/public/login.php`

Accounting reports page:
- `http://localhost/orion_accounts_erp/public/accounting_reports.php`

The app auto-creates database/tables on first run.

## Default Admin
- Username: `admin`
- Password: `Admin@12345`

Change it immediately after first login from Users module.
