@extends('layouts.customer_panel') @section('css') @endsection @section('content')
{{ __('Invoice') }} >> #{{ $saleInvoiceData->reference }}
{{ $company_name }}
{{ $company_street }}
{{ $company_city }}{{ !empty($company_state) ? ', ' . $company_state : '' }}
{{ $company_country_name }}{{ !empty($company_zipCode) ? ', ' . $company_zipCode : '' }}
{{ __('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->pos_shipping)
{{ __('Shipment') }}
{{ $saleInvoiceData->shipping_address->name}}
{{ $saleInvoiceData->shipping_address->ship_email }}
{{ $saleInvoiceData->shipping_address->ship_city }} {{ $saleInvoiceData->shipping_address->ship_city && $saleInvoiceData->shipping_address->ship_state ? ', ' : '' }} {{ $saleInvoiceData->shipping_address->ship_state }}
{{ $saleInvoiceData->shipping_address->ship_country }} {{ $saleInvoiceData->shipping_address->ship_country && $saleInvoiceData->shipping_address->ship_zipCode ? ' - ' : '' }} {{ $saleInvoiceData->shipping_address->ship_zipCode }}
@endif
@if($saleInvoiceData->transaction_type != "POSINVOICE" && !empty($saleInvoiceData->order_reference_id)) {{ __('Quotation No') }} # {{ $saleInvoiceData->reference }}
@endif {{ __('Location') }} : {{ $saleInvoiceData->location->name }}
{{ __('Invoice Date') }} : {{ formatDate($saleInvoiceData->order_date)}}
@if($saleInvoiceData->due_date) {{ __('Due Date') }} : {{ formatDate($saleInvoiceData->due_date) }}
@endif
@if($saleInvoiceData->invoice_type == 'hours') @else @endif @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 = 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) @endif @if($saleInvoiceData->invoice_type != 'amount') @endif @if($saleInvoiceData->has_item_discount) @endif @if($saleInvoiceData->has_tax) @endif @endif @endforeach @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 @endif
{{ __('Service') }}{{ __('Items') }}{{ __('HSN') }}{{ __('Hours') }} {{ __('Rate') }}{{ __('Quantity') }} {{ __('Price') }}({{ $saleInvoiceData->currency->symbol }}){{ __('Discount') }}{{ __('Tax') }} (%) Total ({{ $saleInvoiceData->currency->symbol }})
{{ $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 => $tax) {{ formatCurrencyAmount($tax->rate) }}% @if( $counter < count( json_decode($result->taxList) ) - 1 ) , @endif @endforeach {{ formatCurrencyAmount($priceAmount) }}
{{ __('Sub Total') }} {{ formatCurrencyAmount($subTotal) }}
{{ __('Discount') }} {{ formatCurrencyAmount($saleInvoiceData->saleOrderDetails->sum('discount_amount')) }}
{{ $tax['name'] }} : {{ formatCurrencyAmount($tax['rate']) }}% {{ formatCurrencyAmount(($tax['amount'])) }}
{{ __('Other Discount') }} : {{ $saleInvoiceData->other_discount . " " . formatCurrencyAmount($saleInvoiceData->other_discount_amount) }}{{ $saleInvoiceData->other_discount_type == '$' ? $saleInvoiceData->currency->symbol : '%' }} {{ formatCurrencyAmount(($otherDiscount))}}
{{ __('Shipping') }} {{ $saleInvoiceData->shipping_charge }}
{{ $saleInvoiceData->custom_charge_title }} {{ $saleInvoiceData->custom_charge_amount }}
{{ __('Grand Total') }} {{ formatCurrencyAmount($saleInvoiceData->total, $saleInvoiceData->currency->symbol) }}
{{ __('Paid') }} {{ formatCurrencyAmount($saleInvoiceData->paid, $saleInvoiceData->currency->symbol) }}
{{ __('Due') }} @if($saleInvoiceData->total > $saleInvoiceData->paid) {{ formatCurrencyAmount(abs($saleInvoiceData->total - $saleInvoiceData->paid), $saleInvoiceData->currency->symbol) }} @else {{ formatCurrencyAmount(($saleInvoiceData->total - $saleInvoiceData->paid), $saleInvoiceData->currency->symbol) }} @endif
{{ __('Payments') }}
@if(isset($paymentsList) && count($paymentsList) > 0) @php $sumInvoice = 0; @endphp @foreach($paymentsList as $payment) @php $sumInvoice += $payment->amount; @endphp @endforeach
{{ __('Payment No') }} {{ __('Method') }} {{ __('Date') }} {{ __('Currency') }} {{ __('Status') }} {{ __('Amount') }}
id") }}">  {{ sprintf("%04d", $payment->id) }} {{ isset($payment->paymentMethod->name) ? $payment->paymentMethod->name : '' }} {{ formatDate($payment->created_at,'Y-m-d') }} {{ $payment->currency->name }} @if( $payment->status == "Approved") {{ __('Approved') }} @elseif( $payment->status == "Pending" ) {{ __('Pending') }} @elseif( $payment->status == "Declined" ) {{ __('Declined') }} @endif {{ formatCurrencyAmount($payment->amount, $payment->currency->symbol) }}
{{ __('Total') }} {{ formatCurrencyAmount($sumInvoice, $payment->currency->symbol)}}
@else
{{ __('No payment found.') }}
@endif
@if (count($files) > 0)
{{ __('Files') }}
@foreach ($files as $file) @php $url = url('public/dist/js/html5lightbox/no_preview.png?v'). $file->id; $extra = ''; $div = ''; $fileName = !empty($file->original_file_name) ? $file->original_file_name : $file->file_name; if (in_array($file->extension, array('jpg', 'png', 'jpeg', 'gif', 'pdf', 'flv', 'webm', 'mp4', 'ogv', 'swf', 'm4v', 'ogg'))) { $url = url($filePath) .'/'. $file->file_name; } elseif (in_array($file->extension, array('csv', 'xls', 'xlsx', 'doc', 'docx', 'ppt', 'pptx', 'txt'))) { $url = '#pdiv-'. $file->id; $extra = 'data-width=900 data-height=600'; $div = '
'; } @endphp
@if (in_array($file->extension, array('jpg', 'png', 'jpeg', 'gif'))) @else @endif
{{ strlen($fileName) > 15 ? substr_replace($fileName, "..", 15) : $file->original_file_name }}
@endforeach
@endif @if($saleInvoiceData->has_comment == 1 && !empty($saleInvoiceData->comment))
{{ __('Note') }}
{{ $saleInvoiceData->comment }}
@endif
@endsection @section('js') {!! translateValidationMessages() !!} @endsection