# Changelog

## v1.1.7

- Added a stable, separate attachment directory for every company under `public/storage/uploads/companies/company-{id}/`.
- Added standard `members`, `users`, `loans`, and `documents` subfolders for each company.
- New Member photos and NID files are now written only inside the active company's folder.
- Company-user profile pictures are stored inside their own company folder; the global Developer profile uses `public/storage/uploads/global/users/`.
- New company onboarding now creates the complete attachment directory tree automatically.
- Added the one-time `bin/migrate_company_attachments_v117.php` utility to move legacy Member/User files and update database paths.
- Added Windows and Linux/macOS migration launchers.
- No database schema migration is required.

## v1.1.6

- Removed the demo password hint from the public login page.
- Demo credentials remain available only in project documentation for authorized setup/testing.


## v1.1.5

- Fixed Member registration responses that could be corrupted by undefined optional-field warnings and appear as an invalid HTTP 422 response after the member had already been created.
- Made Member creation atomic: uploaded files are validated first, the database insert runs in one transaction, and newly written files are removed automatically if the transaction fails.
- Corrected Member Photo, NID Front, and NID Back storage to `public/storage/uploads/members`, matching the public URLs stored in the database.
- Added clear upload errors for file size, partial uploads, unsupported types, temporary-folder issues, and unwritable storage directories.
- Added server `post_max_size` detection and client-side per-file size validation.
- Added current attachment links on Member Edit and member photos in the directory.
- Added a legacy upload migration utility to move existing Member files from the old private storage path into the public upload path without changing database URLs.
- Standardized form actions so the primary Save/Submit button appears before Cancel on Member, Savings, and Loan forms.
- Bumped CSS/JavaScript assets, Composer metadata, and the PWA cache to v1.1.5.

## v1.1.4

- Fixed Savings account reactivation so an inactive account can be restored to Active reliably from either the list action or Edit page.
- Clears stale `closed_at` values and synchronizes `current_balance` from the latest savings transaction during reactivation.
- Moved **New Loan Application** to a dedicated `/loans/create` page instead of placing the form below the Loan register.
- Added secure member autocomplete by member ID, name, Bangla name, or mobile for new and editable loan applications.
- Replaced separate Requested Amount and Approved Amount fields on Loan Management screens with a single **Amount** field while preserving the approval workflow internally.
- Merged Activity-page and Notification-page access into one company-wise `company_tools.view` permission.
- Kept Notification Sending as a separate capability and enforced combined page access on the send API.
- Redesigned Admin Settings and Developer company-permission controls with grouped cards, clearer summaries, value-type-aware controls, and premium responsive styling.
- Fixed unchanged Admin setting submissions so saving an existing value no longer produces a false permission error.
- Added migration `20260627_v1.1.4_savings_loans_permissions_settings.sql` and bumped application/PWA assets to v1.1.4.

## v1.1.3

- Added company-wise Notification page permissions for Admin, Manager, Collector, and Accountant.
- Added separate `notifications.view` and `notifications.send` switches in Developer → Company Settings.
- Enforced Notification permissions in the sidebar menu, page route, direct URL access, send button, and protected send API.
- Added safe permission dependency rules: enabling Send also enables View; disabling View also disables Send.
- Added read-only Notification log mode for roles that may view but may not send.
- Added default permission rules for existing companies and newly created companies.
- Added migration `20260627_v1.1.3_notification_permissions.sql` and updated the User Manual.

## v1.1.2

- Moved the account profile control to the far-right of the top bar immediately after Collection.
- Redesigned the account dropdown with icon-first, left-aligned rows for user identity, My Profile, and Logout.
- Added the company-specific `member_qr_card` feature switch in the Developer panel; it is disabled by default for existing and newly created companies.
- Hidden Member QR Card actions and blocked direct QR Card routes while the feature is disabled.
- Added premium gradient Edit buttons with a pencil icon, hover sheen, and accessible focus treatment across Member, Savings, Loan, Company, and future `/edit` actions.
- Added migration `20260627_v1.1.2_profile_qr_edit_ui.sql` for the QR feature row and profile helper translations.
- Bumped application metadata, CSS/JS asset versions, and PWA cache to v1.1.2.

## v1.1.1

- Rebuilt Reports as a multi-report command center with Overview, Member, Savings, Loan, Collection, and Financial tabs.
- Added shared 7/15/30/45/60/90-day and custom date filtering across every report.
- Added data-driven metric cards, management insights, responsive charts, category/status breakdowns, and searchable responsive tables.
- Added UTF-8 Excel/CSV export for every report type, including all matching records and summary metrics.
- Added Dompdf-based A4 landscape PDF export with a print-page fallback when Dompdf is unavailable.
- Added dedicated print-ready output for every report type with company details, metrics, insights, full records, signature lines, and database-controlled Developer branding.
- Added report permissions so `reports.view` controls viewing/printing and `reports.export` controls Excel/PDF downloads.
- Expanded the User Manual with step-by-step Member, Savings, Loan, date-filter, Excel, PDF, and print instructions.
- Added database migration `20260627_v1.1.1_reporting_center.sql` for the new database-backed report translations.
- Bumped CSS, JavaScript metadata, Composer package version, and PWA cache to v1.1.1.

## v1.0.9

- Added Developer-only Company Edit pages for identity, localization, subscription, and status management.
- Added a separate settings workspace for every company with independent feature switches, tenant settings, Admin visibility policy, and Activity permissions.
- Made the Fines module a strict company-level feature; disabled companies no longer see the menu and cannot access its routes.
- Added company-specific Activity page permission overrides for Admin, Manager, Collector, and Accountant.
- Isolated Developer audit records from every tenant Activity page and added a private Developer Activity page.
- Added automatic savings current-balance synchronization from the transaction ledger, including database triggers and ledger-derived display values.
- Replaced the generic Notifications placeholder with a working notification composer, template preview, member/recipient selection, provider feature checks, and delivery logs.
- Added a provider-free in-app notice template so the Notifications page can be tested before SMS or WhatsApp credentials are configured.
- Added a professional profile page for every role with profile-picture upload, contact/language update, and password change.
- Added a top-right account menu and a persistent Logout action at the bottom of the sidebar for every user.
- Changed all footer/print branding so `developer_url` is used only as the link behind `developer_name`.
- Added migration `database/migrations/20260627_v1.0.9_company_profile_activity_notifications.sql`.
- Bumped CSS, JavaScript, Composer metadata, and PWA cache versions to v1.0.9.

## v1.0.8

- Added Admin/Developer-only Member Edit pages and server-side role enforcement.
- Added Savings Edit pages. Admin and Developer always have access; the Developer can expose or hide Savings Edit for other roles with the per-company `savings_edit_all_users` switch.
- Added Admin/Developer-only Savings Active/Inactive controls and database support for the `inactive` status.
- Added Admin/Developer-only Loan Edit pages. Loans are permanently locked for editing after the first installment payment is received.
- Rebuilds an unpaid installment schedule safely when an already-disbursed loan is edited before its first payment.
- Made Member Directory, Accounting Transactions, Developer tables, and all current/future data tables responsive on mobile.
- Added custom print pages with Print and Back buttons for Members, Savings, Loans, Accounting, Activity, Fines, Collectors, and Reports.
- Fixed Activity Log printing.
- Renamed the collection module and route to `/collections` and removed the previous wording from all visible application text.
- Added migration `database/migrations/20260627_v1.0.8_edit_responsive_print.sql`.
- Bumped CSS, JavaScript, Composer metadata, and PWA cache versions to v1.0.8.

## v1.0.7

- Fixed mobile overflow in Dashboard `Collection Trend` and `Quick Workflow` panels.
- Fixed mobile overflow in Reports `Financial Collection Trend` and `Operational Summary` panels.
- Added strict min-width handling and responsive Chart.js canvas sizing for small screens.
- Added wrapping and compact spacing for report summaries, panel headers, filters, and action buttons.
- Converted generic module record tables into mobile card rows below 620px.
- Added the missing Savings `Date` column using each account's opening date.
- Bumped CSS, JavaScript, and PWA cache versions to v1.0.7.

## v1.0.6

- Fixed the `sidebarToggle` button on desktop and mobile layouts.
- Desktop navigation now collapses to an icon-only rail and remembers the preference in local storage.
- Mobile navigation now opens as an off-canvas drawer with a backdrop, Escape-key support, and automatic closing after navigation.
- Added `aria-controls` and synchronized `aria-expanded` state for accessibility.
- Added sidebar menu tooltips in collapsed mode.
- Corrected the RTL sidebar margin variable.
- Bumped CSS, JavaScript, and PWA cache versions to v1.0.6.

## v1.0.5

- Fixed report cards showing `Undefined array key` warnings by correcting view-variable extraction and passing a dedicated report summary variable.
- Added defensive report defaults so empty datasets render as zero values without warnings.
- Implemented database-backed Bangla, English, and Arabic UI translations for the main layout, dashboard, reports, and Admin settings page.
- Language switching now uses the session locale immediately, persists to the user record, reloads the interface, and applies database-configured RTL direction.
- Restricted the Admin settings page to explicitly visible, non-secret, company-scoped settings only.
- Global branding, Developer, security, and platform settings can no longer appear in the Admin panel.
- Added Developer controls for setting company-setting visibility and editability.
- Added the required database migration in `database/migrations/20260626_v1.0.5_reports_language_settings.sql`.
- Bumped PWA asset cache to v1.0.5.

## v1.0.4

- Added a secure Developer company-workspace selector for multi-tenant operations.
- Fixed `A company context is required` errors on Members, Savings, Loans, Collections, Accounting, Reports, and related pages.
- Developer users can now open a company workspace while retaining access to the global Developer console.
- Automatically selects the company on single-tenant installations.
- Added tenant-context middleware so missing context redirects safely instead of producing a PHP fatal error.
- Tenant-specific settings, audit logs, dashboard statistics, and module queries now use the selected Developer workspace.
- Tenant-only sidebar items stay hidden until a company workspace is available.

## v1.0.3

- Fixed `Call to undefined function e()` on the Developer dashboard and other content views.
- Moved the HTML escaping helper into `app/helpers.php`.
- Loaded global helpers during application bootstrap, before any view file is rendered.
- Removed duplicate helper declarations from application, guest, and print layouts.

## v1.0.2

- Fixed PDO native-prepared-statement login placeholders.
- Improved JSON exception responses and server-side error logging.

## v1.0.1

- Added PHP development-server static asset passthrough.
- Added secure non-JavaScript POST login fallback.
