Beispiel #1
0
 def test_get_tvas(self):
     task = TaskCompute()
     task.lines = [DummyLine(cost=35000, quantity=1, tva=1960),
                   DummyLine(cost=40000, quantity=1, tva=550)]
     task.discounts = [DummyLine(amount=1200, tva=550),
                       DummyLine(amount=15000, tva=1960)]
     tvas = task.get_tvas()
     assert tvas.keys() == [1960, 550]
     assert tvas[1960] == 3920
     assert tvas[550] == 2134
Beispiel #2
0
 def test_get_tvas(self):
     task = TaskCompute()
     task.lines = [DummyLine(cost=35000, quantity=1, tva=1960),
                   DummyLine(cost=40000, quantity=1, tva=550)]
     task.discounts = [DummyLine(amount=1200, tva=550),
                       DummyLine(amount=15000, tva=1960)]
     tvas = task.get_tvas()
     self.assertEqual(tvas.keys(), [1960, 550])
     self.assertEqual(tvas[1960], 3920)
     self.assertEqual(tvas[550], 2134)
 def test_get_tvas_multiple_rounding(self):
     task = TaskCompute()
     task.line_groups = [
         DummyGroup(
             lines=[DummyLine(cost=10004000, quantity=1, tva=1000), DummyLine(cost=5002000, quantity=1, tva=2000)]
         )
     ]
     # Ref https://github.com/CroissanceCommune/autonomie/issues/305
     tvas = task.get_tvas()
     assert tvas[1000] == 1000000
     assert task.tva_amount() == 2000000
Beispiel #4
0
 def test_get_tvas_multiple_rounding(self):
     task = TaskCompute()
     task.line_groups = [
         DummyGroup(lines=[
             DummyLine(cost=10004000, quantity=1, tva=1000),
             DummyLine(cost=5002000, quantity=1, tva=2000),
         ])
     ]
     # Ref https://github.com/CroissanceCommune/autonomie/issues/305
     tvas = task.get_tvas()
     assert tvas[1000] == 1000000
     assert task.tva_amount() == 2000000
Beispiel #5
0
 def test_get_tvas_multiple(self):
     task = TaskCompute()
     task.line_groups = [
         DummyGroup(lines=[
             DummyLine(cost=35000000, quantity=1, tva=1960),
             DummyLine(cost=40000000, quantity=1, tva=550)
         ])
     ]
     task.discounts = [
         DummyDiscountLine(amount=1200000, tva=550),
         DummyDiscountLine(amount=15000000, tva=1960)
     ]
     tvas = task.get_tvas()
     assert tvas.keys() == [1960, 550]
     assert tvas[1960] == 3920000
     assert tvas[550] == 2134000