{{-- Header --}} {{-- @if($invoice->logo) logo @endif --}}

Invoice

Invoice No 56677

Date: {{ $month_name }} {{ $year }}

{{-- Seller - Buyer --}}
Seller Buyer

Toyo

Address: No. F/S-14, Bayintnaung Road, Kamaryut Township, Yangon, Myanmar

Phone: +(95-9) 4200 775 07

{{ $merchant->name ?? '-' }}

Phone: {{ $merchant->phone_number ?? '-' }}

Address: {{ $merchant->address->address ?? '-' }}

{{-- Table --}}
Date Order Id Product Unit Price Quantity Price
@php $total = null; $total_product_sold = null; @endphp @foreach ($orders as $order) @php $lastOrders = []; @endphp @foreach ($order->orderDetails as $key =>$order_details) @php $total += $order_details->price * $order_details->quantity; @endphp @if($key == 0) {{-- @if($key>0) @endif --}} @else @php $lastOrders[] = $order_details; @endphp @endif @endforeach @if(count($lastOrders) > 0) @foreach ($lastOrders as $order_details) @endforeach @endif @endforeach
{{ Carbon\Carbon::parse($order->created_at)->format('d-m-Y') }} {{ $order->id }}    {{ $order_details->product->model ?? '-' }} {{ number_format($order_details->price ?? '-')}} {{ $order_details->quantity ?? '-'}} {{ number_format($order_details->price * $order_details->quantity ?? '-') }}
    {{ $order_details->product->model ?? '-' }} {{ number_format($order_details->price ?? '-') }} {{ $order_details->quantity ?? '-'}} {{ number_format($order_details->price * $order_details->quantity ?? '-') }}
Total Amount {{ number_format($total) }}
{{-- monthly purchased products --}}
Total Purchased Products
No. Product Quantity Total Price
@foreach ($total_purchased_products as $index => $purchase) @php $total_product_sold += $purchase->total_price; @endphp @endforeach
{{ $index+1 }} {{ $purchase->product->model }} {{ $purchase->qty }} {{ number_format($purchase->total_price) }}
Total Amount {{ number_format($total_product_sold) }}