Initial commit

This commit is contained in:
2025-11-20 23:21:05 +08:00
commit 13bc6db529
378 changed files with 54527 additions and 0 deletions

View File

@@ -0,0 +1,194 @@
<x-app-layout>
<x-slot name="header">
<h2 class="text-xl font-semibold leading-tight text-gray-800">
現金簿餘額報表
</h2>
</x-slot>
<div class="py-12">
<div class="mx-auto max-w-7xl sm:px-6 lg:px-8 space-y-4">
<!-- Action Buttons -->
<div class="flex justify-between">
<a href="{{ route('admin.cashier-ledger.index') }}" class="inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
返回現金簿
</a>
<button onclick="window.print()" class="inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
<svg class="-ml-1 mr-2 h-5 w-5 text-gray-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z" />
</svg>
列印報表
</button>
</div>
<!-- Report Header -->
<div class="bg-white shadow sm:rounded-lg">
<div class="px-4 py-5 sm:p-6 text-center">
<h3 class="text-2xl font-bold text-gray-900">現金簿餘額報表</h3>
<p class="mt-1 text-sm text-gray-500">報表日期: {{ now()->format('Y-m-d H:i') }}</p>
</div>
</div>
<!-- Account Balances -->
<div class="bg-white shadow sm:rounded-lg">
<div class="px-4 py-5 sm:p-6">
<h3 class="text-lg font-medium leading-6 text-gray-900 mb-4">各帳戶餘額</h3>
@if($accounts->isNotEmpty())
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
@php
$totalBalance = 0;
@endphp
@foreach($accounts as $account)
@php
$totalBalance += $account['balance'];
@endphp
<div class="rounded-lg border-2 {{ $account['balance'] >= 0 ? 'border-green-300 bg-green-50' : 'border-red-300 bg-red-50' }} p-4">
<div class="flex items-center justify-between">
<div class="flex-1">
<dt class="text-sm font-medium text-gray-700">{{ $account['bank_account'] }}</dt>
<dd class="mt-2 text-3xl font-bold {{ $account['balance'] >= 0 ? 'text-green-700' : 'text-red-700' }}">
NT$ {{ number_format($account['balance'], 2) }}
</dd>
@if($account['last_updated'])
<p class="mt-1 text-xs text-gray-500">
最後更新: {{ $account['last_updated']->format('Y-m-d') }}
</p>
@endif
</div>
<div class="flex-shrink-0">
<svg class="h-12 w-12 {{ $account['balance'] >= 0 ? 'text-green-400' : 'text-red-400' }}" fill="none" stroke="currentColor" viewBox="0 0 24 24">
@if($account['balance'] >= 0)
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
@else
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
@endif
</svg>
</div>
</div>
</div>
@endforeach
</div>
<!-- Total Balance -->
<div class="mt-6 rounded-lg border-2 border-indigo-300 bg-indigo-50 p-6">
<div class="flex items-center justify-between">
<div>
<dt class="text-base font-medium text-indigo-900">總餘額</dt>
<dd class="mt-2 text-4xl font-bold {{ $totalBalance >= 0 ? 'text-indigo-700' : 'text-red-700' }}">
NT$ {{ number_format($totalBalance, 2) }}
</dd>
</div>
<svg class="h-16 w-16 text-indigo-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2m2 4h10a2 2 0 002-2v-6a2 2 0 00-2-2H9a2 2 0 00-2 2v6a2 2 0 002 2zm7-5a2 2 0 11-4 0 2 2 0 014 0z" />
</svg>
</div>
</div>
@else
<div class="text-center py-8 text-gray-500">
暫無帳戶餘額記錄
</div>
@endif
</div>
</div>
<!-- Monthly Summary -->
<div class="bg-white shadow sm:rounded-lg">
<div class="px-4 py-5 sm:p-6">
<h3 class="text-lg font-medium leading-6 text-gray-900 mb-4">本月交易摘要 ({{ now()->format('Y年m月') }})</h3>
<div class="grid grid-cols-1 gap-4 sm:grid-cols-3">
<!-- Monthly Receipts -->
<div class="rounded-lg border border-green-200 bg-green-50 p-4">
<div class="flex items-center">
<div class="flex-shrink-0">
<svg class="h-10 w-10 text-green-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 11l5-5m0 0l5 5m-5-5v12" />
</svg>
</div>
<div class="ml-4 flex-1">
<dt class="text-sm font-medium text-gray-700">本月收入</dt>
<dd class="mt-1 text-2xl font-semibold text-green-700">
NT$ {{ number_format($monthlySummary['receipts'], 2) }}
</dd>
</div>
</div>
</div>
<!-- Monthly Payments -->
<div class="rounded-lg border border-red-200 bg-red-50 p-4">
<div class="flex items-center">
<div class="flex-shrink-0">
<svg class="h-10 w-10 text-red-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 13l-5 5m0 0l-5-5m5 5V6" />
</svg>
</div>
<div class="ml-4 flex-1">
<dt class="text-sm font-medium text-gray-700">本月支出</dt>
<dd class="mt-1 text-2xl font-semibold text-red-700">
NT$ {{ number_format($monthlySummary['payments'], 2) }}
</dd>
</div>
</div>
</div>
<!-- Net Change -->
<div class="rounded-lg border border-blue-200 bg-blue-50 p-4">
<div class="flex items-center">
<div class="flex-shrink-0">
<svg class="h-10 w-10 text-blue-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
</svg>
</div>
<div class="ml-4 flex-1">
<dt class="text-sm font-medium text-gray-700">淨變動</dt>
@php
$netChange = $monthlySummary['receipts'] - $monthlySummary['payments'];
@endphp
<dd class="mt-1 text-2xl font-semibold {{ $netChange >= 0 ? 'text-green-700' : 'text-red-700' }}">
{{ $netChange >= 0 ? '+' : '' }} NT$ {{ number_format($netChange, 2) }}
</dd>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Notes -->
<div class="bg-yellow-50 border border-yellow-200 rounded-lg p-4 print:hidden">
<div class="flex">
<div class="flex-shrink-0">
<svg class="h-5 w-5 text-yellow-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
</div>
<div class="ml-3">
<h3 class="text-sm font-medium text-yellow-800">報表說明</h3>
<div class="mt-2 text-sm text-yellow-700">
<ul class="list-disc pl-5 space-y-1">
<li>餘額為即時數據,以最後一筆分錄的交易後餘額為準</li>
<li>本月交易摘要統計當月 ({{ now()->format('Y-m') }}) 的所有交易</li>
<li>建議每日核對餘額,確保記錄正確</li>
<li>如發現餘額異常,請檢查分錄記錄是否有誤</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
@push('styles')
<style>
@media print {
.print\:hidden {
display: none !important;
}
body {
print-color-adjust: exact;
-webkit-print-color-adjust: exact;
}
}
</style>
@endpush
</x-app-layout>