diff --git a/addons/lunch/report/order.py b/addons/lunch/report/order.py index 29c9d381745..11ca7f79dbc 100644 --- a/addons/lunch/report/order.py +++ b/addons/lunch/report/order.py @@ -41,8 +41,12 @@ class order(report_sxw.rml_parse): total=0.0 for line in lines: total+=line.price + self.net_total+=total return total + def get_nettotal(self): + return self.net_total + def get_users(self, objects): users=[] for obj in objects: @@ -52,12 +56,13 @@ class order(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(order, self).__init__(cr, uid, name, context) - + self.net_total=0.0 self.localcontext.update({ 'time': time, 'get_lines': self.get_lines, 'get_users': self.get_users, 'get_total': self.get_total, + 'get_nettotal': self.get_nettotal, }) report_sxw.report_sxw('report.lunch.order', 'lunch.order', diff --git a/addons/lunch/report/order.rml b/addons/lunch/report/order.rml index d47816abd9c..ba66dcddb03 100644 --- a/addons/lunch/report/order.rml +++ b/addons/lunch/report/order.rml @@ -14,25 +14,28 @@ - + - - + + + + + + - - + @@ -63,9 +66,14 @@ + + + + + @@ -84,16 +92,10 @@ Lunch Order - -
- [[repeatIn(get_users(objects),'o')]] - + - Name - - - Date + Name/Date Order @@ -107,28 +109,43 @@
- [[ repeatIn(get_lines(o,objects),'lines') ]] - + [[repeatIn(get_users(objects),'o')]] + - [[ (lines.user_id and lines.user_id.name) or '']] + [[ o.name ]] - [[ formatLang(lines.date,date='True') ]] + + + - [[ (lines.product and lines.product.name) or '' ]] - - - [[ lines.descript]] - - - [[ lines.price ]] [[ (o.company_id and o.company_id.currency_id and o.company_id.currency_id.symbol) or '' ]] + [[ formatLang(get_total(o,objects)) ]] [[ (o.company_id and o.company_id.currency_id and o.company_id.currency_id.symbol) or '' ]] +
+ [[ repeatIn(get_lines(o,objects),'lines') ]] + + + + [[ formatLang(lines.date,date='True') ]] + + + [[ (lines.product and lines.product.name) or '' ]] + + + [[ lines.descript]] + + + [[ lines.price ]] [[ (o.company_id and o.company_id.currency_id and o.company_id.currency_id.symbol) or '' ]] + + + +
- + @@ -136,16 +153,15 @@ - Total: + Total : - [[ formatLang(get_total(o,objects)) ]] [[ (o.company_id and o.company_id.currency_id and o.company_id.currency_id.symbol) or '' ]] + [[ formatLang(get_nettotal()) ]] [[ (o.company_id and o.company_id.currency_id and o.company_id.currency_id.symbol) or '' ]] - + -
- + \ No newline at end of file