update tgl 3 juni
This commit is contained in:
parent
c29be2538a
commit
c1b4718680
|
@ -79,18 +79,16 @@ private function calculateBalance($previousBalance, $debit, $kredit, $accountTyp
|
|||
|
||||
public function index(Request $request)
|
||||
{
|
||||
// Default date range hanya jika ada parameter filter
|
||||
$startDate = $request->input('start_date');
|
||||
$endDate = $request->input('end_date');
|
||||
// Default date range untuk bulan ini jika tidak ada parameter
|
||||
$startDate = $request->input('start_date', Carbon::now()->startOfMonth()->format('Y-m-d'));
|
||||
$endDate = $request->input('end_date', Carbon::now()->endOfMonth()->format('Y-m-d'));
|
||||
|
||||
try {
|
||||
// Query dasar
|
||||
$query = DB::table('laporan_transaksis');
|
||||
|
||||
// Terapkan filter tanggal hanya jika ada parameter
|
||||
if ($startDate && $endDate) {
|
||||
$query->whereBetween('Tanggal', [$startDate, $endDate]);
|
||||
}
|
||||
// Terapkan filter tanggal
|
||||
$query->whereBetween('Tanggal', [$startDate, $endDate]);
|
||||
|
||||
// Ambil semua transaksi
|
||||
$transaksis = $query->get();
|
||||
|
@ -445,9 +443,6 @@ public function showAll()
|
|||
->orderBy('periode')
|
||||
->get();
|
||||
|
||||
// Debug untuk memastikan data terisi
|
||||
Log::info('Daily Totals:', ['data' => $monthlyTotals->toArray()]);
|
||||
|
||||
// Get category totals for distribution chart
|
||||
$categoryTotals = DB::table('laporan_transaksis')
|
||||
->select(
|
||||
|
@ -466,8 +461,8 @@ public function showAll()
|
|||
->get();
|
||||
|
||||
// Calculate growth percentage
|
||||
$lastMonthStart = Carbon::parse($startDate)->subMonth()->startOfMonth();
|
||||
$lastMonthEnd = Carbon::parse($startDate)->subMonth()->endOfMonth();
|
||||
$lastMonthStart = Carbon::now()->subMonth()->startOfMonth();
|
||||
$lastMonthEnd = Carbon::now()->subMonth()->endOfMonth();
|
||||
|
||||
$lastMonthData = DB::table('laporan_transaksis')
|
||||
->whereBetween('Tanggal', [$lastMonthStart, $lastMonthEnd])
|
||||
|
@ -507,7 +502,6 @@ public function showAll()
|
|||
|
||||
// Ambil data neraca saldo untuk pie chart
|
||||
$rawTransaksis = DB::table('laporan_transaksis')
|
||||
->whereBetween('Tanggal', [$startDate, $endDate])
|
||||
->orderBy('kode', 'asc')
|
||||
->get();
|
||||
$totalsPerAkun = [];
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<!-- Switch Toggle -->
|
||||
<div class="flex items-center gap-2">
|
||||
<label class="relative inline-flex items-center cursor-pointer">
|
||||
<input type="checkbox" id="showAllSwitch" class="sr-only peer" {{ !request('start_date') && !request('end_date') ? 'checked' : '' }}>
|
||||
<input type="checkbox" id="showAllSwitch" class="sr-only peer" {{ request()->routeIs('home.all') ? 'checked' : '' }}>
|
||||
<div class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-indigo-300 dark:peer-focus:ring-indigo-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-indigo-600"></div>
|
||||
<span class="ml-3 text-sm font-medium text-gray-600 dark:text-gray-300">Tampilkan Semua</span>
|
||||
</label>
|
||||
|
@ -321,12 +321,6 @@ class="text-sm font-medium text-gray-500 dark:text-gray-400 hover:text-gray-900
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <a href="#" class="uppercase text-sm font-semibold inline-flex items-center rounded-lg text-blue-600 hover:text-blue-700 dark:hover:text-blue-500 hover:bg-gray-100 dark:hover:bg-gray-700 dark:focus:ring-gray-700 dark:border-gray-700 px-3 py-2">
|
||||
LAPORAN KATEGORI
|
||||
<svg class="w-2.5 h-2.5 ms-1.5 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 6 10">
|
||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 9 4-4-4-4"/>
|
||||
</svg>
|
||||
</a> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue