@if($saleInvoiceData->total > 0) @if($saleInvoiceData->paid == 0) @elseif($saleInvoiceData->paid > 0 && $saleInvoiceData->total > $saleInvoiceData->paid ) @elseif($saleInvoiceData->total <= $saleInvoiceData->paid) @endif @else @endif
{{ __('Invoice No') }} : {{ $saleInvoiceData->reference }}
{{ __('Date') }} : {{ formatDate($saleInvoiceData->order_date) }}
{{ __('Due Date') }} : {{ formatDate($saleInvoiceData->due_date) }}
{{ __('Status') }} :{{ __('Unpaid') }}{{ __('Partially Paid') }}{{ __('Paid') }}{{ __('Paid') }}
@if (isset($company_name) && !empty($company_name))

{{ $company_name }}

@endif

{{ $company_street }}

{{ ! empty($company_city) ? $company_city : '' }}{{ ! empty($company_state) ? ', '.$company_state : ''}}{{!empty($company_zipCode) ? ', '.$company_zipCode : ''}}

{{ $company_country_name }}

{{ __('Bill To') }}

{{ isset($saleInvoiceData->customer->first_name) ? $saleInvoiceData->customer->first_name : '' }} {{ isset($saleInvoiceData->customer->last_name) ? $saleInvoiceData->customer->last_name : '' }}

{{ isset($saleInvoiceData->customerBranch->billing_street) ? $saleInvoiceData->customerBranch->billing_street : '' }}

{{ isset($saleInvoiceData->customerBranch->billing_state) ? $saleInvoiceData->customerBranch->billing_state : '' }}{{ isset($saleInvoiceData->customerBranch->billing_city) ? ', '. $saleInvoiceData->customerBranch->billing_city : '' }}

{{ isset($saleInvoiceData->customerBranch->billingCountry) ? $saleInvoiceData->customerBranch->billingCountry->name : '' }} {{ isset($saleInvoiceData->customerBranch->billing_zip_code) ? ', '.$saleInvoiceData->customerBranch->billing_zip_code : '' }}

@if($saleInvoiceData->has_hsn) @endif @if($saleInvoiceData->invoice_type == 'hours') @else @endif @if($saleInvoiceData->has_item_discount) @endif @if($saleInvoiceData->has_tax) @endif @php $itemsInformation = ''; $row = 6; $currentTaxArray = []; if ($saleInvoiceData->invoice_type == 'amount') { $row = $row - 2; } if (!$saleInvoiceData->has_item_discount) { $row = $row - 1; } if (!$saleInvoiceData->has_hsn) { $row = $row - 1; } if (!$saleInvoiceData->has_tax) { $row = $row - 1; } @endphp @if ( count ($saleInvoiceData->saleOrderDetails) > 0 ) @php $subTotal = $totalDiscount = $i = 0; @endphp @foreach ($saleInvoiceData->saleOrderDetails as $result) @php $priceAmount = ($result->quantity * $result['unit_price']); $subTotal += $priceAmount; @endphp @if($result->quantity > 0) @if($saleInvoiceData->has_hsn == 1) @endif @if($saleInvoiceData->invoice_type != 'amount') @endif @if($saleInvoiceData->has_item_discount == 1) @endif @if($saleInvoiceData->has_tax == 1) @endif @endif @endforeach @endif
{{ __('SI') }} {{ __('Description')}}{{ __('HSN') }}{{ __('Hours') }} {{ __('Rate') }}{{ __('Quantity') }} {{ __('Price') }}{{ __('Discount') }}{{ __('Tax') }}(%){{ __('Amount') }} ({{ $saleInvoiceData->currency->symbol }})
{{ ++$i }} {{ $result->item_name }}
@if($saleInvoiceData->has_description && $result->description) {{ $result->description }} @endif
{{ $result->hsn }}{{ formatCurrencyAmount($result->quantity) }}{{ formatCurrencyAmount($result->unit_price) }}{{ formatCurrencyAmount($result->discount) }}{{ $result->discount_type }} @foreach ( json_decode($result->taxList) as $counter => $taxItem) {{ formatCurrencyAmount($taxItem->rate) }}% @if ($counter < count(json_decode($result->taxList)) - 1 )
@endif @endforeach
{{ formatCurrencyAmount($priceAmount) }}
@if($saleInvoiceData->has_item_discount) @endif @forelse($taxes as $tax) @empty @endforelse @if($saleInvoiceData->has_other_discount == 1) @php if($saleInvoiceData->other_discount_type=="$"){ $otherDiscount = $saleInvoiceData->other_discount_amount; }else{ $otherDiscount = $subTotal * $saleInvoiceData->other_discount_amount / 100; } @endphp @endif @if($saleInvoiceData->has_shipping_charge && $saleInvoiceData->shipping_charge) @endif @if($saleInvoiceData->has_custom_charge) @endif
{{ __('Sub Total') }} : {{ formatCurrencyAmount($subTotal, isset($saleInvoiceData->currency->symbol) ? $saleInvoiceData->currency->symbol : '') }}
Discount : {{ formatCurrencyAmount($saleInvoiceData->saleOrderDetails->sum('discount_amount'), isset($saleInvoiceData->currency->symbol) ? $saleInvoiceData->currency->symbol : '') }}
{{ $saleInvoiceData->tax_type == 'inclusive' ? __('Included') : '' }}{{ $tax['name'] }} ({{ formatCurrencyAmount($tax['rate']) }})% : {{ formatCurrencyAmount($tax['amount'], isset($saleInvoiceData->currency->symbol) ? $saleInvoiceData->currency->symbol : '') }}
{{ __('Other Discount') }} ({{ formatCurrencyAmount($saleInvoiceData->other_discount_amount) }}) {{ $saleInvoiceData->other_discount_type=='$' ? $saleInvoiceData->currency->symbol : '%' }} : {{ formatCurrencyAmount($otherDiscount, $saleInvoiceData->currency->symbol )}}
Shipping : {{ formatCurrencyAmount($saleInvoiceData->shipping_charge, $saleInvoiceData->currency->symbol) }}
{{ $saleInvoiceData->custom_charge_title }} : {{ formatCurrencyAmount($saleInvoiceData->custom_charge_amount, isset($saleInvoiceData->currency->symbol) ? $saleInvoiceData->currency->symbol : '') }}

{{ __('Grand Total') }} {{ formatCurrencyAmount($saleInvoiceData->total, isset($saleInvoiceData->currency->symbol) ? $saleInvoiceData->currency->symbol : '') }}
{{ __('Paid') }} : {{ formatCurrencyAmount($saleInvoiceData->paid, isset($saleInvoiceData->currency->symbol) ? $saleInvoiceData->currency->symbol : '') }}
{{ __('Due') }} : @if($saleInvoiceData->total > $saleInvoiceData->paid) {{ formatCurrencyAmount(abs($saleInvoiceData->total - $saleInvoiceData->paid), isset($saleInvoiceData->currency->symbol) ? $saleInvoiceData->currency->symbol : '') }} @else {{ formatCurrencyAmount(abs($saleInvoiceData->total - $saleInvoiceData->paid), isset($saleInvoiceData->currency->symbol) ? $saleInvoiceData->currency->symbol : '') }} @endif
@if($saleInvoiceData->has_comment == 1 && !empty($saleInvoiceData->comment))

{{ __('Note') }} : {{ $saleInvoiceData->comment }}

@endif