[FIX] account: invoiced amount with down payment
- Create a SO of 1000 - Create a down payment of 300, validate - Create the final invoice In the partner view, a total of 1600 is displayed as invoiced. In the case of a down payment, the corresponding invoice line has an amount with a negative sign. Since the report computes the absolute value before multiplying by the sign, this information is lost. The absolute value is not necessary since `price_subtotal_signed` already includes the correct sign. opw-741159
This commit is contained in:
@@ -114,7 +114,7 @@ class AccountInvoiceReport(models.Model):
|
||||
ai.type, ai.state, pt.categ_id, ai.date_due, ai.account_id, ail.account_id AS account_line_id,
|
||||
ai.partner_bank_id,
|
||||
SUM ((invoice_type.sign * ail.quantity) / (u.factor * u2.factor)) AS product_qty,
|
||||
SUM(invoice_type.sign * ABS(ail.price_subtotal_signed)) AS price_total,
|
||||
SUM(ail.price_subtotal_signed) AS price_total,
|
||||
SUM(ABS(ail.price_subtotal_signed)) / CASE
|
||||
WHEN SUM(ail.quantity / u.factor * u2.factor) <> 0::numeric
|
||||
THEN SUM(ail.quantity / u.factor * u2.factor)
|
||||
|
||||
Reference in New Issue
Block a user