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',