From 8138db8e0f829acb8e65954ad510bdd270cf2c35 Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Mon, 3 Nov 2014 12:24:09 +0100 Subject: [PATCH] [FIX] point_of_sale: details of sales report: include discount when computing taxes Also, fixed a typo in the report's view. --- addons/point_of_sale/report/pos_details.py | 2 +- addons/point_of_sale/views/report_detailsofsales.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/report/pos_details.py b/addons/point_of_sale/report/pos_details.py index 1c1f46ac0b7..1d407461921 100644 --- a/addons/point_of_sale/report/pos_details.py +++ b/addons/point_of_sale/report/pos_details.py @@ -160,7 +160,7 @@ class pos_details(report_sxw.rml_parse): pos_ids = pos_order_obj.search(self.cr, self.uid, [('date_order','>=',form['date_start'] + ' 00:00:00'),('date_order','<=',form['date_end'] + ' 23:59:59'),('state','in',['paid','invoiced','done']),('user_id','in',user_ids)]) for order in pos_order_obj.browse(self.cr, self.uid, pos_ids): for line in order.lines: - line_taxes = account_tax_obj.compute_all(self.cr, self.uid, line.product_id.taxes_id, line.price_unit, line.qty, product=line.product_id, partner=line.order_id.partner_id or False) + line_taxes = account_tax_obj.compute_all(self.cr, self.uid, line.product_id.taxes_id, line.price_unit * (1-(line.discount or 0.0)/100.0), line.qty, product=line.product_id, partner=line.order_id.partner_id or False) for tax in line_taxes['taxes']: taxes.setdefault(tax['id'], {'name': tax['name'], 'amount':0.0}) taxes[tax['id']]['amount'] += tax['amount'] diff --git a/addons/point_of_sale/views/report_detailsofsales.xml b/addons/point_of_sale/views/report_detailsofsales.xml index 5f9fa48752d..648d40969f9 100644 --- a/addons/point_of_sale/views/report_detailsofsales.xml +++ b/addons/point_of_sale/views/report_detailsofsales.xml @@ -79,7 +79,7 @@ Taxes - +