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:
parent
aa7ebcee3e
commit
edfec84074
@ -496,4 +496,14 @@ class Invoice extends BaseModel
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
public function getBalanceDueAttribute()
|
||||
{
|
||||
return $this->balance;
|
||||
}
|
||||
|
||||
public function getTotalAttribute()
|
||||
{
|
||||
return $this->calc()->getTotal();
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user