devsofttech_hms_ci4/app/Views/Setting
DevSoftTech Server d025111bcc Fix: IPD discharge template delete not working
ISSUE: Delete button executed but did not actually delete templates
ROUTE: /setting/template/discharge_templates/delete/{id}

ROOT CAUSE:
The delete button's fetch() call was sending 'new FormData(form)' which:
1. Included entire edit form data (template_html, header_html, footer_html)
2. These are HUGE LONGTEXT fields that can cause request payload issues
3. CSRF token from form might be stale or missing if no template is being edited
4. Server received malformed request and silently failed

SOLUTION:
- Create fresh FormData with ONLY the CSRF token
- Delete request now lightweight and reliable
- Added success message display after successful delete
- Server-side delete logic already correct (line 2969-3028 in Template.php)

CHANGED:
- app/Views/Setting/Template/discharge_templates.php (line 618-653)
  - Replace: body: new FormData(form)
  - With: body: deleteFormData (contains only CSRF token)
  - Added: setNotice('success', ...) to show success message

TESTING:
1. Go to /setting/template/discharge_templates
2. Click Delete on any non-default template
3. Confirm deletion
4. Template should now be removed from list
5. Success message should display
2026-06-07 11:11:41 +05:30
..
Admin Add pharmacy invoice permissions and discount print fixes 2026-06-01 10:13:40 +05:30
Bank Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
Bed refactor: set number input step to 1 across views 2026-04-10 21:16:25 +05:30
Charges feat(ipd-charges): group delete, sort order, Up/Down buttons, foldable billing panels 2026-04-18 06:56:38 +05:30
Doctor feat: add HealthPlix OPD sync flow with settings, diagnostics, and sync ID persistence 2026-04-27 08:32:51 +05:30
Insurance Fix legacy billing prints and pathology template compatibility 2026-03-21 02:23:31 +05:30
MedicalBank Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
Reffer Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
Stock refactor: set number input step to 1 across views 2026-04-10 21:16:25 +05:30
Template Fix: IPD discharge template delete not working 2026-06-07 11:11:41 +05:30