|
@@ -135,6 +135,22 @@ class BillingInvoiceCreationTests(TestCase):
|
|
|
|
|
|
self.assertEqual(invoice.amount(), 111)
|
|
|
|
|
|
+ def test_invoice_partial_payment(self):
|
|
|
+ invoice = Invoice(member=self.member)
|
|
|
+ invoice.save()
|
|
|
+
|
|
|
+ invoice.details.create(label=self.offer.name,
|
|
|
+ amount=100,
|
|
|
+ offersubscription=self.subscription,
|
|
|
+ period_from=datetime.date(2014, 1, 1),
|
|
|
+ period_to=datetime.date(2014, 3, 31),
|
|
|
+ tax=0)
|
|
|
+ self.assertEqual(invoice.status, 'open')
|
|
|
+ invoice.payments.create(payment_mean='cash', amount=10)
|
|
|
+ self.assertEqual(invoice.status, 'open')
|
|
|
+ invoice.payments.create(payment_mean='cash', amount=90)
|
|
|
+ self.assertEqual(invoice.status, 'closed')
|
|
|
+
|
|
|
def test_invoice_amount_before_tax(self):
|
|
|
invoice = Invoice(member=self.member)
|
|
|
invoice.save()
|