@php $invoiceRawCurrency = $invoice->invoice->getRawOriginal('currency'); @endphp @include('admin.pages.finances.payment.authority-invoice.invoice-info-header', ['invoice' => $invoice->invoice]) @if(isset($invoicePayment))
@method('PUT') @else @method('POST') @endif @csrf
{{--
{{ 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' => $invoice->uuid, 'dependent_2' => 'Invoice', 'dependent_3' => 'Partial', 'mainInvoice' => $invoice->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 = $invoice->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, $invoice->invoice->currency, true) }}

Reverse Charge: {{ cMoney(@$invoicePayment?->totalVatPaidAmount() ?? 0, $invoice->invoice->currency, true) }}
Withholding Tax Amount: {{ cMoney(@$invoicePayment?->totalExcludingVatPaidAmount() ?? 0, $invoice->invoice->currency, true) }}

{{--

Reverse Charge Payment

--}} @if(($payableRC = ($invoice->payableRC() + (@$rcInvoicePayment ? $rcInvoicePayment->amount/$rcInvoicePayment->conversion_rate : 0))) && (isset($invoicePayment) ? $rcInvoicePayment : true))
{{-- total reverse charge --}} {{-- paid rc amount --}} {{-- remaining rc amount --}} {{-- account --}} {{-- paying rc amount --}} {{-- paying excluding vat --}} {{-- --}}
Total Reverse Charge Paid RC Amount Remaining RC Amount Account Paying Reverse Charge Amount
@cMoney($invoice->total_rc, $invoice->invoice->currency, true)

@cMoney($payableRC, $invoice->invoice->currency, true)
{!! Form::select('rc_account_balance_id', $selectedAccountBalance ?? [], @$invoicePayment->accountTransaction->account_balance_id ?? @array_keys($selectedAccountBalance ?? [])[0], [ 'class' => 'form-select globalOfSelect2Remote', 'data-url' => route('resource-select', [ 'AccountBalance', 'dependent' => 'invoice_id', 'dependent_2_col' => 'inv-type', 'dependent_3_col' => 'pay-type', 'dependent_id' => $invoice->uuid, 'dependent_2' => 'AuthorityInvoice', 'dependent_3' => 'rc', 'mainInvoice' => $invoice->invoice->type, ]), 'data-placeholder' => __('Select Account'), 'data-allow-clear' => 'true' ]) !!}
{{ $invoiceRawCurrency }}
{{ $invoiceRawCurrency }}
@endif @if(($payableWHT = ($invoice->payableWHT() + (@$whtInvoicePayment ? $whtInvoicePayment->amount/$whtInvoicePayment->conversion_rate : 0))) && (isset($invoicePayment) ? $whtInvoicePayment : true))
{{-- total wht --}} {{-- paid wht amount --}} {{-- remaining wht amount --}} {{-- account --}} {{-- paying wht amount --}} {{-- paying excluding vat --}} {{-- --}}
Total WHT Amount Paid WHT Amount Remaining WHT Amount Account Paying WHT Amount
@cMoney($invoice->total_wht, $invoice->invoice->currency, true)

@cMoney($payableWHT, $invoice->invoice->currency, true)
{!! Form::select('wht_account_balance_id', $selectedWhtAccountBalance ?? [], @$invoicePayment->accountTransaction->account_balance_id ?? @array_keys($selectedWhtAccountBalance ?? [])[0], [ 'class' => 'form-select globalOfSelect2Remote', 'data-url' => route('resource-select', [ 'AccountBalance', 'dependent' => 'invoice_id', 'dependent_2_col' => 'inv-type', 'dependent_3_col' => 'pay-type', 'dependent_id' => $invoice->uuid, 'dependent_2' => 'AuthorityInvoice', 'dependent_3' => 'wht', 'mainInvoice' => $invoice->invoice->type, ]), 'data-placeholder' => __('Select Account'), 'data-allow-clear' => 'true' ]) !!}
{{ $invoiceRawCurrency }}
{{ $invoiceRawCurrency }}
@endif