From dd9c39e0481d54c32f9cb95e828f459eaad947a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Tue, 3 Feb 2026 17:46:22 +0900 Subject: [PATCH] =?UTF-8?q?feat:=ED=99=88=ED=83=9D=EC=8A=A4=20=EB=8C=80?= =?UTF-8?q?=EC=8B=9C=EB=B3=B4=EB=93=9C=20=EC=B9=B4=EB=93=9C=205=EA=B0=9C?= =?UTF-8?q?=EB=A1=9C=20=ED=99=95=EC=9E=A5=20=EB=B0=8F=20=ED=85=8C=EC=9D=B4?= =?UTF-8?q?=EB=B8=94=20=ED=95=A9=EA=B3=84=ED=96=89=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/barobill/hometax/index.blade.php | 68 +++++++++++++++++-- 1 file changed, 63 insertions(+), 5 deletions(-) diff --git a/resources/views/barobill/hometax/index.blade.php b/resources/views/barobill/hometax/index.blade.php index dc172961..6c7c9e58 100644 --- a/resources/views/barobill/hometax/index.blade.php +++ b/resources/views/barobill/hometax/index.blade.php @@ -169,7 +169,8 @@ className={`px-6 py-3 text-sm font-medium rounded-lg transition-all ${ loading, type, onExport, - onRequestCollect + onRequestCollect, + summary // 합계 정보 }) => { const formatCurrency = (val) => new Intl.NumberFormat('ko-KR').format(val || 0); @@ -313,6 +314,24 @@ className="flex items-center gap-2 px-3 py-1.5 bg-blue-100 text-blue-700 rounded ); }) )} + {/* 합계행 */} + {invoices.length > 0 && summary && ( + + + 합계 ({invoices.length}건) + + + {formatCurrency(summary.supplyAmount)} + + + {formatCurrency(summary.taxAmount)} + + + {formatCurrency(summary.totalAmount)} + + + + )} @@ -696,10 +715,41 @@ className="flex items-center gap-2 px-3 py-1.5 bg-blue-100 text-blue-700 rounded }; const formatCurrency = (val) => new Intl.NumberFormat('ko-KR').format(val || 0) + '원'; + const formatNumber = (val) => new Intl.NumberFormat('ko-KR').format(val || 0); + + // 과세/면세 합계 계산 + const calculateTaxTypeSummary = (invoices) => { + let taxableAmount = 0; // 과세 공급가액 + let exemptAmount = 0; // 면세 공급가액 + let taxableCount = 0; + let exemptCount = 0; + + invoices.forEach(inv => { + const amount = inv.supplyAmount || 0; + if (inv.taxTypeName === '면세') { + exemptAmount += amount; + exemptCount++; + } else { + taxableAmount += amount; + taxableCount++; + } + }); + + return { taxableAmount, exemptAmount, taxableCount, exemptCount }; + }; const currentData = activeTab === 'sales' ? salesData : purchaseData; const filteredInvoices = filterByCorpName(currentData.invoices); + // 매입 과세/면세 합계 + const purchaseTaxSummary = calculateTaxTypeSummary(purchaseData.invoices); + // 현재 탭 인보이스 합계 (테이블 합계용) + const currentInvoiceSummary = { + supplyAmount: filteredInvoices.reduce((sum, inv) => sum + (inv.supplyAmount || 0), 0), + taxAmount: filteredInvoices.reduce((sum, inv) => sum + (inv.taxAmount || 0), 0), + totalAmount: filteredInvoices.reduce((sum, inv) => sum + (inv.totalAmount || 0), 0), + }; + return (
{/* Page Header */} @@ -911,7 +961,7 @@ className="flex items-center gap-2 text-sm font-semibold rounded-md disabled:opa )} {/* Dashboard */} -
+
} color="red" /> + } + color="purple" + />