added amount due to email templates

This commit is contained in:
Denis Duliçi
2021-01-22 14:24:53 +03:00
parent ab0553bfb4
commit dbab1d93c3
5 changed files with 26 additions and 5 deletions

View File

@ -298,6 +298,18 @@ class Document extends Model
return round($paid, $precision);
}
/**
* Get the not paid amount.
*
* @return string
*/
public function getAmountDueAttribute()
{
$precision = config('money.' . $this->currency_code . '.precision');
return round($this->amount - $this->paid, $precision);
}
/**
* Get the status label.
*