@extends('layouts.master') @section('content')
| # | School | Advance | Amount | M Share | C Share | Promo | Status | Date | Action |
|---|---|---|---|---|---|---|---|---|---|
| {{ $key + 1 }} |
{{ $invoices->school->name ?? 'N/A' }}
{{ $invoices->school->ceo_name ?? '—' }} |
Rs.{{ number_format($invoices->advance, 0) }} |
Rs.{{ number_format($invoices->amount, 0) }}
{{ $invoices->type == 1 ? 'New Account' : 'Renew' }} |
Rs.{{ number_format($invoices->m_share, 0) }}
{{$invoices->user->name}} |
Rs.{{ number_format($invoices->c_share, 0) }}
{{ $invoices->transaction_id ?? '—' }} {{ $invoices->date ? \Carbon\Carbon::parse($invoices->date)->format('d M Y') : '—' }} |
@if($invoices->promo) {{ $invoices->promo->discount }}% OFF @else — @endif | {{ $invoices->paid ? 'Approved' : 'Pending' }} |
@php
$buyingDate = $invoices->created_at;
if ($invoices->type == 2 && $invoices->expirydate && $invoices->school && $invoices->school->expirydate) {
$subtractedExpiry = \Carbon\Carbon::parse($invoices->expirydate)->subYear()->format('Y-m-d');
$schoolExpiry = \Carbon\Carbon::parse($invoices->school->expirydate)->format('Y-m-d');
if ($subtractedExpiry === $schoolExpiry) {
$buyingDate = \Carbon\Carbon::parse($invoices->school->expirydate);
}
}
@endphp
{{-- Buying Date --}}
{{ $buyingDate->format('d M Y') }}
{{-- Expiry Date --}} {{ \Carbon\Carbon::parse($invoices->expirydate)->format('d M Y') }} |
|
| No invoices found | |||||||||