Commit Graph

20 Commits

Author SHA1 Message Date
d923dc6c29 Fix: Template delete page refresh + add debug logging
ISSUE: Template delete returns success but record appears not deleted

ROOT CAUSE: Delete WAS working (verified in database), but page wasn't refreshing properly after success

CHANGES:

1. JavaScript fix (discharge_templates.php):
   - Replaced conditional load_form_div / location.assign logic
   - Now uses simple location.reload() after 500ms delay
   - Ensures page always refreshes after successful delete

2. Controller debug logging (Template.php):
   - Added comprehensive debug logs to trace delete flow
   - Logs: request ID, row fetch, query compilation, affected rows
   - Logs error codes and messages for troubleshooting
   - Will help diagnose future issues

VERIFIED:
- Database confirmed template ID 2 was deleted
- Only frontend refresh was failing
- Now forces reload to show updated list
2026-06-07 11:32:24 +05:30
f341e8e76e fix(discharge-template): make delete endpoint reliable for URL and AJAX 2026-06-05 07:37:39 +05:30
171ff50155 fix(template): backfill discharge template columns for legacy schemas 2026-06-05 07:20:43 +05:30
fdb7c15f85 Fix discharge template page edit flow and AJAX save/delete 2026-06-05 07:12:58 +05:30
ecb55e7329 Add page settings and header footer support to discharge templates 2026-06-05 06:22:13 +05:30
7253fa0cca Improve radiology template workflow and editor stability 2026-05-30 18:01:20 +05:30
78c23af7e5 Checkpoint: pathology panel modal workflow, gateway component search, and ABDM-style component/print editors 2026-05-30 06:32:30 +05:30
2977192017 Make IPD forms dynamic and stop stale OPD refresh polling 2026-04-08 11:41:33 +05:30
1a2dbf5366 feat: upgrade IPD Document Master to OPD-style print builder
- 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
2026-04-08 07:56:43 +05:30
9d2f91e73a Pathology report list: optional hc_items filter with null-safe fallback 2026-04-03 16:15:23 +05:30
ab4b9a39f8 Pathology report list: exclude mixed ultrasound by requiring lab_repotests mapping 2026-04-03 16:09:50 +05:30
d9e4d50dc6 Pathology report list: include all lab_repo templates even if group mapping missing 2026-04-03 16:06:26 +05:30
721f374521 Pathology report list: show templates without strict hc_items join filter 2026-04-03 16:03:12 +05:30
874d5ffba6 feat: add granular template permissions for role-based template access
- add new permissions:
  template.opd_print, template.pathology_print, template.diagnosis_print,
  template.document_print, template.ipd_document
- Template controller now accepts new permission keys (with backward-compatible fallbacks)
- IPD Document Master now has independent permission key (template.ipd_document)
- Template index tile visibility updated to use new granular keys
- OPD print template builder now honors template.opd_print permission
- preserve existing behavior via legacy permission fallbacks to avoid role breakage
2026-03-31 06:35:36 +05:30
99ec71677a Restore legacy HMS flows and add IPD document master templates 2026-03-24 04:24:19 +05:30
addef91468 Fix legacy billing prints and pathology template compatibility 2026-03-21 02:23:31 +05:30
d94797a433 Implement finance phase 2 pharmacy workflow and admin hospital/pharmacy profile settings 2026-03-17 04:05:02 +05:30
1dee940ac0 feat(diagnosis): add print templates with image upload and optimize PDF rendering 2026-03-15 06:50:44 +05:30
aa845ac5ff Add report panel updates and related billing/discharge enhancements 2026-03-10 02:43:35 +05:30
614713f76b Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30