@extends('dashboard.layouts.app') @section('content') @if (session('success')) @endif @if ($errors->any()) @endif @section('content')
Upedia
10062 Al Ahli Bank Building, Main Carrefour Street,
Zahraa Al Maadi, Cairo, Egypt
Invoice {{ $studentInvoice->invoice_number }}
Invoice Date: {{ $studentInvoice->created_at->format('Y-m-d') }}
Student Information
@if ($studentInvoice->transactions && $studentInvoice->transactions->count() > 0)
Transaction Details
@foreach ($studentInvoice->transactions as $index => $transaction) @endforeach
# Payment Type Amount Status Transaction Image Actions
{{ $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) Transaction Image @else N/A @endif @if ($transaction->status == 'pending' && $transaction->payment_type == 'instapay')
@csrf @method('PATCH') {{-- Change status to 'accepted' if that is the correct status for accepting a pending payment --}}
{{-- The button correctly targets the unique modal ID --}} @else No Actions @endif
@endif
@if ($studentInvoice->type === 'track') Track Details @elseif($studentInvoice->product) Product Details @else Course Details @endif
@if ($studentInvoice->type === 'track') @else @endif @if ($studentInvoice->type === 'track') @foreach ($studentInvoice->courseStudentInvoices as $item) @php $course = $item->course; @endphp @endforeach @else @foreach ($studentInvoice->courseStudentInvoices as $item) @php $course = $item->course; @endphp @endforeach @endif
Course Start Date End Date Teacher PriceProduct Start Date End Date Staff Price
{{ $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) }}
{{ $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) }}
@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) }}
@endsection