@php use App\Models\Utility; $setting = Utility::settingsById($invoice->created_by); @endphp @extends('layouts.invoicepayheader') @section('page-title') {{ __('Invoice Detail') }} @endsection @push('css-page') @endpush @push('script-page') @if (isset($company_payment_setting['is_khalti_enabled']) && $company_payment_setting['is_khalti_enabled'] == 'on') @endif @endpush @section('content') @php $customer = $invoice->customer; @endphp @can('send invoice') @if ($invoice->status != 4) {{--
{{__('Create Invoice')}}
@can('edit invoice')
@endcan {{__('Created on ')}} {{\Auth::user()->dateFormat($invoice->issue_date)}}
{{__('Send Invoice')}}
@if ($invoice->status == 0)
@can('send invoice') @endcan
@endif @if ($invoice->status != 0) {{__('Sent on')}} {{\Auth::user()->dateFormat($invoice->send_date)}} @else @can('send invoice') {{__('Status')}} : {{__('Not Sent')}} @endcan @endif
{{__('Get Paid')}}
@if ($invoice->status != 0) @can('create payment invoice') @endcan @endif {{__('Awaiting payment')}}
--}} @endif @endcan @if ($invoice->status != 0)
@if (!empty($invoicePayment)) @endif {{-- @if ($invoice->status != 4) @endif --}}
{{ __('Download') }} @if ($invoice->getDue() > 0) {{-- @if (\Auth::guard('customer')->check()) --}} {{-- {{ __('Pay Now') }} --}} {{ __('Pay Now') }} {{-- @endif --}} @endif
@endif

{{ __('Invoice') }}

{{ Utility::invoiceNumberFormat($company_setting, $invoice->invoice_id) }}


{{ __('Issue Date') }} :
@if (\Auth::check()) {{ \App\Models\User::dateFormat($invoice->issue_date) }}

@else {{ \App\Models\User::dateFormat($invoice->issue_date) }}

@endif
{{ __('Due Date') }} :
@if (\Auth::check()) {{ \App\Models\User::dateFormat($invoice->due_date) }}

@else {{ \App\Models\User::dateFormat($invoice->due_date) }}

@endif
@if (!empty($customer->billing_name))
{{ __('Billed To') }} :
{{ !empty($customer->billing_name) ? $customer->billing_name : '' }}
{{ !empty($customer->billing_address) ? $customer->billing_address : '' }}
{{ !empty($customer->billing_city) ? $customer->billing_city : '' . ', ' }}, {{ !empty($customer->billing_state) ? $customer->billing_state : '', ', ' }} {{ !empty($customer->billing_zip) ? $customer->billing_zip : '' }}
{{ !empty($customer->billing_country) ? $customer->billing_country : '' }}
{{ !empty($customer->billing_phone) ? $customer->billing_phone : '' }}
@if(!empty($setting['tax_type']) && !empty($setting['vat_number'])){{$setting['tax_type'].' '. __('Number')}} : {{$setting['vat_number']}}
@endif
@endif @if (App\Models\Utility::getValByName('shipping_display') == 'on')
{{ __('Shipped To') }} :
{{ !empty($customer->shipping_name) ? $customer->shipping_name : '' }}
{{ !empty($customer->shipping_address) ? $customer->shipping_address : '' }}
{{ !empty($customer->shipping_city) ? $customer->shipping_city : '' . ', ' }}, {{ !empty($customer->shipping_state) ? $customer->shipping_state : '' . ', ' }} {{ !empty($customer->shipping_zip) ? $customer->shipping_zip : '' }}
{{ !empty($customer->shipping_country) ? $customer->shipping_country : '' }}
{{ !empty($customer->shipping_phone) ? $customer->shipping_phone : '' }}
@endif
@if ( isset($setting['invoice_qr_display']) && $setting['invoice_qr_display'] == 'on') {!! DNS2D::getBarcodeHTML( route('pay.invoice', \Illuminate\Support\Facades\Crypt::encrypt($invoice->id)), 'QRCODE', 2, 2, ) !!} @endif
{{ __('Status') }} :
@if ($invoice->status == 0) {{ __(\App\Models\Invoice::$statues[$invoice->status]) }} @elseif($invoice->status == 1) {{ __(\App\Models\Invoice::$statues[$invoice->status]) }} @elseif($invoice->status == 2) {{ __(\App\Models\Invoice::$statues[$invoice->status]) }} @elseif($invoice->status == 3) {{ __(\App\Models\Invoice::$statues[$invoice->status]) }} @elseif($invoice->status == 4) {{ __(\App\Models\Invoice::$statues[$invoice->status]) }} @endif
@if (!empty($customFields) && count($invoice->customField) > 0) @foreach ($customFields as $field)
{{ $field->name }} :
{{ !empty($invoice->customField) ? $invoice->customField[$field->id] : '-' }}

@endforeach @endif
{{ __('Product Summary') }}
{{ __('All items here cannot be deleted.') }}
@php $totalQuantity = 0; $totalRate = 0; $totalTaxPrice = 0; $totalDiscount = 0; $taxesData = []; $TaxPrice_array = []; @endphp @foreach ($iteams as $key => $iteam) @if (!empty($iteam->tax)) @php $taxes = App\Models\Utility::tax($iteam->tax); $totalQuantity += $iteam->quantity; $totalRate += $iteam->price; $totalDiscount += $iteam->discount; foreach ($taxes as $taxe) { $taxDataPrice = App\Models\Utility::taxRate($taxe->rate, $iteam->price, $iteam->quantity, $iteam->discount); if (array_key_exists($taxe->name, $taxesData)) { $taxesData[$taxe->name] = $taxesData[$taxe->name] + $taxDataPrice; } else { $taxesData[$taxe->name] = $taxDataPrice; } } @endphp @endif {{-- --}} @endforeach {{-- @if (!empty($taxesData)) @foreach ($taxesData as $taxName => $taxPrice) @endforeach @endif --}} @if (!empty($taxesData)) @php $user = \App\Models\User::where('id', $tax->created_by)->first(); @endphp @foreach ($taxesData as $taxName => $taxPrice) @endforeach @endif
# {{ __('Product') }} {{ __('Quantity') }} {{ __('Rate') }} {{ __('Discount') }} {{ __('Tax') }} {{ __('Description') }} {{ __('Price') }}
{{ __('before tax & discount') }}
{{ $key + 1 }} {{ !empty($iteam->product) ? $iteam->product->name : '' }} {{ $iteam->quantity }} {{ Utility::priceFormat($company_setting, $iteam->price) }} {{ Utility::priceFormat($company_setting, $iteam->discount) }} @if (!empty($iteam->tax)) @php $totalTaxRate = 0;@endphp @foreach ($taxes as $tax) @php $taxPrice = App\Models\Utility::taxRate($tax->rate, $iteam->price, $iteam->quantity); $totalTaxPrice += $taxPrice; @endphp @endforeach
{{ $tax->name . ' (' . $tax->rate . '%)' }} {{ Utility::priceFormat($company_setting, $taxPrice) }}
@else - @endif
@if (!empty($iteam->tax)) @php $totalTaxRate = 0; $data = 0; @endphp @foreach ($taxes as $tax) @php $taxPrice = App\Models\Utility::taxRate($tax->rate, $iteam->price, $iteam->quantity, $iteam->discount); $totalTaxPrice += $taxPrice; $user = \App\Models\User::where('id', $tax->created_by)->first(); @endphp @endforeach @php array_push($TaxPrice_array, $data); @endphp
{{ $tax->name . ' (' . $tax->rate . '%)' }} {{ Utility::priceFormat($company_setting, $taxPrice) }}
@else - @endif
{{ !empty($iteam->description) ? $iteam->description : '-' }} {{ Utility::priceFormat($company_setting, $iteam->price * $iteam->quantity) }}
{{ __('Total') }} {{ $totalQuantity }} {{ Utility::priceFormat($company_setting, $totalRate) }} {{ Utility::priceFormat($company_setting, $totalDiscount) }} {{ Utility::priceFormat($company_setting, $totalTaxPrice) }}
{{ __('Sub Total') }} {{ Utility::priceFormat($company_setting, $invoice->getSubTotal()) }}
{{ __('Discount') }} {{ Utility::priceFormat($company_setting, $invoice->getTotalDiscount()) }}
{{ $taxName }} {{ Utility::priceFormat($company_setting, $taxPrice) }}
{{ $taxName }} {{ Utility::priceFormat($company_setting, $taxPrice) }}
{{ __('Total') }} {{ Utility::priceFormat($company_setting, $invoice->getTotal()) }}
{{ __('Paid') }} {{ Utility::priceFormat($company_setting, $invoice->getTotal() - $invoice->getDue() - $invoice->invoiceTotalCreditNote()) }}
{{ __('Credit Note') }} {{ Utility::priceFormat($company_setting, $invoice->invoiceTotalCreditNote()) }}
{{ __('Due') }} {{ Utility::priceFormat($company_setting, $invoice->getDue()) }}
{{ __('Receipt Summary') }}
@php $paymentpath = \App\Models\Utility::get_file('uploads/payment'); $path = \App\Models\Utility::get_file('/uploads/bank_receipt'); @endphp @foreach ($invoice->payments as $key => $payment) @endforeach @php $path = \App\Models\Utility::get_file('/uploads/bank_receipt'); @endphp @foreach ($invoice->bankpayment as $key => $bankpayment) @endforeach
{{ __('Date') }} {{ __('Amount') }} {{ __('Payment Type') }} {{ __('Account') }} {{ __('Reference') }} {{ __('Description') }} {{ __('Receipt') }} {{ __('OrderId') }}
{{ Utility::dateFormat($company_setting, $payment->date) }} {{ Utility::priceFormat($company_setting, $payment->amount) }} {{ $payment->payment_type }} {{ !empty($payment->bankAccount) ? $payment->bankAccount->bank_name . ' ' . $payment->bankAccount->holder_name : '--' }} {{ !empty($payment->reference) ? $payment->reference : '--' }} {{ !empty($payment->description) ? $payment->description : '--' }} @if (!empty($payment->add_receipt) && empty($payment->receipt) && ($payment->payment_type=='Manually'))
@elseif(!empty($payment->add_receipt) && empty($payment->receipt) ) @elseif(empty($payment->add_receipt) && !empty($payment->receipt) ) @else -- @endif
{{ !empty($payment->order_id) ? $payment->order_id : '--' }}
{{ Utility::dateFormat($company_setting, $bankpayment->date ?? $bankpayment->created_at) }} {{ Utility::priceFormat($company_setting, $bankpayment->amount) }} {{ 'Bank Transfer' }} {{ !empty($bankpayment->bankAccount) ? $bankpayment->bankAccount->bank_name . ' ' . $bankpayment->bankAccount->holder_name : '--' }} {{ !empty($bankpayment->reference) ? $bankpayment->reference : '--' }} {{ !empty($bankpayment->description) ? $bankpayment->description : '--' }} @if (!empty($bankpayment->receipt)) @else -- @endif {{ !empty($bankpayment->order_id) ? $bankpayment->order_id : '--' }}
{{ __('Credit Note Summary') }}
@forelse($invoice->creditNote as $key =>$creditNote) @empty @endforelse
{{ __('Date') }} {{ __('Amount') }} {{ __('Description') }}
{{ Utility::dateFormat($company_setting, $creditNote->date) }} {{ Utility::priceFormat($company_setting, $creditNote->amount) }} {{ $creditNote->description }}

{{ __('No Data Found') }}

@if ($invoice->getDue() > 0) @endif {{-- @endauth --}} @endsection