diff --git a/resources/views/Laporan.blade.php b/resources/views/Laporan.blade.php index f8e41ed..ad44d89 100644 --- a/resources/views/Laporan.blade.php +++ b/resources/views/Laporan.blade.php @@ -35,87 +35,26 @@ +
No | -Tanggal | ++ Tanggal + + | Kode Akun | Nama Akun | Keterangan | @@ -129,9 +68,21 @@ $no = 1; $totalDebitTable = 0; $totalKreditTable = 0; + + // Sort laporan berdasarkan tanggal + $sortOrder = request('sort_order', 'asc'); + $sortedLaporan = $laporan->sortBy(function($item) { + return strtotime($item->Tanggal); + }); + + if ($sortOrder == 'desc') { + $sortedLaporan = $sortedLaporan->sortByDesc(function($item) { + return strtotime($item->Tanggal); + }); + } @endphp - @foreach($laporan as $item) + @foreach($sortedLaporan as $item) @php // Cek apakah semua nilai adalah debit $allDebit = true; @@ -194,9 +145,12 @@ $totalDebitTable += $rowDebit; $totalKreditTable += $rowKredit; @endphp -
---|---|---|---|---|---|
{{ $no++ }} | -{{ date('d/m/Y', strtotime($item->Tanggal)) }} | +
+ {{ date('d/m/Y', strtotime($item->Tanggal)) }}
+ {{ date('l', strtotime($item->Tanggal)) }}
+ |
{{ $item->kode }}
@@ -312,9 +266,6 @@
|
-
-
@@ -335,32 +286,32 @@
-
-
-
-
-
+
+
+
+
+
-
-
-
- Page 1
-
+
+
-
+
+ Page 1
+
+
|