|
@@ -55,6 +55,13 @@ class Invoice(models.Model):
|
|
|
return total.quantize(Decimal('0.01'))
|
|
|
amount_paid.short_description = 'Montant payé'
|
|
|
|
|
|
+ def amount_remaining_to_pay(self):
|
|
|
+ """
|
|
|
+ Calcul le montant restant à payer
|
|
|
+ """
|
|
|
+ return self.amount() - self.amount_paid()
|
|
|
+ amount_remaining_to_pay.short_description = 'Reste à payer'
|
|
|
+
|
|
|
def has_owner(self, uid):
|
|
|
"Check if passed uid (ex gmajax) is owner of the invoice"
|
|
|
return (self.member and self.member.ldap_cn and
|