[FIX] point_of_sale: details of sales report: include discount when computing taxes

Also, fixed a typo in the report's view.
This commit is contained in:
Simon Lejeune 2014-11-03 12:24:09 +01:00
parent 78f3b94601
commit 8138db8e0f
2 changed files with 2 additions and 2 deletions

View File

@ -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']

View File

@ -79,7 +79,7 @@
<tr t-if="gettaxamount(data['form'])"><td colspan="2"><strong>Taxes</strong></td></tr>
<tr t-foreach="gettaxamount(data['form'])" t-as="tax">
<td><span t-esc="tax['name']"/></td>
<td class="text_right">
<td class="text-right">
<strong t-esc="formatLang(tax['amount'], currency_obj = res_company.currency_id)"/>
</td>
</tr>