dbfdg @extends('layouts.admin') @section('page-title') {{ __('Invoice Detail') }} @endsection @section('breadcrumb') @endsection @php $settings = Utility::settings(); @endphp @push('css-page') @endpush @push('script-page') @endpush @section('content') @can('send invoice') @if ($invoice->status != 4)
{{ __('Create Invoice') }}

{{ __('Created on ') }}{{ \Auth::user()->dateFormat($invoice->issue_date) }}

@can('edit invoice') {{ __('Edit') }} @endcan
{{ __('Send Invoice') }}

@if ($invoice->status != 0) {{ __('Sent on') }} {{ \Auth::user()->dateFormat($invoice->send_date) }} @else @can('send invoice') {{ __('Status') }} : {{ __('Not Sent') }} @endcan @endif

@if ($invoice->status == 0) @can('send bill') {{ __('Send') }} @endcan @endif
{{ __('Get Paid') }}

{{ __('Status') }} : {{ __('Awaiting payment') }}

@if ($invoice->status != 0) @can('create payment invoice') {{ __('Receive Payment') }}
@endcan @endif
@endif @endcan @if (Gate::check('show invoice')) @if ($invoice->status != 0)
@if (!empty($creditnote)) @endif @if ($invoice->status != 4) @endif
@endif @endif

{{ __('Invoice') }}

{{ AUth::user()->invoiceNumberFormat($invoice->invoice_id) }}


{{ __('Issue Date') }} :
{{ \Auth::user()->dateFormat($invoice->issue_date) }}

{{ __('Due Date') }} :
{{ \Auth::user()->dateFormat($invoice->due_date) }}

{{ __('Billed To') }} :
@if (!empty($customer->billing_name)) {{ !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 ($settings['vat_gst_number_switch'] == 'on') {{ __('Tax Number ') }} : {{ !empty($customer->tax_number) ? $customer->tax_number : '' }} @endif @else - @endif
@if (App\Models\Utility::getValByName('shipping_display') == 'on')
{{ __('Shipped To') }} :
@if (!empty($customer->shipping_name)) {{ !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 : '' }}
@else - @endif
@endif
{!! DNS2D::getBarcodeHTML( route('invoice.link.copy', \Illuminate\Support\Facades\Crypt::encrypt($invoice->id)), 'QRCODE', 2, 2, ) !!}
{{ __('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 = []; @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 --}} @php $productName = $iteam->product; $totalRate += $iteam->price; $totalQuantity += $iteam->quantity; $totalDiscount += $iteam->discount; @endphp {{-- --}} @endforeach @if (!empty($taxesData)) @foreach ($taxesData as $taxName => $taxPrice) @endforeach @endif
# {{ __('Product') }} {{ __('Quantity') }} {{ __('Rate') }} {{ __('Discount') }} {{ __('Tax') }} {{ __('Description') }} {{ __('Price') }}
{{ __('after tax & discount') }}
{{ $key + 1 }}{{ !empty($productName) ? $productName->name : '' }} {{ $iteam->quantity . ' (' . (isset($productName->unit) ? $productName->unit->name : 'No unit') . ')' }} {{ \Auth::user()->priceFormat($iteam->price) }} {{ \Auth::user()->priceFormat($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,$iteam->discount) ; $totalTaxPrice+=$taxPrice; @endphp @endforeach
{{$tax->name .' ('.$tax->rate .'%)'}} {{\Auth::user()->priceFormat($taxPrice)}}
@else - @endif
@if (!empty($iteam->tax)) @php $itemTaxes = []; $getTaxData = Utility::getTaxData(); if (!empty($iteam->tax)) { foreach (explode(',', $iteam->tax) as $tax) { $taxPrice = \Utility::taxRate($getTaxData[$tax]['rate'], $iteam->price, $iteam->quantity); $totalTaxPrice += $taxPrice; $itemTax['name'] = $getTaxData[$tax]['name']; $itemTax['rate'] = $getTaxData[$tax]['rate'] . '%'; $itemTax['price'] = \Auth::user()->priceFormat($taxPrice); $itemTaxes[] = $itemTax; if (array_key_exists($getTaxData[$tax]['name'], $taxesData)) { $taxesData[$getTaxData[$tax]['name']] = $taxesData[$getTaxData[$tax]['name']] + $taxPrice; } else { $taxesData[$getTaxData[$tax]['name']] = $taxPrice; } } $iteam->itemTax = $itemTaxes; } else { $iteam->itemTax = []; } @endphp @foreach ($iteam->itemTax as $tax) @endforeach
{{$tax['name'] .' ('.$tax['rate'] .'%)'}} {{ $tax['price']}}
@else - @endif
{{ !empty($iteam->description) ? $iteam->description : '-' }} {{ \Auth::user()->priceFormat($iteam->price * $iteam->quantity - $iteam->discount + $totalTaxPrice) }}
{{ __('Total') }} {{ $totalQuantity }} {{ \Auth::user()->priceFormat($totalRate) }} {{ \Auth::user()->priceFormat($totalDiscount) }} {{ \Auth::user()->priceFormat($totalTaxPrice) }}
{{ __('Sub Total') }} {{ \Auth::user()->priceFormat($invoice->getSubTotal()) }}
{{ __('Discount') }} {{ \Auth::user()->priceFormat($invoice->getTotalDiscount()) }}
{{ $taxName }} {{ \Auth::user()->priceFormat($taxPrice) }}
{{ __('Total') }} {{ \Auth::user()->priceFormat($invoice->getTotal()) }}
{{ __('Paid') }} {{ \Auth::user()->priceFormat($invoice->getTotal() - $invoice->getDue() - $invoice->invoiceTotalCreditNote()) }}
{{ __('Credit Note') }} {{ \Auth::user()->priceFormat($invoice->invoiceTotalCreditNote()) }}
{{ __('Due') }} {{ \Auth::user()->priceFormat($invoice->getDue()) }}
{{ __('Receipt Summary') }}

@if ($user_plan->storage_limit <= $invoice_user->storage_limit) {{ __('Your plan storage limit is over , so you can not see customer uploaded payment receipt') }}
@endif
@can('delete payment invoice') @endcan @if (!empty($invoice->payments) && $invoice->bankPayments) @php $path = \App\Models\Utility::get_file('uploads/order'); @endphp @foreach ($invoice->payments as $key => $payment) @if ($user_plan->storage_limit <= $invoice_user->storage_limit) @else @endif @can('delete invoice product') @endcan @endforeach {{-- start for bank transfer --}} @foreach ($invoice->bankPayments as $key => $bankPayment) @if ($user_plan->storage_limit <= $invoice_user->storage_limit) @else @endif @can('delete invoice product') @endcan @endforeach {{-- end for bank transfer --}} @else @endif
{{ __('Payment Receipt') }} {{ __('Date') }} {{ __('Amount') }} {{ __('Payment Type') }} {{ __('Account') }} {{ __('Reference') }} {{ __('Description') }} {{ __('Receipt') }} {{ __('OrderId') }}{{ __('Action') }}
@if (!empty($payment->add_receipt)) @else - @endif {{ \Auth::user()->dateFormat($payment->date) }} {{ \Auth::user()->priceFormat($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->receipt)) {{ __('Receipt') }} @elseif(!empty($payment->add_receipt)) {{ __('Receipt') }} @else -- @endif {{ !empty($payment->order_id) ? $payment->order_id : '--' }}
{!! Form::open([ 'method' => 'post', 'route' => ['invoice.payment.destroy', $invoice->id, $payment->id], 'id' => 'delete-form-' . $payment->id, ]) !!} {!! Form::close() !!}
- {{ \Auth::user()->dateFormat($bankPayment->date) }} {{ \Auth::user()->priceFormat($bankPayment->amount) }} {{ __('Bank Transfer') }}
- - - --- @if (!empty($bankPayment->receipt)) {{ __('Receipt') }} @endif {{ !empty($bankPayment->order_id) ? $bankPayment->order_id : '--' }} @if ($bankPayment->status == 'Pending') @endif
{!! Form::open([ 'method' => 'post', 'route' => ['invoice.payment.destroy', $invoice->id, $bankPayment->id], 'id' => 'delete-form-' . $bankPayment->id, ]) !!} {!! Form::close() !!}

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

{{ __('Credit Note Summary') }}
@if (Gate::check('edit credit note') || Gate::check('delete credit note')) @endif @forelse($invoice->creditNote as $key =>$creditNote) @empty @endforelse
{{ __('Date') }} {{ __('Amount') }} {{ __('Description') }}{{ __('Action') }}
{{ \Auth::user()->dateFormat($creditNote->date) }} {{ \Auth::user()->priceFormat($creditNote->amount) }} {{ $creditNote->description }} @can('edit credit note') @endcan @can('delete credit note')
{!! Form::open([ 'method' => 'DELETE', 'route' => ['invoice.delete.credit.note', $creditNote->invoice, $creditNote->id], 'id' => 'delete-form-' . $creditNote->id, ]) !!} {!! Form::close() !!}
@endcan

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

@endsection