From eaccd57934fafc2d24987226c623bc94519c186f Mon Sep 17 00:00:00 2001 From: saz-OpenERP Date: Sat, 9 Oct 2010 17:16:34 +0530 Subject: [PATCH] [IMP]Improves all reports of point of sale module bzr revid: azaz.201186@gmail.com-20101009114634-4ruovxonxa1bny4d --- .../report/all_closed_cashbox_of_the_day.rml | 30 +-- .../report/pos_details_summary.rml | 189 +++++++++--------- addons/point_of_sale/report/pos_lines.rml | 16 +- .../report/pos_payment_report.py | 12 +- .../report/pos_payment_report.rml | 4 +- .../report/pos_payment_report_date.py | 12 +- .../report/pos_payment_report_date.rml | 16 +- .../report/pos_payment_report_user.py | 6 +- .../report/pos_payment_report_user.rml | 13 +- .../point_of_sale/report/pos_sales_user.rml | 26 +-- .../report/pos_sales_user_today.rml | 26 ++- .../pos_sales_user_today_current_user.rml | 19 +- .../report/pos_users_product.rml | 64 +++--- 13 files changed, 220 insertions(+), 213 deletions(-) diff --git a/addons/point_of_sale/report/all_closed_cashbox_of_the_day.rml b/addons/point_of_sale/report/all_closed_cashbox_of_the_day.rml index 658e7e958b9..7013ddcfb6f 100644 --- a/addons/point_of_sale/report/all_closed_cashbox_of_the_day.rml +++ b/addons/point_of_sale/report/all_closed_cashbox_of_the_day.rml @@ -2,7 +2,7 @@ @@ -114,10 +114,10 @@ Today's Closed Cashbox - + - + Company @@ -127,7 +127,7 @@ - + [[ company.name ]] @@ -140,7 +140,7 @@ - + St.Name @@ -162,7 +162,7 @@ - + Total: @@ -183,16 +183,16 @@ - [[ formatLang(get_net_total_starting(user)[1]) ]] [[company.currency_id.symbol]] + [[ formatLang(get_net_total_starting(user)[1]) ]] [[company.currency_id.symbol]] - [[ formatLang(get_net_total(user)) ]] [[company.currency_id.symbol]] + [[ formatLang(get_net_total(user)) ]] [[company.currency_id.symbol]]
- [[ repeatIn(get_data(user),'statement') ]] - + [[ repeatIn(get_data(user),'statement') ]] + [[ statement['statement'] ]] @@ -207,16 +207,16 @@ [[ statement['closing_date'] ]] - [[ (get_bal(statement)) or '0.00' ]] [[company.currency_id.symbol]] + [[ (get_bal(statement)) or '0.00' ]] [[company.currency_id.symbol]] - [[ formatLang(get_sub_total(user,statement['journal_id'],statement['date'])) ]] [[company.currency_id.symbol]] + [[ formatLang(get_sub_total(user,statement['journal_id'],statement['date'])) ]] [[company.currency_id.symbol]]
- [[ repeatIn(get_lines(statement),'line_ids') ]] - + [[ repeatIn(get_lines(statement),'line_ids') ]] + [[ line_ids['name'] ]] @@ -240,7 +240,7 @@ - +
diff --git a/addons/point_of_sale/report/pos_details_summary.rml b/addons/point_of_sale/report/pos_details_summary.rml index 5f68c7869f0..4c538f3b15e 100644 --- a/addons/point_of_sale/report/pos_details_summary.rml +++ b/addons/point_of_sale/report/pos_details_summary.rml @@ -2,7 +2,7 @@ @@ -38,23 +38,30 @@ + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + - + @@ -64,11 +71,6 @@ - - - - - @@ -104,11 +106,12 @@ - - - - - + + + + + + @@ -147,14 +150,14 @@ + + + + Details of Sales - Details of Sales - - - - + Company @@ -167,7 +170,7 @@ - + [[ '%s' % getcompany(objects)]] @@ -180,80 +183,84 @@ - + - + Mode of Taxes + + + + + + + +
+ [[ repeatIn(gettaxamount(objects).items(),'p') ]] + + + + [[ p[0] ]] + + + [[ p[1] ]] + + + + + + +
+ + + + + + + Mode of Payment + + + + + + + + +
+ [[ repeatIn(getpayments(objects).items(),'t') ]] + + + + [[ t[0] ]] + + + [[ '%.2f' % (t[1],) ]] + + + + + + +
+ + + + + + + Summary + - - - - [[ repeatIn(gettaxamount(objects).items(),'p') ]] - [[ p[0] ]] - - - - [[ p[1] ]] - - - - - - Mode of Payment - - - - - - - - - - - [[ repeatIn(getpayments(objects).items(),'t') ]] - [[ t[0] ]] - - - - [[ '%.2f' % (t[1],) ]] - - - - - - - - - - - - - - - - - - - Summary - - - - - - - - - + Sales total diff --git a/addons/point_of_sale/report/pos_lines.rml b/addons/point_of_sale/report/pos_lines.rml index a62cd04e104..95f02bb5c1c 100644 --- a/addons/point_of_sale/report/pos_lines.rml +++ b/addons/point_of_sale/report/pos_lines.rml @@ -2,7 +2,7 @@ @@ -115,7 +115,7 @@ - + Company @@ -128,7 +128,7 @@ - + [[ company.name ]] @@ -147,7 +147,7 @@ - + Description @@ -170,8 +170,8 @@
- [[repeatIn(o.lines,'l')]] - + [[repeatIn(o.lines,'l')]] + [ [[l.product_id.code]] ] [[l.product_id.name]] @@ -194,7 +194,7 @@
- + @@ -284,4 +284,4 @@ -
\ No newline at end of file +
diff --git a/addons/point_of_sale/report/pos_payment_report.py b/addons/point_of_sale/report/pos_payment_report.py index dc5653551a2..f679e230107 100644 --- a/addons/point_of_sale/report/pos_payment_report.py +++ b/addons/point_of_sale/report/pos_payment_report.py @@ -38,17 +38,17 @@ class pos_payment_report(report_sxw.rml_parse): sql = """ select id from pos_order where id = %d"""%(obj.id) self.cr.execute(sql) if self.cr.fetchone(): - self.cr.execute ("select pt.name,pol.qty,pol.discount,pol.price_unit, " \ + self.cr.execute ("select pt.name,pp.default_code as code,pol.qty,pu.name as uom,pol.discount,pol.price_unit, " \ "(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) as total " \ - "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \ - "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \ + "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt, product_uom as pu " \ + "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id and pu.id=pt.uom_id " \ "and po.state IN ('paid','invoiced') and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date = current_date and po.id=%d"%(obj.id)) data=self.cr.dictfetchall() else : - self.cr.execute ("select pt.name,pol.qty,pol.discount,pol.price_unit, " \ + self.cr.execute ("select pt.name,pp.default_code as code,pol.qty,pu.name as uom,pol.discount,pol.price_unit, " \ "(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) as total " \ - "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \ - "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \ + "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt, product_uom as pu " \ + "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id and pu.id=pt.uom_id " \ "and po.state IN ('paid','invoiced') and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date = current_date") data=self.cr.dictfetchall() diff --git a/addons/point_of_sale/report/pos_payment_report.rml b/addons/point_of_sale/report/pos_payment_report.rml index 01fcdf355e1..2d25c740d77 100644 --- a/addons/point_of_sale/report/pos_payment_report.rml +++ b/addons/point_of_sale/report/pos_payment_report.rml @@ -175,10 +175,10 @@ - [[ line_ids['name'] ]] + [ [[ line_ids['code'] ]] ] [[ line_ids['name'] ]] - [[ formatLang(line_ids['qty']) ]] + [[ formatLang(line_ids['qty']) ]] [[line_ids['uom'] ]] [[ formatLang(line_ids['discount']) ]] diff --git a/addons/point_of_sale/report/pos_payment_report_date.py b/addons/point_of_sale/report/pos_payment_report_date.py index 362ff569f72..823fb3ce95e 100644 --- a/addons/point_of_sale/report/pos_payment_report_date.py +++ b/addons/point_of_sale/report/pos_payment_report_date.py @@ -38,17 +38,17 @@ class pos_payment_report_date(report_sxw.rml_parse): dt2 = form['date_end'] + ' 23:59:59' data={} if form['user_id']: - self.cr.execute ("select pt.name,pol.qty,pol.discount,pol.price_unit, " \ + self.cr.execute ("select pt.name,pp.default_code as code,pol.qty,pu.name as uom,pol.discount,pol.price_unit, " \ "(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) as total " \ - "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \ - "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \ + "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt,product_uom as pu " \ + "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id and pu.id=pt.uom_id " \ "and po.state IN ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s and po.user_id IN %s " \ ,(dt1,dt2,tuple(form['user_id']))) else: - self.cr.execute ("select pt.name,pol.qty,pol.discount,pol.price_unit, " \ + self.cr.execute ("select pt.name,pp.default_code as code,pol.qty,pu.name as uom,pol.discount,pol.price_unit, " \ "(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) as total " \ - "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \ - "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \ + "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt,product_uom as pu " \ + "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id and pu.id=pt.uom_id " \ "and po.state IN ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s" \ ,(dt1,dt2)) data=self.cr.dictfetchall() diff --git a/addons/point_of_sale/report/pos_payment_report_date.rml b/addons/point_of_sale/report/pos_payment_report_date.rml index 35e605d0bff..23c3f950d81 100644 --- a/addons/point_of_sale/report/pos_payment_report_date.rml +++ b/addons/point_of_sale/report/pos_payment_report_date.rml @@ -2,7 +2,7 @@ @@ -102,7 +102,7 @@ - + Company @@ -112,7 +112,7 @@ - + [[ company.name ]] @@ -128,7 +128,7 @@ - + Product @@ -149,13 +149,13 @@
[[ repeatIn(pos_payment_date(data['form']), 'line_ids') ]] - + - [[ line_ids['name'] ]] + [ [[ line_ids['code'] ]] ] [[ line_ids['name'] ]] - [[ formatLang(line_ids['qty']) ]] + [[ formatLang(line_ids['qty']) ]] [[line_ids['uom'] ]] [[ formatLang(line_ids['discount']) ]] @@ -169,7 +169,7 @@
- + diff --git a/addons/point_of_sale/report/pos_payment_report_user.py b/addons/point_of_sale/report/pos_payment_report_user.py index 1a982457895..37b129f68f2 100644 --- a/addons/point_of_sale/report/pos_payment_report_user.py +++ b/addons/point_of_sale/report/pos_payment_report_user.py @@ -35,10 +35,10 @@ class pos_payment_report_user(report_sxw.rml_parse): def __pos_payment_user__(self,form): data={} ids = form['user_id'] - sql = "select pt.name,pol.qty,pol.discount,pol.price_unit, " \ + sql = "select pt.name,pp.default_code as code,pol.qty,pu.name as uom,pol.discount,pol.price_unit, " \ "(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) as total " \ - "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \ - "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \ + "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt,product_uom as pu " \ + "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id and pu.id=pt.uom_id " \ "and po.state in ('paid','invoiced') and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date = current_date " \ "and po.user_id IN %s" self.cr.execute (sql, (tuple(ids), )) diff --git a/addons/point_of_sale/report/pos_payment_report_user.rml b/addons/point_of_sale/report/pos_payment_report_user.rml index 4779fad9e6b..18ed5b73d84 100644 --- a/addons/point_of_sale/report/pos_payment_report_user.rml +++ b/addons/point_of_sale/report/pos_payment_report_user.rml @@ -59,8 +59,7 @@ - - + @@ -103,8 +102,8 @@ - Payment By User - + Payment By User + @@ -153,14 +152,14 @@
- [[ repeatIn(pos_payment_user(data['form']), 'line_ids') ]] + [[ repeatIn(pos_payment_user(data['form']), 'line_ids') ]] - [[ line_ids['name'] ]] + [ [[ line_ids['code'] ]] ] [[ line_ids['name'] ]] - [[ formatLang(line_ids['qty']) ]] + [[ formatLang(line_ids['qty']) ]] [[line_ids['uom'] ]] [[ formatLang(line_ids['discount']) ]] diff --git a/addons/point_of_sale/report/pos_sales_user.rml b/addons/point_of_sale/report/pos_sales_user.rml index 5a98c092a3a..d2fefc379fd 100644 --- a/addons/point_of_sale/report/pos_sales_user.rml +++ b/addons/point_of_sale/report/pos_sales_user.rml @@ -2,7 +2,7 @@ @@ -41,7 +41,7 @@ - + @@ -54,8 +54,7 @@ - - + @@ -98,11 +97,11 @@ - Sales Report - + Sales Report + - + Company @@ -112,7 +111,7 @@ - + [[ company.name ]] @@ -128,7 +127,7 @@ - + Name @@ -148,8 +147,8 @@
- [[ repeatIn(get_data(data['form']), 'line_ids')]] - + [[ repeatIn(get_data(data['form']), 'line_ids')]] + [[ line_ids['pos'] ]] @@ -168,12 +167,9 @@ - +
- - -
diff --git a/addons/point_of_sale/report/pos_sales_user_today.rml b/addons/point_of_sale/report/pos_sales_user_today.rml index 9f1bc6eb14b..6e633d375d8 100644 --- a/addons/point_of_sale/report/pos_sales_user_today.rml +++ b/addons/point_of_sale/report/pos_sales_user_today.rml @@ -2,7 +2,7 @@ @@ -53,10 +53,8 @@ - - - - + + @@ -99,11 +97,11 @@ - Today's Sales By User - + Today's Sales By User + - + Company @@ -113,7 +111,7 @@ - + [[ company.name ]] @@ -129,7 +127,7 @@ - + Name @@ -138,7 +136,7 @@ Date Order - User + User State @@ -149,8 +147,8 @@
- [[ repeatIn(get_data(data['form']), 'line_ids')]] - + [[ repeatIn(get_data(data['form']), 'line_ids')]] + [[ line_ids['pos'] ]] @@ -169,7 +167,7 @@ - +
diff --git a/addons/point_of_sale/report/pos_sales_user_today_current_user.rml b/addons/point_of_sale/report/pos_sales_user_today_current_user.rml index c4d046ad9f8..7a94f5d6632 100644 --- a/addons/point_of_sale/report/pos_sales_user_today_current_user.rml +++ b/addons/point_of_sale/report/pos_sales_user_today_current_user.rml @@ -2,7 +2,7 @@ @@ -65,8 +65,7 @@ - - + @@ -109,11 +108,11 @@ - Today's Sales By Current User + Today's Sales By Current User - + Company @@ -126,7 +125,7 @@ - + [[ company.name ]] @@ -145,7 +144,7 @@ - + Name @@ -162,8 +161,8 @@
- [[ repeatIn(get_data_current_user(user), 'line_ids')]] - + [[ repeatIn(get_data_current_user(user), 'line_ids')]] + [[ line_ids['name'] ]] @@ -180,7 +179,7 @@
- + diff --git a/addons/point_of_sale/report/pos_users_product.rml b/addons/point_of_sale/report/pos_users_product.rml index d5c7d6a9996..ae15e6478e7 100644 --- a/addons/point_of_sale/report/pos_users_product.rml +++ b/addons/point_of_sale/report/pos_users_product.rml @@ -1,6 +1,6 @@ -