Added isPaid() method to PersonTarget model.
This commit is contained in:
+10
-1
@@ -9,7 +9,7 @@ class PersonTarget extends Model
|
||||
{
|
||||
|
||||
/**************************************************************************
|
||||
* PAYMENT STATES *
|
||||
* COLLECTIONS FILTERED BY PAYMENT STATES *
|
||||
**************************************************************************/
|
||||
|
||||
/*
|
||||
@@ -203,4 +203,13 @@ class PersonTarget extends Model
|
||||
public function difference() {
|
||||
return $this->signedAmount() - $this->actualsSum();
|
||||
}
|
||||
|
||||
/*
|
||||
* Return true, if the target is paid and therefore closed.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function isPaid() {
|
||||
return $this->difference() == 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user