Fix sign of the amount to pay on line
issue2746 review464003
This commit is contained in:
1 parent
26ad2fba55
commit
b35134fb9a
2 files changed
+9
-2
No files matched your search
+3
-1
@@ -262,7 +262,9 @@ class Statement(Workflow, ModelSQL, ModelView):
|
||||
else:
|
||||
res['lines']['update'].append({
|
||||
'id': line['id'],
|
||||
'amount': amount_to_pay,
|
||||
'amount': (amount_to_pay
|
||||
if line['amount'] >= 0
|
||||
else -amount_to_pay),
|
||||
})
|
||||
res['lines'].setdefault('add', [])
|
||||
vals = line.copy()
|
||||
|
||||
@@ -265,11 +265,16 @@ Paid 50 to supplier::
|
||||
>>> statement_line = StatementLine()
|
||||
>>> statement.lines.append(statement_line)
|
||||
>>> statement_line.date = today
|
||||
>>> statement_line.amount = Decimal('-50')
|
||||
>>> statement_line.amount = Decimal('-60')
|
||||
>>> statement_line.party = supplier
|
||||
>>> statement_line.account == payable
|
||||
True
|
||||
>>> statement_line.invoice = supplier_invoice
|
||||
>>> statement_line.amount == Decimal('-50')
|
||||
True
|
||||
>>> statement_line = statement.lines.pop()
|
||||
>>> statement_line.amount == Decimal('-10')
|
||||
True
|
||||
|
||||
>>> statement.save()
|
||||
|
||||
|
||||
Reference in new issue
Block a user