@extends('layouts.app') @section('content')

Make Payment for Invoice: {{ $invoice->invoice_id }}

Invoice Details

Service Rate: {{ $invoice->serviceOrder ? number_format(($invoice->serviceOrder->payment_method && in_array($invoice->serviceOrder->payment_method, ['cash_tk', 'bank_bmt', 'ibbl_bmt', 'bkash_bmt']) && \App\Models\CurrencyRate::getCurrentRateRecord()->rate ? ($invoice->serviceOrder->total_cost / \App\Models\CurrencyRate::getCurrentRateRecord()->rate) : $invoice->serviceOrder->total_cost), 2) : '0.00' }} SR @if($invoice->serviceOrder && in_array($invoice->serviceOrder->payment_method, ['cash_tk', 'bank_bmt', 'ibbl_bmt', 'bkash_bmt'])) ({{ number_format($invoice->serviceOrder->total_cost, 2) }} BDT) @endif

Paid by Dates: @if($invoice->payments->isEmpty()) No payments made yet. @else

    @foreach($invoice->payments as $payment)
  • {{ number_format($payment->amount, 2) }} SR on {{ $payment->payment_date->format('d M Y') }} @if($payment->bdt_amount) ({{ number_format($payment->bdt_amount, 2) }} BDT) @endif via {{ ucfirst(str_replace('_', ' ', $payment->payment_method)) }} in {{ $payment->branch->name }} @if($payment->trx_id) (Trx ID: {{ $payment->trx_id }}) @endif
  • @endforeach
@endif

Due: {{ $invoice->serviceOrder ? number_format(($invoice->serviceOrder->payment_method && in_array($invoice->serviceOrder->payment_method, ['cash_tk', 'bank_bmt', 'ibbl_bmt', 'bkash_bmt']) && \App\Models\CurrencyRate::getCurrentRateRecord()->rate ? ($invoice->serviceOrder->total_cost / \App\Models\CurrencyRate::getCurrentRateRecord()->rate) : $invoice->serviceOrder->total_cost) - $invoice->payments->sum('amount'), 2) : '0.00' }} SR @if($invoice->serviceOrder && in_array($invoice->serviceOrder->payment_method, ['cash_tk', 'bank_bmt', 'ibbl_bmt', 'bkash_bmt'])) ({{ number_format($invoice->serviceOrder->total_cost - $invoice->payments->sum('bdt_amount'), 2) }} BDT) @endif

@csrf @if(auth()->user()->role !== 'super_admin' && auth()->user()->role !== 'co_admin') @endif
@error('amount')

{{ $message }}

@enderror
@error('payment_method')

{{ $message }}

@enderror
@error('trx_id')

{{ $message }}

@enderror
@if(auth()->user()->role === 'super_admin' || auth()->user()->role === 'co_admin')
@error('branch_id')

{{ $message }}

@enderror
@endif
Cancel
@push('scripts') @endpush @endsection