style: Pint 포맷팅 적용
This commit is contained in:
@@ -3,11 +3,11 @@
|
||||
namespace App\Http\Controllers\Finance;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Finance\VatRecord;
|
||||
use App\Models\Barobill\CardTransaction as BarobillCardTransaction;
|
||||
use App\Models\Barobill\CardTransactionSplit;
|
||||
use App\Models\Barobill\CardTransactionHide;
|
||||
use App\Models\Barobill\CardTransactionSplit;
|
||||
use App\Models\Barobill\HometaxInvoice;
|
||||
use App\Models\Finance\VatRecord;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -43,7 +43,7 @@ public function index(Request $request): JsonResponse
|
||||
|
||||
$hometaxSalesRecords = $hometaxSales->map(function ($inv) use ($period, $taxTypeMap) {
|
||||
return [
|
||||
'id' => 'hometax_' . $inv->id,
|
||||
'id' => 'hometax_'.$inv->id,
|
||||
'period' => $period,
|
||||
'type' => 'sales',
|
||||
'taxType' => $taxTypeMap[$inv->tax_type] ?? 'taxable',
|
||||
@@ -69,7 +69,7 @@ public function index(Request $request): JsonResponse
|
||||
|
||||
$hometaxPurchaseRecords = $hometaxPurchases->map(function ($inv) use ($period, $taxTypeMap) {
|
||||
return [
|
||||
'id' => 'hometax_' . $inv->id,
|
||||
'id' => 'hometax_'.$inv->id,
|
||||
'period' => $period,
|
||||
'type' => 'purchase',
|
||||
'taxType' => $taxTypeMap[$inv->tax_type] ?? 'taxable',
|
||||
@@ -104,7 +104,7 @@ public function index(Request $request): JsonResponse
|
||||
foreach ($splitsByKey as $fullKey => $splits) {
|
||||
$parts = explode('|', $fullKey);
|
||||
if (count($parts) >= 3) {
|
||||
$partialKey = $parts[0] . '|' . $parts[1] . '|' . $parts[2];
|
||||
$partialKey = $parts[0].'|'.$parts[1].'|'.$parts[2];
|
||||
$splitsByPartialKey[$partialKey] = $splits;
|
||||
}
|
||||
}
|
||||
@@ -117,8 +117,8 @@ public function index(Request $request): JsonResponse
|
||||
|
||||
// 분개 매칭: 정확한 키 → 부분키(금액 제외) 순으로 시도
|
||||
$splits = $splitsByKey[$card->unique_key] ?? null;
|
||||
if (!$splits) {
|
||||
$cardPartialKey = $card->card_num . '|' . $card->use_dt . '|' . $card->approval_num;
|
||||
if (! $splits) {
|
||||
$cardPartialKey = $card->card_num.'|'.$card->use_dt.'|'.$card->approval_num;
|
||||
$splits = $splitsByPartialKey[$cardPartialKey] ?? null;
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ public function index(Request $request): JsonResponse
|
||||
foreach ($splits as $split) {
|
||||
if ($split->deduction_type === 'deductible') {
|
||||
$cardRecords->push([
|
||||
'id' => 'card_split_' . $split->id,
|
||||
'id' => 'card_split_'.$split->id,
|
||||
'period' => $period,
|
||||
'type' => 'purchase',
|
||||
'taxType' => 'taxable',
|
||||
@@ -153,7 +153,7 @@ public function index(Request $request): JsonResponse
|
||||
$effectiveTax = $card->modified_tax ?? $card->tax;
|
||||
|
||||
$cardRecords->push([
|
||||
'id' => 'card_' . $card->id,
|
||||
'id' => 'card_'.$card->id,
|
||||
'period' => $period,
|
||||
'type' => 'purchase',
|
||||
'taxType' => 'taxable',
|
||||
@@ -269,13 +269,13 @@ public function index(Request $request): JsonResponse
|
||||
// 확정(C) 기간이면 대응하는 예정(P)의 netVat를 계산
|
||||
if ($period && str_ends_with($period, 'C')) {
|
||||
try {
|
||||
$prelimPeriod = substr($period, 0, -1) . 'P';
|
||||
$prelimPeriod = substr($period, 0, -1).'P';
|
||||
$stats['preliminaryVat'] = $this->calculatePeriodNetVat($tenantId, $prelimPeriod);
|
||||
} catch (\Throwable $e) {
|
||||
\Log::error('예정 세액 계산 실패', [
|
||||
'message' => $e->getMessage(),
|
||||
'file' => $e->getFile() . ':' . $e->getLine(),
|
||||
'trace' => array_slice(array_map(fn($t) => ($t['file'] ?? '') . ':' . ($t['line'] ?? '') . ' ' . ($t['function'] ?? ''), $e->getTrace()), 0, 5),
|
||||
'file' => $e->getFile().':'.$e->getLine(),
|
||||
'trace' => array_slice(array_map(fn ($t) => ($t['file'] ?? '').':'.($t['line'] ?? '').' '.($t['function'] ?? ''), $e->getTrace()), 0, 5),
|
||||
'tenant_id' => $tenantId,
|
||||
'period' => $prelimPeriod ?? null,
|
||||
]);
|
||||
@@ -385,7 +385,7 @@ public function destroy(int $id): JsonResponse
|
||||
private function calculatePeriodNetVat(int $tenantId, string $period): int
|
||||
{
|
||||
[$startDate, $endDate] = $this->periodToDateRange($period);
|
||||
if (!$startDate || !$endDate) {
|
||||
if (! $startDate || ! $endDate) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -422,7 +422,7 @@ private function calculatePeriodNetVat(int $tenantId, string $period): int
|
||||
foreach ($splitsByKey as $fullKey => $splits) {
|
||||
$parts = explode('|', $fullKey);
|
||||
if (count($parts) >= 3) {
|
||||
$partialKey = $parts[0] . '|' . $parts[1] . '|' . $parts[2];
|
||||
$partialKey = $parts[0].'|'.$parts[1].'|'.$parts[2];
|
||||
$splitsByPartialKey[$partialKey] = $splits;
|
||||
}
|
||||
}
|
||||
@@ -433,8 +433,8 @@ private function calculatePeriodNetVat(int $tenantId, string $period): int
|
||||
}
|
||||
|
||||
$splits = $splitsByKey[$card->unique_key] ?? null;
|
||||
if (!$splits) {
|
||||
$cardPartialKey = $card->card_num . '|' . $card->use_dt . '|' . $card->approval_num;
|
||||
if (! $splits) {
|
||||
$cardPartialKey = $card->card_num.'|'.$card->use_dt.'|'.$card->approval_num;
|
||||
$splits = $splitsByPartialKey[$cardPartialKey] ?? null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user