@extends('layout.layout') @section('content') @include('components.alert') @php $originalPrice = (float) ($studentInvoice->original_amount ?: $studentInvoice->total_price ?: $studentInvoice->net_price ?: 0); $invoiceTotal = (float) ($studentInvoice->final_amount ?: $studentInvoice->net_price ?: $studentInvoice->total_price ?: 0); $discountAmount = (float) ($studentInvoice->discount_amount ?? max(0, round($originalPrice - $invoiceTotal, 2))); $paidAmount = (float) $studentInvoice->transaction ->whereIn('status', ['paid', 'approved']) ->sum('amount'); $remainingAmount = max(0, round($invoiceTotal - $paidAmount, 2)); $isDepositInvoice = in_array($studentInvoice->payment_status, ['deposite', 'paid_deposite'], true) || (float) ($studentInvoice->deposite ?? 0) > 0; $invoiceStatusLabel = $studentInvoice->payment_status ? ucfirst(str_replace('_', ' ', $studentInvoice->payment_status)) : 'Not paid'; $formatDiscount = function ($type, $value) { $value = (float) ($value ?? 0); if ($value <= 0) { return '0'; } return $type === 'percentage' ? number_format($value, 0) . '%' : number_format($value, 2); }; @endphp
10062 Al Ahli Bank Building, Main Carrefour Street,
Zahraa Al Maadi, Cairo, Egypt
Basic student contact details.
Payment attempts, transaction proof, reasons, and status.
Applied discount plan information.
Applied referral reward information.
Applied promocode information.