Merge remote-tracking branch 'origin/develop'

This commit is contained in:
snipe 2024-06-19 11:13:47 +01:00
commit 66ed26fbf9
2 changed files with 10 additions and 2 deletions

View file

@ -102,7 +102,7 @@ class AssetImporter extends ItemImporter
$this->item['expected_checkin'] = trim($this->findCsvMatch($row, 'expected_checkin')); $this->item['expected_checkin'] = trim($this->findCsvMatch($row, 'expected_checkin'));
$this->item['last_audit_date'] = trim($this->findCsvMatch($row, 'last_audit_date')); $this->item['last_audit_date'] = trim($this->findCsvMatch($row, 'last_audit_date'));
$this->item['next_audit_date'] = trim($this->findCsvMatch($row, 'next_audit_date')); $this->item['next_audit_date'] = trim($this->findCsvMatch($row, 'next_audit_date'));
$this->item['asset_eol_date'] = trim($this->findCsvMatch($row, 'next_audit_date')); $this->item['asset_eol_date'] = trim($this->findCsvMatch($row, 'asset_eol_date'));
$this->item['asset_tag'] = $asset_tag; $this->item['asset_tag'] = $asset_tag;
// We need to save the user if it exists so that we can checkout to user later. // We need to save the user if it exists so that we can checkout to user later.

View file

@ -106,7 +106,7 @@ class Asset extends Depreciable
'last_checkout' => 'nullable|date_format:Y-m-d H:i:s', 'last_checkout' => 'nullable|date_format:Y-m-d H:i:s',
'last_checkin' => 'nullable|date_format:Y-m-d H:i:s', 'last_checkin' => 'nullable|date_format:Y-m-d H:i:s',
'expected_checkin' => 'nullable|date', 'expected_checkin' => 'nullable|date',
'last_audit_date' => 'nullable|date_format:Y-m-d H:i:s', 'last_audit_date' => 'nullable',
// 'next_audit_date' => 'nullable|date|after:last_audit_date', // 'next_audit_date' => 'nullable|date|after:last_audit_date',
'next_audit_date' => 'nullable|date', 'next_audit_date' => 'nullable|date',
'location_id' => 'nullable|exists:locations,id', 'location_id' => 'nullable|exists:locations,id',
@ -990,6 +990,14 @@ class Asset extends Depreciable
); );
} }
protected function lastAuditDate(): Attribute
{
return Attribute::make(
get: fn ($value) => $value ? Carbon::parse($value)->format('Y-m-d H:i:s') : null,
set: fn ($value) => $value ? Carbon::parse($value)->format('Y-m-d H:i:s') : null,
);
}
protected function lastCheckout(): Attribute protected function lastCheckout(): Attribute
{ {
return Attribute::make( return Attribute::make(