@php $invoiceRawCurrency = $invoices[0]->getRawOriginal('currency'); @endphp @include('admin.pages.finances.payment.bulk-invoice-payment.invoice-info-header', ['invoice' => $invoices[0]]) @if(isset($invoicePayment))
@method('PUT') @else @method('POST') @endif @csrf
{{-- Account --}}
{{ Form::label('account_balance_id', __('Account'), ['class' => 'col-form-label']) }} {!! Form::select('account_balance_id', $selectedAccountBalance ?? [], @$invoicePayment->accountTransaction->account_balance_id ?? @array_keys($selectedAccountBalance ?? [])[0], [ 'class' => 'form-select', 'data-kt-select2' => 'true', 'data-remote' => route('resource-select', [ 'AccountBalance', 'dependent' => 'invoice_id', 'dependent_2_col' => 'inv-type', 'dependent_3_col' => 'pay-type', 'dependent_id' => $invoices[0]->uuid, 'dependent_2' => 'Invoice', 'dependent_3' => 'Partial', 'mainInvoice' => $invoices[0]->type ]), 'data-placeholder' => __('Select Account'), 'data-allow-clear' => 'true' ]) !!}
{{-- Transaction Id --}}
{{ Form::label('transaction_id', __('Transaction Id'), ['class' => 'col-form-label']) }} {!! Form::text('transaction_id', @$invoicePayment->transaction_id, ['class' => 'form-control', 'placeholder' => __('Transaction Id')]) !!}
{{-- payment date --}}
{{ Form::label('payment_date', __('Payment Date'), ['class' => 'col-form-label']) }} {!! Form::date('payment_date', @$invoicePayment->payment_date, ['class' => 'form-control flatpickr', 'placeholder' => __('Payment Date')]) !!}
{{-- Currency --}}
{{ Form::label('currency', __('Currency'), ['class' => 'col-form-label']) }} {!! Form::select('currency', [cCurrency()->getSymbol() => cCurrency()->getSymbol(), $invoiceRawCurrency => $invoiceRawCurrency], $invoiceRawCurrency, [ 'class' => 'form-select', 'data-kt-select2' => 'true' ], [ cCurrency()->getSymbol() => ['data-is-base' => '1', 'data-symbol' => cCurrency()->getSymbol()], $invoiceRawCurrency => ['data-is-base' => '0', 'data-symbol' => $invoiceRawCurrency], ]) !!}
{{-- {{dd($invoice->payments->pluck('conversion_rate'))}} --}} {{-- conversion rate --}}
@if($isForeignCurrencyInvoice && ($used_conversion_rates = $invoices[0]->payments->pluck('conversion_rate'))->count() > 0) @endif
1 {{$invoiceRawCurrency}} = {!! Form::number('conversion_rate', @floatval($invoicePayment->conversion_rate), ['class' => 'form-control']) !!} {{ cCurrency()->getSymbol() }}
{{-- paying amount h3 --}}
Total Paying Amount

{{ cMoney(isset($invoicePayment) ? ($invoicePayment->amount / $invoicePayment->conversion_rate) : 0, $invoices[0]->currency, true) }}

Vat Amount: {{ cMoney(@$invoicePayment?->totalVatPaidAmount() ?? 0, $invoices[0]->currency, true) }}
Excluding VAT Amount : {{ cMoney(@$invoicePayment?->totalExcludingVatPaidAmount() ?? 0, $invoices[0]->currency, true) }}

@include('admin.pages.finances.payment.bulk-invoice-payment.fill-actions')
@forelse ($invoices as $invoice)

Invoice: {{$invoice->invoice_number}}

@forelse ($invoice->items as $item) @php $item->conversion_rate = $applicable_conversion_rate ?? 1; $item->setIsBaseCurrency(false); if(isset($invoicePayment)) { $paidItem = $invoicePayment->paidItems->firstWhere('invoice_item_id', $item->id); $item->this_vat_paid_amount = $paidItem?->vat_paid_amount / $invoicePayment->conversion_rate; $item->this_excluding_vat_paid_amount = $paidItem?->excluding_vat_paid_amount / $invoicePayment->conversion_rate; } @endphp {{-- payable vat --}} {{-- payable excluding vat --}} {{-- paying vat --}} {{-- paying excluding vat --}} @empty @endforelse
Invoice Item Payable VAT Amount Payable Excluding VAT Amount Paid VAT Amount Paid Excluding VAT Amount
{{$item->name ? : $item->invoiceable->name}}
{{$item->description}}
@cMoney($payableVatAmount, $invoice->currency, true)
@cMoney($pxvatAmount, $invoice->currency, true)
{{ $invoiceRawCurrency }}
{{ $invoiceRawCurrency }}
@empty @endforelse