mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
purchase_date
This commit is contained in:
parent
ccf3fe40ec
commit
53d4fd1d0b
|
@ -124,8 +124,8 @@ 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…
Reference in a new issue