feat:카드 사용내역 공급가액/부가세 수정 및 이력 추적 기능
- CardTransaction 모델에 modified_supply_amount, modified_tax 추가 - CardTransactionAmountLog 모델 신규 생성 (수정 이력) - parseTransactionLogs: effectiveSupplyAmount, effectiveTax, isAmountModified 응답 추가 - save: 금액 변경 감지 시 amount_logs 이력 자동 기록 - 프론트엔드: 공급가액/부가세 input 수정 가능, 합계금액 자동계산 - 수정 시 주황색 배경 + 원본값 취소선 표시 - 분개된 거래는 금액 수정 비활성화 (읽기전용) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
44
app/Models/Barobill/CardTransactionAmountLog.php
Normal file
44
app/Models/Barobill/CardTransactionAmountLog.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Barobill;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* 카드 거래 금액 수정 이력 모델
|
||||
*/
|
||||
class CardTransactionAmountLog extends Model
|
||||
{
|
||||
protected $table = 'barobill_card_transaction_amount_logs';
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'card_transaction_id',
|
||||
'original_unique_key',
|
||||
'before_supply_amount',
|
||||
'before_tax',
|
||||
'after_supply_amount',
|
||||
'after_tax',
|
||||
'modified_by',
|
||||
'modified_by_name',
|
||||
'ip_address',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'before_supply_amount' => 'decimal:2',
|
||||
'before_tax' => 'decimal:2',
|
||||
'after_supply_amount' => 'decimal:2',
|
||||
'after_tax' => 'decimal:2',
|
||||
'created_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
* 카드 거래 관계
|
||||
*/
|
||||
public function cardTransaction(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(CardTransaction::class, 'card_transaction_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user