From b911e8912d6d4f75f89702cd9058920a92d9affd Mon Sep 17 00:00:00 2001 From: Andri Desmana Date: Sun, 17 Jul 2022 22:36:35 +0700 Subject: [PATCH] Improve Pembayaran --- .../views/pembayaran/index.blade.php | 8 ++++-- Modules/SPP/Entities/DetailPaymentSpp.php | 5 ++++ .../SPP/Http/Controllers/SPPController.php | 2 +- .../SPP/Resources/views/murid/index.blade.php | 26 +++++++++---------- .../SPP/Resources/views/murid/show.blade.php | 6 ++--- database/seeders/DatabaseSeeder.php | 3 ++- 6 files changed, 30 insertions(+), 20 deletions(-) diff --git a/Modules/Murid/Resources/views/pembayaran/index.blade.php b/Modules/Murid/Resources/views/pembayaran/index.blade.php index 44e1913..388ef67 100644 --- a/Modules/Murid/Resources/views/pembayaran/index.blade.php +++ b/Modules/Murid/Resources/views/pembayaran/index.blade.php @@ -64,10 +64,14 @@ {{$payments->payment->year}} {{$payments->month}} Rp {{number_format($payments->amount)}} - {{$payments->status}} + {{$payments->status}} {{$payments->date_file}} - {{$payments->file != null ? 'Pembayaran Diproses' : 'Bayar'}} + @if ($payments->status == 'paid') + Pembayaran Diterima + @else + {{$payments->file != null ? 'Pembayaran Diproses' : 'Bayar'}} + @endif @endforeach diff --git a/Modules/SPP/Entities/DetailPaymentSpp.php b/Modules/SPP/Entities/DetailPaymentSpp.php index 9e271bc..908fbab 100644 --- a/Modules/SPP/Entities/DetailPaymentSpp.php +++ b/Modules/SPP/Entities/DetailPaymentSpp.php @@ -32,4 +32,9 @@ public function user() { return $this->belongsTo(User::class,'user_id'); } + + public function aprroveBy() + { + return $this->belongsTo(User::class, 'approve_by'); + } } diff --git a/Modules/SPP/Http/Controllers/SPPController.php b/Modules/SPP/Http/Controllers/SPPController.php index 8cda6c6..c566dbe 100644 --- a/Modules/SPP/Http/Controllers/SPPController.php +++ b/Modules/SPP/Http/Controllers/SPPController.php @@ -39,7 +39,7 @@ public function murid() // Detail Pembayaran public function detail($id) { - $payment = PaymentSpp::with('detailPayment','user.muridDetail')->findOrFail($id); + $payment = PaymentSpp::with('detailPayment.aprroveBy','user.muridDetail')->findOrFail($id); return view('spp::murid.show', compact('payment')); } diff --git a/Modules/SPP/Resources/views/murid/index.blade.php b/Modules/SPP/Resources/views/murid/index.blade.php index 7fc5f67..3cace46 100644 --- a/Modules/SPP/Resources/views/murid/index.blade.php +++ b/Modules/SPP/Resources/views/murid/index.blade.php @@ -65,32 +65,32 @@ {{$payments->email}} @if (Date('m') == 1) - {{strtoupper($payments->payment->January)}} + {{strtoupper($payments->payment->January)}} @elseif(Date('m') == 2) - {{strtoupper($payments->payment->Febuary)}} + {{strtoupper($payments->payment->Febuary)}} @elseif(Date('m') == 3) - {{strtoupper($payments->payment->March)}} + {{strtoupper($payments->payment->March)}} @elseif(Date('m') == 4) - {{strtoupper($payments->payment->April)}} + {{strtoupper($payments->payment->April)}} @elseif(Date('m') == 5) - {{strtoupper($payments->payment->Mey)}} + {{strtoupper($payments->payment->Mey)}} @elseif(Date('m') == 6) - {{strtoupper($payments->payment->Juny)}} + {{strtoupper($payments->payment->Juny)}} @elseif(Date('m') == 7) - {{ strtoupper($payments->payment->July) }} + {{strtoupper($payments->payment->July)}} @elseif(Date('m') == 8) - {{strtoupper($payments->payment->August)}} + {{strtoupper($payments->payment->August)}} @elseif(Date('m') == 9) - {{strtoupper($payments->payment->September)}} + {{strtoupper($payments->payment->September)}} @elseif(Date('m') == 10) - {{strtoupper($payments->payment->October)}} + {{strtoupper($payments->payment->October)}} @elseif(Date('m') == 11) - {{strtoupper($payments->payment->November)}} + {{strtoupper($payments->payment->November)}} @elseif(Date('m') == 12) - {{strtoupper($payments->payment->December)}} + {{strtoupper($payments->payment->December)}} @endif - {{$payments->payment->is_active == 1 ? 'ACTIVE' : 'SUSPEND'}} + {{$payments->payment->is_active == 1 ? 'ACTIVE' : 'SUSPEND'}} Detail diff --git a/Modules/SPP/Resources/views/murid/show.blade.php b/Modules/SPP/Resources/views/murid/show.blade.php index 594ef67..2309a22 100644 --- a/Modules/SPP/Resources/views/murid/show.blade.php +++ b/Modules/SPP/Resources/views/murid/show.blade.php @@ -62,11 +62,11 @@ {{$key+1}} {{$detail->month}} Rp {{number_format($detail->amount)}} - {{$detail->status}} - {{$detail->approve_by ?? '-'}} + {{$detail->status}} + {{$detail->aprroveBy->name ?? '-'}} {{$detail->approve_date ?? '-'}} - @if ($detail->file != null && $detail->statua == 'unpaid') + @if ($detail->file != null && $detail->status == 'unpaid')