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))
def test_001(self): tl = ts.TransactionLine('70.00.024', 1, 30) self.assertEqual(tl.value_delta, 30)
def test_012(self): tl = ts.TransactionLine('70.00.024', 2, 20) self.assertEqual(tl.is_apotelesma, True)
def test_011(self): tl = ts.TransactionLine('54.00.024', 2, 20) self.assertEqual(tl.is_apotelesma, False)
def test_009(self): tl = ts.TransactionLine('54.00.024', 2, 20) self.assertEqual(tl.account_type, "LINE-FPA")
def test_008(self): tl = ts.TransactionLine('64.00.024', 1, -20) self.assertEqual(tl.account_type, "LINE-EKSODA")
def test_007(self): with self.assertRaises(Exception): ts.TransactionLine('64.00.024', 3, -20)
def test_006(self): tl = ts.TransactionLine('64.00.024', 2, -20) self.assertEqual(tl.line_type, 'normal')
def test_004(self): tl = ts.TransactionLine('70.00.024', 1, 20) self.assertEqual(tl.line_type, 'credit')
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)
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)