@extends("common.layout") @section("header") {!! resource('css/dashboard.css') !!} {!! resource('js/dashboard/dashboard-common.js') !!} @endsection @section("content")

전일({{$yesterday->format('m/d')}}) 매출 현황

총 매출액 {{ number_format($dailyStats['total']) }}원

신규 {{$dailyStats['new']['count']}}건 매출액 {{number_format($dailyStats['new']['sum'])}}원 | 재등록 {{$dailyStats['re']['count']}}건 매출액 {{number_format($dailyStats['re']['sum'])}}원 | (+) 변경 {{$dailyStats['change']['count']}}건 매출액 {{number_format($dailyStats['change']['sum'])}}원 | (-) 변경(환불) {{$dailyStats['change_refund']['count']}}건 매출액 {{ $dailyStats['change_refund']['sum'] > 0 ? '-' . number_format($dailyStats['change_refund']['sum']) : number_format($dailyStats['change_refund']['sum']) }}원 | 기타 {{$dailyStats['etc']['count']}}건 매출액 {{number_format($dailyStats['etc']['sum'])}}

어학센터(정산기준)

@php $colCount = count($academyMonthArray); $dynamicWidth = "calc((100% - 390px) / {$colCount})"; // $results를 month 기준으로 key로 변환 (빠른 조회용) $resultsByMonth = $academyData->keyBy('month'); $detailByMonth = $academyDetail->keyBy('month'); // 누계용 변수 $totalRevenue = 0; $newRevenue = 0; $reRevenue = 0; $changeRevenue = 0; $refundRevenue= 0; $etcRevenue = 0; $totalGrowthRate = 0; @endphp @foreach($academyMonthArray as $month) @endforeach @foreach($academyMonthArray as $month) @endforeach @foreach($academyMonthArray as $month) @php $currNet = $detailByMonth[$month]->payment_new ?? 0; $newRevenue += $currNet; @endphp @endforeach @foreach($academyMonthArray as $month) @php $currNet = $detailByMonth[$month]->payment_re ?? 0; $reRevenue += $currNet; @endphp @endforeach @foreach($academyMonthArray as $month) @php $currNet = $detailByMonth[$month]->payment_change ?? 0; $changeRevenue += $currNet; @endphp @endforeach @foreach($academyMonthArray as $month) @php $currNet = $detailByMonth[$month]->refund_total ?? 0; $refundRevenue += $currNet; @endphp @endforeach @foreach($academyMonthArray as $month) @php $currNet = $detailByMonth[$month]->payment_etc ?? 0; $etcRevenue += $currNet; @endphp @endforeach @foreach($academyMonthArray as $month) @php $currNet = $resultsByMonth[$month]->curr_net ?? 0; $totalRevenue += $currNet; @endphp @endforeach @foreach($academyMonthArray as $month) @php $currNet = $resultsByMonth[$month]->curr_net ?? 0; $prevMonthNet = $resultsByMonth[$month]->prev_net ?? 0; if (is_null($prevMonthNet) || $prevMonthNet == 0) { $growth = null; // 0이 아니라 null로 표시 } else { $growth = ($currNet - $prevMonthNet) / $prevMonthNet * 100; } // 색 결정 (양수: 파랑, 음수: 빨강, null: 기본) if (is_null($growth)) { $colorClass = ''; } elseif ($growth > 0) { $colorClass = 'text-blue'; // Tailwind 예시 } else { $colorClass = 'text-red'; } @endphp @endforeach
{{ \Carbon\Carbon::parse($month.'-01')->month }}월누계
신규{{ number_format($currNet) }}{{ number_format($newRevenue) }}
재등록{{ number_format($currNet) }}{{ number_format($reRevenue) }}
(+) 변경{{ number_format($currNet) }}{{ number_format($changeRevenue) }}
(-) 변경 / 환불 {{ $currNet > 0 ? '-' . number_format($currNet) : number_format($currNet) }} {{ $refundRevenue > 0 ? '-' . number_format($refundRevenue) : number_format($refundRevenue) }}
기타{{ number_format($currNet) }}{{ number_format($etcRevenue) }}
합계{{ number_format($currNet) }}{{ number_format($totalRevenue) }}
증감율 {{ is_null($growth) ? '-' : number_format($growth, 1) . '%' }} {{ is_null($growth) ? '-' : number_format($growth, 1) . '%' }}

인강

@php $colCount = count($monthArray); $dynamicWidth = "calc((100% - 360px) / {$colCount})"; // $results를 month 기준으로 key로 변환 (빠른 조회용) $resultsByMonth = $ieltsData->keyBy('month'); // 누계용 변수 $totalRevenue = 0; $totalGrowthRate = 0; $totalPaymentRevenue = 0; $totalRefundRevenue = 0; @endphp @foreach($monthArray as $month) @endforeach @foreach($monthArray as $month) @endforeach @foreach($monthArray as $month) @php $currPayment = $resultsByMonth[$month]->curr_payment ?? 0; $totalPaymentRevenue += $currPayment; @endphp @endforeach @foreach($monthArray as $month) @php $currRefund = $resultsByMonth[$month]->curr_refund ?? 0; $totalRefundRevenue += $currRefund; @endphp @endforeach {{-- 매출액 --}} @foreach($monthArray as $month) @php $currNet = $resultsByMonth[$month]->curr_net ?? 0; $totalRevenue += $currNet; @endphp @endforeach {{-- 증감율 (전월 대비) --}} @foreach($monthArray as $month) @php $currNet = $resultsByMonth[$month]->curr_net ?? 0; $prevMonthNet = $resultsByMonth[$month]->prev_net ?? 0; if (is_null($prevMonthNet) || $prevMonthNet == 0) { $growth = null; // 0이 아니라 null로 표시 } else { $growth = ($currNet - $prevMonthNet) / $prevMonthNet * 100; } // 색 결정 (양수: 파랑, 음수: 빨강, null: 기본) if (is_null($growth)) { $colorClass = ''; } elseif ($growth > 0) { $colorClass = 'text-blue'; // Tailwind 예시 } else { $colorClass = 'text-red'; } @endphp @endforeach
{{ \Carbon\Carbon::parse($month.'-01')->month }}월누계
매출액{{ number_format($currPayment) }}{{ number_format($totalPaymentRevenue) }}
취소/환불액 {{ $currRefund != 0 ? '-'.number_format($currRefund) : number_format($currRefund) }} {{ $totalRefundRevenue != 0 ? '-'.number_format($totalRefundRevenue) : number_format($totalRefundRevenue) }}
합계{{ number_format($currNet) }}{{ number_format($totalRevenue) }}
증감율 {{ is_null($growth) ? '-' : number_format($growth, 1) . '%' }} {{ is_null($growth) ? '-' : number_format($growth, 1) . '%' }}
@endsection @push("script") @endpush