FIX
balance is debit - credit whereas on tax return you want to see what vat has to be paid so : VAT on sales (credit) - VAT on purchases (debit).pull/190/head
parent
4563ad2dc5
commit
a6c1489ce6
|
@ -45,7 +45,10 @@ class AccountTax(models.Model):
|
|||
def compute_balance(self, tax_or_base='tax'):
|
||||
self.ensure_one()
|
||||
move_lines = self.get_move_lines_domain(tax_or_base=tax_or_base)
|
||||
total = sum([l.balance for l in move_lines])
|
||||
# balance is debit - credit whereas on tax return you want to see what
|
||||
# vat has to be paid so:
|
||||
# VAT on sales (credit) - VAT on purchases (debit).
|
||||
total = -sum([l.balance for l in move_lines])
|
||||
return total
|
||||
|
||||
def get_balance_domain(self, state_list):
|
||||
|
|
|
@ -46,5 +46,5 @@ class TestAccountTaxBalance(TransactionCase):
|
|||
# change the state of invoice to open by clicking Validate button
|
||||
invoice.signal_workflow('invoice_open')
|
||||
|
||||
self.assertEquals(tax.base_balance, -100)
|
||||
self.assertEquals(tax.balance, -10)
|
||||
self.assertEquals(tax.base_balance, 100)
|
||||
self.assertEquals(tax.balance, 10)
|
||||
|
|
Loading…
Reference in New Issue