1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

Add new properties to models for easier fetching:

Invoice:
- balance_due is now alias to balance
- total is now alias to calc()->getTotal()

Quote:
- valid_until is now alias to due_date
- balance_due is now alias to balance
This commit is contained in:
Benjamin Beganović 2020-08-14 14:53:36 +02:00
parent aa7ebcee3e
commit edfec84074
2 changed files with 25 additions and 0 deletions

View File

@ -496,4 +496,14 @@ class Invoice extends BaseModel
// }
// }
// }
public function getBalanceDueAttribute()
{
return $this->balance;
}
public function getTotalAttribute()
{
return $this->calc()->getTotal();
}
}

View File

@ -250,4 +250,19 @@ class Quote extends BaseModel
return false;
}
public function getValidUntilAttribute()
{
return $this->due_date;
}
public function getBalanceDueAttribute()
{
return $this->balance;
}
public function getTotalAttribute()
{
return $this->calc()->getTotal();
}
}