From 2d68a195847ad140132862424d2b27ce6be1908d Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Sat, 29 Aug 2026 04:45:28 +0530 Subject: [PATCH] feat(hms): add Document Type selection dropdown to HMS Desktop Scan Upload Modal and save document_type with badges --- app/Controllers/Opd.php | 7 ++++++- app/Views/billing/opd_scan_carousel_list.php | 5 +++-- app/Views/billing/opd_scan_modal_body.php | 18 ++++++++++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/app/Controllers/Opd.php b/app/Controllers/Opd.php index 9ea814d..80a8724 100644 --- a/app/Controllers/Opd.php +++ b/app/Controllers/Opd.php @@ -6364,6 +6364,11 @@ class Opd extends BaseController $scanType = $this->detectScanType((string) $filename); + $docType = trim((string) ($this->request->getPost('document_type') ?? 'Paper Document')); + if (empty($docType)) { + $docType = 'Paper Document'; + } + if ($insertId > 0 && $this->db->tableExists('file_upload_data')) { $fields = $this->db->getFieldNames('file_upload_data'); $update = []; @@ -6371,7 +6376,7 @@ class Opd extends BaseController $update['scan_type'] = $scanType; } if (in_array('document_type', $fields, true)) { - $update['document_type'] = ''; + $update['document_type'] = $docType; } if (in_array('content_description', $fields, true)) { $update['content_description'] = 'Queued for AI analysis'; diff --git a/app/Views/billing/opd_scan_carousel_list.php b/app/Views/billing/opd_scan_carousel_list.php index ea5f83c..208fcd0 100644 --- a/app/Views/billing/opd_scan_carousel_list.php +++ b/app/Views/billing/opd_scan_carousel_list.php @@ -25,8 +25,9 @@
-
- Uploaded: +
+ + Uploaded:
+
+ + +
+
@@ -572,6 +585,11 @@ function submitScanFormData(formData) { // Common upload handler used by both camera capture and file upload. + var docType = $('#opd_scan_document_type').val() || 'Paper Document'; + if (formData && !formData.has('document_type')) { + formData.append('document_type', docType); + } + $.ajax({ url: '/' + opdid, type: 'POST',