@extends('layouts.invoicepayheader') @section('page-title') {{ __('Invoice Detail') }} @endsection @push('css') @endpush @section('action-btn') @if ($invoice->status != 0)
@if (!empty($invoicePayment)) @endif
{{ __('Print') }} @if ($invoice->getDue() > 0) {{ __(' Pay Now') }} @endif
@endif @endsection @section('content')

{{ __('Invoice') }}

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


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

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

@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',$invoice->created_by,$invoice->workspace)=='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',$invoice->created_by))
@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
{{ __('Product 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; if ($invoice->invoice_module == 'account') { $totalDiscount += $iteam->discount; } elseif ($invoice->invoice_module == 'taskly') { $totalDiscount = $invoice->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, $invoice->created_by,$invoice->workspace) }} {{ currency_format_with_sym($iteam->discount, $invoice->created_by,$invoice->workspace) }} @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, $invoice->created_by,$invoice->workspace) }}
@else - @endif
{{ !empty($iteam->description) ? $iteam->description : '-' }} {{ currency_format_with_sym(($iteam->price*$iteam->quantity) -$iteam->discount + $tr_tex ,$invoice->created_by,$invoice->workspace)}}
{{ __('Total') }} {{ $totalQuantity }} {{ currency_format_with_sym($totalRate, $invoice->created_by,$invoice->workspace) }} {{ currency_format_with_sym($totalDiscount, $invoice->created_by,$invoice->workspace) }} {{ currency_format_with_sym($totalTaxPrice, $invoice->created_by,$invoice->workspace) }}
{{ __('Sub Total') }} {{ currency_format_with_sym($invoice->getSubTotal(), $invoice->created_by,$invoice->workspace) }}
{{ __('Discount') }} {{ currency_format_with_sym($invoice->getTotalDiscount(), $invoice->created_by,$invoice->workspace) }}
{{ $taxName }} {{ currency_format_with_sym($taxPrice, $invoice->created_by,$invoice->workspace) }}
{{ __('Total') }} {{ currency_format_with_sym($invoice->getTotal(), $invoice->created_by,$invoice->workspace) }}
{{ __('Paid') }} {{ currency_format_with_sym($invoice->getTotal() - $invoice->getDue() - $invoice->invoiceTotalCreditNote(), $invoice->created_by,$invoice->workspace) }}
{{ __('Credit Note') }} {{ currency_format_with_sym($invoice->invoiceTotalCreditNote(), $invoice->created_by,$invoice->workspace) }}
{{ __('Due') }} {{ currency_format_with_sym($invoice->getDue(), $invoice->created_by,$invoice->workspace) }}
{{ __('Receipt Summary') }}
@forelse($invoice->payments as $key =>$payment) @if(module_is_active('Account')) @endif @empty @include('layouts.nodatafound') @endforelse
{{ __('Date') }} {{ __('Amount') }} {{ __('Payment Type') }} {{ __('Account') }} {{ __('Reference') }} {{ __('Receipt') }} {{ __('Description') }} {{ __('OrderId') }}
{{ company_date_formate($payment->date, $invoice->created_by,$invoice->workspace) }} {{ currency_format_with_sym($payment->amount, $invoice->created_by,$invoice->workspace) }} {{ $payment->payment_type }}{{ !empty($payment->bankAccount) ? $payment->bankAccount->bank_name . ' ' . $payment->bankAccount->holder_name : '--' }} @else --{{ !empty($payment->reference) ? $payment->reference : '--' }} @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->description) ? $payment->description : '--' }} {{ !empty($payment->order_id) ? $payment->order_id : '--' }}
@if (module_is_active('Account'))
{{ __('Credit Note Summary') }}
@if (Gate::check('edit credit note') || Gate::check('delete credit note')) @endif @forelse($invoice->creditNote as $key =>$creditNote) @empty @include('layouts.nodatafound') @endforelse
{{ __('Date') }} {{ __('Amount') }} {{ __('Description') }}{{ __('Action') }}
{{ company_date_formate($creditNote->date,$invoice->created_by,$invoice->workspace) }} {{ currency_format_with_sym($creditNote->amount, $invoice->created_by,$invoice->workspace) }} {{ $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
@endif
@if ($invoice->getDue() > 0) @endif @endsection @push('scripts') @endpush