[IMP] point_of_sale: receipt report: better date formatting
bzr revid: olt@tinyerp.com-20090617141914-q45nj9rw1jf3zs34
This commit is contained in:
parent
e538dc976d
commit
3d88cb1d65
|
@ -22,6 +22,7 @@
|
|||
|
||||
import time
|
||||
from report import report_sxw
|
||||
from mx.DateTime.ISO import ParseAny
|
||||
import pooler
|
||||
|
||||
|
||||
|
@ -35,11 +36,17 @@ class order(report_sxw.rml_parse):
|
|||
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'dformat': '%Y/%m/%d %H:%M:%S',
|
||||
'disc': self.discount,
|
||||
'net': self.netamount,
|
||||
'formatdate': self.formatdate,
|
||||
'address': partner.address and partner.address[0] or False,
|
||||
})
|
||||
|
||||
def formatdate(self, datestr):
|
||||
dateobj = ParseAny(datestr)
|
||||
return dateobj.strftime(self.localcontext['dformat'])
|
||||
|
||||
def netamount(self, order_line_id):
|
||||
sql = 'select (qty*price_unit) as net_price from pos_order_line where id = %s'
|
||||
self.cr.execute(sql, (order_line_id,))
|
||||
|
|
|
@ -83,8 +83,8 @@
|
|||
<para style="terp_default_Centre_9">Tel : [[ address and address.phone ]]</para>
|
||||
<para style="terp_default_Centre_9">E-mail : [[ address and address.email ]]</para>
|
||||
<para style="terp_default_Centre_9">Salesman : [[ o.salesman_id.name ]]</para>
|
||||
<para style="terp_default_Centre_9">Sale Date : [[ o.date_order ]]</para>
|
||||
<para style="terp_default_Centre_9">Receipt Printing Date : [[ time.strftime('%d/%m/%Y %H:%M') ]]</para>
|
||||
<para style="terp_default_Centre_9">Sale Date : [[ formatdate(o.date_order) ]]</para>
|
||||
<para style="terp_default_Centre_9">Receipt Printing Date : [[ time.strftime(dformat) ]]</para>
|
||||
<para style="terp_default_Centre_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
|
|
Loading…
Reference in New Issue