- [[ line.partner_id and line.partner_id.name or '' ]]
- |
-
- [[ line.bank_id and line.bank_id.name ]]
- |
-
- [[ line.name ]]
- |
-
- [[ line.date ]]
+ [[line.partner_id and line.partner_id.name or '-' ]]
+ |
+
+ [[ line.bank_id and line.bank_id.name or '-' ]]
+ |
+
+ [[ get_invoice_name(line.ml_inv_ref.id) or '-' ]]
+ |
+
+ [[line.date=='False' and '-' or line.date ]]
+ |
+
+ [[formatLang(line.amount) or '-' ]]
|
[[ formatLang(line.amount_currency) ]] [[ line.currency.name ]]
@@ -154,8 +243,38 @@
-
+
+
+
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+ Total:
+ |
+
+ [[ formatLang(get_amount_total(o)) or '' ]]
+ |
+
+ [[ formatLang(get_amount_total_in_currency(o)) or '' ]] [[ get_amount_total_in_currency(o) and line.currency.name ]]
+ |
+
+
+
+
=== modified file 'account_payment/report/payment_order.py'
--- account_payment/report/payment_order.py 2009-10-09 11:49:00 +0000
+++ account_payment/report/payment_order.py 2010-08-12 08:38:17 +0000
@@ -22,6 +22,7 @@
import time
import datetime
+import pooler
from report import report_sxw
class payment_order(report_sxw.rml_parse):
@@ -29,8 +30,54 @@
super(payment_order, self).__init__(cr, uid, name, context=context)
self.localcontext.update( {
'time': time,
-
+ 'get_invoice_name': self._get_invoice_name,
+ 'get_company_currency' : self._get_company_currency,
+ 'get_amount_total_in_currency' : self._get_amount_total_in_currency,
+ 'get_amount_total' : self._get_amount_total,
})
+ def _get_invoice_name(self,invoice_id):
+ if invoice_id:
+ pool = pooler.get_pool(self.cr.dbname)
+ value_name = pool.get('account.invoice').name_get(self.cr, self.uid, [invoice_id])
+ if value_name:
+ return value_name[0][1]
+ else:
+ return False
+ else:
+ return False
+ def _get_amount_total_in_currency(self,payment):
+ total = 0.0
+ if payment.line_ids:
+ currency_cmp = payment.line_ids[0].currency.id
+ else:
+ return False
+ for line in payment.line_ids:
+ if currency_cmp == line.currency.id:
+ total = total + line.amount_currency
+ else:
+ return False
+ return total
+
+ def _get_amount_total(self,payment):
+ total = 0.0
+ if not payment.line_ids:
+ return False
+ for line in payment.line_ids:
+ total = total + line.amount
+ return total
+
+
+ def _get_company_currency(self):
+ pool = pooler.get_pool(self.cr.dbname)
+ user = pool.get('res.users').browse(self.cr, self.uid, self.uid)
+ return user.company_id and user.company_id.currency_id and user.company_id.currency_id.name or False
+
+ def _get_company_currency(self):
+ pool = pooler.get_pool(self.cr.dbname)
+ user = pool.get('res.users').browse(self.cr, self.uid, self.uid)
+ return user.company_id and user.company_id.currency_id and user.company_id.currency_id.name or False
+
+
report_sxw.report_sxw('report.payment.order', 'payment.order', 'addons/account_payment/report/payment_order.rml', parser=payment_order,header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|