@extends('layouts.invoice') @section('content') @php $sub_total =0; $tax =0; foreach ($invoice->products as $product){ $sub_total += $product->unit_price*$product->invoiced_qty; } $tax = $sub_total * $invoice->salesorder->tax_percentage / 100; @endphp

Invoice Details

@php if($invoice->status == "Fully Paid"){ $background_color ='has-background-success' ; }elseif ($invoice->status == "Partially Paid"){ $background_color ='has-background-warning' ; }else{ $background_color ='has-background-primary'; } @endphp
{{$invoice->status}}

Payments for invoice #{{$invoice->invnumber}}

@if(!$invoice->payments->isEmpty())
@foreach ($invoice->payments as $payment)
{{$payment->paymentmethod}}
{{date_format($payment->created_at,'Y-M-d')}}
{{$payment->amount}}
@endforeach
@endif @if($invoice->payments->isEmpty())
This invoice does not have any payments.
@endif @if($invoice->status !='Fully Paid')
@endif
$567.99
{{$invoice->salesorder->sonumber}}
{{$invoice->salesorder->customer->firstname }} {{$invoice->salesorder->customer->lastname }}
@foreach ($invoice->products as $product) @endforeach
Product Name Amount
{{$product->details->name}}
{{$product->invoiced_qty}} X ${{$product->unit_price}}
{{number_format($product->unit_price*$product->invoiced_qty, 2, '.', '')}}
Sub Total ${{number_format($sub_total, 2, '.', '')}}
${{number_format($tax, 2, '.', '')}}
Total ${{number_format($sub_total+$tax, 2, '.', '')}}
51 67
@endsection