Skip to content

Commit

Permalink
Merge pull request #84 from andes2912/feature/spp
Browse files Browse the repository at this point in the history
Improve Pembayaran
  • Loading branch information
andes2912 authored Jul 17, 2022
2 parents 72aa478 + b911e89 commit 663de96
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 20 deletions.
8 changes: 6 additions & 2 deletions Modules/Murid/Resources/views/pembayaran/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,14 @@
<td> {{$payments->payment->year}} </td>
<td> {{$payments->month}} </td>
<td>Rp {{number_format($payments->amount)}} </td>
<td> {{$payments->status}} </td>
<td> <span class="badge badge-{{$payments->status == 'paid' ? 'info' : 'warning'}}">{{$payments->status}}</span> </td>
<td> {{$payments->date_file}} </td>
<td>
<a href="{{route('pembayaran.edit', $payments->id)}}" class="btn btn-success btn-sm">{{$payments->file != null ? 'Pembayaran Diproses' : 'Bayar'}}</a>
@if ($payments->status == 'paid')
<span class="badge badge-info">Pembayaran Diterima</span>
@else
<a href="{{route('pembayaran.edit', $payments->id)}}" class="btn btn-success btn-sm">{{$payments->file != null ? 'Pembayaran Diproses' : 'Bayar'}}</a>
@endif
</td>
</tr>
@endforeach
Expand Down
5 changes: 5 additions & 0 deletions Modules/SPP/Entities/DetailPaymentSpp.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,9 @@ public function user()
{
return $this->belongsTo(User::class,'user_id');
}

public function aprroveBy()
{
return $this->belongsTo(User::class, 'approve_by');
}
}
2 changes: 1 addition & 1 deletion Modules/SPP/Http/Controllers/SPPController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}

Expand Down
26 changes: 13 additions & 13 deletions Modules/SPP/Resources/views/murid/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,32 +65,32 @@
<td> {{$payments->email}} </td>
<td>
@if (Date('m') == 1)
{{strtoupper($payments->payment->January)}}
<span class="badge badge-{{$payments->payment->January == 'paid' ? 'info' : 'warning'}}">{{strtoupper($payments->payment->January)}}</span>
@elseif(Date('m') == 2)
{{strtoupper($payments->payment->Febuary)}}
<span class="badge badge-{{$payments->payment->Febuary == 'paid' ? 'info' : 'warning'}}">{{strtoupper($payments->payment->Febuary)}}</span>
@elseif(Date('m') == 3)
{{strtoupper($payments->payment->March)}}
<span class="badge badge-{{$payments->payment->March == 'paid' ? 'info' : 'warning'}}">{{strtoupper($payments->payment->March)}}</span>
@elseif(Date('m') == 4)
{{strtoupper($payments->payment->April)}}
<span class="badge badge-{{$payments->payment->April == 'paid' ? 'info' : 'warning'}}">{{strtoupper($payments->payment->April)}}</span>
@elseif(Date('m') == 5)
{{strtoupper($payments->payment->Mey)}}
<span class="badge badge-{{$payments->payment->Mey == 'paid' ? 'info' : 'warning'}}">{{strtoupper($payments->payment->Mey)}}</span>
@elseif(Date('m') == 6)
{{strtoupper($payments->payment->Juny)}}
<span class="badge badge-{{$payments->payment->Juny == 'paid' ? 'info' : 'warning'}}">{{strtoupper($payments->payment->Juny)}}</span>
@elseif(Date('m') == 7)
{{ strtoupper($payments->payment->July) }}
<span class="badge badge-{{$payments->payment->July == 'paid' ? 'info' : 'warning'}}">{{strtoupper($payments->payment->July)}}</span>
@elseif(Date('m') == 8)
{{strtoupper($payments->payment->August)}}
<span class="badge badge-{{$payments->payment->August == 'paid' ? 'info' : 'warning'}}">{{strtoupper($payments->payment->August)}}</span>
@elseif(Date('m') == 9)
{{strtoupper($payments->payment->September)}}
<span class="badge badge-{{$payments->payment->September == 'paid' ? 'info' : 'warning'}}">{{strtoupper($payments->payment->September)}}</span>
@elseif(Date('m') == 10)
{{strtoupper($payments->payment->October)}}
<span class="badge badge-{{$payments->payment->October == 'paid' ? 'info' : 'warning'}}">{{strtoupper($payments->payment->October)}}</span>
@elseif(Date('m') == 11)
{{strtoupper($payments->payment->November)}}
<span class="badge badge-{{$payments->payment->November == 'paid' ? 'info' : 'warning'}}">{{strtoupper($payments->payment->November)}}</span>
@elseif(Date('m') == 12)
{{strtoupper($payments->payment->December)}}
<span class="badge badge-{{$payments->payment->December == 'paid' ? 'info' : 'warning'}}">{{strtoupper($payments->payment->December)}}</span>
@endif
</td>
<td> {{$payments->payment->is_active == 1 ? 'ACTIVE' : 'SUSPEND'}} </td>
<td> <span class="badge badge-info">{{$payments->payment->is_active == 1 ? 'ACTIVE' : 'SUSPEND'}}</span></td>
<td>
<a href="{{route('spp.murid.detail', $payments->payment->id)}}" class="btn btn-success btn-sm">Detail</a>
</td>
Expand Down
6 changes: 3 additions & 3 deletions Modules/SPP/Resources/views/murid/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@
<td> {{$key+1}} </td>
<td>{{$detail->month}}</td>
<td>Rp {{number_format($detail->amount)}}</td>
<td>{{$detail->status}}</td>
<td>{{$detail->approve_by ?? '-'}}</td>
<td><span class="badge badge-{{$detail->status == 'paid' ? 'info' : 'warning'}}">{{$detail->status}}</span></td>
<td>{{$detail->aprroveBy->name ?? '-'}}</td>
<td>{{$detail->approve_date ?? '-'}}</td>
<td>
@if ($detail->file != null && $detail->statua == 'unpaid')
@if ($detail->file != null && $detail->status == 'unpaid')
<a href="" class="btn btn-success btn-sm" data-toggle="modal" id="klikModal" data-target="#modalPembayaran"
data-id="{{$detail->id}}"
data-name="{{$detail->user->name}}"
Expand Down
3 changes: 2 additions & 1 deletion database/seeders/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public function run()
RoleSeeder::class,
AddRoleSeeder::class,
UserSeeder::class,
AddRoleBendaharaSeederTableSeeder::class
AddRoleBendaharaSeederTableSeeder::class,
IndoBankSeeder::class
]);

}
Expand Down

0 comments on commit 663de96

Please sign in to comment.