@extends('report.layout') @section('title', __('lang.invoice')) @section('type', __('lang.invoice')) @section('to') @if(isset($extra['shipping_details']) && $extra['shipping_details'] && $invoice->estimates_id) @endif
{{ __('lang.bill_to') }}
@if($invoice->client_estimate_status_id) {{ $invoice->client_estimate_status->estimate->client->getCompleteName() }}
{{ $invoice->client_estimate_status->estimate->client->address }}
{{ $invoice->client_estimate_status->estimate->client->getCityName() }}, {{ $invoice->client_estimate_status->estimate->client->getStateName() }} {{ $invoice->client_estimate_status->estimate->client->postal_code }}
@elseif($invoice->estimates_id) {{ $invoice->estimate->client->getCompleteName() }}
@if(isset($extra['customer_details']) && $extra['customer_details']) {{ $extra['customer_details']['address']['line1'] }}
{{ $extra['customer_details']['address']['city'] }}, {{ $extra['customer_details']['address']['state'] }} {{ $extra['customer_details']['address']['postal_code'] }}
@else {{ $invoice->estimate->client->address }}
{{ $invoice->estimate->client->city ? $invoice->estimate->client->city->name : '' }}, {{ $invoice->estimate->client->state ? $invoice->estimate->client->state->name : '' }} {{ $invoice->estimate->client->postal_code ?? '' }}
@endif @endif
{{ __('lang.ship_to') }}
{{ $invoice->estimate->client->getCompleteName() }}
{{ $extra['shipping_details']['address']['line1'] }}
{{ $extra['shipping_details']['address']['city'] }}, {{ $extra['shipping_details']['address']['state'] }} {{ $extra['shipping_details']['address']['postal_code'] }}
{{ __('lang.details') }}
{{ __('lang.invoice') }} # {{ $invoice->number }}
@if($invoice->getPaymentDateFormat()) {{ __('lang.date.date') }} {{ $invoice->getPaymentDateFormat() }}
@endif {{ __('lang.status') }} {{ $invoice->getStatus() }}
@endsection @section('content') @php $estimate = $invoice->client_estimate_status ? $invoice->client_estimate_status->estimate : $invoice->estimate; @endphp @foreach($estimate->estimate_sections as $key => $section) @foreach($section->estimate_products as $keyProduct => $product) @endforeach
{{ $section->name }}
{{ __('lang.product.product') }} {{ __('lang.quantity') }} {{ __('lang.price') }} {{ __('lang.total') }}

{{ $product->product->name }}

@if($product->product->description)

{{ $product->product->description }}

@endif
{{ $product->quantity }} {{ MoneyHelper::format($product->price) }} {{ MoneyHelper::format($product->price * $product->quantity) }}
@endforeach @if($estimate->discounts_id) @endif
{{ __('lang.sub_total') }}: {{ MoneyHelper::format($estimate->sub_total) }}
{{ __('lang.tax') }}: {{ MoneyHelper::format($estimate->tax) }}
{{ __('lang.discount') }} : {{ $estimate->discount->getDiscountName() }} {{ MoneyHelper::format( $estimate->discount->getDiscountTotal() * -1) }}
{{ __('lang.total') }}: {{ MoneyHelper::format($estimate->total) }}
@endsection