purchase_date
This commit is contained in:
parent
ccf3fe40ec
commit
53d4fd1d0b
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue