devsofttech_hms_ci4/app/Views
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
..
abdm ABDM: enforce PDF-backed report submit and improve gateway tracking 2026-05-31 04:17:39 +05:30
abha feat: ABDM OPD Queue + ABHA Register flow + patient ABHA search fix 2026-05-16 04:21:31 +05:30
account Add dedicated Save Settings button for user preferences 2026-04-28 13:54:46 +05:30
auth Add dark border theme for better visibility on old LED screens 2026-06-05 16:10:38 +05:30
billing Fix: Prevent duplicate medicine saves on 'Save Discharge Advice' button 2026-06-07 09:03:12 +05:30
dashboard Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
diagnosis Improve radiology template workflow and editor stability 2026-05-30 18:01:20 +05:30
doctor_document Improve doctor document workflow and print performance 2026-05-06 02:06:18 +05:30
errors Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
finance feat: ABDM OPD Queue + ABHA Register flow + patient ABHA search fix 2026-05-16 04:21:31 +05:30
Invoice Polish payment request alert wording 2026-04-10 04:20:14 +05:30
ipd_discharge Add IPD Discharge search functionality with AJAX 2026-06-06 14:43:10 +05:30
ipd_nursing refactor: set number input step to 1 across views 2026-04-10 21:16:25 +05:30
medical Restore legacy pharmacy reports and fix net/payment totals 2026-06-01 10:53:27 +05:30
org_packing Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
partials Add IPD Discharge search functionality with AJAX 2026-06-06 14:43:10 +05:30
PathLab_Report Improve radiology template workflow and editor stability 2026-05-30 18:01:20 +05:30
report Implement medical store credit payout workflow and optimize payout pool DataTable grouping 2026-04-30 01:42:03 +05:30
Setting Fix: IPD discharge template delete not working 2026-06-07 11:11:41 +05:30
setup Fix: {{advice}} prints as-is (no Hindi/AI conversion); fix Schema Diff truncation 2026-04-16 12:31:42 +05:30
storestock Revert card/modal/container borders to original light colors 2026-06-05 16:20:21 +05:30
tools feat: OPD speech-to-text mic, medicine label enhancements & template search 2026-03-30 18:46:33 +05:30
welcome_message.php Add dark border theme for better visibility on old LED screens 2026-06-05 16:10:38 +05:30