diff --git a/addons/point_of_sale/report/pos_lines.py b/addons/point_of_sale/report/pos_lines.py index c7f59b30f5a..1abec66dc80 100644 --- a/addons/point_of_sale/report/pos_lines.py +++ b/addons/point_of_sale/report/pos_lines.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution +# OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved # $Id$ # @@ -32,6 +32,8 @@ class pos_lines(report_sxw.rml_parse): self.localcontext.update({ 'time': time, 'total_quantity': self.__total_quantity__, + 'taxes':self.__taxes__, + }) def __total_quantity__(self, obj): @@ -41,6 +43,16 @@ class pos_lines(report_sxw.rml_parse): self.total = tot return self.total + def __taxes__(self,obj): + self.cr.execute ( " Select acct.name from pos_order as po " \ + " LEFT JOIN pos_order_line as pol ON po.id = pol.order_id " \ + " LEFT JOIN product_taxes_rel as ptr ON pol.product_id = ptr.prod_id " \ + " LEFT JOIN account_tax as acct ON acct.id = ptr.tax_id " \ + " WHERE pol.id = %d" %(obj.id)) + res=self.cr.fetchone()[0] + return res + + report_sxw.report_sxw('report.pos.lines', 'pos.order', 'addons/point_of_sale/report/pos_lines.rml', parser=pos_lines) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/point_of_sale/report/pos_lines.rml b/addons/point_of_sale/report/pos_lines.rml index 42ad6597655..440e593a2f2 100644 --- a/addons/point_of_sale/report/pos_lines.rml +++ b/addons/point_of_sale/report/pos_lines.rml @@ -2,7 +2,7 @@ @@ -10,41 +10,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - @@ -53,202 +81,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + - [[ repeatIn(objects,'o') ]] - + [[ repeatIn(objects,'o') ]] + - - Company: [[ company.name ]] - - - Print Date: [[time.strftime('%d/%m/%Y')]] - - - - - - Journal: - - + - Date + Company - Name + Print Date - Product Name + No. Of Articles + + + + + + + [[ company.name ]] - Unit Price + [[ formatLang(time.strftime('%Y-%m-%d'),date = True) ]] - Disc. (%) + [[formatLang(total_quantity(o))]] + + + + + + + + + + + + + Description - Taxes + VAT + + + Quantity + + + Unit Price + + + Disc. (%) + + + Price
- - [[ repeatIn(o.lines, 'l') ]] - - + [[ repeatIn(o.lines, 'l') ]] + - [[l.create_date]] + [[l.product_id.code]] [[l.product_id.name]] - [[l.name]] + [[taxes(l)]] - [[l.product_id.name]] + [[ formatLang(l.qty) ]] - [[l.price_unit]] + [[ formatLang(l.price_unit) ]] - [[l.discount]] + [[ formatLang(l.discount) ]] - - - + [[ formatLang(l.price_subtotal) ]]
- - - - + - + - + - + - + - Total No. of Articles + Net Total - - [[total_quantity(o)]] - + [[ formatLang(o.amount_total) ]] [[o.pricelist_id.currency_id.code ]] - + - + - + - + - - Total Sold - + Taxes - - - + [[ formatLang(o.amount_tax) ]] [[o.pricelist_id.currency_id.code ]] - + - + - + - + - Total Taxes + Total - [[ '%.2f' % o.amount_tax ]] [[o.pricelist_id.currency_id.code ]] - - - - - - - - - - - - - - - - - - - - - - - - - Total Paid - - - [[ '%.2f' % o.amount_total ]] [[o.pricelist_id.currency_id.code ]] - + [[ formatLang(o.amount_total + o.amount_tax) ]] [[o.pricelist_id.currency_id.code ]] - +
-