modified logic in chat bot
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
This commit is contained in:
@@ -174,7 +174,7 @@
|
||||
{{-- ── BASIC MODE ── --}}
|
||||
{{-- ══════════════════════════════════════════════════════════════════ --}}
|
||||
@if($mode === 'basic')
|
||||
<div style="padding:1rem;display:flex;flex-direction:column;gap:0.875rem;">
|
||||
<div style="padding:1rem;display:flex;flex-direction:column;gap:0.875rem;max-height:480px;overflow-y:auto;">
|
||||
|
||||
{{-- ── Report Type Selector (dropdown) ──────────────────────────── --}}
|
||||
<div style="position:relative;">
|
||||
@@ -431,25 +431,138 @@
|
||||
|
||||
{{-- Invoice Status Result --}}
|
||||
@if($hasInvoiceStatusResult)
|
||||
<div style="background:#111827;border:1px solid {{ str_contains($invoiceStatusResult, '✅') ? '#10b981' : (str_contains($invoiceStatusResult, 'No records') || str_contains($invoiceStatusResult, 'valid') ? '#f59e0b' : '#3b82f6') }};border-radius:0.5rem;padding:0.875rem;display:flex;gap:0.75rem;align-items:flex-start;animation:fadeIn .25s ease;">
|
||||
@if(str_contains($invoiceStatusResult, '✅'))
|
||||
{{-- All scanned — green check --}}
|
||||
<svg style="width:1.25rem;height:1.25rem;color:#10b981;flex-shrink:0;margin-top:0.1rem;" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
|
||||
</svg>
|
||||
@elseif(str_contains($invoiceStatusResult, 'No records') || str_contains($invoiceStatusResult, 'valid') || str_contains($invoiceStatusResult, "couldn't"))
|
||||
{{-- Not found / error — warning --}}
|
||||
<svg style="width:1.25rem;height:1.25rem;color:#f59e0b;flex-shrink:0;margin-top:0.1rem;" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z" />
|
||||
</svg>
|
||||
@else
|
||||
{{-- Partial / none scanned — barcode --}}
|
||||
<svg style="width:1.25rem;height:1.25rem;color:#3b82f6;flex-shrink:0;margin-top:0.1rem;" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 4.875c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5A1.125 1.125 0 0 1 3.75 9.375v-4.5ZM3.75 14.625c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5a1.125 1.125 0 0 1-1.125-1.125v-4.5ZM13.5 4.875c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5A1.125 1.125 0 0 1 13.5 9.375v-4.5Z" />
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6.75 6.75h.75v.75h-.75v-.75ZM6.75 16.5h.75v.75h-.75v-.75ZM16.5 6.75h.75v.75h-.75v-.75ZM13.5 13.5h.75v.75h-.75v-.75ZM13.5 19.5h.75v.75h-.75v-.75ZM19.5 13.5h.75v.75h-.75v-.75ZM19.5 19.5h.75v.75h-.75v-.75ZM16.5 16.5h.75v.75h-.75v-.75Z" />
|
||||
</svg>
|
||||
|
||||
@php
|
||||
$sd = $invoiceStatusData;
|
||||
$sdType = $sd['type'] ?? 'error';
|
||||
$sdTotal = $sd['total'] ?? 0;
|
||||
$sdScanned = $sd['scanned'] ?? 0;
|
||||
$sdNot = $sd['not_scanned'] ?? 0;
|
||||
$sdSerials = $sd['unscanned_serials'] ?? [];
|
||||
$sdCount = count($sdSerials);
|
||||
$sdInv = $sd['invoice_number'] ?? '';
|
||||
$isGood = $sdType === 'all_scanned';
|
||||
$isWarn = in_array($sdType, ['error', 'not_found', 'invalid']);
|
||||
$borderCol = $isGood ? '#10b981' : ($isWarn ? '#f59e0b' : '#3b82f6');
|
||||
@endphp
|
||||
|
||||
<div style="background:#111827;border:1px solid {{ $borderCol }};border-radius:0.5rem;padding:0.875rem;animation:fadeIn .25s ease;">
|
||||
|
||||
{{-- ── Icon + summary row ── --}}
|
||||
<div style="display:flex;gap:0.75rem;align-items:flex-start;">
|
||||
@if($isGood)
|
||||
<svg style="width:1.25rem;height:1.25rem;color:#10b981;flex-shrink:0;margin-top:0.1rem;" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
|
||||
</svg>
|
||||
@elseif($isWarn)
|
||||
<svg style="width:1.25rem;height:1.25rem;color:#f59e0b;flex-shrink:0;margin-top:0.1rem;" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z" />
|
||||
</svg>
|
||||
@else
|
||||
<svg style="width:1.25rem;height:1.25rem;color:#3b82f6;flex-shrink:0;margin-top:0.1rem;" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 4.875c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5A1.125 1.125 0 0 1 3.75 9.375v-4.5ZM3.75 14.625c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5a1.125 1.125 0 0 1-1.125-1.125v-4.5ZM13.5 4.875c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5A1.125 1.125 0 0 1 13.5 9.375v-4.5Z" />
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6.75 6.75h.75v.75h-.75v-.75ZM6.75 16.5h.75v.75h-.75v-.75ZM16.5 6.75h.75v.75h-.75v-.75ZM13.5 13.5h.75v.75h-.75v-.75ZM13.5 19.5h.75v.75h-.75v-.75ZM19.5 13.5h.75v.75h-.75v-.75ZM19.5 19.5h.75v.75h-.75v-.75ZM16.5 16.5h.75v.75h-.75v-.75Z" />
|
||||
</svg>
|
||||
@endif
|
||||
|
||||
<div style="flex:1;min-width:0;">
|
||||
<p style="font-size:0.8125rem;color:#f9fafb;line-height:1.6;margin:0;">
|
||||
{{ $sd['message'] ?? $invoiceStatusResult }}
|
||||
</p>
|
||||
|
||||
{{-- ── Count pills (only for real invoice data) ── --}}
|
||||
@if($sdTotal > 0)
|
||||
<div style="display:flex;gap:0.375rem;flex-wrap:wrap;margin-top:0.625rem;">
|
||||
<span style="background:#1e3a2f;border:1px solid #10b98155;color:#6ee7b7;font-size:0.68rem;font-weight:700;padding:0.2rem 0.55rem;border-radius:9999px;">
|
||||
Total: {{ $sdTotal }}
|
||||
</span>
|
||||
<span style="background:#1a3350;border:1px solid #3b82f655;color:#93c5fd;font-size:0.68rem;font-weight:700;padding:0.2rem 0.55rem;border-radius:9999px;">
|
||||
✔ Scanned: {{ $sdScanned }}
|
||||
</span>
|
||||
@if($sdNot > 0)
|
||||
<span style="background:#3b1a1a;border:1px solid #ef444455;color:#fca5a5;font-size:0.68rem;font-weight:700;padding:0.2rem 0.55rem;border-radius:9999px;">
|
||||
✘ Not scanned: {{ $sdNot }}
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- ── Unscanned serial numbers section ── --}}
|
||||
@if($sdCount > 0)
|
||||
<div style="margin-top:0.875rem;border-top:1px solid #374151;padding-top:0.75rem;">
|
||||
|
||||
<p style="font-size:0.72rem;font-weight:600;color:#9ca3af;margin:0 0 0.5rem;text-transform:uppercase;letter-spacing:.05em;">
|
||||
Unscanned serial numbers
|
||||
<span style="background:#3b1a1a;color:#fca5a5;border-radius:9999px;padding:0.1rem 0.45rem;font-size:0.68rem;margin-left:0.25rem;">
|
||||
{{ $sdCount }}
|
||||
</span>
|
||||
</p>
|
||||
|
||||
{{-- Serial chips — first 10, or all when expanded --}}
|
||||
@php
|
||||
$visibleSerials = $showAllUnscanned
|
||||
? $sdSerials
|
||||
: array_slice($sdSerials, 0, 10);
|
||||
$hiddenCount = $sdCount - 10;
|
||||
@endphp
|
||||
|
||||
<div style="display:flex;flex-wrap:wrap;gap:0.35rem;
|
||||
@if($showAllUnscanned) max-height:200px;overflow-y:auto;padding-right:2px; @endif">
|
||||
@foreach($visibleSerials as $serial)
|
||||
<span style="
|
||||
display:inline-block;
|
||||
background:#1e293b;
|
||||
border:1px solid #475569;
|
||||
color:#e2e8f0;
|
||||
font-family:monospace;
|
||||
font-size:0.72rem;
|
||||
padding:0.2rem 0.5rem;
|
||||
border-radius:0.3rem;
|
||||
white-space:nowrap;
|
||||
">{{ $serial }}</span>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
{{-- Show more / Show less button --}}
|
||||
@if($sdCount > 10)
|
||||
<button
|
||||
wire:click="toggleShowAllUnscanned"
|
||||
style="
|
||||
margin-top:0.625rem;
|
||||
background:transparent;
|
||||
border:1px solid #3b82f655;
|
||||
border-radius:0.375rem;
|
||||
color:#60a5fa;
|
||||
font-size:0.75rem;
|
||||
font-weight:600;
|
||||
padding:0.3rem 0.75rem;
|
||||
cursor:pointer;
|
||||
display:flex;
|
||||
align-items:center;
|
||||
gap:0.35rem;
|
||||
transition:background .15s, border-color .15s;
|
||||
"
|
||||
onmouseover="this.style.background='#1e3a5f';this.style.borderColor='#3b82f6';"
|
||||
onmouseout="this.style.background='transparent';this.style.borderColor='#3b82f655';">
|
||||
@if($showAllUnscanned)
|
||||
<svg style="width:0.75rem;height:0.75rem;" fill="none" viewBox="0 0 24 24" stroke-width="2.5" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="m4.5 15.75 7.5-7.5 7.5 7.5" />
|
||||
</svg>
|
||||
Show less
|
||||
@else
|
||||
<svg style="width:0.75rem;height:0.75rem;" fill="none" viewBox="0 0 24 24" stroke-width="2.5" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
|
||||
</svg>
|
||||
Show {{ $hiddenCount }} more…
|
||||
@endif
|
||||
</button>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
@endif
|
||||
<p style="font-size:0.8125rem;color:#f9fafb;line-height:1.6;margin:0;white-space:pre-line;">{{ $invoiceStatusResult }}</p>
|
||||
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@@ -619,4 +732,3 @@
|
||||
@endif
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user