feat(accounting): 優化會計報表與公共事業費 UI,並統一全域日期處理格式
This commit is contained in:
@@ -30,8 +30,8 @@ class PurchaseOrder extends Model
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'expected_delivery_date' => 'date',
|
||||
'invoice_date' => 'date',
|
||||
'expected_delivery_date' => 'date:Y-m-d',
|
||||
'invoice_date' => 'date:Y-m-d',
|
||||
'total_amount' => 'decimal:2',
|
||||
'tax_amount' => 'decimal:2',
|
||||
'grand_total' => 'decimal:2',
|
||||
@@ -76,7 +76,7 @@ class PurchaseOrder extends Model
|
||||
|
||||
public function getExpectedDateAttribute(): ?string
|
||||
{
|
||||
return $this->expected_delivery_date ? $this->expected_delivery_date->format('Y-m-d') : null;
|
||||
return $this->attributes['expected_delivery_date'] ?? null;
|
||||
}
|
||||
|
||||
public function getTotalAmountAttribute(): float
|
||||
@@ -111,8 +111,7 @@ class PurchaseOrder extends Model
|
||||
|
||||
public function getInvoiceDateAttribute(): ?string
|
||||
{
|
||||
$date = $this->attributes['invoice_date'] ?? null;
|
||||
return $date ? \Illuminate\Support\Carbon::parse($date)->format('Y-m-d') : null;
|
||||
return $this->attributes['invoice_date'] ?? null;
|
||||
}
|
||||
|
||||
public function getInvoiceAmountAttribute(): ?float
|
||||
|
||||
Reference in New Issue
Block a user