@extends('user::layouts.master') @section('content')

Purchase Order Report

Purchase Order Report

Delivery Date: {{ $purchase->delivery_date->format('d-m-Y') }} Delivery Time: {{ $purchase->delivery_time }} Delivery Address: {{ $purchase->delivery_address }}
Area: {{ $purchase->mainActivity->area }} Level: {{ $purchase->mainActivity->level }} Sub Code: {{ $purchase->subActivity->sub_code }}
@if($purchase->invoices->isNotEmpty()) @foreach($purchase->invoices as $invoice) @endforeach
Invoice No Invoice Amount Invoice Date
{{ $invoice->invoice_no }} £{{ number_format($invoice->invoice_amount, 4) }} {{ $invoice->invoice_date->format('d-m-Y') }}
@endif @php $grand_total = 0; $total_purchases = 0; $total_estimate = 0; $total_profit = 0; $total_loss = 0; @endphp @if($purchase->orders->isNotEmpty()) @foreach($purchase->orders as $order) @php $estimate = 0; $purchases = 0; $profit1 = 0; $profit = 0; $loss1 = 0; $loss = 0; $estimate = ((($order->activityOfOrder->rate * $order->activityOfOrder->quantity) * $purchase->subActivity->quantity) * $purchase->mainActivity->quantity); $purchases = $order->total; $profit1 = ($estimate - $purchases); if($profit1 > 0){ $profit = $profit1; } $loss1 = ($purchases - $estimate); if($loss1 > 0){ $loss = $loss1; } @endphp @php $total_estimate = ($total_estimate + $estimate); $total_purchases = ($total_purchases + $purchases); $total_profit = ($total_profit + $profit); $total_loss = ($total_loss + $loss); $grand_total = ($grand_total + $order->total); $grand_total = ($grand_total + $purchase->carriage_costs + $purchase->c_of_c + $purchase->other_costs); @endphp @endforeach @php $grand_total = ($grand_total + $purchase->carriage_costs + $purchase->c_of_c + $purchase->other_costs); @endphp @endif
Sr No. Activity Images Unit Quantity Rate Estimate Purchases Profit Loss
{{ $order->activityOfOrder->item_code }} {{ $order->activityOfOrder->activity }} @if(\Storage::disk('public')->has('purchases/'.$order->photo)) Download @else @endif {{ $order->unit }} {{ $order->quantity }} £{{ $order->rate }} £{{ number_format($estimate,4) }} £{{ number_format($purchases,4) }} @if($profit > 0) £{{ number_format($profit,4) }} @endif @if($loss > 0) £{{ number_format($loss,4) }} @endif
Total £{{ number_format($total_estimate , 4 ) }} £{{ number_format($total_purchases , 4) }} @if($total_profit > 0) £{{ number_format($total_profit , 4 ) }} @endif @if($total_loss > 0) £{{ number_format($total_loss , 4 ) }} @endif
Carriage costs £{{ number_format($purchase->carriage_costs, 4) }}
C of C £{{ number_format($purchase->c_of_c, 4) }}
Other costs £{{ number_format($purchase->other_costs, 4) }}
Total Value £{{ number_format($grand_total, 4) }}
Note :
{{ nl2br(ucfirst($purchase->note)) }}
@stop @push('scripts') @endpush