mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 13:44:06 -08:00
fixes the order expiring assets are listed in notifications
This commit is contained in:
parent
78d5c37267
commit
309229619b
|
@ -694,7 +694,7 @@ class Asset extends Depreciable
|
||||||
public static function getExpiringWarrantee($days = 30)
|
public static function getExpiringWarrantee($days = 30)
|
||||||
{
|
{
|
||||||
$days = (is_null($days)) ? 30 : $days;
|
$days = (is_null($days)) ? 30 : $days;
|
||||||
|
|
||||||
return self::where('archived', '=', '0')
|
return self::where('archived', '=', '0')
|
||||||
->whereNotNull('warranty_months')
|
->whereNotNull('warranty_months')
|
||||||
->whereNotNull('purchase_date')
|
->whereNotNull('purchase_date')
|
||||||
|
@ -702,7 +702,7 @@ class Asset extends Depreciable
|
||||||
->whereRaw(\DB::raw('DATE_ADD(`purchase_date`,INTERVAL `warranty_months` MONTH) <= DATE(NOW() + INTERVAL '
|
->whereRaw(\DB::raw('DATE_ADD(`purchase_date`,INTERVAL `warranty_months` MONTH) <= DATE(NOW() + INTERVAL '
|
||||||
. $days
|
. $days
|
||||||
. ' DAY) AND DATE_ADD(`purchase_date`, INTERVAL `warranty_months` MONTH) > NOW()'))
|
. ' DAY) AND DATE_ADD(`purchase_date`, INTERVAL `warranty_months` MONTH) > NOW()'))
|
||||||
->orderBy('purchase_date', 'ASC')
|
->orderByRaw(\DB::raw('DATE_ADD(`purchase_date`,INTERVAL `warranty_months` MONTH)'))
|
||||||
->get();
|
->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue