diff --git a/app/Models/StockLog.php b/app/Models/StockLog.php index cf38307..f2c88fe 100644 --- a/app/Models/StockLog.php +++ b/app/Models/StockLog.php @@ -26,4 +26,14 @@ class StockLog extends Model { return $this->belongsTo(Product::class); } + + public function getChangeTypeLabelAttribute(): string + { + return $this->change_type === 'in' ? '입고' : '출고'; + } + + public function getSignedAmountAttribute(): int + { + return $this->change_type === 'in' ? (int) $this->change_amount : -(int) $this->change_amount; + } } diff --git a/resources/views/product/list.blade.php b/resources/views/product/list.blade.php index 4e9ab21..1a133aa 100644 --- a/resources/views/product/list.blade.php +++ b/resources/views/product/list.blade.php @@ -51,7 +51,7 @@