@if ( $invoice->status != 0 && $invoice->getDue() > 0 && (!empty($company_payment_setting) && ($company_payment_setting['is_bank_transfer_enabled'] == 'on' || $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' || $company_payment_setting['is_toyyibpay_enabled'] == 'on' || $company_payment_setting['is_payfast_enabled'] == 'on' || $company_payment_setting['is_iyzipay_enabled'] == 'on' || $company_payment_setting['is_sspay_enabled'] == 'on' || $company_payment_setting['is_paytab_enabled'] == 'on' || $company_payment_setting['is_benefit_enabled'] == 'on' || $company_payment_setting['is_cashfree_enabled'] == 'on' || $company_payment_setting['is_aamarpay_enabled'] == 'on' || $company_payment_setting['is_yookassa_enabled'] == 'on' || $company_payment_setting['is_midtrans_enabled'] == 'on' || $company_payment_setting['is_nepalste_enabled'] == 'on' || $company_payment_setting['is_paiementpro_enabled'] == 'on' || $company_payment_setting['is_cinetpay_enabled'] == 'on' || $company_payment_setting['is_xendit_enabled'] == 'on' || $company_payment_setting['is_fedapay_enabled'] == 'on' || $company_payment_setting['is_payhere_enabled'] == 'on' || $company_payment_setting['tap_payment_is_on'] == 'on' || $company_payment_setting['authorizenet_payment_is_on'] == 'on' || $company_payment_setting['khalti_payment_is_on'] == 'on' || $company_payment_setting['easebuzz_payment_is_on'] == 'on' || $company_payment_setting['company_ozow_payment_is_enabled'] == 'on'))) @endif

{{ __('Invoice') }}

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


{{ __('Issue Date') }} :
{{ Utility::dateFormat($settings, $invoice->issue_date) }}

{{ __('Due Date') }} :
{{ Utility::dateFormat($settings, $invoice->due_date) }}

@if (!empty($customer->billing_name))
{{ __('Billed To') }} :
{{ !empty($customer->billing_name) ? $customer->billing_name : '' }}
{{ !empty($customer->billing_phone) ? $customer->billing_phone : '' }}
{{ !empty($customer->billing_address) ? $customer->billing_address : '' }}
{{ !empty($customer->billing_zip) ? $customer->billing_zip : '' }}
{{ !empty($customer->billing_city) ? $customer->billing_city : '' . ', ' }} {{ !empty($customer->billing_state) ? $customer->billing_state : '', ', ' }} {{ !empty($customer->billing_country) ? $customer->billing_country : '' }}
@endif @if (\Utility::companyData($invoice->created_by, 'shipping_display') == 'on')
{{ __('Shipped To') }} :
{{ !empty($customer->shipping_name) ? $customer->shipping_name : '' }}
{{ !empty($customer->shipping_phone) ? $customer->shipping_phone : '' }}
{{ !empty($customer->shipping_address) ? $customer->shipping_address : '' }}
{{ !empty($customer->shipping_zip) ? $customer->shipping_zip : '' }}
{{ !empty($customer->shipping_city) ? $customer->shipping_city : '' . ', ' }} {{ !empty($customer->shipping_state) ? $customer->shipping_state : '' . ', ' }},{{ !empty($customer->shipping_country) ? $customer->shipping_country : '' }}
@endif
@if(isset($settings['invoice_qr_display']) == 'on') {!! DNS2D::getBarcodeHTML( route('invoice.link.copy', \Illuminate\Support\Facades\Crypt::encrypt($invoice->id)), 'QRCODE', 2, 2, ) !!} @endif
@if($company_setting['vat_gst_number_switch'] == 'on') @if(!empty($company_setting['tax_type']) && !empty($company_setting['vat_number'])){{$company_setting['tax_type'].' '. __('Number')}} : {{$company_setting['vat_number']}}
@endif {{__('Tax Number ')}} : {{!empty($customer->tax_number)?$customer->tax_number:'--'}} @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; $totalPrice = 0; $totalTaxPrice = 0; $totalDiscount = 0; $taxSummary = []; @endphp @if(!empty($iteams) && (is_array($iteams) || $iteams->count() > 0)) @foreach ($iteams as $key => $item) @php $productName = !empty($item->product) ? $item->product : null; $quantity = $item->quantity ?? 0; $price = $item->price ?? 0; $discount = $item->discount ?? 0; $taxableAmount = ($price * $quantity) - $discount; $itemTaxPrice = 0; $totalQuantity += $quantity; $totalPrice += $price * $quantity; $totalDiscount += $discount; @endphp @endforeach @else @endif @if (!empty($taxSummary)) @foreach ($taxSummary as $taxName => $taxPrice) @endforeach @endif
# {{ __('Product') }} {{ __('Quantity') }} {{ __('Rate') }} {{ __('Discount') }} {{ __('Tax') }} {{ __('Description') }} {{ __('Price') }}
{{ __('after tax & discount') }}
{{ $key + 1 }} {{ $productName && !empty($productName->name) ? $productName->name : '-' }} {{ $quantity . ' (' . ($productName && !empty($productName->unit) && !empty($productName->unit->name) ? $productName->unit->name : '') . ')' }} {{ !empty($settings) ? \App\Models\Utility::priceFormat($settings, $price) : number_format($price, 2) }} {{ !empty($settings) ? \App\Models\Utility::priceFormat($settings, $discount) : number_format($discount, 2) }} @php try { $taxData = !empty($item->tax) ? (is_string($item->tax) ? json_decode($item->tax, true, 512, JSON_INVALID_UTF8_IGNORE) : $item->tax) : []; if (!is_array($taxData)) { $taxData = !empty($item->tax) && is_string($item->tax) ? array_filter(explode(',', $item->tax)) : []; } } catch (\Exception $e) { \Log::error('Tax Parsing Error', [ 'item_id' => $item->id ?? 'unknown', 'tax' => $item->tax ?? null, 'error' => $e->getMessage() ]); $taxData = []; } $taxRates = []; $taxDetails = []; foreach (array_unique($taxData) as $taxId) { $tax = \App\Models\Tax::find((int) trim($taxId)); if ($tax && !empty($tax->rate)) { $taxRates[] = floatval($tax->rate); $taxDetails[] = $tax; } } $totalRate = array_sum($taxRates); $totalTaxAmount = ($taxableAmount * $totalRate) / 100; $itemTaxPrice += $totalTaxAmount; $totalTaxPrice += $totalTaxAmount; @endphp @if (!empty($taxData)) @if (!empty($settings['tax_type']) && strtolower($settings['tax_type']) === 'vat') @php $taxSummary['VAT'] = ($taxSummary['VAT'] ?? 0) + $totalTaxAmount; @endphp
VAT ({{ number_format($totalRate, 2) }}%) - {{ \App\Models\Utility::priceFormat($settings, $totalTaxAmount) }}
@else @if (isset($isSameState) && $isSameState) @php $halfRate = $totalRate / 2; $halfAmount = $totalTaxAmount / 2; $taxSummary['CGST'] = ($taxSummary['CGST'] ?? 0) + $halfAmount; $taxSummary['SGST'] = ($taxSummary['SGST'] ?? 0) + $halfAmount; @endphp
CGST ({{ number_format($halfRate, 2) }}%)
SGST ({{ number_format($halfRate, 2) }}%)
@else @php $taxSummary['IGST'] = ($taxSummary['IGST'] ?? 0) + $totalTaxAmount; @endphp
IGST ({{ number_format($totalRate, 2) }}%) - {{ \App\Models\Utility::priceFormat($settings, $totalTaxAmount) }}
@endif @endif @else
@endif
{{ !empty($item->description) ? $item->description : '-' }} {{ !empty($settings) ? \App\Models\Utility::priceFormat($settings, $taxableAmount + $itemTaxPrice) : number_format($taxableAmount + $itemTaxPrice, 2) }}
{{ __('No items found.') }}
{{ __('Total') }} {{ $totalQuantity }} {{ !empty($settings) ? \App\Models\Utility::priceFormat($settings, $totalPrice) : number_format($totalPrice, 2) }} {{ !empty($settings) ? \App\Models\Utility::priceFormat($settings, $totalDiscount) : number_format($totalDiscount, 2) }} {{ !empty($settings) ? \App\Models\Utility::priceFormat($settings, $totalTaxPrice) : number_format($totalTaxPrice, 2) }}
{{ __('Sub Total') }} {{ isset($settings) && isset($invoice) ? \App\Models\Utility::priceFormat($settings, $invoice->getSubTotal() ?? 0) : '0.00' }}
{{ __('Discount') }} {{ isset($settings) && isset($invoice) ? \App\Models\Utility::priceFormat($settings, $invoice->getTotalDiscount() ?? 0) : '0.00' }}
{{ $taxName }} {{ isset($settings) ? \App\Models\Utility::priceFormat($settings, $taxPrice) : '0.00' }}
{{ __('Total') }} {{ isset($settings) && isset($invoice) ? \App\Models\Utility::priceFormat($settings, $invoice->getTotal() ?? 0) : '0.00' }}
{{ __('Paid') }} {{ isset($settings) && isset($invoice) ? \App\Models\Utility::priceFormat($settings,$invoice->getTotal() - $invoice->getDue() - $invoice->invoiceTotalCreditNote() ?? 0) : '0.00' }}
{{ __('Credit Note') }} {{ isset($settings) && isset($invoice) ? \App\Models\Utility::priceFormat($settings,$invoice->invoiceTotalCreditNote()?? 0) : '0.00' }}
{{ __('Due') }} {{ isset($settings) && isset($invoice) ? \App\Models\Utility::priceFormat($settings,$invoice->getDue()?? 0) : '0.00' }}
{{ __('Receipt Summary') }}

@if ($user_plan->storage_limit <= $user->storage_limit) {{ __('Your plan storage limit is over , so you can not see customer uploaded payment receipt') }}
@endif
@php $path = \App\Models\Utility::get_file('uploads/order'); @endphp @if (!empty($invoice->payments) && $invoice->bankPayments) @foreach ($invoice->payments as $key => $payment) @if ($user_plan->storage_limit <= $user->storage_limit) @else @endif @endforeach @foreach ($invoice->bankPayments as $key => $bankPayment) @if ($user_plan->storage_limit <= $user->storage_limit) @else @endif @can('delete invoice product') @endcan @endforeach @else @endforelse
{{ __('Date') }} {{ __('Amount') }} {{ __('Payment Type') }} {{ __('Account') }} {{ __('Reference') }} {{ __('Description') }} {{ __('Receipt') }} {{ __('OrderId') }}
{{ Utility::dateFormat($settings, $payment->date) }} {{ Utility::priceFormat($settings, $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 : '--' }}
{{ Utility::dateFormat($settings, $bankPayment->date) }} {{ Utility::priceFormat($settings, $bankPayment->amount) }} {{ __('Bank Transfer') }} - - - -- @if ($user_plan->storage_limit <= $user->storage_limit) @if (!empty($bankPayment->receipt)) {{ __('Receipt') }} @endif @else -- @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') }}

@if ($invoice->getDue() > 0) @endif