- Update isIpdDischargedInvoice to check ONLY ipd_status field (remove fallback checks)
- Add IPD status toggle UI in discharge panel (Active/Discharged control)
- Create toggleIpdStatus controller method with permission check
- Add billing.ipd.status.manage permission for controlling bill edit lock
- Allows editing bills when needed by toggling status independently of discharge_date
- Auto-releases bed when setting status to discharged
- Implemented automatic bed release on patient discharge
- Added bed transfer functionality in nursing workspace
- Added date/time tracking for bed assignments with duration calculation
- Fixed bed_master.current_ipd_id as source of truth for occupancy
- Created data fix scripts for existing records
- Added bed assignment history with duration display (hours/minutes)
- Fixed display issues in bed assignment tab
- Added route for bed transfer endpoint
- Supports custom assignment datetime for backdated entries
- Automatically marks previous bed as released on transfer
- Updated all controllers: Opd, Diagnosis, Billing\Charges, Billing\Ipd, Storestock, AbdmGateway
- freeserif provides better Unicode coverage and more readable font weight
- Ipd_discharge and DoctorDocument already used good fonts (freeserif/freesans)
- Added comprehensive font configuration documentation
Root cause: 50k+ invoices had insurance_case_id='0', and MySQL string comparison '0'='C26060004997' matched (both convert to numeric 0).
Fix: Exclude NULL/empty/'0' insurance_case_id before comparison in:
- getOrganizationCaseInvoiceRows() union query
- updateOrgTotals() aggregate queries
Result: Case C26060004997 now returns 9 rows instead of 56,786 (memory crash fixed)
- Add paper print settings to IPD templates (page size/custom size/margins)\n- Add Header HTML, Footer HTML, and Style (CSS) support\n- Update IPD PDF renderer to honor template paper settings and header/footer\n- Extend IPD placeholders with logo/QR support: {{H_logo}}, {{H_logo_abs}}, {{hospital_logo_html}}, {{qr_content}}, {{qr_code_html}}\n- Improve token rendering with robust curly placeholder parser for body/header/footer\n- Keep legacy sticker forms aligned with custom label dimensions and migrate old default rows