fixing transaksi, fixing other
parent
f04a243a33
commit
29754d9a3b
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports;
|
||||
|
||||
use App\Models\Transaksi;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Maatwebsite\Excel\Concerns\FromView;
|
||||
|
||||
class SppExport implements FromView
|
||||
{
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function collection()
|
||||
{
|
||||
return Transaksi::orderBy('created_at','desc')->get();
|
||||
}
|
||||
|
||||
public function view(): View
|
||||
{
|
||||
return view('transaksi.transaksiexport', [
|
||||
'transaksi' => $this->collection(),
|
||||
]);
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><b>Tanggal</b></th>
|
||||
<th><b>Siswa</b></th>
|
||||
<th><b>Tagihan</b></th>
|
||||
<th><b>Diskon</b></th>
|
||||
<th><b>Dibayarkan</b></th>
|
||||
<th><b>Keterangan</b></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($transaksi as $item)
|
||||
<tr>
|
||||
<td>{{ $item->created_at->format('d-m-Y') }}</td>
|
||||
<td>{{ $item->siswa->nama.'('.$item->siswa->kelas->nama.')' }}</td>
|
||||
<td>{{ $item->tagihan->nama }}</td>
|
||||
<td>IDR. {{ format_idr($item->diskon) }}</td>
|
||||
<td>IDR. {{ format_idr($item->keuangan->jumlah) }}</td>
|
||||
<td style="max-width:150px;">{{ $item->keterangan }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
Loading…
Reference in New Issue