Added isPaid() method to PersonTarget model.

This commit is contained in:
Lukas Halbritter
2018-09-20 16:48:16 +02:00
parent c8fcb4c959
commit c9bc400308
+10 -1
View File
@@ -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() { public function difference() {
return $this->signedAmount() - $this->actualsSum(); return $this->signedAmount() - $this->actualsSum();
} }
/*
* Return true, if the target is paid and therefore closed.
*
* @return boolean
*/
public function isPaid() {
return $this->difference() == 0;
}
} }