feat:부가세 관리 구분 6개로 확장 (전자/종이세금계산서 분리)

- 매출(세금계산서) → 매출(전자세금계산서) + 매출(종이세금계산서) 분리
- 매입(세금계산서) → 매입(전자세금계산서) + 매입(종이세금계산서) 분리
- 매입(카드) → 매입(신용카드) 명칭 변경
- 요약 테이블 6행으로 확장, 필터 드롭다운 업데이트
- 컨트롤러 stats에 hometaxSales/manualSales/manualPurchase 분리 반환

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
김보곤
2026-02-09 09:46:21 +09:00
parent 4ed902e846
commit b204e73ada
2 changed files with 64 additions and 23 deletions

View File

@@ -195,12 +195,12 @@ public function index(Request $request): JsonResponse
->concat($manualRecords)
->values();
// 홈택스 매출 (과세 + 영세만, 면세 제외)
// 홈택스 매출 전자세금계산서 (과세 + 영세만, 면세 제외)
$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');
@@ -208,23 +208,42 @@ public function index(Request $request): JsonResponse
// 홈택스 면세 계산서 (매입 + 매출 모두)
$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');
$manualSalesVat = $manualRecords->where('type', 'sales')->sum('vatAmount');
$manualPurchaseSupply = $manualRecords->where('type', 'purchase')->sum('supplyAmount');
$manualPurchaseVat = $manualRecords->where('type', 'purchase')->sum('vatAmount');
// 수동입력 매출 종이세금계산서 (과세+영세)
$manualSalesTaxable = $manualRecords->where('type', 'sales')->whereIn('taxType', ['taxable', 'zero_rated']);
$manualSalesSupply = $manualSalesTaxable->sum('supplyAmount');
$manualSalesVat = $manualSalesTaxable->sum('vatAmount');
// 수동입력 매입 종이세금계산서 (과세+영세)
$manualPurchaseTaxable = $manualRecords->where('type', 'purchase')->whereIn('taxType', ['taxable', 'zero_rated']);
$manualPurchaseSupply = $manualPurchaseTaxable->sum('supplyAmount');
$manualPurchaseVat = $manualPurchaseTaxable->sum('vatAmount');
// 수동입력 면세 계산서
$manualExemptSalesSupply = $manualRecords->where('type', 'sales')->where('taxType', 'exempt')->sum('supplyAmount');
$manualExemptPurchaseSupply = $manualRecords->where('type', 'purchase')->where('taxType', 'exempt')->sum('supplyAmount');
// 면세 계산서 합계 (홈택스 + 수동)
$exemptSupply = $exemptSalesSupply + $exemptPurchaseSupply + $manualExemptSalesSupply + $manualExemptPurchaseSupply;
$stats = [
'salesSupply' => $hometaxSalesSupply + $manualSalesSupply,
'salesVat' => $hometaxSalesVat + $manualSalesVat,
'purchaseSupply' => $hometaxPurchaseSupply + $cardPurchaseSupply + $manualPurchaseSupply,
'purchaseVat' => $hometaxPurchaseVat + $cardPurchaseVat + $manualPurchaseVat,
'hometaxSalesSupply' => $hometaxSalesSupply,
'hometaxSalesVat' => $hometaxSalesVat,
'manualSalesSupply' => $manualSalesSupply,
'manualSalesVat' => $manualSalesVat,
'hometaxPurchaseSupply' => $hometaxPurchaseSupply,
'hometaxPurchaseVat' => $hometaxPurchaseVat,
'exemptSupply' => $exemptSupply, // 면세 계산서 공급가액
'manualPurchaseSupply' => $manualPurchaseSupply,
'manualPurchaseVat' => $manualPurchaseVat,
'exemptSupply' => $exemptSupply,
'cardPurchaseSupply' => $cardPurchaseSupply,
'cardPurchaseVat' => $cardPurchaseVat,
'total' => $allRecords->count(),