Fix patch issue237 with invoices with zero amount

This commit is contained in:
Sergi Almacellas Abellana 2014-04-03 10:28:11 +02:00
parent 7ee45cc2d7
commit 1537a57357
1 changed files with 2 additions and 2 deletions

View File

@ -11,8 +11,8 @@ Index: invoice.py
- total_currency += line['amount_second_currency']
+ debit_credit = line['debit'] - line['credit']
+ total += debit_credit
+ total_currency += (abs(line['amount_second_currency']) *
+ abs(debit_credit) / debit_credit)
+ total_currency += line['amount_second_currency'].copy_sign(
+ debit_credit)
term_lines = self.payment_term.compute(total, self.company.currency,
self.invoice_date)