diff --git a/addons/email_template/email_template_account_view.xml b/addons/email_template/email_template_account_view.xml
index 65973fea9f7..4a35134bb41 100644
--- a/addons/email_template/email_template_account_view.xml
+++ b/addons/email_template/email_template_account_view.xml
@@ -96,6 +96,8 @@
+
diff --git a/addons/point_of_sale/report/report_pos_order.py b/addons/point_of_sale/report/report_pos_order.py
index 082ff3f434e..42b2f3e9efb 100644
--- a/addons/point_of_sale/report/report_pos_order.py
+++ b/addons/point_of_sale/report/report_pos_order.py
@@ -41,13 +41,20 @@ class report_pos_order(osv.osv):
('advance','Advance'),
('paid', 'Paid'), ('done', 'Done'), ('invoiced', 'Invoiced'), ('cancel', 'Cancel')],
'State'),
+ 'state_2': fields.function([('to_verify', 'To Verify'), ('accepted', 'Accepted'),
+ ('refused', 'Refused')], string='State'),
'user_id':fields.many2one('res.users', 'Salesman', readonly=True),
'price_total':fields.float('Total Price', readonly=True),
+ 'total_discount':fields.float('Total Discount', readonly=True),
+ 'average_price': fields.float('Average Price', readonly=True,group_operator="avg"),
'shop_id':fields.many2one('sale.shop', 'Shop', readonly=True),
'company_id':fields.many2one('res.company', 'Company', readonly=True),
'nbr':fields.integer('# of Lines', readonly=True),
'product_qty':fields.float('# of Qty', readonly=True),
'journal_id': fields.many2one('account.journal', 'Journal'),
+ 'statement_journal_id': fields.many2one('account.journal','Cash Register'),
+ 'delay_validation': fields.integer('Delay Validation'),
+ 'delay_payment': fields.integer('Delay Payment'),
}
_order = 'date desc'
def init(self, cr):
@@ -63,26 +70,32 @@ class report_pos_order(osv.osv):
to_char(po.date_order, 'YYYY') as year,
to_char(po.date_order, 'MM') as month,
to_char(po.date_order, 'YYYY-MM-DD') as day,
+ (date(po.date_order)-date(po.date_validation)) as delay_validation,
+ (date(po.date_order)-date(po.date_payment)) as delay_payment,
po.partner_id as partner_id,
po.state as state,
+ po.state_2 as state_2,
po.user_id as user_id,
po.shop_id as shop_id,
po.company_id as company_id,
- po.sale_journal as journal_id
+ po.sale_journal as journal_id,
+ aj.id as statement_journal_id
from
- pos_order as po,
+ pos_order as po,account_bank_statement_line absl,account_journal as aj,
( select pl.id as id,
pl.product_id as product_id,
pl.qty as product_qty,
sum(pl.qty * pl.price_unit)- sum(pl.qty * pl.price_ded) as price_total,
+ sum(pl.qty * pl.price_ded) as total_discount,
+ ((sum(pl.qty * pl.price_unit)-sum(pl.qty * pl.price_ded))/sum(pl.qty)*count(pl.qty))::decimal(16,2) as average_price,
pl.order_id
from
pos_order_line as pl
left join product_template pt on (pt.id=pl.product_id)
group by
pl.id,pl.order_id, pl.qty,pl.product_id) el
- where po.id = el.order_id
+ where po.id = el.order_id and absl.pos_statement_id = po.id and aj.name = absl.journal_id
)
""")
diff --git a/addons/point_of_sale/report/report_pos_order_view.xml b/addons/point_of_sale/report/report_pos_order_view.xml
index 3efe9548c70..401ce6f8720 100644
--- a/addons/point_of_sale/report/report_pos_order_view.xml
+++ b/addons/point_of_sale/report/report_pos_order_view.xml
@@ -7,7 +7,7 @@
tree
-
+
@@ -18,10 +18,15 @@
+
+
+
+
+
@@ -45,6 +50,7 @@
separator="1"
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="POS ordered created last 7 days"/>
+
-
+
+
-
@@ -73,14 +79,15 @@
-
+
+
+
+
+
+
-
-
-
-