feat:부가세 요약 테이블 개선
- 매출 → 매출(세금계산서) 명칭 변경 - 계산서(면세) 행 추가 - 홈택스 면세 데이터 집계 - 면세는 세액 없으므로 공급가액만 표시 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -195,10 +195,21 @@ public function index(Request $request): JsonResponse
|
||||
->concat($manualRecords)
|
||||
->values();
|
||||
|
||||
$hometaxSalesSupply = $hometaxSalesRecords->sum('supplyAmount');
|
||||
$hometaxSalesVat = $hometaxSalesRecords->sum('vatAmount');
|
||||
$hometaxPurchaseSupply = $hometaxPurchaseRecords->sum('supplyAmount');
|
||||
$hometaxPurchaseVat = $hometaxPurchaseRecords->sum('vatAmount');
|
||||
// 홈택스 매출 (과세 + 영세만, 면세 제외)
|
||||
$hometaxSalesTaxable = $hometaxSalesRecords->whereIn('taxType', ['taxable', 'zero_rated']);
|
||||
$hometaxSalesSupply = $hometaxSalesTaxable->sum('supplyAmount');
|
||||
$hometaxSalesVat = $hometaxSalesTaxable->sum('vatAmount');
|
||||
|
||||
// 홈택스 매입 세금계산서 (과세 + 영세만, 면세 제외)
|
||||
$hometaxPurchaseTaxable = $hometaxPurchaseRecords->whereIn('taxType', ['taxable', 'zero_rated']);
|
||||
$hometaxPurchaseSupply = $hometaxPurchaseTaxable->sum('supplyAmount');
|
||||
$hometaxPurchaseVat = $hometaxPurchaseTaxable->sum('vatAmount');
|
||||
|
||||
// 홈택스 면세 계산서 (매입 + 매출 모두)
|
||||
$exemptSalesSupply = $hometaxSalesRecords->where('taxType', 'exempt')->sum('supplyAmount');
|
||||
$exemptPurchaseSupply = $hometaxPurchaseRecords->where('taxType', 'exempt')->sum('supplyAmount');
|
||||
$exemptSupply = $exemptSalesSupply + $exemptPurchaseSupply;
|
||||
|
||||
$cardPurchaseSupply = $cardRecords->sum('supplyAmount');
|
||||
$cardPurchaseVat = $cardRecords->sum('vatAmount');
|
||||
$manualSalesSupply = $manualRecords->where('type', 'sales')->sum('supplyAmount');
|
||||
@@ -213,6 +224,7 @@ public function index(Request $request): JsonResponse
|
||||
'purchaseVat' => $hometaxPurchaseVat + $cardPurchaseVat + $manualPurchaseVat,
|
||||
'hometaxPurchaseSupply' => $hometaxPurchaseSupply,
|
||||
'hometaxPurchaseVat' => $hometaxPurchaseVat,
|
||||
'exemptSupply' => $exemptSupply, // 면세 계산서 공급가액
|
||||
'cardPurchaseSupply' => $cardPurchaseSupply,
|
||||
'cardPurchaseVat' => $cardPurchaseVat,
|
||||
'total' => $allRecords->count(),
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
function VatManagement() {
|
||||
const [vatRecords, setVatRecords] = useState([]);
|
||||
const [stats, setStats] = useState({ salesSupply: 0, salesVat: 0, purchaseSupply: 0, purchaseVat: 0, hometaxPurchaseSupply: 0, hometaxPurchaseVat: 0, cardPurchaseSupply: 0, cardPurchaseVat: 0, total: 0 });
|
||||
const [stats, setStats] = useState({ salesSupply: 0, salesVat: 0, purchaseSupply: 0, purchaseVat: 0, hometaxPurchaseSupply: 0, hometaxPurchaseVat: 0, exemptSupply: 0, cardPurchaseSupply: 0, cardPurchaseVat: 0, total: 0 });
|
||||
const [periods, setPeriods] = useState([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [saving, setSaving] = useState(false);
|
||||
@@ -170,6 +170,7 @@ function VatManagement() {
|
||||
const purchaseSupply = stats.purchaseSupply || 0;
|
||||
const hometaxPurchaseSupply = stats.hometaxPurchaseSupply || 0;
|
||||
const hometaxPurchaseVat = stats.hometaxPurchaseVat || 0;
|
||||
const exemptSupply = stats.exemptSupply || 0;
|
||||
const cardPurchaseSupply = stats.cardPurchaseSupply || 0;
|
||||
const cardPurchaseVat = stats.cardPurchaseVat || 0;
|
||||
const netVat = salesVat - purchaseVat;
|
||||
@@ -363,7 +364,7 @@ function VatManagement() {
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr className="border-b border-gray-100">
|
||||
<td className="px-6 py-3 text-sm">매출</td>
|
||||
<td className="px-6 py-3 text-sm">매출(세금계산서)</td>
|
||||
<td className="px-6 py-3 text-sm text-right">{formatCurrency(salesSupply)}원</td>
|
||||
<td className="px-6 py-3 text-sm text-right text-emerald-600 font-medium">{formatCurrency(salesVat)}원</td>
|
||||
</tr>
|
||||
@@ -372,6 +373,11 @@ function VatManagement() {
|
||||
<td className="px-6 py-3 text-sm text-right">{formatCurrency(hometaxPurchaseSupply)}원</td>
|
||||
<td className="px-6 py-3 text-sm text-right text-pink-600 font-medium">({formatCurrency(hometaxPurchaseVat)}원)</td>
|
||||
</tr>
|
||||
<tr className="border-b border-gray-100 bg-gray-50/50">
|
||||
<td className="px-6 py-3 text-sm text-gray-600">계산서(면세)</td>
|
||||
<td className="px-6 py-3 text-sm text-right text-gray-600">{formatCurrency(exemptSupply)}원</td>
|
||||
<td className="px-6 py-3 text-sm text-right text-gray-400">-</td>
|
||||
</tr>
|
||||
<tr className="border-b border-gray-100 bg-purple-50/50">
|
||||
<td className="px-6 py-3 text-sm text-purple-700">매입(카드)</td>
|
||||
<td className="px-6 py-3 text-sm text-right text-purple-600">{formatCurrency(cardPurchaseSupply)}원</td>
|
||||
|
||||
Reference in New Issue
Block a user