@extends('template') @section('title') @lang('Sales Invoice') @endsection @section('receiver-info')

@lang('Invoice')

@lang('Name'): {{ $invoice['client']['name'] }}

@if ($invoice['client']['company_name'])

@lang('Company'): {{ $invoice['client']['company_name'] }}

@endif

@lang('Phone'): {{ $invoice['client']['phone'] }}

@lang('Email'): {{ $invoice['client']['email'] }}

@if ($invoice['client']['address'])

@lang('Address'): {{ $invoice['client']['address'] }}

@endif @endsection @section('pdf-content') @if ($invoice['reference']) @endif @if ($invoice['delivery_place']) @endif @if ($invoice['po_reference']) @endif @if ($invoice['payment_terms']) @endif @if ($invoice['reference']) @endif @if ($invoice['delivery_place']) @endif @if ($invoice['po_reference']) @endif @if ($invoice['payment_terms']) @endif
@lang('Invoice No')@lang('Reference')Date@lang('Delivery Place')@lang('PO Reference')@lang('Payment Terms')
{{ config('config.invoicePrefix') . '-' . $invoice['invoice_no'] }}{{ $invoice['reference'] }}{{ $invoice['invoice_date'] }}{{ $invoice['delivery_place'] }}{{ $invoice['po_reference'] }}{{ $invoice['po_reference'] }}
@foreach ($invoice['invoiceProducts'] as $key => $product) @endforeach @if ($invoice['invoiceReturn']) @endif @if ($invoice['discount']) @endif @if ($invoice['transport']) @endif @if ($invoice->taxAmount()) @endif @if ($accountPayable) @endif
@lang('Item') @lang('Quantity') @lang('Price') @lang('Subtotal')
{{ $product['product']['name'] }} {{ $product['quantity'] . ' ' . $product['product']['productUnit']['code'] }} @currency($product['unit_cost']) @currency($product['unit_cost'] * $product['quantity'])
@lang('Subtotal') @currency($invoice['sub_total'])
@lang('Cost of Return Products') @currency($invoice['invoiceReturn']['total_return'])
@lang('Discount') @currency($invoice['discount'])
@lang('Transport') @currency($invoice['transport'])
@lang('Tax') @currency($invoice->taxAmount())
@lang('Total') @php $totalInvoiceReturn = isset($invoice['invoiceReturn']) ? $invoice['invoiceReturn']['total_return'] : 0; $total = $invoice['sub_total'] - $totalInvoiceReturn - $invoice['discount'] + $invoice['total_tax'] + $invoice['transport']; $accountPayable = isset($invoice['invoiceReturn']['returnTransaction']) ? $invoice['invoiceReturn']['returnTransaction']['amount'] : null; @endphp @currency($total)
@lang('Total Paid') @currency($invoice->invoiceTotalPaid())
@lang('Total Due') @currency($invoice->totalDue())
@lang('Account Payable') @currency($accountPayable)
@endsection