@extends('layouts.main') @section('page-title') {{ __('Invoice Detail') }} @endsection @section('page-breadcrumb') {{ __('Invoice Detail') }} @endsection @push('css') @endpush @push('scripts') @endpush @section('page-action')
@endsection @section('content') @if ($invoice->status != 4)
{{ __('Create Invoice') }}

{{ __('Created on ') }}{{ company_date_formate($invoice->issue_date) }}

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

@if ($invoice->status != 0) {{ __('Sent on') }} {{ company_date_formate($invoice->send_date) }} @else {{ __('Status') }} : {{ __('Not Sent') }} @endif

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

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

@if ($invoice->status != 0) @can('invoice payment create') {{ __('Add Payment') }}
@endcan @endif
@endif @if ($invoice->status != 0)
@can('creditnote create') @if (module_is_active('Account')) {{-- @if (!empty($invoicePayment)) --}} @endif {{-- @endif --}} @endcan @if (\Auth::user()->type == 'company') @if ($invoice->status != 4) @endif @endif
@else
{{-- @if ($invoice->getDue() > 0 && !empty($company_payment_setting) && ($company_payment_setting['is_stripe_enabled'] == 'on' || $company_payment_setting['is_paypal_enabled'] == 'on' || $company_payment_setting['is_paystack_enabled'] == 'on' || $company_payment_setting['is_flutterwave_enabled'] == 'on' || $company_payment_setting['is_razorpay_enabled'] == 'on' || $company_payment_setting['is_mercado_enabled'] == 'on' || $company_payment_setting['is_paytm_enabled'] == 'on' || $company_payment_setting['is_mollie_enabled'] == 'on' || $company_payment_setting['is_paypal_enabled'] == 'on' || $company_payment_setting['is_skrill_enabled'] == 'on' || $company_payment_setting['is_coingate_enabled'] == 'on' || $company_payment_setting['is_paymentwall_enabled'] == 'on')) @endif --}}
@endif

{{ __('Invoice') }}

{{ \App\Models\Invoice::invoiceNumberFormat($invoice->invoice_id) }}


{{ __('Issue Date') }} :
{{ company_date_formate($invoice->issue_date) }}

{{ __('Due Date') }} :
{{ company_date_formate($invoice->due_date) }}

@if (!empty($customer->billing_name) && !empty($customer->billing_address) && !empty($customer->billing_zip))
{{ __('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 : '' }}
{{ __('Tax Number ') }} : {{ !empty($customer->tax_number) ? $customer->tax_number : '' }}
@endif @if (company_setting('invoice_shipping_display') == 'on') @if (!empty($customer->shipping_name) && !empty($customer->shipping_address) && !empty($customer->shipping_zip))
{{ __('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 : '' }}
{{ __('Tax Number ') }} : {{ !empty($customer->tax_number) ? $customer->tax_number : '' }}
@endif @endif
@if (module_is_active('Zatca'))
@include('zatca::zatca_qr_code', [ 'invoice_id' => $invoice->id, ])
@else
{!! 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 }} :
@if ($field->type == 'attachment') @else {{ !empty($invoice->customField[$field->id]) ? $invoice->customField[$field->id] : '-' }} @endif

@endforeach @endif
{{ __('Item Summary') }}
{{ __('All items here cannot be deleted.') }}
@if ($invoice->invoice_module == 'account') @elseif($invoice->invoice_module == 'taskly') @endif @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\Invoice::tax($iteam->tax); $totalQuantity += $iteam->quantity; $totalRate += $iteam->price; $totalDiscount += $iteam->discount; foreach ($taxes as $taxe) { $taxDataPrice = \App\Models\Invoice::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 @if ($invoice->invoice_module == 'account') @elseif($invoice->invoice_module == 'taskly') @endif @php $tr_tex = array_key_exists($key, $TaxPrice_array) == true ? $TaxPrice_array[$key] : 0; @endphp @endforeach @if ($invoice->invoice_module == 'account') @endif @php $colspan = 6; if ($invoice->invoice_module == 'account') { $colspan = 7; } @endphp @if (!empty($taxesData)) @foreach ($taxesData as $taxName => $taxPrice) @endforeach @endif
#{{ __('Item Type') }} {{ __('Item') }}{{ __('Project') }}{{ __('Quantity') }} {{ __('Rate') }} {{ __('Discount') }} {{ __('Tax') }} {{ __('Description') }} {{ __('Price') }}
{{ __('After discount & tax') }}
{{ $key + 1 }}{{ !empty($iteam->product_type) ? Str::ucfirst($iteam->product_type) : '--' }} {{ !empty($iteam->product()) ? $iteam->product()->name : '' }}{{ !empty($iteam->product()) ? $iteam->product()->title : '' }}{{ $iteam->quantity }} {{ currency_format_with_sym($iteam->price) }} {{ currency_format_with_sym($iteam->discount) }} @if (!empty($iteam->tax)) @php $totalTaxRate = 0; $data = 0; @endphp @foreach ($taxes as $tax) @php $taxPrice = \App\Models\Invoice::taxRate($tax->rate, $iteam->price, $iteam->quantity, $iteam->discount); $totalTaxPrice += $taxPrice; $data += $taxPrice; @endphp @endforeach @php array_push($TaxPrice_array, $data); @endphp
{{ $tax->name . ' (' . $tax->rate . '%)' }} {{ currency_format_with_sym($taxPrice) }}
@else - @endif
{{ !empty($iteam->description) ? $iteam->description : '-' }} {{ currency_format_with_sym($iteam->price * $iteam->quantity - $iteam->discount + $tr_tex) }}
{{ __('Total') }} {{ $totalQuantity }} {{ currency_format_with_sym($totalRate) }} {{ currency_format_with_sym($totalDiscount) }} {{ currency_format_with_sym($totalTaxPrice) }}
{{ __('Sub Total') }} {{ currency_format_with_sym($invoice->getSubTotal()) }}
{{ __('Discount') }} {{ currency_format_with_sym($invoice->getTotalDiscount()) }}
{{ $taxName }} {{ currency_format_with_sym($taxPrice) }}
{{ __('Total') }} {{ currency_format_with_sym($invoice->getTotal()) }}
{{ __('Paid') }} {{ currency_format_with_sym($invoice->getTotal() - $invoice->getDue() - $invoice->invoiceTotalCreditNote()) }}
{{ __('Credit Note') }} {{ currency_format_with_sym($invoice->invoiceTotalCreditNote()) }}
{{ __('Due') }} {{ currency_format_with_sym($invoice->getDue()) }}
{{ __('Receipt Summary') }}
@can('invoice payment delete') @endcan @if (!empty($retainer->payments) || !empty($bank_transfer_payments)) @foreach ($bank_transfer_payments as $bank_transfer_payment) @endforeach @foreach ($invoice->payments as $key => $payment) @if (module_is_active('Account')) @else @endif @can('invoice payment delete') @endcan @endforeach @else @include('layouts.nodatafound') @endif
{{ __('Date') }} {{ __('Amount') }} {{ __('Payment Type') }} {{ __('Account') }} {{ __('Reference') }} {{ __('Description') }} {{ __('Receipt') }} {{ __('OrderId') }}{{ __('Action') }}
{{ company_datetime_formate($bank_transfer_payment->created_at) }} {{ currency_format_with_sym($bank_transfer_payment->price) }} {{ 'Bank transfer' }} - - - @if (!empty($bank_transfer_payment->attachment)) @else -- @endif {{ $bank_transfer_payment->order_id }}
{{ Form::open(['route' => ['bank-transfer-request.destroy', $bank_transfer_payment->id], 'class' => 'm-0']) }} @method('DELETE') {{ Form::close() }}
{{ company_date_formate($payment->date) }} {{ currency_format_with_sym($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) && (check_file($payment->add_receipt))) @elseif (!empty($payment->receipt) && empty($payment->add_receipt) && $payment->type == 'STRIPE') @elseif($payment->payment_type == 'Bank Transfer') @else -- @endif {{ !empty($payment->order_id) ? $payment->order_id : '--' }}
{{ Form::open(['route' => ['invoice.payment.destroy', $invoice->id, $payment->id], 'class' => 'm-0']) }} {{ Form::close() }}
@if (module_is_active('Account')) @include('account::invoice.invoice_section') @endif
{{ __('Attachments') }}
{{ __('Drop files here to upload') }}
@forelse($invoice_attachment as $key =>$attachment) @empty @include('layouts.nodatafound') @endforelse
{{__('#')}} {{__('File Name')}} {{__('File Size')}} {{__('Date Created')}} {{__('Action')}}
{{ ++$key }} {{ $attachment->file_name }} {{ $attachment->file_size }} {{ company_date_formate($attachment->created_at) }}
{{Form::open(array('route'=>array('invoice.attachment.destroy',$attachment->id),'class' => 'm-0'))}} @method('DELETE') {{Form::close()}}
@endsection