Browse Source

add fields to journal_report_xls

pull/7/merge
Luc De Meyer 10 years ago
parent
commit
3499ea25a6
  1. 8
      account_journal_report_xls/__init__.py
  2. 13
      account_journal_report_xls/__openerp__.py
  3. 5
      account_journal_report_xls/account_journal.py
  4. 59
      account_journal_report_xls/i18n/fr.po
  5. 59
      account_journal_report_xls/i18n/nl.po
  6. 24
      account_journal_report_xls/report/nov_account_journal.py
  7. 20
      account_journal_report_xls/report/nov_account_journal_xls.py
  8. 6
      account_journal_report_xls/wizard/__init__.py
  9. 6
      account_journal_report_xls/wizard/print_journal_wizard.py

8
account_journal_report_xls/__init__.py

@ -3,7 +3,7 @@
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@ -12,11 +12,11 @@
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -28,6 +28,4 @@ except ImportError:
import logging
logging.getLogger('openerp.module').warning('report_xls not available in addons path. account_financial_report_webkit_xls will not be usable')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

13
account_journal_report_xls/__openerp__.py

@ -3,7 +3,7 @@
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@ -12,17 +12,17 @@
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Financial Journal reports',
'version': '0.1',
'version': '0.2',
'license': 'AGPL-3',
'author': 'Noviat',
'category': 'Accounting & Finance',
@ -47,9 +47,8 @@ cf. https://launchpad.net/openerp-reporting-engines
'account_voucher',
'report_xls',
],
'demo_xml': [],
'init_xml': [],
'update_xml': [
'demo': [],
'data': [
'wizard/print_journal_wizard.xml',
],
}

5
account_journal_report_xls/account_journal.py

@ -65,6 +65,11 @@ class account_journal(orm.Model):
#'partner_ref', # res.partner,ref
#'move_ref', # account.move,ref
#'move_id', # account.move,id
#'acc_name', # account.account,name
#'journal', # account.journal,name
#'journal_code', # account.journal,code
#'analytic_account', # account.analytic.account,name
#'analytic_account_code', # account.analytic.account,code
]
return res

59
account_journal_report_xls/i18n/fr.po

@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 6.1\n"
"Report-Msgid-Bugs-To: support@noviat.be\n"
"POT-Creation-Date: 2013-11-23 17:11:14.941000\n"
"PO-Revision-Date: 2013-11-23 17:11:14.941000\n"
"POT-Creation-Date: 2014-01-19 17:16:37.990000\n"
"PO-Revision-Date: 2014-01-19 17:16:37.990000\n"
"Last-Translator: Luc De Meyer (Noviat nv/sa)\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -119,11 +119,36 @@ msgstr "Exercice fiscal"
msgid "Journal Overview"
msgstr "Journal détaillé"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Journal Items"
msgstr "Écritures comptables"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Entry"
msgstr "Écriture"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Name"
msgstr "Nom"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Reference"
msgstr "Référence"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Effective Date"
msgstr "Date"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Period"
msgstr "Période"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Date"
@ -134,6 +159,16 @@ msgstr "Date"
msgid "Account"
msgstr "Compte"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Account Name"
msgstr "Description compte "
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Journal"
msgstr "Journal"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Description"
@ -179,6 +214,16 @@ msgstr "Let."
msgid "Part. Rec."
msgstr "Let. Part."
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Tax Code"
msgstr "Case TVA"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Tax/Base Amount"
msgstr "Montant TVA/Base"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "VAT"
@ -209,6 +254,16 @@ msgstr "Montant devise"
msgid "Curr."
msgstr "Dev."
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Comp. Curr."
msgstr "Dev. Soc."
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Analytic Account"
msgstr "Compte analytique"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Document"

59
account_journal_report_xls/i18n/nl.po

@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 6.1\n"
"Report-Msgid-Bugs-To: support@noviat.be\n"
"POT-Creation-Date: 2013-11-23 17:11:14.936000\n"
"PO-Revision-Date: 2013-11-23 17:11:14.936000\n"
"POT-Creation-Date: 2014-01-19 17:16:37.980000\n"
"PO-Revision-Date: 2014-01-19 17:16:37.980000\n"
"Last-Translator: Luc De Meyer (Noviat nv/sa)\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -119,11 +119,36 @@ msgstr "Boekjaar"
msgid "Journal Overview"
msgstr "Dagboekoverzicht"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Journal Items"
msgstr "Boekingsregels"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Entry"
msgstr "Boeking"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Name"
msgstr "Naam"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Reference"
msgstr "Referentie"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Effective Date"
msgstr "Datum"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Period"
msgstr "Periode"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Date"
@ -134,6 +159,16 @@ msgstr "Datum"
msgid "Account"
msgstr "Rekening"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Account Name"
msgstr "Omschrijving rekening"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Journal"
msgstr "Dagboek"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Description"
@ -179,6 +214,16 @@ msgstr "Rec."
msgid "Part. Rec."
msgstr "Rec. Part."
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Tax Code"
msgstr "BTW vak"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Tax/Base Amount"
msgstr "Bedrag BTW/Mvh"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "VAT"
@ -209,6 +254,16 @@ msgstr "Bedrag valuta"
msgid "Curr."
msgstr "Val."
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Comp. Curr."
msgstr "Bedr. Val."
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Analytic Account"
msgstr "Kostenplaats"
#. module: account_journal_report_xls
#: report:nov.account.journal.print:0
msgid "Document"

24
account_journal_report_xls/report/nov_account_journal.py

@ -3,7 +3,7 @@
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@ -12,11 +12,11 @@
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -121,9 +121,12 @@ class nov_journal_print(report_sxw.rml_parse):
select_extra, join_extra, where_extra = j_obj._report_xls_query_extra(self.cr, self.uid, self.context)
# SQL select for performance reasons, as a consequence, there are no field value translations.
# If performance is no issue, you can adapt the _report_xls_template in an inherited module to add field value translations.
self.cr.execute("SELECT l.move_id AS move_id, l.id AS aml_id, "
"am.name AS move_name, coalesce(am.ref,'') AS move_ref, am.date AS move_date, "
"aa.id AS account_id, aa.code AS acc_code, "
"aa.id AS account_id, aa.code AS acc_code, aa.name AS acc_name, "
"aj.name AS journal, aj.code AS journal_code, "
"coalesce(rp.name,'') AS partner_name, coalesce(rp.ref,'') AS partner_ref, rp.id AS partner_id, "
"coalesce(l.name,'') AS aml_name, "
"l.date_maturity AS date_maturity, "
@ -131,6 +134,7 @@ class nov_journal_print(report_sxw.rml_parse):
"coalesce(atc.code,'') AS tax_code, atc.id AS tax_code_id, coalesce(l.tax_amount,0.0) AS tax_amount, "
"coalesce(l.debit,0.0) AS debit, coalesce(l.credit,0.0) AS credit, "
"coalesce(amr.name,'') AS reconcile, coalesce(amrp.name,'') AS reconcile_partial, "
"ana.name AS an_acc_name, coalesce(ana.code,'') AS an_acc_code, "
"coalesce(l.amount_currency,0.0) AS amount_currency, "
"rc.id AS currency_id, rc.name AS currency_name, rc.symbol AS currency_symbol, "
"coalesce(ai.internal_number,'-') AS inv_number, coalesce(abs.name,'-') AS st_number, coalesce(av.number,'-') AS voucher_number "
@ -138,6 +142,7 @@ class nov_journal_print(report_sxw.rml_parse):
"FROM account_move_line l "
"INNER JOIN account_move am ON l.move_id = am.id "
"INNER JOIN account_account aa ON l.account_id = aa.id "
"INNER JOIN account_journal aj ON l.journal_id = aj.id "
"INNER JOIN account_period ap ON l.period_id = ap.id "
"LEFT OUTER JOIN account_invoice ai ON ai.move_id = am.id "
"LEFT OUTER JOIN account_voucher av ON av.move_id = am.id "
@ -146,6 +151,7 @@ class nov_journal_print(report_sxw.rml_parse):
"LEFT OUTER JOIN account_tax_code atc ON l.tax_code_id = atc.id "
"LEFT OUTER JOIN account_move_reconcile amr ON l.reconcile_id = amr.id "
"LEFT OUTER JOIN account_move_reconcile amrp ON l.reconcile_partial_id = amrp.id "
"LEFT OUTER JOIN account_analytic_account ana ON l.analytic_account_id = ana.id "
"LEFT OUTER JOIN res_currency rc ON l.currency_id = rc.id "
+ join_extra +
"WHERE l.period_id IN %s AND l.journal_id = %s "
@ -165,6 +171,10 @@ class nov_journal_print(report_sxw.rml_parse):
#_logger.warn('code_string= %s', code_string)
[x.update({'docname': eval(code_string) or '-'}) for x in lines]
# group lines
if self.group_entries:
lines = self._group_lines(lines)
# format debit, credit, amount_currency for pdf report
if self.display_currency and self.report_type == 'pdf':
curr_obj = self.pool.get('res.currency')
@ -175,10 +185,6 @@ class nov_journal_print(report_sxw.rml_parse):
else:
[x.update({'amount1': self.formatLang(x['debit']), 'amount2': self.formatLang(x['credit'])}) for x in lines]
# group lines
if self.group_entries:
lines = self._group_lines(lines)
# insert a flag in every move_line to indicate the end of a move
# this flag will be used to draw a full line between moves
for cnt in range(len(lines) - 1):
@ -215,7 +221,7 @@ class nov_journal_print(report_sxw.rml_parse):
grouped_lines = [lines_in[0]]
move_id = lines_in[0]['move_id']
line_cnt = len(lines_in)
for i in range(1,line_cnt):
for i in range(1, line_cnt):
line = lines_in[i]
if line['move_id'] == move_id:
grouped_lines.append(line)

20
account_journal_report_xls/report/nov_account_journal_xls.py

@ -86,6 +86,10 @@ class account_journal_xls(report_xls):
'header': [1, 12, 'text', _render("_('Account')")],
'lines': [1, 0, 'text', _render("l['acc_code']")],
'totals': [1, 0, 'text', None]},
'acc_name': {
'header': [1, 36, 'text', _render("_('Account Name')")],
'lines': [1, 0, 'text', _render("l['acc_name']")],
'totals': [1, 0, 'text', None]},
'aml_name': {
'header': [1, 42, 'text', _render("_('Description')")],
'lines': [1, 0, 'text', _render("l['aml_name']")],
@ -94,6 +98,22 @@ class account_journal_xls(report_xls):
'header': [1, 12, 'text', _render("_('Period')")],
'lines': [1, 0, 'text', _render("l['period']")],
'totals': [1, 0, 'text', None]},
'journal': {
'header': [1, 20, 'text', _render("_('Journal')")],
'lines': [1, 0, 'text', _render("l['journal']")],
'totals': [1, 0, 'text', None]},
'journal_code': {
'header': [1, 10, 'text', _render("_('Journal')")],
'lines': [1, 0, 'text', _render("l['journal_code']")],
'totals': [1, 0, 'text', None]},
'analytic_account': {
'header': [1, 20, 'text', _render("_('Analytic Account')")],
'lines': [1, 0, 'text', _render("l['an_acc_name']")],
'totals': [1, 0, 'text', None]},
'analytic_account_code': {
'header': [1, 20, 'text', _render("_('Analytic Account')")],
'lines': [1, 0, 'text', _render("l['an_acc_code']")],
'totals': [1, 0, 'text', None]},
'partner_name': {
'header': [1, 36, 'text', _render("_('Partner')")],
'lines': [1, 0, 'text', _render("l['partner_name']")],

6
account_journal_report_xls/wizard/__init__.py

@ -3,7 +3,7 @@
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@ -12,11 +12,11 @@
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

6
account_journal_report_xls/wizard/print_journal_wizard.py

@ -3,7 +3,7 @@
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@ -12,11 +12,11 @@
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

Loading…
Cancel
Save