From 0242159928c20007bed0d78528658c6def1448b5 Mon Sep 17 00:00:00 2001 From: Ravi Gulhane Date: Fri, 16 Oct 2026 12:53:30 +0530 Subject: [PATCH 1/3] Changes --- app/Http/Controllers/FormController.php | 7 +++---- app/Http/Controllers/FormentityController.php | 6 ------ 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/app/Http/Controllers/FormController.php b/app/Http/Controllers/FormController.php index e28553b3..584cde81 100644 --- a/app/Http/Controllers/FormController.php +++ b/app/Http/Controllers/FormController.php @@ -12963,13 +12963,12 @@ class FormController extends Controller } /** - * Selected user attribute codes when the form is configured to show them. - * Uses the saved attribute list as the source of truth so columns still render - * if Show User Attributes was left off after attributes were selected. + * Selected user attribute codes when Show User Attributes is Yes. + * A saved attribute list is ignored while that setting is No. */ protected function userAttributeCodes($form): array { - if (!$form) { + if (!$form || ($form->show_user_attributes ?? 'no') !== 'yes') { return []; } $raw = $form->user_attributes ?? []; diff --git a/app/Http/Controllers/FormentityController.php b/app/Http/Controllers/FormentityController.php index f9a5ce7e..7b7eb08e 100644 --- a/app/Http/Controllers/FormentityController.php +++ b/app/Http/Controllers/FormentityController.php @@ -158,9 +158,6 @@ class FormentityController extends Controller $values->show_manager_details = $values->show_manager_details ?? 'no'; $values->show_user_attributes = (($values->show_user_attributes ?? 'no') === 'yes') ? 'yes' : 'no'; $values->user_attributes = $this->normalizeAttributeCodes($values->user_attributes ?? []); - if (!empty($values->user_attributes)) { - $values->show_user_attributes = 'yes'; - } } //echo '
'; print_r($values); exit;
         return $values;
@@ -254,9 +251,6 @@ class FormentityController extends Controller
         $data['roles_info'] = ($data['roles_info'] ?? 'no') === 'yes' ? 'yes' : 'no';
         $data['show_user_attributes'] = ($data['show_user_attributes'] ?? 'no') === 'yes' ? 'yes' : 'no';
         $data['user_attributes'] = $this->normalizeAttributeCodes($data['user_attributes'] ?? []);
-        if (!empty($data['user_attributes'])) {
-            $data['show_user_attributes'] = 'yes';
-        }
         if ($data['email_notification'] === 'no') {
             $data['email_notification_rules'] = [];
         } else {

From 6d8a5b87c9fd70d934e61f1ea20d30813b6d7325 Mon Sep 17 00:00:00 2001
From: Ravi Gulhane 
Date: Fri, 16 Oct 2026 16:50:57 +0530
Subject: [PATCH 2/3] Changes

---
 ...8862-93e7-43b5-bf4e-7a29b30e3830.blade.php | 323 ++++++++++++++++++
 1 file changed, 323 insertions(+)
 create mode 100644 resources/views/form/rapport-team3/preview-1791391025-cf688862-93e7-43b5-bf4e-7a29b30e3830.blade.php

diff --git a/resources/views/form/rapport-team3/preview-1791391025-cf688862-93e7-43b5-bf4e-7a29b30e3830.blade.php b/resources/views/form/rapport-team3/preview-1791391025-cf688862-93e7-43b5-bf4e-7a29b30e3830.blade.php
new file mode 100644
index 00000000..f87ee299
--- /dev/null
+++ b/resources/views/form/rapport-team3/preview-1791391025-cf688862-93e7-43b5-bf4e-7a29b30e3830.blade.php
@@ -0,0 +1,323 @@
+
+
+
+    @include('layouts.shared/title-meta', ['title' => $form->title ?? 'POB'])
+    @include('layouts.shared/head-css', ['mode' => $mode ?? '', 'demo' => $demo ?? ''])
+    
+
+
+@php
+    $byCode = [];
+    foreach ($questions ?? [] as $question) {
+        if (isset($question->code)) {
+            $byCode[$question->code] = $question;
+        }
+    }
+    $submitted = $submitted_formdata ?? null;
+    $val = function ($code) use ($byCode, $submitted) {
+        if (is_object($submitted) && isset($submitted->{$code}) && $submitted->{$code} !== '' && $submitted->{$code} !== null) {
+            return $submitted->{$code};
+        }
+        if (is_array($submitted) && isset($submitted[$code]) && $submitted[$code] !== '' && $submitted[$code] !== null) {
+            return $submitted[$code];
+        }
+        if (isset($byCode[$code]->value) && $byCode[$code]->value !== '' && $byCode[$code]->value !== null) {
+            return $byCode[$code]->value;
+        }
+        return '';
+    };
+    $fileUrl = function ($url) {
+        $url = trim((string) $url);
+        if ($url === '') {
+            return '';
+        }
+        if (!preg_match('#^https?://#i', $url)) {
+            return rtrim((string) env('AWS_URL'), '/') . '/' . ltrim($url, '/');
+        }
+        return $url;
+    };
+    $contactType = strtolower((string) $val('contact_type'));
+    $isChemist = $contactType === 'ebt_chemist';
+    $contactLabel = $isChemist ? 'Chemist' : 'Doctor';
+    $skus = [
+        ['Asthalin Inhaler', 'asthalin_inhaler'],
+        ['Asthalin Rotacap', 'asthalin_rotacap'],
+        ['Aerocort Inhaler', 'aerocort_inhaler'],
+        ['Aerocort Rotacap', 'aerocort_rotacap'],
+        ['Aerocort Forte Rotacap', 'aerocort_forte_rotacap'],
+    ];
+    $supplyStatus = (string) $val('supply_status');
+    $invoiceUrl = $fileUrl($val('upload_invoice'));
+    $invoiceExt = strtolower(pathinfo((string) parse_url($invoiceUrl, PHP_URL_PATH), PATHINFO_EXTENSION));
+    $invoiceIsImage = in_array($invoiceExt, ['jpg', 'jpeg', 'png', 'gif', 'webp'], true);
+    $invoiceIsPdf = $invoiceExt === 'pdf';
+    $showActual = $supplyStatus === 'Yes' || $invoiceUrl !== '' || $val('total_actual_pob_units') !== '' || $val('total_actual_pob_value') !== '';
+@endphp
+
+    
+
+

POB Review

+

Review the order and invoice before you approve or reject

+ @if(isset($form->user_info->name) && $form->user_info->name !== '') +

Submitted by: {{ $form->user_info->name }}

+ @endif +
+ +
+
{{ $contactLabel }} details
+
+
+ Date + {{ $val('record_date') !== '' ? $val('record_date') : '—' }} +
+
+ {{ $contactLabel }} + {{ $val('contact_name') !== '' ? $val('contact_name') : '—' }} +
+ @if(!$isChemist) +
+ Speciality + {{ $val('speciality') !== '' ? $val('speciality') : '—' }} +
+
+ Doctor Address + {{ $val('doctor_location') !== '' ? $val('doctor_location') : '—' }} +
+ @else +
+ Chemist Address + {{ $val('chemist_location') !== '' ? $val('chemist_location') : '—' }} +
+ @endif +
+ MSL Code + {{ $val('msl_code') !== '' ? $val('msl_code') : '—' }} +
+
+ Supply Status + {{ $supplyStatus !== '' ? $supplyStatus : '—' }} +
+
+ Submission Status + {{ $val('submission_status') !== '' ? $val('submission_status') : '—' }} +
+
+
+ +
+
POB
+
+ + + + + + + + + + @foreach($skus as [$label, $code]) + + + + + + @endforeach + + + + + + +
SKUUnitsValue
{{ $label }}{{ $val($code.'_units') !== '' ? $val($code.'_units') : '0' }}{{ $val($code.'_value') !== '' ? $val($code.'_value') : '0' }}
Total{{ $val('total_pob_units') !== '' ? $val('total_pob_units') : '0' }}{{ $val('total_pob_value') !== '' ? $val('total_pob_value') : '0' }}
+
+
+ + @if($showActual) +
+
Actual POB
+
+ + + + + + + + + + @foreach($skus as [$label, $code]) + + + + + + @endforeach + + + + + + +
SKUActual UnitsActual Value
{{ $label }}{{ $val('actual_'.$code.'_units') !== '' ? $val('actual_'.$code.'_units') : '0' }}{{ $val('actual_'.$code.'_value') !== '' ? $val('actual_'.$code.'_value') : '0' }}
Total{{ $val('total_actual_pob_units') !== '' ? $val('total_actual_pob_units') : '0' }}{{ $val('total_actual_pob_value') !== '' ? $val('total_actual_pob_value') : '0' }}
+
+
+ @endif + +
+
Invoice
+
+ @if($invoiceUrl === '') +

No invoice uploaded.

+ @elseif($invoiceIsImage) +
+ Uploaded invoice +
+

Open invoice

+ @elseif($invoiceIsPdf) + +

Open invoice

+ @else +

Open invoice

+ @endif +
+
+
+ +
+
+ × + Uploaded invoice +
+
+ + + + + From cc2b8cfba2c9fc4f2d7647e1580e5892a7fa5baf Mon Sep 17 00:00:00 2001 From: Ravi Gulhane Date: Fri, 16 Oct 2026 17:04:19 +0530 Subject: [PATCH 3/3] Changes --- ...8862-93e7-43b5-bf4e-7a29b30e3830.blade.php | 72 ++++++++----------- 1 file changed, 29 insertions(+), 43 deletions(-) diff --git a/resources/views/form/rapport-team3/preview-1791391025-cf688862-93e7-43b5-bf4e-7a29b30e3830.blade.php b/resources/views/form/rapport-team3/preview-1791391025-cf688862-93e7-43b5-bf4e-7a29b30e3830.blade.php index f87ee299..1c9b8d7f 100644 --- a/resources/views/form/rapport-team3/preview-1791391025-cf688862-93e7-43b5-bf4e-7a29b30e3830.blade.php +++ b/resources/views/form/rapport-team3/preview-1791391025-cf688862-93e7-43b5-bf4e-7a29b30e3830.blade.php @@ -51,20 +51,20 @@ $invoiceExt = strtolower(pathinfo((string) parse_url($invoiceUrl, PHP_URL_PATH), PATHINFO_EXTENSION)); $invoiceIsImage = in_array($invoiceExt, ['jpg', 'jpeg', 'png', 'gif', 'webp'], true); $invoiceIsPdf = $invoiceExt === 'pdf'; - $showActual = $supplyStatus === 'Yes' || $invoiceUrl !== '' || $val('total_actual_pob_units') !== '' || $val('total_actual_pob_value') !== ''; @endphp

POB Review

-

Review the order and invoice before you approve or reject

+

Review the actual POB and invoice before you approve or reject

@if(isset($form->user_info->name) && $form->user_info->name !== '')

Submitted by: {{ $form->user_info->name }}

@endif
-
-
{{ $contactLabel }} details
+
+
+ {{ $contactLabel }} details
Date @@ -102,40 +102,10 @@ {{ $val('submission_status') !== '' ? $val('submission_status') : '—' }}
-
+ -
-
POB
-
- - - - - - - - - - @foreach($skus as [$label, $code]) - - - - - - @endforeach - - - - - - -
SKUUnitsValue
{{ $label }}{{ $val($code.'_units') !== '' ? $val($code.'_units') : '0' }}{{ $val($code.'_value') !== '' ? $val($code.'_value') : '0' }}
Total{{ $val('total_pob_units') !== '' ? $val('total_pob_units') : '0' }}{{ $val('total_pob_value') !== '' ? $val('total_pob_value') : '0' }}
-
-
- - @if($showActual) -
-
Actual POB
+
+ Actual POB
@@ -161,11 +131,10 @@
-
- @endif + -
-
Invoice
+
+ Invoice
@if($invoiceUrl === '')

No invoice uploaded.

@@ -181,6 +150,7 @@

Open invoice

@endif
+
@@ -235,21 +205,37 @@ font-size: 1rem; margin-bottom: 0; } - .details-section, .request-letter-section { + .preview-panel { background: #fff; border: 1px solid #dee2e6; border-radius: 8px; margin: 16px 0; overflow: hidden; } + .preview-panel > summary { + list-style: none; + cursor: pointer; + } + .preview-panel > summary::-webkit-details-marker { display: none; } .section-title { background: #007bff; color: #fff; margin: 0; - padding: 12px 16px; + padding: 12px 40px 12px 16px; font-size: 1.05rem; font-weight: 600; + position: relative; } + .section-title::after { + content: '+'; + position: absolute; + right: 16px; + top: 50%; + transform: translateY(-50%); + font-size: 1.25rem; + line-height: 1; + } + .preview-panel[open] > .section-title::after { content: '−'; } .section-content { padding: 16px; } .detail-row { display: flex;