Skip to content

Commit

Permalink
Improve Pembayaran
Browse files Browse the repository at this point in the history
  • Loading branch information
andes2912 committed Jul 29, 2022
1 parent 64e590a commit f816a37
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
5 changes: 5 additions & 0 deletions Modules/Murid/Resources/views/pembayaran/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,14 @@
<div class="card shadow">
<div class="card-body">
<div class="d-flex justify-content-between">
@php
$p = new NumberFormatter("id", NumberFormatter::SPELLOUT);
$result = preg_replace("/\..+/", "", $payment->amount);
@endphp
<span>
Jumlah :
<span style="font-weight: bold">Rp {{number_format($payment->amount)}}</span>
<small style="font-style: italic; font-size:10px; color:brown">{{ ucwords($p->format($result))}} Rupiah</small>
</span>
<span style="font-size: 21px">
<i class="feather icon-credit-card"></i>
Expand Down
17 changes: 9 additions & 8 deletions Modules/PPDB/Http/Controllers/DataMuridController.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,15 @@ public function payment($murid)
]);

if ($payment) {
DetailPaymentSpp::create([
'payment_id' => $payment->id,
'user_id' => $murid,
'month' => date('F'),
'amount' => 300000,
'status' => 'unpaid',
'file' => null,
]);
$generate = rand(10,100);
DetailPaymentSpp::create([
'payment_id' => $payment->id,
'user_id' => $murid,
'month' => date('F'),
'amount' => 300 .$murid .$generate,
'status' => 'unpaid',
'file' => null,
]);
}
DB::commit();
} catch (\ErrorException $e) {
Expand Down

0 comments on commit f816a37

Please sign in to comment.