@extends('layouts.invoicepayheader') @section('page-title') {{ __('Invoice Detail') }} @endsection @push('css') @endpush @php $company_settings = getCompanyAllSetting($invoice->created_by, $invoice->workspace); @endphp @section('action-btn')
{{ __(' Print') }} @if ($invoice->status != 0 && $invoice->getDue() > 0) {{ __(' Pay Now') }} @endif
@endsection @section('content')

{{ __('Invoice') }}

{{ __('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) }}

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

@if ( $invoice->invoice_module == 'taskly' || $invoice->invoice_module == 'account' || $invoice->invoice_module == 'cmms' || $invoice->invoice_module == 'cardealership' || $invoice->invoice_module == 'musicinstitute' || $invoice->invoice_module == 'rent')

{{ __('Name ') }}: {{ !empty($customer->name) ? $customer->name : '' }}

@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

{{ __('Email ') }}: {{ !empty($customer->email) ? $customer->email : '' }}

@if (!empty($company_settings['invoice_shipping_display']) && $company_settings['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->billing_phone) ? $customer->billing_phone : '' }}

{{ __('Tax Number ') }} : {{ !empty($customer->tax_number) ? $customer->tax_number : '' }}

@endif @endif
@endif @if ($invoice->invoice_module == 'mobileservice' && !empty($mobileCustomer))

{{ $mobileCustomer->customer_name }}

{{ $mobileCustomer->mobile_no }}

{{ $mobileCustomer->email }}

{{ $mobileCustomer->getServiceCreatedName->name }}

@if ($mobileCustomer->is_approve == 1) {{ __('Accepted') }} @else {{ __('Rejected') }} @endif
@endif @if (($invoice->invoice_module == 'legalcase' || $invoice->invoice_module == 'lms' || $invoice->invoice_module == 'sales' || $invoice->invoice_module == 'newspaper' || $invoice->invoice_module == 'RestaurantMenu' || $invoice->invoice_module == 'Fleet') && !empty($commonCustomer))

{{ $commonCustomer['name'] }}

{{ $commonCustomer['email'] }}
@endif @if ($invoice->invoice_module == 'childcare' && !empty($childCustomer))
{{ __('Child Detail') }}

{{ __('Name :') }} {{ $childCustomer['child']->first_name . ' ' . $childCustomer['child']->last_name }}
{{ __('Date Of Birth :') }} {{ $childCustomer['child']->dob }}
{{ __('Gender :') }} {{ $childCustomer['child']->gender }}
{{ __('Age :') }} {{ $childCustomer['child']->age }}
{{ __('Class :') }} {{ !empty($childCustomer['child']->class) ? $childCustomer['child']->class->class_level : '' }}

{{ __('Parent Detail') }}

{{ __('Name :') }} {{ $childCustomer['parent']->name }}
{{ __('Email : ') }} {{ $childCustomer['parent']->email }}
{{ __('Contact Number :') }} {{ $childCustomer['parent']->contact_number }}
{{ __('Address :') }} {{ $childCustomer['parent']->address }}

@endif @if ($invoice->invoice_module == 'vehicleinspection') @php $inspectionRequest = Workdo\VehicleInspectionManagement\Entities\InspectionRequest::find( $invoice->customer_id, ); $vehicle_details = Workdo\VehicleInspectionManagement\Entities\InspectionVehicle::find( $inspectionRequest->vehicle_id, ); @endphp @if (!empty($inspectionRequest->inspector_name) && !empty($inspectionRequest->inspector_email))

{{ __('Request Number') }} : {{ !empty($invoice->customer_id) ? \Workdo\VehicleInspectionManagement\Entities\InspectionRequest::inspectionRequestIdFormat($invoice->customer_id, $invoice->created_by, $invoice->workspace) : '' }}

{{ __('Billed To') }} : {{ !empty($inspectionRequest->inspector_name) ? $inspectionRequest->inspector_name : '' }}
{{ !empty($inspectionRequest->inspector_email) ? $inspectionRequest->inspector_email : '' }}

{{ __('Vehicle Details') }} :

{{ __('Model') }}
: {{ !empty($vehicle_details->model) ? $vehicle_details->model : '' }}
{{ __('ID Number') }}
: {{ !empty($vehicle_details->vehicle_id_number) ? $vehicle_details->vehicle_id_number : '' }}
{{ __('Current Mileage') }}
: {{ !empty($vehicle_details->mileage) ? $vehicle_details->mileage : '' }}
{{ __('Manufacture Year') }}
: {{ !empty($vehicle_details->manufacture_year) ? $vehicle_details->manufacture_year : '' }}

@endif @endif @if ($invoice->invoice_module == 'machinerepair' && !empty($invoice->customer_id)) @php $repair_request = \Workdo\MachineRepairManagement\Entities\MachineRepairRequest::find( $invoice->customer_id, ); $machine_details = \Workdo\MachineRepairManagement\Entities\Machine::find( $repair_request->machine_id, ); @endphp

{{ __('Request Number') }} :
{{ !empty($invoice->customer_id) ? \Workdo\MachineRepairManagement\Entities\MachineRepairRequest::machineRepairNumberFormat($invoice->customer_id, $invoice->created_by, $invoice->workspace) : '' }}

{{ __('Billed To') }} :
{{ !empty($repair_request->customer_name) ? $repair_request->customer_name : '' }}
{{ !empty($repair_request->customer_email) ? $repair_request->customer_email : '' }}

{{ __('Machine Details') }} :

{{ __('Name') }}
: {{ !empty($machine_details->name) ? $machine_details->name : '' }}
{{ __('Model') }}
: {{ !empty($machine_details->model) ? $machine_details->model : '' }}
{{ __('Manufacturer') }}
: {{ !empty($machine_details->manufacturer) ? $machine_details->manufacturer : '' }}

@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($company_settings['invoice_qr_display']) && $company_settings['invoice_qr_display'] == 'on')
@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
@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' || $invoice->invoice_module == 'cmms' || $invoice->invoice_module == 'rent' || $invoice->invoice_module == 'machinerepair' || $invoice->invoice_module == 'musicinstitute' || $invoice->invoice_module == 'vehicleinspection' ) @elseif($invoice->invoice_module == 'taskly') @elseif($invoice->invoice_module == 'lms') @elseif($invoice->invoice_module == 'childcare') @elseif($invoice->invoice_module == 'cardealership' || $invoice->invoice_module == 'sales' || $invoice->invoice_module == 'newspaper'|| $invoice->invoice_module == 'mobileservice') @elseif($invoice->invoice_module == 'legalcase' ) @elseif($invoice->invoice_module == 'Fleet' ) @elseif($invoice->invoice_module == 'RestaurantMenu') @endif @if($invoice->invoice_module !== 'Fleet' && $invoice->invoice_module !== 'taskly' && $invoice->invoice_module !== 'childcare') @endif @if($invoice->invoice_module != 'Fleet' && $invoice->invoice_module != 'childcare' ) @endif @php $totalQuantity = 0; $totalRate = 0; $totalTaxPrice = 0; $totalDiscount = 0; $taxesData = []; $TaxPrice_array = []; $commonSubtotal = 0; @endphp @foreach ($iteams as $key => $iteam) @php $commonSubtotal += $iteam->price; @endphp @if (!empty($iteam->tax)) @php if ($invoice->invoice_module == 'newspaper'){ $taxes = \Workdo\Newspaper\Entities\NewspaperTax::tax($iteam->tax); $totalQuantity += $iteam->quantity; $totalRate += $iteam->price; foreach ($taxes as $taxe) { $taxDataPrice = \Workdo\Newspaper\Entities\NewspaperTax::taxRate( $taxe->percentage, $iteam->price, $iteam->quantity ); if (array_key_exists($taxe->name, $taxesData)) { $taxesData[$taxe->name] = $taxesData[$taxe->name] + $taxDataPrice; } else { $taxesData[$taxe->name] = $taxDataPrice; } } } else { $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 @elseif ($invoice->invoice_module == 'Fleet') @php $totalRate += $iteam->price; @endphp @endif @if ($invoice->invoice_module == 'account' || $invoice->invoice_module == 'machinerepair' || $invoice->invoice_module == 'musicinstitute' || $invoice->invoice_module == 'vehicleinspection') @elseif ($invoice->invoice_module == 'taskly') @elseif ($invoice->invoice_module == 'cmms' || $invoice->invoice_module == 'rent') @elseif ($invoice->invoice_module == 'lms') @elseif ($invoice->invoice_module == 'childcare' || $invoice->invoice_module == 'legalcase') @elseif ($invoice->invoice_module == 'cardealership' || $invoice->invoice_module == 'sales' || $invoice->invoice_module == 'newspaper' || $invoice->invoice_module == 'mobileservice') @elseif ($invoice->invoice_module == 'RestaurantMenu') @endif @if ($invoice->invoice_module == 'Fleet') @elseif($invoice->invoice_module == 'taskly' || $invoice->invoice_module == 'childcare') @else @endif @if($invoice->invoice_module != 'Fleet' && $invoice->invoice_module != 'childcare') @endif @php $tr_tex = array_key_exists($key, $TaxPrice_array) == true ? $TaxPrice_array[$key] : 0; @endphp @endforeach @if ($invoice->invoice_module == 'account') @endif @if ($invoice->invoice_module == 'cmms' || $invoice->invoice_module == 'rent' || $invoice->invoice_module == 'vehicleinspection' || $invoice->invoice_module == 'musicinstitute' || $invoice->invoice_module == 'machinerepair') @else @endif @if ($invoice->invoice_module == 'Fleet') @elseif($invoice->invoice_module == 'taskly') @elseif($invoice->invoice_module == 'cmms') @elseif($invoice->invoice_module == 'childcare') @else @endif @php $colspan = 6; $customerInvoices = ['taskly', 'account', 'cmms', 'cardealership', 'RestaurantMenu', 'rent' , 'Fleet']; if (in_array($invoice->invoice_module, $customerInvoices)) { $colspan = 7; } if ($invoice->invoice_module == 'taskly') { $colspan = 5; } if ($invoice->invoice_module == 'Fleet' || $invoice->invoice_module == 'childcare') { $colspan = 3; } @endphp @if ($invoice->invoice_module != 'Fleet') @endif @if (!empty($taxesData)) @foreach ($taxesData as $taxName => $taxPrice) @endforeach @endif
#{{ __('Item Type') }} {{ __('Item') }}{{ __('Project') }}{{ __('Course') }}{{ __('Name') }}{{ __('Items') }}{{ __('PARTICULARS') }}{{ __('Distance') }}{{ __('Item Name') }}{{ __('Quantity') }}{{ __('Rate') }}{{ __('Discount') }} {{ __('Tax') }}{{ __('Description') }} {{ __('Price') }}
{{ $key + 1 }}{{ !empty($iteam->product_type) ? Str::ucfirst($iteam->product_type) : '--' }} {{ !empty($iteam->product()) ? $iteam->product()->name : '' }}{{ !empty($iteam->product()) ? $iteam->product()->title : '' }}{{ !empty($iteam->product_type) ? Str::ucfirst($iteam->product_type) : '--' }} {{ !empty($iteam->product()) ? $iteam->product()->name : '' }}{{ !empty($iteam->product()) ? $iteam->product()->title : '' }}{{ !empty($iteam->product_name) ? $iteam->product_name : '' }}{{ !empty($iteam->product()) ? $iteam->product()->name : '' }}{{ !empty($iteam->product_name) ? $iteam->product_name : '' }}{{ !empty($iteam->product()) ? $iteam->product()->distance : 0 }}{{ $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 if ($invoice->invoice_module == 'newspaper'){ $taxPrice = \Workdo\Newspaper\Entities\NewspaperTax::taxRate( $tax->percentage, $iteam->price, $iteam->quantity ); } else { $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 : '-' }} @if ($invoice->invoice_module == 'childcare') {{ currency_format_with_sym($iteam->price, $invoice->created_by, $invoice->workspace) }} @elseif ($invoice->invoice_module == 'Fleet') @php $distance = !empty($iteam->product()) ? $iteam->product()->distance : 0; $price = $iteam->price * $iteam->product()->distance; @endphp {{ currency_format_with_sym($price,$invoice->created_by, $invoice->workspace) }} @else {{ currency_format_with_sym($iteam->price * $iteam->quantity - $iteam->discount + $tr_tex, $invoice->created_by, $invoice->workspace) }} @endif
{{ __('Total') }}{{ __('Total') }}{{ currency_format_with_sym($totalRate,$invoice->created_by, $invoice->workspace) }}{{ 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)}}{{ $totalQuantity,$invoice->created_by, $invoice->workspace }} {{ 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) }}{{ currency_format_with_sym($commonSubtotal,$invoice->created_by, $invoice->workspace) }}{{ $totalQuantity,$invoice->created_by, $invoice->workspace }} {{ 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') }} @if ($invoice->invoice_module == 'childcare') {{ currency_format_with_sym($commonSubtotal,$invoice->created_by, $invoice->workspace) }} @else {{ currency_format_with_sym($invoice->getSubTotal(),$invoice->created_by, $invoice->workspace) }} @endif
{{ __('Discount') }} {{ currency_format_with_sym($invoice->getTotalDiscount(),$invoice->created_by, $invoice->workspace) }}
{{ $taxName }} {{ currency_format_with_sym($taxPrice,$invoice->created_by, $invoice->workspace) }}
{{ __('Total') }} @if ($invoice->invoice_module == 'childcare') {{ currency_format_with_sym($commonSubtotal,$invoice->created_by, $invoice->workspace) }} @elseif ($invoice->invoice_module == 'Fleet') {{ currency_format_with_sym($invoice->getFleetSubTotal(),$invoice->created_by, $invoice->workspace) }} @else {{ currency_format_with_sym($invoice->getTotal(),$invoice->created_by, $invoice->workspace) }} @endif
{{ __('Paid') }} {{ currency_format_with_sym($invoice->getTotal() - $invoice->getDue() - $invoice->invoiceTotalCreditNote(),$invoice->created_by, $invoice->workspace) }}
{{ __('Credit Note Applied') }} {{ currency_format_with_sym($invoice->invoiceTotalCreditNote(),$invoice->created_by, $invoice->workspace) }}
{{ __('Debit note issued') }} {{ currency_format_with_sym($invoice->invoiceTotalCustomerCreditNote(),$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->payment_type == 'Stripe') @elseif (!empty($payment->receipt) && empty($payment->add_receipt) && $payment->payment_type == 'Coin') @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 (Laratrust::hasPermission('edit credit note') || Laratrust::hasPermission('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 }} @permission('edit credit note') @endpermission @permission('delete credit note') {!! Form::open([ 'method' => 'DELETE', 'route' => ['invoice.delete.credit.note', $creditNote->invoice, $creditNote->id], 'id' => 'delete-form-' . $creditNote->id, ]) !!} {!! Form::close() !!} @endpermission
@endif
@if ($invoice->getDue() > 0) @endif @endsection @push('scripts') @endpush