fix:수동입력 카드거래 금액 계산 버그 수정
수동입력시 approval_amount가 공급가액(supply)인데 effectiveSupplyAmount = amount - tax로 이중 차감되던 문제 수정 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user