示例#1
0
 def add_line_final(self, account, comment=''):
     """Insert final TransactionLine"""
     diff = self.total_delta
     if diff < 0:
         self.lines.append(
             trl.TransactionLine(account, cfg.DEBIT, -diff, comment))
     elif diff > 0:
         self.lines.append(
             trl.TransactionLine(account, cfg.CREDIT, diff, comment))
示例#2
0
 def test_001(self):
     tl = ts.TransactionLine('70.00.024', 1, 30)
     self.assertEqual(tl.value_delta, 30)
示例#3
0
 def test_012(self):
     tl = ts.TransactionLine('70.00.024', 2, 20)
     self.assertEqual(tl.is_apotelesma, True)
示例#4
0
 def test_011(self):
     tl = ts.TransactionLine('54.00.024', 2, 20)
     self.assertEqual(tl.is_apotelesma, False)
示例#5
0
 def test_009(self):
     tl = ts.TransactionLine('54.00.024', 2, 20)
     self.assertEqual(tl.account_type, "LINE-FPA")
示例#6
0
 def test_008(self):
     tl = ts.TransactionLine('64.00.024', 1, -20)
     self.assertEqual(tl.account_type, "LINE-EKSODA")
示例#7
0
 def test_007(self):
     with self.assertRaises(Exception):
         ts.TransactionLine('64.00.024', 3, -20)
示例#8
0
 def test_006(self):
     tl = ts.TransactionLine('64.00.024', 2, -20)
     self.assertEqual(tl.line_type, 'normal')
示例#9
0
 def test_004(self):
     tl = ts.TransactionLine('70.00.024', 1, 20)
     self.assertEqual(tl.line_type, 'credit')
示例#10
0
 def add_line_dc(self, account, debit, credit, comnt='', acc_name=''):
     """Insert a new transaction line from debit credit values"""
     delta = debit - credit
     nli = trl.TransactionLine(account, Decr.DEBIT.value, delta, comnt,
                               acc_name)
     self.lines.append(nli)
示例#11
0
 def add_line(self, account, ttype, value, comment='', accname=''):
     """Insert a new transactionLine"""
     new_line = trl.TransactionLine(account, ttype, value, comment, accname)
     self.lines.append(new_line)