Give label to spare customer in logs

This commit is contained in:
Afiq Hamzah
2024-10-08 08:44:08 +08:00
parent a71fc12e43
commit bcf6021af7
2 changed files with 32 additions and 8 deletions
+16 -4
View File
@@ -48,12 +48,24 @@
<button class="accordion-toggle w-full bg-gray-600 text-gray-100 p-2 text-left focus:outline-none">
<h2 class="inline-block">Bill ID: {{ $bill_id }}</h2>
@php
$extractedCustomerName = json_decode($logs[0]['payload']) != null && $logs[0]['status'] == '1' ? json_decode($logs[0]['payload'])[3] : 'error';
$isSpareCustomer = json_decode($logs[0]['payload']) != null && $logs[0]['status'] == '6';
$isArrahnPayCustomer = json_decode($logs[0]['payload']) != null && $logs[0]['status'] == '1';
$extractedCustomerName = 'error';
if($isSpareCustomer) {
$extractedCustomerName = 'SPARE';
}elseif($isArrahnPayCustomer) {
$extractedCustomerName = json_decode($logs[0]['payload'])[3];
}
@endphp
@if($extractedCustomerName == 'error')
<span class="ml-4 bg-red-200 text-red-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-red-200 dark:text-red-800"><h2 class="inline-block">{{ $extractedCustomerName }}</h2></span>
@else
@if($isSpareCustomer)
<span class="ml-4 bg-gray-200 text-gray-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-gray-200 dark:text-gray-800"><h2 class="inline-block">{{ $extractedCustomerName }}</h2></span>
@elseif($isArrahnPayCustomer)
<span class="ml-4 bg-green-200 text-green-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-green-200 dark:text-green-800"><h2 class="inline-block">Customer Name: {{ $extractedCustomerName }}</h2></span>
@else
<span class="ml-4 bg-red-200 text-red-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-red-200 dark:text-red-800"><h2 class="inline-block">{{ $extractedCustomerName }}</h2></span>
@endif
<span class="acccordian-arrow float-right">&#9660;</span>
</button>
+16 -4
View File
@@ -25,12 +25,24 @@
<button class="accordion-toggle w-full bg-gray-700 text-gray-100 p-2 text-left focus:outline-none">
<h2 class="inline-block">Bill ID: {{ $bill_id }}</h2>
@php
$extractedCustomerName = json_decode($logs[0]['payload']) != null && $logs[0]['status'] == '1' ? json_decode($logs[0]['payload'])[3] : 'error';
$isSpareCustomer = json_decode($logs[0]['payload']) != null && $logs[0]['status'] == '6';
$isArrahnPayCustomer = json_decode($logs[0]['payload']) != null && $logs[0]['status'] == '1';
$extractedCustomerName = 'error';
if($isSpareCustomer) {
$extractedCustomerName = 'SPARE';
}elseif($isArrahnPayCustomer) {
$extractedCustomerName = json_decode($logs[0]['payload'])[3];
}
@endphp
@if($extractedCustomerName == 'error')
<span class="ml-4 bg-red-200 text-red-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-red-200 dark:text-red-800"><h2 class="inline-block">{{ $extractedCustomerName }}</h2></span>
@else
@if($isSpareCustomer)
<span class="ml-4 bg-gray-200 text-gray-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-gray-200 dark:text-gray-800"><h2 class="inline-block">{{ $extractedCustomerName }}</h2></span>
@elseif($isArrahnPayCustomer)
<span class="ml-4 bg-green-200 text-green-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-green-200 dark:text-green-800"><h2 class="inline-block">Customer Name: {{ $extractedCustomerName }}</h2></span>
@else
<span class="ml-4 bg-red-200 text-red-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-red-200 dark:text-red-800"><h2 class="inline-block">{{ $extractedCustomerName }}</h2></span>
@endif
<span class="acccordian-arrow float-right">&#9660;</span>
</button>