@extends('portal.ninja2020.layout.app') @section('meta_title', ctrans('texts.payment')) @section('body')

{{ ctrans('texts.payment') }}

{{ ctrans('texts.payment_details') }}

@if(!empty($payment->status_id) && !is_null($payment->status_id))
{{ ctrans('texts.status') }}
{!! \App\Models\Payment::badgeForStatus($payment->status_id) !!}
@endif @if(!empty($payment->clientPaymentDate()) && !is_null($payment->clientPaymentDate()))
{{ ctrans('texts.payment_date') }}
{{ $payment->clientPaymentDate() }}
@endif @if(!empty($payment->number) && !is_null($payment->number))
{{ ctrans('texts.number') }}
{{ $payment->number }}
@endif @if(!empty($payment->transaction_reference) && !is_null($payment->transaction_reference))
{{ ctrans('texts.transaction_reference') }}
{{ $payment->transaction_reference }}
@endif
{{ ctrans('texts.method') }}
{{ $payment->translatedType() }}
@if(!empty($payment->formattedAmount()) && !is_null($payment->formattedAmount()))
{{ ctrans('texts.amount') }}
{{ $payment->formatAmount($payment->amount > 0 ? $payment->amount : $payment?->invoices->sum('pivot.amount')) }}
@endif @if(!empty($payment->status_id) && !is_null($payment->status_id)) @if($payment->refunded > 0)
{{ ctrans('texts.refunded') }}
{{ \App\Utils\Number::formatMoney($payment->refunded, $payment->client) }}
@endif @if($payment->applied != $payment->amount)
{{ ctrans('texts.remaining') }}
{{ \App\Utils\Number::formatMoney($payment->amount - $payment->applied, $payment->client) }}
@endif @endif

{{ ctrans('texts.invoices') }}

{{ ctrans('texts.list_of_payment_invoices') }}

@foreach($payment->invoices as $invoice) @if(!$invoice->is_proforma && !$invoice->is_deleted)
{{ ctrans('texts.invoice_number') }}
{{ $invoice->number }} - {{ \App\Utils\Number::formatMoney($payment->invoices->where('id', $invoice->id)->sum('pivot.amount') - $payment->invoices->where('id', $invoice->id)->sum('pivot.refunded'), $payment->client) }}
@endif @endforeach
@if($bank_details) @include('portal.ninja2020.gateways.stripe.bank_transfer.bank_details') @endif
@endsection