@if ($studentInvoice->transactions && $studentInvoice->transactions->count() > 0)
Transaction Details
| # |
Payment Type |
Amount |
Status |
Transaction Image |
Actions |
@foreach ($studentInvoice->transactions as $index => $transaction)
| {{ $index + 1 }} |
{{ ucfirst($transaction->payment_type) }} |
{{ number_format($transaction->amount, 2) }} |
@if ($transaction->status == 'pending')
Pending
@elseif ($transaction->status == 'accepted')
Accepted
@elseif ($transaction->status == 'rejected')
Rejected
@else
{{ ucfirst($transaction->status) }}
@endif
|
@php
$img = $transaction->transaction_img;
if ($img) {
if (str_starts_with(basename($img), 'retention')) {
$imageUrl = config('app.Retention_URL') . '/' . ltrim($img, '/');
}
else {
$imageUrl = config('app.CRM_URL') . '/' . ltrim($img, '/');
}
}
@endphp
@if ($img)
@else
N/A
@endif
|
@if ($transaction->status == 'pending' && $transaction->payment_type == 'instapay')
{{-- The button correctly targets the unique modal ID --}}
@else
No Actions
@endif
|
@endforeach
@endif
@if ($studentInvoice->type === 'track')
Track Details
@elseif($studentInvoice->product)
Product Details
@else
Course Details
@endif
@if ($studentInvoice->type === 'track')
| Course |
Start Date |
End Date |
Teacher |
Price |
@else
Product |
Start Date |
End Date |
Staff |
Price |
@endif
@if ($studentInvoice->type === 'track')
@foreach ($studentInvoice->courseStudentInvoices as $item)
@php
$course = $item->course;
@endphp
| {{ $course->track->name_en }} |
{{ $course->start_date }} |
{{ $course->end_date }} |
@if ($course->staff)
{{ $course->staff->first_name }} {{ $course->staff->last_name }}
@else
No teacher found
@endif
|
{{ number_format($studentInvoice->total_price, 2) }} |
@endforeach
@else
@foreach ($studentInvoice->courseStudentInvoices as $item)
@php $course = $item->course; @endphp
| {{ $course->academyProduct->name_en }} |
{{ $course->start_date }} |
{{ $course->end_date }} |
@if ($course->staff)
{{ $course->staff->first_name }} {{ $course->staff->last_name }}
@else —
@endif
|
{{ number_format($studentInvoice->total_price, 2) }} |
@endforeach
@endif
@if ($studentInvoice->discount_plan_id)
Pricing Plan Details
Discount Plan:
Total Price:
Discount:
Net Price:
{{ $studentInvoice->discountPlan->name_en ?? '' }}
{{ number_format($studentInvoice->total_price, 2) }}
@if ($studentInvoice->discount_plan_type == 'fixed')
{{ number_format($studentInvoice->discount_plan_price, 2) }}
{{ number_format($studentInvoice->total_price, 2) - number_format($studentInvoice->discount_plan_price, 2) }}
@elseif ($studentInvoice->discount_plan_type == 'percentage')
{{ number_format($studentInvoice->discount_plan_price, 0) }}%
{{ number_format($studentInvoice->total_price * $studentInvoice->discount_plan_price / 100, 2) }}
@else
0
@endif
@endif
@if ($studentInvoice->promocode_id)
Promocode Details
Promocode:
Total Price:
Discount:
Net Price:
{{ $studentInvoice->promocode->code ?? '' }}
@if ($studentInvoice->discount_plan_id)
{{ number_format($studentInvoice->total_price * $studentInvoice->discount_plan_price / 100, 2) }}
@else
{{ number_format($studentInvoice->total_price, 2) }}
@endif
@if ($studentInvoice->promocode_type == 'fixed')
{{ number_format($studentInvoice->promocode_price, 2) }}
@elseif ($studentInvoice->promocode_type == 'percentage')
{{ number_format($studentInvoice->promocode_price, 0) }}%
@else
0
@endif
{{ number_format($studentInvoice->net_price, 2) }}
@endif
Final Total:
{{ number_format($studentInvoice->net_price, 2) }}