clean up
This commit is contained in:
parent
ffaacc04ef
commit
baa7e7d561
1 changed files with 2 additions and 2 deletions
|
@ -67,7 +67,7 @@ class Depreciable extends SnipeModel
|
||||||
* @return float|int
|
* @return float|int
|
||||||
*/
|
*/
|
||||||
public function getLinearDepreciatedValue() // TODO - for testing it might be nice to have an optional $relative_to param here, defaulted to 'now'
|
public function getLinearDepreciatedValue() // TODO - for testing it might be nice to have an optional $relative_to param here, defaulted to 'now'
|
||||||
{ ;
|
{
|
||||||
if (($this->get_depreciation()) && ($this->purchase_date)) {
|
if (($this->get_depreciation()) && ($this->purchase_date)) {
|
||||||
$months_passed = ($this->purchase_date->diff(now())->m)+($this->purchase_date->diff(now())->y*12);
|
$months_passed = ($this->purchase_date->diff(now())->m)+($this->purchase_date->diff(now())->y*12);
|
||||||
} else {
|
} else {
|
||||||
|
@ -76,7 +76,7 @@ class Depreciable extends SnipeModel
|
||||||
|
|
||||||
if ($months_passed >= $this->get_depreciation()->months){
|
if ($months_passed >= $this->get_depreciation()->months){
|
||||||
//if there is a floor use it
|
//if there is a floor use it
|
||||||
if(!$this->get_depreciation()->depreciation_min == null) {
|
if((!$this->get_depreciation()->depreciation_min) === null) {
|
||||||
|
|
||||||
$current_value = $this->calculateDepreciation();
|
$current_value = $this->calculateDepreciation();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue