@if(!empty($setting['logo']) && file_exists(public_path('images/'.$setting['logo'])))
@endif
|
STOCK TRANSFER
{{$transfer['Ref']}}
| Date: |
@php
$dateFormat = $setting['date_format'] ?? 'YYYY-MM-DD';
$dateTime = \Carbon\Carbon::parse($transfer['date']);
$phpDateFormat = str_replace(['YYYY', 'MM', 'DD'], ['Y', 'm', 'd'], $dateFormat);
// Check if original date string contains time
$hasTime = strpos($transfer['date'], ' ') !== false && preg_match('/\d{1,2}:\d{2}/', $transfer['date']);
if ($hasTime) {
$formattedDate = $dateTime->format($phpDateFormat . ' H:i');
// Preserve seconds if they exist
if (preg_match('/:\d{2}:\d{2}/', $transfer['date'])) {
$formattedDate = $dateTime->format($phpDateFormat . ' H:i:s');
}
} else {
$formattedDate = $dateTime->format($phpDateFormat);
}
@endphp
{{$formattedDate}}
|
| Transfer #: |
{{$transfer['Ref']}} |
| Status: |
@php
$statusColors = [
'completed' => ['bg' => '#d1fae5', 'color' => '#065f46'],
'sent' => ['bg' => '#d1fae5', 'color' => '#065f46'],
'pending' => ['bg' => '#fef3c7', 'color' => '#92400e'],
];
$statusKey = strtolower($transfer['statut']);
$statusStyle = $statusColors[$statusKey] ?? ['bg' => '#e5e7eb', 'color' => '#374151'];
@endphp
{{$transfer['statut']}}
|
|