@extends('layouts.app') @section('title', 'Project Details') @section('content')
@include('project.head')
@include('project.nav')
@if(session('success'))
{{ session('success') }}
@endif @if(session('danger'))
{{ session('danger') }}
@endif @if ($errors->any())
{!! implode('
', $errors->all(':message')) !!}
@endif

Financials Gross Profit: £0.00

@if ($items->count() > 0) @endif Add PO
@php $plant = 0; $labour = 0; $material = 0; $estimated_price = 0; $sales_price = 0; $total_vat = 0; $total_sales_net = 0; @endphp @if($uplifts->count()>0) @foreach($uplifts as $uplift)

Uplifted {{ $uplift->percentage }}% by {{$uplift->firstname}} {{$uplift->lastname}} at {{ date('jS M Y', strtotime($uplift->created_at)) }}.

@endforeach @endif

Sales

£{{ number_format($plant, 2) }}
Plant (0%)
£{{ number_format($labour, 2) }}
Labour (0%)
£{{ number_format($material, 2) }}
Material (0%)
£{{ number_format($total_sales_net, 2) }}
Sales Net
£{{ number_format($total_vat, 2) }}
VAT
£{{ number_format($sales_price, 2) }}
Sales Gross

Labour Days Estimated

0
Days

Estimated Cost

£0
Plant
£0
Labour
£0
Material

Total Labour

{{ number_format($totalHours, 2) }} Hrs
Labour
@foreach($sub_contracts as $sc)
£{{ number_format($sc->amount, 2) }}
{{ $sc->title }}
@endforeach

Purchase Orders

@foreach($purchase_orders as $po)
£{{ number_format($po->total, 2) }} PO-{{str_pad($po->id, 4, '0', STR_PAD_LEFT);}}
@if($po->sub_contract==1) {{ $po->sc->title }} @else P: £{{number_format($po->total_plant, 2)}} | L: £{{number_format($po->total_labour, 2)}} | M: £{{number_format($po->total_materials, 2)}} @endif
@endforeach
@csrf
@foreach($items as $item) @php $estimated_price += $item->estimated_price; $sales_price += $gross; $plant += $item->plant*$item->quantity; $labour += $item->labour*$item->quantity; $material += $item->material*$item->quantity; @endphp @endforeach
Code Description UoM Qty Plant Labour Material Sales Net VAT Sales Gross Estimated Cost Supplier Actual Cost PO Number Sales Invoice No.
@if($item->invoiced==0)
@endif
@if($item->variation==1) @endif {{ $item->code }} {{ substr($item->description, 0, 30).'...' }} invoiced==1) readonly @endif class="form-control table-field form-control-sm" type="text" value="{{ $item->description }}" name="description[]"> {{ $item->uom }} @if($item->invoiced==1) @else @endif {{ $item->quantity }} invoiced==1) readonly @endif class="form-control quantity table-field form-control-sm" type="number" value="{{ $item->quantity }}" name="quantity[]"> £{{ number_format(round($item->plant, 2)*$item->quantity, 2) }} £{{ number_format(round($item->labour, 2)*$item->quantity, 2) }} £{{ number_format(round($item->material, 2)*$item->quantity, 2) }} @php $sales_net = $item->quantity*(round($item->plant, 2)+round($item->labour, 2)+round($item->material, 2)); $total_sales_net += $sales_net; @endphp £{{ number_format($sales_net, 2) }} @php $vat = $sales_net * (20 / 100); $total_vat += $vat; @endphp £{{ number_format($vat, 2) }} @php $gross = $vat+$sales_net; @endphp £{{ number_format($gross, 2) }} £{{ number_format($item->estimated_price, 2) }} {{ $item->supplier }} @if($item->purchased==1) PO-{{str_pad($item->purchase_order_id, 4, '0', STR_PAD_LEFT);}} @endif @if($item->invoiced==1) @if($item->credit_note==0) WGI-{{str_pad($item->invoice_id, 4, '0', STR_PAD_LEFT);}} @else WGC-{{str_pad($item->invoice_id, 4, '0', STR_PAD_LEFT);}} @endif @endif @if($item->invoiced != 1 && $item->purchased != 1 && $item->sub_contract_accepted != 1) @endif
@php $plant_percentage = 0; $labour_percentage = 0; $material_percentage = 0; if ($total_sales_net > 0) { $plant_percentage = ($plant / $total_sales_net) * 100; $labour_percentage = ($labour / $total_sales_net) * 100; $material_percentage = ($material / $total_sales_net) * 100; } @endphp

Invoices History

@csrf @foreach($invoices as $invoice) @php $invoice_vat = $invoice->final_amount*0.20; $invoice_total = $invoice_vat+$invoice->final_amount; @endphp @endforeach
Date Invoice Name Status Final Amount Actions
{{ date('jS M Y', strtotime($invoice->created_at)) }} @if($invoice->credit_note==0) WGI-{{str_pad($invoice->id, 4, '0', STR_PAD_LEFT);}} @else WGC-{{str_pad($invoice->id, 4, '0', STR_PAD_LEFT);}} @endif {{ $customer->company_name }} @if($invoice->sent_to_client==0) {{ ucfirst($invoice->status) }} @else {{ ucfirst($invoice->status) }} @endif £{{ number_format($invoice_total, 2) }} @if($invoice->sent_to_client==0) @else @endif
£{{ number_format($normalInvoice->total_sales_price, 2) }}
Invoice Sales Net
£{{ number_format($normalInvoice->total_vat, 2) }}
Invoice VAT
£{{ number_format($normalInvoice->gross_total, 2) }}
Invoice Sales Gross
£{{ number_format($creditInvoice->total_sales_price, 2) }}
Credit Note Sales Net
£{{ number_format($creditInvoice->total_vat, 2) }}
Credit Note VAT
£{{ number_format($creditInvoice->gross_total, 2) }}
Credit Note Sales Gross
£{{ number_format($difference['sales_price_difference'], 2) }}
Total Sales Net
£{{ number_format($difference['vat_difference'], 2) }}
Total VAT
£{{ number_format($difference['gross_total_difference'], 2) }}
Total Sales Gross
@csrf
@endsection @section('js') @endsection