- Add B2C same-invoice exchange and pure refund workflows (Marg ERP standard)
- Support returning excess/unused medicines with proportional unit pricing on original invoice
- Auto-net return credits against new medicines in POS cart with refund outflow handling
- Implement stock replenishment for restocked batches with audit trail in mst_stock_audit
- Generate sequential GST Credit Notes in mst_sale_returns and mst_sale_return_items
- Update Thermal 80mm, A5, and A4 print templates with separated dispensed vs returned items
- Add CI4 migration 2026-09-08-000001_CreateMedicalStoreReturnsAndExchanges.php for remote execution
- Add standalone SQL script scripts/sql/2026-09-08_medical_store_b2c_returns_and_exchanges.sql
- Fix mPDF single-threaded server deadlock by replacing HTTP logo URL fallbacks with inline base64 data URIs
- Add fast path in DoctorDocument to read scanned NABH PDFs directly from disk without mPDF re-rendering
- Support doctor_document and patient_document entity types in task board health document preview
- Enhance task board preview form with in-modal PDF preview, image thumbnail, and download actions
- Populate Composition.encounter with AMB encounter and set Wellness Record display code
- Dynamically resolve and generate PDF using designated Online/ABDM template (is_abdm=1) from ipd_discharge_templates
- Unify mPDF rendering logic between show_discharge and generateDischargeSummaryPdfBinary for exact byte-for-byte consistency
- Attach generated PDF as DocumentReference under SNOMED 373942005 (Discharge summary) in NRCES FHIR DocumentBundle
- Add quick-set actions and AJAX endpoints for Default and ABDM template selection in discharge template list UI
- Update unit tests covering DocumentReference generation and template resolution
- discharge_create.php (JS): Fixed AJAX done handler to JSON.parse the
raw string response (jQuery with dataType:'html' does not auto-parse
JSON), then re-render #discharge_medicine_tbody from result.drugRows.
Also fixed Remove All (#btn_discharge_med_reset) to send AJAX POST
with action=remove_all_drugs so records are deleted from DB, not just
cleared from the DOM.
- Ipd_discharge.php (Controller): In the AJAX JSON response block,
resolve dosage/dosage_when/dosage_freq IDs to human-readable labels
using getDoseMasterRows() before returning drugRows, so the table
displays 'BD / After Food' instead of raw numeric IDs. Added new
remove_all_drugs action that deletes all medicine rows for the IPD
from both legacy (ipd_discharge_prescrption_prescribed) and classic
(ipd_discharge_drug) tables. Added remove_all_drugs to both
lightweight-action whitelists to skip the expensive getIpdPanelInfo()
join.