. . .
Buyer Name: {{ $record->buyer->buyerName }} Buyer Address: {{ $record->buyer->address }} BBLC Percentage: @php $btbPercentage = 0; @endphp @foreach($record->lcDrafts as $item) @php $btbPercentage += $item->pi_value; @endphp @endforeach {{ number_format(($btbPercentage * 100) / ($record->lc_value ?: 1), 2) }}%
L/C Number: {{ $record->lc_number }} L/C Value: $ {{ $record->lc_value }} L/C Date: {{ \Carbon\Carbon::parse($record->lc_date)->format('d-m-Y') }}
PC Value:{{ " " . "$" . " " . $record->pc_value }} PC Date:{{ " " . " " . $record->pc_date }} PC Percentage {{ number_format(($record->pc_value * 100) / ($record->lc_value ?: 1), 2) }}%

{{-- ==============Replace LC Details============= --}}
@if ($record->replaceLC->isNotEmpty())

REPLACE LC DETAILS

@foreach ($record->replaceLC as $item) @endforeach
LC number Issue DT Value Shipment Date Expiry Date
{{ $item->lc_number }} {{ \Carbon\Carbon::parse($item->lc_date)->format('d-m-y') }} {{ $item->lc_value }} {{ \Carbon\Carbon::parse($item->shipment_date)->format('d-m-y') }} {{ \Carbon\Carbon::parse($item->expiry_date)->format('d-m-y') }}
@else

No Replace LC Details

@endif
{{-- ===============Replace LC Details============= --}}

BACK TO BACK DETAILS

@php $btbTotal = 0; @endphp @foreach ($record->lcDrafts as $item) @php $btbTotal += $item->pi_value; // sum here @endphp @endforeach
Sl BTB NO VALUE/USD DATE SUPPLIER ITEM QTY SHIP DT EXPIRY DT
{{ $loop->iteration }} {{ $item->pi_number }} {{ $item->pi_value }} {{ \Carbon\Carbon::parse($item->pi_date)->format('d-m-y') }} {{ $item->supplier?->supplier_name }} {{ $item->draft_purpose }} {{ $item->RMG_for ?? '0' }} {{ $item->shipment_date ?? 'NA' }} {{ $item->expiry_date ?? 'NA' }}
Grand Total : {{ "$" .' ' . $btbTotal }}

@if (is_null($invoice))

No Invoice Yet

@else {{-- Display invoice details --}}

EXPORE DETAILS

@php $ExportTotal = 0; $TotalPcs = 0; @endphp @foreach ($record->invoice as $item) @php $ExportTotal += $item->amount; // sum here $TotalPcs += $item->invoice_qty; // sum here @endphp @endforeach
Sl INV NO VALUE DATE QTY/pcs EXP NO EXP DATE REALIZE FBC NO DATE
{{ $loop->iteration }} {{ $item->invoice_number }} {{ $item->amount }} {{ \Carbon\Carbon::parse($item->invoice_date)->format('d-m-y') }} {{ $item->invoice_qty }} {{ $item->exp_number }} {{ \Carbon\Carbon::parse($item->exp_date)->format('d-m-y') }} {{ $item->PRC_value ?? '0' }} {{ $item->PRC_number ?? 'NA' }} {{ $item->PRC_date ?? 'NA' }}
Grand Total : {{ "$" .' ' . $ExportTotal }} Pcs : {{ $TotalPcs }}
@endif