1 # -*- encoding: utf-8 -*-
2 ##############################################################################
4 # OpenERP, Open Source Management Solution
5 # Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 ##############################################################################
24 from report import report_sxw
25 from tools import amount_to_text_en
28 class report_voucher(report_sxw.rml_parse):
29 def __init__(self, cr, uid, name, context):
30 super(report_voucher, self).__init__(cr, uid, name, context)
31 self.localcontext.update({
33 'convert':self.convert,
36 'get_ref' : self._get_ref
39 def convert(self,amount, cur):
40 amt_en = amount_to_text_en.amount_to_text(amount,'en',cur);
43 def debit(self, move_ids):
45 for move in move_ids:#self.pool.get('account.move.line').browse(self.cr, self.uid, move_ids):
49 def credit(self, move_ids):
51 for move in move_ids:#self.pool.get('account.move.line').browse(self.cr, self.uid, move_ids):
55 def _get_ref(self, voucher_id, move_ids):
56 voucher_line = self.pool.get('account.voucher.line').search(self.cr, self.uid, [('partner_id','=',move_ids.partner_id.id), ('voucher_id','=',voucher_id)])
58 voucher = self.pool.get('account.voucher.line').browse(self.cr, self.uid, voucher_line)[0]
62 report_sxw.report_sxw(
63 'report.voucher.cash_receipt',
65 'addons/account_voucher/report/report_voucher.rml',
66 parser=report_voucher,header=False