@if($patron)
Vendor: {{ $patron->legal_name }} @if($patron->addresses->isNotEmpty()) @php $pAddr = $patron->addresses->first(); @endphp {{ $pAddr->line_1 ?? '' }}@if($pAddr->line_2), {{ $pAddr->line_2 }}@endif
{{ $pAddr->city ?? '' }} - {{ $pAddr->zipcode ?? '' }}
@endif GSTIN/UIN # : {{ $patron->gstin ?? '' }}
Contact #: {{ $patron->mobile_number ?? ($patron->contacts->first()->mobile ?? '0') }}
@else
Report Target: All Vendors (Consolidated Overview)
@endif
Address: {{ $plant->name ?? 'DEMO LOGIN' }} @if($plant && $plant->addresses->isNotEmpty()) @php $plAddr = $plant->addresses->first(); @endphp {{ $plAddr->line_1 ?? '' }}
@if($plAddr->line_2){{ $plAddr->line_2 }}
@endif {{ $plAddr->city ?? '' }}, {{ $plAddr->state->state_name ?? $plAddr->state_code ?? '' }} - {{ $plAddr->zipcode ?? '' }}
@else 3/150, Akkiyampatti (Po),
Sendamangalam (Tk),
Namakkal (Dt), Tamil Nadu - 637409
@endif GSTIN/UIN #: {{ $plant->gstin ?? '' }}
MSME - UDYAM- {{ $plant->msme_no ?? '' }}

Purchase Statement of Accounts

Period: {{ $start }} to {{ $end }}

1. Purchase Order wise Details

@foreach($transactions as $index => $row) @endforeach
# Date PO Number Supplier / Vendor Taxable Amt Tax Amt Total Amt
{{ $index + 1 }} {{ \Carbon\Carbon::parse($row['date'])->format('d-m-Y') }} {{ $row['po_number'] }} {{ $row['vendor_name'] }} ₹ {{ number_format($row['amount_untaxed'], 2) }} ₹ {{ number_format($row['amount_tax'], 2) }} ₹ {{ number_format($row['amount_total'], 2) }}
Total Details ₹ {{ number_format($total_untaxed, 2) }} ₹ {{ number_format($total_tax, 2) }} ₹ {{ number_format($total_amount, 2) }}

2. Product wise Consolidated Summary

@foreach($product_summary as $index => $row) @endforeach
# Product Name UOM Quantity Avg Rate Taxable Amt Tax Amt Total Amt
{{ $index + 1 }} {{ $row['product_name'] }} {{ $row['uom'] }} {{ number_format($row['quantity'], 2) }} ₹ {{ number_format($row['avg_rate'], 2) }} ₹ {{ number_format($row['amount_untaxed'], 2) }} ₹ {{ number_format($row['amount_tax'], 2) }} ₹ {{ number_format($row['amount_total'], 2) }}
Total Summary {{ number_format($total_quantity, 2) }} ₹ {{ number_format($total_product_untaxed, 2) }} ₹ {{ number_format($total_product_tax, 2) }} ₹ {{ number_format($total_product_amount, 2) }}