@if ($invoice->status == \App\Models\Invoice::DRAFT)
{{ Form::label('client_id', __('messages.invoice.client') . ':', ['class' => 'form-label required fs-6 mb-3']) }}
{{ Form::select('client_id', $clients, $client_id ?? null, ['class' => 'form-select io-select2', 'id' => 'client_id', 'placeholder' => __('messages.invoice.client'), 'required', 'data-control' => 'select2']) }}
@else
{{ Form::label('client_id', __('messages.invoice.client') . ':', ['class' => 'form-label mb-3']) }}
{{ $invoice->client->user->full_name }}
@endif
{{ __('messages.invoice.invoice') }} # {{ $invoice->invoice_id }}
{{ Form::label('status', __('messages.common.status') . ':', ['class' => 'form-label required mb-3']) }}
{{ Form::select('status', getTranslatedData($statusArr), isset($invoice) ? $invoice->status : null, ['class' => 'form-select', 'id' => 'status', 'required', 'data-control' => 'select2']) }}
{{ Form::label('invoice_date', __('messages.invoice.invoice_date') . ':', ['class' => 'form-label required mb-3']) }}
{{ Form::text('invoice_date', null, ['class' => 'form-select', 'id' => 'editInvoiceDate', 'autocomplete' => 'off', 'required']) }}
{{ Form::label('due_date', __('messages.invoice.due_date') . ':', ['class' => 'form-label required mb-3']) }}
{{ Form::text('due_date', null, ['class' => 'form-select', 'id' => 'editDueDate', 'autocomplete' => 'off', 'required']) }}
{{ Form::label('templateId', __('messages.setting.invoice_template') . ':', ['class' => 'form-label mb-3']) }}
{{ Form::select('template_id', $template, isset($invoice) ? $invoice->template_id : null, ['class' => 'form-select', 'id' => 'templateId', 'required', 'data-control' => 'select2']) }}
{{ Form::label('payment_qr_code_id', __('messages.payment_qr_codes.payment_qr_code') . ':', ['class' => 'form-label mb-3']) }}
{{ Form::select('payment_qr_code_id', $paymentQrCodes, isset($invoice) ? $invoice->paymentQrCodes?->id : null, ['class' => 'form-select io-select2 payment-qr-code', 'data-control' => 'select2', 'placeholder' => __('messages.flash.select_payment_qr_code')]) }}
{{ Form::label('currencyType', __('messages.setting.currencies') . ':', ['class' => 'form-label mb-3']) }}
{{ Form::label('recurringCycle', __('messages.invoice.recurring_cycle') . ':', ['class' => 'form-label mb-3']) }}
{{ Form::number('recurring_cycle', $invoice->recurring_cycle, ['class' => 'form-control', 'id' => 'recurringCycle', 'autocomplete' => 'off', 'placeholder' => __('messages.flash.number_of_days_for_recurring_cycle')]) }}
@php
$i = 1;
@endphp
@foreach ($invoice->invoiceItems as $invoiceItem)
@endforeach
# |
{{ __('messages.product.product') }} |
{{ __('messages.invoice.qty') }} |
{{ __('messages.product.unit_price') }} |
{{ __('messages.invoice.tax') }} |
{{ __('messages.invoice.amount') }} |
{{ __('messages.common.action') }} |
{{ $i++ }} |
{{ Form::select('product_id[]', $products, isset($invoiceItem->product_id) ? $invoiceItem->product_id : $invoiceItem->product_name ?? [], ['class' => 'form-select productId product io-select2', 'required', 'placeholder' => __('messages.flash.select_product_or_enter_free_text'), 'data-control' => 'select2']) }}
{{ Form::hidden('id[]', $invoiceItem->id) }}
|
{{ Form::number('quantity[]', number_format($invoiceItem->quantity, 2), ['class' => 'form-control qty ', 'id' => 'qty', 'required', 'type' => 'number', 'min' => '0', 'step' => '.01', 'oninput' => "validity.valid||(value=value.replace(/[e\+\-]/gi,''))"]) }}
|
{{ Form::number('price[]', $invoiceItem->price, ['class' => 'form-control price-input price ', 'oninput' => "validity.valid||(value=value.replace(/[e\+\-]/gi,''))", 'min' => '0', 'step' => '.01', 'required', 'onKeyPress' => 'if(this.value.length==8) return false;']) }}
|
|
{{ number_format($invoiceItem->total, 2) }}
|
|
{{ Form::label('discount', __('messages.invoice.discount') . ':', ['class' => 'form-label mb-1']) }}
{{ Form::label('taxes', __('messages.invoice.tax') . ':', ['class' => 'form-label mb-1']) }}
{{ __('messages.invoice.sub_total') . ':' }} |
@if (!getSettingValue('currency_after_amount'))
{{ getInvoiceCurrencyIcon($invoice->currency_id) }}
@endif
{{ isset($invoice) ? number_format($invoice->amount, 2) : 0 }}
@if (getSettingValue('currency_after_amount'))
{{ getInvoiceCurrencyIcon($invoice->currency_id) }}
@endif
|
{{ __('messages.invoice.discount') . ':' }} |
@if (!getSettingValue('currency_after_amount'))
{{ getInvoiceCurrencyIcon($invoice->currency_id) }}
@endif
@if (isset($invoice) && $invoice->discount_type == \App\Models\Invoice::FIXED)
{{ $invoice->discount ?? 0 }}
@else
{{ isset($invoice) ? number_format(($invoice->amount * $invoice->discount) / 100, 2) : 0 }}
@endif
@if (getSettingValue('currency_after_amount'))
{{ getInvoiceCurrencyIcon($invoice->currency_id) }}
@endif
|
{{ __('messages.invoice.total_tax') . ':' }} |
@if (!getSettingValue('currency_after_amount'))
{{ getInvoiceCurrencyIcon($invoice->currency_id) }}
@endif
0
@if (getSettingValue('currency_after_amount'))
{{ getInvoiceCurrencyIcon($invoice->currency_id) }}
@endif
|
{{ __('messages.invoice.total') . ':' }} |
@if (!getSettingValue('currency_after_amount'))
{{ getInvoiceCurrencyIcon($invoice->currency_id) }}
@endif
{{ isset($invoice) ? number_format($invoice->amount - ($invoice->amount * $invoice->discount) / 100, 2) : 0 }}
@if (getSettingValue('currency_after_amount'))
{{ getInvoiceCurrencyIcon($invoice->currency_id) }}
@endif
|
{{ Form::label('note', __('messages.invoice.note') . ':', ['class' => 'form-label fs-6 mb-3']) }}
{{ Form::textarea('note', isset($invoice) ? $invoice->note : null, ['class' => 'form-control', 'id' => 'note', 'rows' => '5']) }}
{{ Form::label('term', __('messages.invoice.terms') . ':', ['class' => 'form-label fs-6 mb-3']) }}
{{ Form::textarea('term', isset($invoice) ? $invoice->term : null, ['class' => 'form-control', 'id' => 'term', 'rows' => '5']) }}
{{ Form::hidden('amount', isset($invoice) ? number_format($invoice->amount - ($invoice->amount * $invoice->discount) / 100, 2) : 0, ['class' => 'form-control', 'id' => 'total_amount']) }}
{{ Form::hidden('final_amount', isset($invoice) ? $invoice->final_amount : 0, ['class' => 'form-control', 'id' => 'finalTotalAmt']) }}