@extends('dashboard.layouts.app') @section('content')
Upedia
123 Academy Street, City, Country
Invoice {{ $studentInvoice->invoice_number }}
Invoice Date: {{ $studentInvoice->created_at->format('Y-m-d') }}
Student Information

Name: {{ $studentInvoice->student->first_name ?? '' }} {{ $studentInvoice->student->last_name ?? '' }}

Email: {{ $studentInvoice->student->email ?? 'Not available' }}

Course Details
@if ($studentInvoice->product) @else @endif {{-- --}}
ProductLevelStart Date End Date Staff Price
{{ $studentInvoice->product?->name_en ?? ($studentInvoice->level?->name_en ?? '') }} {{ $studentInvoice->staffScheduled?->start_date ?? '' }} {{ $studentInvoice->staffScheduled?->end_date ?? '' }} @if ($studentInvoice->staffScheduled?->staff) {{ $studentInvoice->staffScheduled->staff->first_name ?? '' }} {{ $studentInvoice->staffScheduled->staff->last_name ?? '' }} @else @endif {{ number_format($priceBeforeDiscount, 2) }}{{ number_format($studentInvoice->total_price, 2) }}
@php $showDiscountTable = false; $discountAmount = 0; if ( !$studentInvoice->product && $discountPlan && $studentInvoice->level && $studentInvoice->level->track ) { $trackLevelNumbers = $studentInvoice->level->track->level_number; if ( $discountPlan->level_from <= $trackLevelNumbers && $discountPlan->level_to >= $trackLevelNumbers ) { $showDiscountTable = true; $discountAmount = $discountPlan->type == 'fixed' ? $discountPlan->discount : $priceBeforeDiscount * ($discountPlan->discount / 100); } } @endphp
{{-- @if ($showDiscountTable)
Discount Details
Discount Name:
Discount Levels:
Type:
Discount:
Discount Amount:
{{ $discountPlan->name_en ?? '' }}
From {{ $discountPlan->level_from ?? '' }} To {{ $discountPlan->level_to ?? '' }}
{{ ucfirst($discountPlan->type ?? '') }}
@if ($discountPlan->type == 'fixed') {{ number_format($discountPlan->discount, 2) }} @else {{ number_format($discountPlan->discount, 0) }}% @endif
{{ number_format($discountAmount, 2) }}
@endif --}} @if ($studentInvoice->promocode_id)
Promocode Details
Promocode:
Type:
Total Price:
Discount:
Net Price:
{{ $studentInvoice->promocode->code ?? '' }}
{{ $studentInvoice->discount_type ?? '' }}
{{ number_format($studentInvoice->total_price, 2) }}
@if ($studentInvoice->discount_type == 'fixed') {{ number_format($studentInvoice->discount, 2) }} @else {{ number_format($studentInvoice->discount, 0) }}% @endif
{{ number_format($studentInvoice->net_price, 2) }}
@endif
Final Total: {{ number_format($studentInvoice->net_price, 2) }}
@endsection