From 51f45b3f5bbc86a1d7043ab4e434b185c86fb7f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Thu, 5 Feb 2026 14:39:29 +0900 Subject: [PATCH] =?UTF-8?q?fix:=EC=88=98=EB=8F=99=EC=9E=85=EB=A0=A5=20?= =?UTF-8?q?=EC=B9=B4=EB=93=9C=EA=B1=B0=EB=9E=98=20=EA=B8=88=EC=95=A1=20?= =?UTF-8?q?=EA=B3=84=EC=82=B0=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 수동입력시 approval_amount가 공급가액(supply)인데 effectiveSupplyAmount = amount - tax로 이중 차감되던 문제 수정 Co-Authored-By: Claude Opus 4.5 --- app/Http/Controllers/Barobill/EcardController.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/Barobill/EcardController.php b/app/Http/Controllers/Barobill/EcardController.php index a9c8be58..34408ac5 100644 --- a/app/Http/Controllers/Barobill/EcardController.php +++ b/app/Http/Controllers/Barobill/EcardController.php @@ -1457,13 +1457,15 @@ private function convertManualToLogs($manualTransactions): array } foreach ($manualTransactions as $t) { - $amount = (float) $t->approval_amount; + // 수동입력: approval_amount = 공급가액, tax = 부가세 + $supplyAmount = (float) $t->approval_amount; $tax = (float) $t->tax; + $totalApproval = $supplyAmount + $tax; // 합계금액 = 공급가액 + 부가세 $isApproval = $t->approval_type !== '2'; $useDt = $t->use_dt; if ($isApproval) { - $totalAmount += $amount; + $totalAmount += $totalApproval; $approvalCount++; } else { $cancelCount++; @@ -1478,7 +1480,7 @@ private function convertManualToLogs($manualTransactions): array } $deductionType = $t->deduction_type ?? 'non_deductible'; - $absAmount = abs($amount); + $absAmount = abs($totalApproval); if ($deductionType === 'deductible') { $deductibleAmount += $absAmount; $deductibleCount++; @@ -1500,8 +1502,8 @@ private function convertManualToLogs($manualTransactions): array 'approvalNum' => $t->approval_num ?? '', 'approvalType' => $isApproval ? '1' : '2', 'approvalTypeName' => $isApproval ? '승인' : '취소', - 'approvalAmount' => $amount, - 'approvalAmountFormatted' => number_format($amount), + 'approvalAmount' => $totalApproval, + 'approvalAmountFormatted' => number_format($totalApproval), 'tax' => $tax, 'taxFormatted' => number_format($tax), 'serviceCharge' => 0, @@ -1524,7 +1526,7 @@ private function convertManualToLogs($manualTransactions): array 'isSaved' => true, 'modifiedSupplyAmount' => null, 'modifiedTax' => null, - 'effectiveSupplyAmount' => $amount - $tax, + 'effectiveSupplyAmount' => $supplyAmount, 'effectiveTax' => $tax, 'isAmountModified' => false, 'isManual' => true,