~vauxoo/addons-vauxoo/7.0-add_project_followers_rule-dev-ernesto

« back to all changes in this revision

Viewing changes to account_move_report/report/account_move_html.py

  • Committer: Isaac López
  • Date: 2013-11-08 20:12:11 UTC
  • mto: This revision was merged to the branch mainline in revision 924.
  • Revision ID: isaac@vauxoo.com-20131108201211-9vuausgw7a8auw22
[ADD][account_move_report] generic module added

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
# -*- encoding: utf-8 -*-
 
3
###########################################################################
 
4
#    Module Writen to OpenERP, Open Source Management Solution
 
5
#    Copyright (C) Vauxoo (<http://vauxoo.com>).
 
6
#    All Rights Reserved
 
7
###############Credits######################################################
 
8
#    Coded by: Luis Ernesto García (ernesto_gm@vauxoo.com)
 
9
#############################################################################
 
10
#    This program is free software: you can redistribute it and/or modify
 
11
#    it under the terms of the GNU Affero General Public License as published by
 
12
#    the Free Software Foundation, either version 3 of the License, or
 
13
#    (at your option) any later version.
 
14
#
 
15
#    This program is distributed in the hope that it will be useful,
 
16
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
#    GNU Affero General Public License for more details.
 
19
#
 
20
#    You should have received a copy of the GNU Affero General Public License
 
21
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
22
################################################################################
 
23
from openerp.report import report_sxw
 
24
from openerp.tools.translate import _
 
25
import time
 
26
from report_webkit import report_helper
 
27
from report_webkit import webkit_report
 
28
 
 
29
class account_move_report_html(report_sxw.rml_parse):
 
30
    def __init__(self, cr, uid, name, context):
 
31
        super(account_move_report_html, self).__init__(cr, uid, name,
 
32
                                context=context)
 
33
        self.localcontext.update({
 
34
            'time': time,
 
35
            'get_total_debit_credit' : self.get_total_debit_credit,            
 
36
        })
 
37
 
 
38
    def get_total_debit_credit(self, line_ids):
 
39
                sum_tot_debit = 0.00
 
40
                sum_tot_credit = 0.00
 
41
                for line in line_ids:
 
42
                        sum_tot_debit += (line.debit)
 
43
                        sum_tot_credit += (line.credit)
 
44
                return {'sum_tot_debit' : sum_tot_debit, 'sum_tot_credit' : sum_tot_credit}
 
45
 
 
46
webkit_report.WebKitParser('report.account.move.report.webkit', 
 
47
                      'account.move',
 
48
                      'addons/report_account_move/report/account_move_report_html.mako',
 
49
                      parser=account_move_report_html)
 
50
 
 
51
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: