Beispiel #1
0
def invoice():
    inv = Invoice(**INVOICE)
    for line in LINES:
        inv.lines.append(InvoiceLine(**line))
    for discount in DISCOUNTS:
        inv.discounts.append(DiscountLine(**discount))
    return inv
Beispiel #2
0
 def test_total(self):
     i = InvoiceLine(cost=1.25, quantity=1.25, tva=1960)
     self.assertEqual(i.total_ht(), 1.5625)
     self.assertEqual(i.total(), 1.86875)
Beispiel #3
0
 def test_gen_cancelinvoice_line(self):
     line = InvoiceLine(**LINE)
     cline = line.gen_cancelinvoice_line()
     for i in ("rowIndex", "description", "tva", "quantity", "unity"):
         self.assertEqual(getattr(cline, i), getattr(line, i))
     self.assertEqual(cline.cost, -1 * line.cost)
Beispiel #4
0
 def test_duplicate_line(self):
     line = InvoiceLine(**LINE)
     dline = line.duplicate()
     for i in ("rowIndex", "cost", "tva", "description", "quantity", "unity"):
         self.assertEqual(getattr(dline, i), getattr(line, i))
Beispiel #5
0
def invoice():
    inv = Invoice(**INVOICE)
    inv.lines = [InvoiceLine(**LINE)]
    for i in PAYMENTS:
        inv.payments.append(Payment(**i))
    return inv
Beispiel #6
0
 def test_total(self):
     i = InvoiceLine(cost=1.25, quantity=1.25, tva=1960)
     self.assertEqual(i.total_ht(), 1.5625)
     self.assertEqual(i.total(), 1.86875)
Beispiel #7
0
 def test_gen_cancelinvoice_line(self):
     line = InvoiceLine(**LINE)
     cline = line.gen_cancelinvoice_line()
     for i in ('rowIndex', "description", 'tva', "quantity", "unity"):
         self.assertEqual(getattr(cline, i), getattr(line, i))
     self.assertEqual(cline.cost, -1 * line.cost)
Beispiel #8
0
 def test_duplicate_line(self):
     line = InvoiceLine(**LINE)
     dline = line.duplicate()
     for i in ('rowIndex', 'cost', 'tva', "description", "quantity",
               "unity"):
         self.assertEqual(getattr(dline, i), getattr(line, i))