feat(accounting): 優化會計報表與公共事業費 UI,並統一全域日期處理格式
All checks were successful
Koori-ERP-Deploy-System / deploy-demo (push) Successful in 1m7s
Koori-ERP-Deploy-System / deploy-production (push) Has been skipped

This commit is contained in:
2026-01-20 17:45:38 +08:00
parent 89183ca124
commit 9a50bbf887
9 changed files with 251 additions and 120 deletions

View File

@@ -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