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(),
|
||||
|
||||
Reference in New Issue
Block a user