purchase_date

This commit is contained in:
spencerrlongg 2023-09-12 18:01:33 -05:00
parent ccf3fe40ec
commit 53d4fd1d0b

View file

@ -124,7 +124,7 @@ class AssetObserver
public function saving(Asset $asset) public function saving(Asset $asset)
{ {
//determine if calculated eol and then calculate it - this should only happen on a new asset //determine if calculated eol and then calculate it - this should only happen on a new asset
if(is_null($asset->asset_eol_date) && !is_null($asset->asset_purchase_date) && !is_null($asset->model->eol)){ if(is_null($asset->asset_eol_date) && !is_null($asset->purchase_date) && !is_null($asset->model->eol)){
$asset->asset_eol_date = $asset->purchase_date->addMonths($asset->model->eol)->format('Y-m-d'); $asset->asset_eol_date = $asset->purchase_date->addMonths($asset->model->eol)->format('Y-m-d');
$asset->eol_explicit = false; $asset->eol_explicit = false;
} }