diff --git a/app/PersonTarget.php b/app/PersonTarget.php index 940047e..cc0722b 100644 --- a/app/PersonTarget.php +++ b/app/PersonTarget.php @@ -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; + } }