Alessandro Camilli has proposed merging lp:~a-camilli/openobject-italia/7.0-libro_giornale into lp:openobject-italia/7.0.
Requested reviews: OpenERP Italia core devs (openobject-italia-core-devs) For more details, see: https://code.launchpad.net/~a-camilli/openobject-italia/7.0-libro_giornale/+merge/208756 Porting dalla 6.1 -- https://code.launchpad.net/~a-camilli/openobject-italia/7.0-libro_giornale/+merge/208756 Your team OpenERP Italia core devs is requested to review the proposed merge of lp:~a-camilli/openobject-italia/7.0-libro_giornale into lp:openobject-italia/7.0.
=== added directory 'account_central_journal' === added file 'account_central_journal/AUTHORS.txt' --- account_central_journal/AUTHORS.txt 1970-01-01 00:00:00 +0000 +++ account_central_journal/AUTHORS.txt 2014-02-28 10:01:57 +0000 @@ -0,0 +1,2 @@ +Daniele Arcangeli <[email protected]> +Alessandro Camilli <[email protected]> \ No newline at end of file === added file 'account_central_journal/__init__.py' --- account_central_journal/__init__.py 1970-01-01 00:00:00 +0000 +++ account_central_journal/__init__.py 2014-02-28 10:01:57 +0000 @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2012 ISA s.r.l. (<http://www.isa.it>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 +# 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/>. +# +############################################################################## + +import account +import wizard +import report + === added file 'account_central_journal/__openerp__.py' --- account_central_journal/__openerp__.py 1970-01-01 00:00:00 +0000 +++ account_central_journal/__openerp__.py 2014-02-28 10:01:57 +0000 @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2011 ISA s.r.l. (<http://www.isa.it>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 +# 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/>. +# +############################################################################## + +{ + 'name': 'Account Central Journal', + 'version': '3', + 'author': "ISA S.r.l.", + 'website': 'http://www.isa.it', + 'category': 'Generic Modules/Accounting', + 'description': """ +Managing the printing of the "Central Journal" """, + 'depends' : [ + 'base', + 'account', + 'report_webkit', + ], + 'init_xml' : [], + 'update_xml': [ + 'report/webkit_model.xml', + 'report/report.xml', + 'wizard/central_journal_report.xml', + 'account_view.xml', + ], + 'demo_xml': [], + 'test':[], + 'installable': True, + 'active': False, + 'certificate': '', +} === added file 'account_central_journal/account.py' --- account_central_journal/account.py 1970-01-01 00:00:00 +0000 +++ account_central_journal/account.py 2014-02-28 10:01:57 +0000 @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2012 ISA s.r.l. (<http://www.isa.it>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 +# 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/>. +# +############################################################################## + +from osv import fields, orm +from tools.translate import _ +import decimal_precision as dp + +class account_fiscalyear(orm.Model): + _inherit = "account.fiscalyear" + _description = "Fiscal Year" + _columns = { + 'date_last_print': fields.date('Last printed date', readonly=True), + 'progressive_page_number': fields.integer('Progressive of the page', required=True, readonly=True), + 'progressive_line_number': fields.integer('Progressive line', required=True, readonly=True), + 'progressive_credit': fields.float('Progressive Credit', digits_compute=dp.get_precision('Account'), required=True, readonly=True), + 'progressive_debit': fields.float('Progressive Debit', digits_compute=dp.get_precision('Account'), required=True, readonly=True), + } + + _defaults = { + 'progressive_page_number': 0, + 'progressive_line_number': 0, + 'progressive_credit': lambda *a: float(), + 'progressive_debit': lambda *a: float(), + } === added file 'account_central_journal/account_view.xml' --- account_central_journal/account_view.xml 1970-01-01 00:00:00 +0000 +++ account_central_journal/account_view.xml 2014-02-28 10:01:57 +0000 @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <!-- + Account Fiscal Year inheritancy + --> + + <record id="account_central_journal_form_view" model="ir.ui.view"> + <field name="name">account.central.journal.form</field> + <field name="model">account.fiscalyear</field> + <field name="inherit_id" ref="account.view_account_fiscalyear_form"/> + <field name="arch" type="xml"> + <field name="end_journal_period_id" position="after"> + <separator colspan="4" string="Central journal info"/> + <field name="date_last_print"/> + <newline/> + <field name="progressive_page_number"/> + <field name="progressive_line_number"/> + <field name="progressive_credit"/> + <field name="progressive_debit"/> + </field> + </field> + </record> + + </data> +</openerp> === added directory 'account_central_journal/i18n' === added file 'account_central_journal/i18n/account_central_journal.pot' --- account_central_journal/i18n/account_central_journal.pot 1970-01-01 00:00:00 +0000 +++ account_central_journal/i18n/account_central_journal.pot 2014-02-28 10:01:57 +0000 @@ -0,0 +1,235 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_central_journal +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.0.3\n" +"Report-Msgid-Bugs-To: [email protected]\n" +"POT-Creation-Date: 2012-03-16 14:39+0000\n" +"PO-Revision-Date: 2012-03-16 14:39+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_central_journal +#: model:ir.actions.act_window,name:account_central_journal.central_journal_report_action +#: model:ir.ui.menu,name:account_central_journal.menu_central_journal_report_action +msgid "Print Central Journal" +msgstr "" + +#. module: account_central_journal +#: report:report.central_journal_report:135 +msgid "Account code" +msgstr "" + +#. module: account_central_journal +#: report:report.central_journal_report:144 +#: report:report.central_journal_report:170 +msgid "Progressives =>" +msgstr "" + +#. module: account_central_journal +#: model:ir.model,name:account_central_journal.model_central_journal_report +#: model:ir.model,name:account_central_journal.model_wizard_central_journal_report +#: view:wizard.central.journal.report:0 +msgid "Printing parameters of the Center Journal" +msgstr "" + +#. module: account_central_journal +#: field:wizard.central.journal.report,print_state:0 +msgid "State" +msgstr "" + +#. module: account_central_journal +#: selection:wizard.central.journal.report,print_state:0 +msgid "Draft" +msgstr "" + +#. module: account_central_journal +#: report:report.central_journal_report:134 +msgid "Account move" +msgstr "" + +#. module: account_central_journal +#: report:report.central_journal_report:138 +msgid "Debit" +msgstr "" + +#. module: account_central_journal +#: view:wizard.central.journal.report:0 +msgid "Print" +msgstr "" + +#. module: account_central_journal +#: field:account.fiscalyear,progressive_credit:0 +msgid "Progressive Credit" +msgstr "" + +#. module: account_central_journal +#: model:ir.module.module,description:account_central_journal.module_meta_information +msgid "\n" +"Managing the printing of the \"Central Journal\" " +msgstr "" + +#. module: account_central_journal +#: constraint:account.fiscalyear:0 +msgid "Error! You cannot define overlapping fiscal years" +msgstr "" + +#. module: account_central_journal +#: report:report.central_journal_report:133 +msgid "Ref" +msgstr "" + +#. module: account_central_journal +#: field:account.fiscalyear,date_last_print:0 +msgid "Last printed date" +msgstr "" + +#. module: account_central_journal +#: selection:wizard.central.journal.report,print_state:0 +msgid "Printed" +msgstr "" + +#. module: account_central_journal +#: report:report.central_journal_report:136 +msgid "Account name" +msgstr "" + +#. module: account_central_journal +#: report:report.central_journal_report:132 +msgid "Date" +msgstr "" + +#. module: account_central_journal +#: code:addons/account_central_journal/wizard/central_journal_report.py:51 +#: code:addons/account_central_journal/wizard/central_journal_report.py:54 +#, python-format +msgid "Wrong dates !" +msgstr "" + +#. module: account_central_journal +#: view:wizard.central.journal.report:0 +msgid "Dates movements" +msgstr "" + +#. module: account_central_journal +#: field:account.fiscalyear,progressive_debit:0 +msgid "Progressive Debit" +msgstr "" + +#. module: account_central_journal +#: report:report.central_journal_report:124 +#: field:wizard.central.journal.report,date_move_line_to:0 +msgid "to date" +msgstr "" + +#. module: account_central_journal +#: report:report.central_journal_report:137 +msgid "Name" +msgstr "" + +#. module: account_central_journal +#: model:ir.module.module,shortdesc:account_central_journal.module_meta_information +msgid "Account Central Journal" +msgstr "" + +#. module: account_central_journal +#: field:account.fiscalyear,progressive_line_number:0 +msgid "Progressive line" +msgstr "" + +#. module: account_central_journal +#: code:addons/account_central_journal/wizard/central_journal_report.py:54 +#, python-format +msgid "The end date can not be greater than today's date." +msgstr "" + +#. module: account_central_journal +#: report:report.central_journal_report:139 +msgid "Credit" +msgstr "" + +#. module: account_central_journal +#: model:ir.model,name:account_central_journal.model_account_fiscalyear +#: field:wizard.central.journal.report,fiscalyear:0 +msgid "Fiscal Year" +msgstr "" + +#. module: account_central_journal +#: constraint:account.fiscalyear:0 +msgid "Error! The duration of the Fiscal Year is invalid. " +msgstr "" + +#. module: account_central_journal +#: code:addons/account_central_journal/wizard/central_journal_report.py:51 +#, python-format +msgid "The end date must be greater than the initial date." +msgstr "" + +#. module: account_central_journal +#: view:wizard.central.journal.report:0 +msgid "Reference" +msgstr "" + +#. module: account_central_journal +#: model:ir.actions.report.xml,name:account_central_journal.central_journal_report_id +msgid "central_journal" +msgstr "" + +#. module: account_central_journal +#: field:account.fiscalyear,progressive_page_number:0 +msgid "Progressive of the page" +msgstr "" + +#. module: account_central_journal +#: report:report.central_journal_report:124 +msgid "TEST PRINTING" +msgstr "" + +#. module: account_central_journal +#: view:account.fiscalyear:0 +msgid "Central journal info" +msgstr "" + +#. module: account_central_journal +#: report:report.central_journal_report:127 +msgid "Page:" +msgstr "" + +#. module: account_central_journal +#: report:report.central_journal_report:124 +#: field:wizard.central.journal.report,date_move_line_from:0 +#: field:wizard.central.journal.report,date_move_line_from_view:0 +msgid "From date" +msgstr "" + +#. module: account_central_journal +#: selection:wizard.central.journal.report,print_state:0 +msgid "Ready for printing" +msgstr "" + +#. module: account_central_journal +#: view:wizard.central.journal.report:0 +msgid "Cancel" +msgstr "" + +#. module: account_central_journal +#: report:report.central_journal_report:131 +msgid "Row" +msgstr "" + +#. module: account_central_journal +#: view:wizard.central.journal.report:0 +msgid "Final print" +msgstr "" + +#. module: account_central_journal +#: report:report.central_journal_report:116 +msgid "ACCOUNT JOURNAL" +msgstr "" + === added file 'account_central_journal/i18n/it.mo' Binary files account_central_journal/i18n/it.mo 1970-01-01 00:00:00 +0000 and account_central_journal/i18n/it.mo 2014-02-28 10:01:57 +0000 differ === added file 'account_central_journal/i18n/it.po' --- account_central_journal/i18n/it.po 1970-01-01 00:00:00 +0000 +++ account_central_journal/i18n/it.po 2014-02-28 10:01:57 +0000 @@ -0,0 +1,233 @@ +msgid "" +msgstr "" +"Project-Id-Version: Account Central Journal\n" +"Report-Msgid-Bugs-To: [email protected]\n" +"POT-Creation-Date: 2012-03-16 14:39+0000\n" +"PO-Revision-Date: \n" +"Last-Translator: Daniele Arcangeli <[email protected]>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. module: account_central_journal +#: model:ir.actions.act_window,name:account_central_journal.central_journal_report_action +#: model:ir.ui.menu,name:account_central_journal.menu_central_journal_report_action +msgid "Print Central Journal" +msgstr "Giornale Centralizzato" + +#. module: account_central_journal +#: report:report.central_journal_report:135 +msgid "Account code" +msgstr "Codice Conto" + +#. module: account_central_journal +#: report:report.central_journal_report:144 +#: report:report.central_journal_report:170 +msgid "Progressives =>" +msgstr "Progressivi =>" + +#. module: account_central_journal +#: model:ir.model,name:account_central_journal.model_central_journal_report +#: model:ir.model,name:account_central_journal.model_wizard_central_journal_report +#: view:wizard.central.journal.report:0 +msgid "Printing parameters of the Center Journal" +msgstr "Parametri di stampa del Giornale Centralizzato" + +#. module: account_central_journal +#: field:wizard.central.journal.report,print_state:0 +msgid "State" +msgstr "Stato" + +#. module: account_central_journal +#: selection:wizard.central.journal.report,print_state:0 +msgid "Draft" +msgstr "Bozza" + +#. module: account_central_journal +#: report:report.central_journal_report:134 +msgid "Account move" +msgstr "Movimento" + +#. module: account_central_journal +#: report:report.central_journal_report:138 +msgid "Debit" +msgstr "Dare" + +#. module: account_central_journal +#: view:wizard.central.journal.report:0 +msgid "Print" +msgstr "Stampa" + +#. module: account_central_journal +#: field:account.fiscalyear,progressive_credit:0 +msgid "Progressive Credit" +msgstr "Progressivo Avere" + +#. module: account_central_journal +#: model:ir.module.module,description:account_central_journal.module_meta_information +msgid "" +"\n" +"Managing the printing of the \"Central Journal\" " +msgstr "" +"\n" +"Gestione della stampa del \"Giornale Centralizzato\"" + +#. module: account_central_journal +#: constraint:account.fiscalyear:0 +msgid "Error! You cannot define overlapping fiscal years" +msgstr "Errore! Non è possibile definire una sovrapposizione degli anni fiscali." + +#. module: account_central_journal +#: report:report.central_journal_report:133 +msgid "Ref" +msgstr "Rif." + +#. module: account_central_journal +#: field:account.fiscalyear,date_last_print:0 +msgid "Last printed date" +msgstr "Data ultima stampa" + +#. module: account_central_journal +#: selection:wizard.central.journal.report,print_state:0 +msgid "Printed" +msgstr "Stampato" + +#. module: account_central_journal +#: report:report.central_journal_report:136 +msgid "Account name" +msgstr "Conto" + +#. module: account_central_journal +#: report:report.central_journal_report:132 +msgid "Date" +msgstr "Data" + +#. module: account_central_journal +#: code:addons/account_central_journal/wizard/central_journal_report.py:51 +#: code:addons/account_central_journal/wizard/central_journal_report.py:54 +#, python-format +msgid "Wrong dates !" +msgstr "Date errate !" + +#. module: account_central_journal +#: view:wizard.central.journal.report:0 +msgid "Dates movements" +msgstr "Date dei movimenti" + +#. module: account_central_journal +#: field:account.fiscalyear,progressive_debit:0 +msgid "Progressive Debit" +msgstr "Progressivo Dare" + +#. module: account_central_journal +#: report:report.central_journal_report:124 +#: field:wizard.central.journal.report,date_move_line_to:0 +msgid "to date" +msgstr "alla data" + +#. module: account_central_journal +#: report:report.central_journal_report:137 +msgid "Name" +msgstr "Descrizione movimento" + +#. module: account_central_journal +#: model:ir.module.module,shortdesc:account_central_journal.module_meta_information +msgid "Account Central Journal" +msgstr "Giornale Centralizzato" + +#. module: account_central_journal +#: field:account.fiscalyear,progressive_line_number:0 +msgid "Progressive line" +msgstr "Progressivo della riga" + +#. module: account_central_journal +#: code:addons/account_central_journal/wizard/central_journal_report.py:54 +#, python-format +msgid "The end date can not be greater than today's date." +msgstr "La data finale non può essere maggiore della data odierna" + +#. module: account_central_journal +#: report:report.central_journal_report:139 +msgid "Credit" +msgstr "Avere" + +#. module: account_central_journal +#: model:ir.model,name:account_central_journal.model_account_fiscalyear +#: field:wizard.central.journal.report,fiscalyear:0 +msgid "Fiscal Year" +msgstr "Anno Fiscale" + +#. module: account_central_journal +#: constraint:account.fiscalyear:0 +msgid "Error! The duration of the Fiscal Year is invalid. " +msgstr "Errore! La durata dell'anno fiscale non è valida." + +#. module: account_central_journal +#: code:addons/account_central_journal/wizard/central_journal_report.py:51 +#, python-format +msgid "The end date must be greater than the initial date." +msgstr "La data finale deve essere maggiore della data iniziale" + +#. module: account_central_journal +#: view:wizard.central.journal.report:0 +msgid "Reference" +msgstr "Riferimento" + +#. module: account_central_journal +#: model:ir.actions.report.xml,name:account_central_journal.central_journal_report_id +msgid "central_journal" +msgstr "Giornale Centralizzato Report Webkit" + +#. module: account_central_journal +#: field:account.fiscalyear,progressive_page_number:0 +msgid "Progressive of the page" +msgstr "Progressivo della pagina" + +#. module: account_central_journal +#: report:report.central_journal_report:124 +msgid "TEST PRINTING" +msgstr "STAMPA DI PROVA" + +#. module: account_central_journal +#: view:account.fiscalyear:0 +msgid "Central journal info" +msgstr "Informazione del Giornale Centralizzato" + +#. module: account_central_journal +#: report:report.central_journal_report:127 +msgid "Page:" +msgstr "Pagina:" + +#. module: account_central_journal +#: report:report.central_journal_report:124 +#: field:wizard.central.journal.report,date_move_line_from:0 +#: field:wizard.central.journal.report,date_move_line_from_view:0 +msgid "From date" +msgstr "Dalla data" + +#. module: account_central_journal +#: selection:wizard.central.journal.report,print_state:0 +msgid "Ready for printing" +msgstr "Pronto per la stampa" + +#. module: account_central_journal +#: view:wizard.central.journal.report:0 +msgid "Cancel" +msgstr "Annulla" + +#. module: account_central_journal +#: report:report.central_journal_report:131 +msgid "Row" +msgstr "N.riga" + +#. module: account_central_journal +#: view:wizard.central.journal.report:0 +msgid "Final print" +msgstr "Stampa definitiva" + +#. module: account_central_journal +#: report:report.central_journal_report:116 +msgid "ACCOUNT JOURNAL" +msgstr "Giornale di Contabilità" + === added directory 'account_central_journal/report' === added file 'account_central_journal/report/__init__.py' --- account_central_journal/report/__init__.py 1970-01-01 00:00:00 +0000 +++ account_central_journal/report/__init__.py 2014-02-28 10:01:57 +0000 @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2012 ISA s.r.l. (<http://www.isa.it>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 +# 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/>. +# +############################################################################## + +import central_journal_report === added file 'account_central_journal/report/central_journal_report.mako' --- account_central_journal/report/central_journal_report.mako 1970-01-01 00:00:00 +0000 +++ account_central_journal/report/central_journal_report.mako 2014-02-28 10:01:57 +0000 @@ -0,0 +1,190 @@ +<html> +<head> + <meta content="text/html; charset=UTF-8" http-equiv="content-type"/> + <style type="text/css"> + ${css} + + .page_block { + page-break-after: always; + width: 100%; + } + .page_table { + width: 100%; + } + .p_row { + page-break-inside: avoid; + vertical-align:text-top; + height: 21px; + } + .p_cell { + overflow: hidden; + padding: 1px 5px; + } + .p_text { + color: black; + font-size: 9px; + font-family: "Courier New", Courier, monospace; + } + .p_cell_debit, .p_cell_credit { + text-align: right; + } + + .p_row_head { + border: 1px solid black; + border-width: 1px 0px; + } + .p_cell_head { + font-weight: bold; + padding: 3px 5px; + } + + .p_row_page { + font-weight: bold; + } + .p_cell_test { + padding: 5px 5px; + } + .p_cell_page { + padding: 5px 5px; + text-align: right; + } + + .p_row_total { + font-weight: bold; + border: 1px solid gray; + } + .p_row_total_up { + border-width: 0px 0px 1px 0px; + } + .p_row_total_down { + border-width: 1px 0px 0px 0px; + } + .p_cell_progressive { + padding: 3px 5px; + text-align: right; + } + + /* COLUMNS WIDTH + .p_cell_progr_row { width: 15px;} + .p_cell_date { width: 45px;} + .p_cell_ref { width: 70px;} + .p_cell_move_id_name { width: 70px;} + .p_cell_account_id_code { width: 50px;} + .p_cell_account_id_name { width: 200px;} + .p_cell_name { width: 250px;} + .p_cell_debit { width: 70px;} + .p_cell_credit { width: 70px;} + */ + </style> +</head> + +<body> + <% + flag_print_final = data["print_final"] + fiscalyear_id = data["form"]["fiscalyear"] + date_from = data["form"]["date_move_line_from"] + date_to = data["form"]["date_move_line_to"] + %> + <% + print_info = get_print_info(fiscalyear_id) + result_wizard = set_wizard_params(data["form"]) + result_rows = get_movements() + %> + <% + page_rows = 25 + + num_rows = len(result_rows) + num_row = 0 + new_page = True + + progr_page = print_info['start_page'] + progr_row = print_info['start_row'] + %> + <% + debit_tot = print_info['start_debit'] + credit_tot = print_info['start_credit'] + %> + <% result_rows and result_rows[0] and result_rows[0].company_id and result_rows[0].company_id.partner_id and result_rows[0].company_id and result_rows[0].company_id.partner_id.lang and setLang(result_rows[0].company_id and result_rows[0].company_id.partner_id.lang) %> + + %for line in result_rows : + <% num_row = num_row + 1 %> + <% progr_row = progr_row + 1 %> + % if new_page == True: + <% + new_page = False + progr_page = progr_page + 1 + %> + <div class="page_block"> + <table class="header" style="border-bottom: 0px solid black; width: 100%"> + <tr> + <td style="text-align:center;"><span style="font-weight: bold; font-size: 14px;">${_("ACCOUNT JOURNAL")}</span></td> + </tr> + </table> + + <table class="page_table"> + <tr class="p_row p_row_page"> + <td colspan="7" class="p_cell p_cell_test"> + % if flag_print_final == False: + <span class="p_text">${ _("TEST PRINTING") } ${ _("From date") } ${ formatLang(date_from, date=True) or ''|entity } ${ _("to date") } ${ formatLang(date_to, date=True) or ''|entity }</span> + % endif + </td> + <td colspan="2" class="p_cell p_cell_page"><span class="p_text p_page">${ _("Page:") } ${progr_page} / ${print_info['year_name']}</span></td> + </tr> + + <tr class="p_row p_row_head"> + <td class="p_cell p_cell_head"><span class="p_text">${ _("Row") }</span></td> + <td class="p_cell p_cell_head"><span class="p_text">${ _("Date") }</span></td> + <td class="p_cell p_cell_head"><span class="p_text">${ _("Ref") }</span></td> + <td class="p_cell p_cell_head"><span class="p_text">${ _("Account move") }</span></td> + <td class="p_cell p_cell_head"><span class="p_text">${ _("Account code") }</span></td> + <td class="p_cell p_cell_head"><span class="p_text">${ _("Account name") }</span></td> + <td class="p_cell p_cell_head"><span class="p_text">${ _("Name") }</span></td> + <td class="p_cell p_cell_head p_cell_debit"><span class="p_text">${ _("Debit") }</span></td> + <td class="p_cell p_cell_head p_cell_credit"><span class="p_text">${ _("Credit") }</span></td> + </tr> + + <tr class="p_row p_row_total p_row_total_up"> + <td colspan="6"></td> + <td class="p_cell p_cell_progressive"><span class="p_text">${ _("Progressives =>") }</span></td> + <td class="p_cell p_cell_debit"><span class="p_text p_debit">${ formatLang(debit_tot, digits=get_digits(dp='Account')) |entity }</span></td> + <td class="p_cell p_cell_credit"><span class="p_text p_credit">${ formatLang(credit_tot, digits=get_digits(dp='Account')) |entity }</span></td> + </tr> + % endif + <tr class="p_row"> + <td class="p_cell p_cell_progr_row"><span class="p_text p_progr_row">${progr_row}</span></td> + <td class="p_cell p_cell_date"><span class="p_text p_date">${ formatLang(line.date, date=True) or ''|entity }</span></td> + <td class="p_cell p_cell_ref"><span class="p_text p_ref">${ line.ref or ''|entity }</span></td> + <td class="p_cell p_cell_move_id_name"><span class="p_text p_move_id_name">${ line.move_id.name or ''|entity }</span></td> + <td class="p_cell p_cell_account_id_code"><span class="p_text p_account_id_code">${ line.account_id.code or ''|entity }</span></td> + <td class="p_cell p_cell_account_id_name"><span class="p_text p_account_id_name">${ line.account_id.name or ''|entity }</span></td> + <td class="p_cell p_cell_name"><span class="p_text p_name">${ line.name or ''|entity }</span></td> + <td class="p_cell p_cell_debit"><span class="p_text p_debit">${ formatLang(line.debit, digits=get_digits(dp='Account')) |entity }</span></td> + <td class="p_cell p_cell_credit"><span class="p_text p_credit">${ formatLang(line.credit, digits=get_digits(dp='Account')) |entity }</span></td> + </tr> + <% + debit_tot = debit_tot + line.debit + credit_tot = credit_tot + line.credit + %> + % if (num_row % page_rows) == 0 or num_row == num_rows : + <% + new_page = True + %> + <tr class="p_row p_row_total p_row_total_down"> + <td colspan="6"></td> + <td class="p_cell p_cell_progressive"><span class="p_text">${ _("Progressives =>") }</span></td> + <td class="p_cell p_cell_debit"><span class="p_text p_debit">${ formatLang(debit_tot, digits=get_digits(dp='Account')) |entity }</span></td> + <td class="p_cell p_cell_credit"><span class="p_text p_credit">${ formatLang(credit_tot, digits=get_digits(dp='Account')) |entity }</span></td> + </tr> + </table> + </div> + % endif + %endfor + + <% + if flag_print_final == True: + print_info = set_print_info(fiscalyear_id, date_to, progr_row, progr_page, debit_tot, credit_tot) + %> + +</body> +</html> + === added file 'account_central_journal/report/central_journal_report.py' --- account_central_journal/report/central_journal_report.py 1970-01-01 00:00:00 +0000 +++ account_central_journal/report/central_journal_report.py 2014-02-28 10:01:57 +0000 @@ -0,0 +1,89 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2012 ISA s.r.l. (<http://www.isa.it>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 +# 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/>. +# +############################################################################## + +import time +from report import report_sxw +from osv import osv +from tools.translate import _ + +class central_journal_report(report_sxw.rml_parse): + + def _set_wizard_params(self,form_values): + if form_values['date_move_line_from'] : + date_move_line_from=form_values['date_move_line_from'] + filter=("date",">=",date_move_line_from) + self.filters.append(filter) + if form_values['date_move_line_to'] : + date_move_line_to=form_values['date_move_line_to'] + filter=("date","<=",date_move_line_to) + self.filters.append(filter) + return True + + def _get_print_info(self, fiscalyear_id): + fiscalyear_obj = self.pool.get('account.fiscalyear') + fiscalyear_ids=fiscalyear_obj.search(self.cr,self.uid,[('id','=',fiscalyear_id),]) + fiscalyear_data=fiscalyear_obj.browse(self.cr,self.uid,fiscalyear_ids)[0] + print_info = { + 'start_row': fiscalyear_data.progressive_line_number, + 'start_page': fiscalyear_data.progressive_page_number, + 'start_debit': fiscalyear_data.progressive_debit, + 'start_credit': fiscalyear_data.progressive_credit, + 'year_name': fiscalyear_data.name, + } + return print_info + + def _set_print_info(self, fiscalyear_id, end_date_print, end_row, end_page, end_debit, end_credit): + fiscalyear_obj = self.pool.get('account.fiscalyear') + fiscalyear_ids=fiscalyear_obj.search(self.cr,self.uid,[('id','=',fiscalyear_id),]) + fiscalyear_data=fiscalyear_obj.browse(self.cr,self.uid,fiscalyear_ids)[0] + print_info = { + 'date_last_print': end_date_print, + 'progressive_line_number': end_row, + 'progressive_page_number': end_page, + 'progressive_debit': end_debit, + 'progressive_credit': end_credit, + } + res = fiscalyear_obj.write(self.cr, self.uid, fiscalyear_ids, print_info) + return res + + def _get_movements(self): + move_line_obj = self.pool.get('account.move.line') + line_ids=move_line_obj.search(self.cr,self.uid,self.filters,order="date, move_id asc") + report_lines=move_line_obj.browse(self.cr,self.uid,line_ids) + return report_lines + + def __init__(self, cr, uid, name, context): + self.filters=[] + super(central_journal_report, self).__init__(cr, uid, name, context) + self.localcontext.update({ + 'time': time, + 'cr':cr, + 'uid': uid, + 'get_print_info': self._get_print_info, + 'set_print_info': self._set_print_info, + 'set_wizard_params': self._set_wizard_params, + 'get_movements': self._get_movements, + }) + +report_sxw.report_sxw('report.central_journal_report', + 'account.move.line', + 'addons/account_central_journal/report/central_journal_report.mako', + parser=central_journal_report) === added file 'account_central_journal/report/report.xml' --- account_central_journal/report/report.xml 1970-01-01 00:00:00 +0000 +++ account_central_journal/report/report.xml 2014-02-28 10:01:57 +0000 @@ -0,0 +1,15 @@ +<?xml version="1.0"?> +<openerp> + <data> + <record id="central_journal_report_id" model="ir.actions.report.xml"> + <field name="name">central_journal</field> + <field name="type">ir.actions.report.xml</field> + <field name="model">account.move.line</field> + <field name="report_name">central_journal_report</field> + <field name="report_rml">account_central_journal/report/central_journal_report.mako</field> + <field name="report_type">webkit</field> + <field name="webkit_header" ref="ir_header_central_journal_report"/> + </record> + </data> +</openerp> + === added file 'account_central_journal/report/webkit_model.xml' --- account_central_journal/report/webkit_model.xml 1970-01-01 00:00:00 +0000 +++ account_central_journal/report/webkit_model.xml 2014-02-28 10:01:57 +0000 @@ -0,0 +1,107 @@ +<?xml version="1.0" ?> +<openerp> + <data> + <record id="ir_header_central_journal_report" model="ir.header_webkit"> + <field name="footer_html"></field> + <field eval=""""Landscape"""" name="orientation"/> + <field eval=""""A4"""" name="format"/> + <field name="html"><![CDATA[<html> + <head> + <meta content="text/html; charset=UTF-8" http-equiv="content-type"/> + <script> + function subst() { + var vars={}; + var x=document.location.search.substring(1).split('&'); + for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);} + var x=['frompage','topage','page','webpage','section','subsection','subsubsection']; + for(var i in x) { + var y = document.getElementsByClassName(x[i]); + for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]]; + } + } + </script> + <style type="text/css"> + ${css} + </style> + </head> + <body style="border:0; margin:0;" onload="subst()"> + <table class="header" style="border-bottom: 0px solid black; width: 100%"> + <tr> + <td style="text-align:left; padding: 5px 0px;"> + <span style="font-weight: bold;"> + ${company.partner_id.name |entity} - P.IVA: + ${company.partner_id.vat or '' |entity} <br/> + ${company.partner_id.street or '' |entity} + ${company.partner_id.street2 or '' |entity} + ${company.partner_id.zip or '' |entity} + ${company.partner_id.city or '' |entity} </span> + </td> + </tr> + </table> ${_debug or ''|n} + </body> +</html>]]> +</field> + <field eval="20.0" name="margin_top"/> + <field eval="15.0" name="margin_bottom"/> + <field eval="15.0" name="margin_left"/> + <field eval="15.0" name="margin_right"/> + <field name="css" ><![CDATA[ + /* http://meyerweb.com/eric/tools/css/reset/ + v2.0 | 20110126 + License: none (public domain) + */ + /* START OF RESET CSS */ + html, body, div, span, applet, object, iframe, + h1, h2, h3, h4, h5, h6, p, blockquote, pre, + a, abbr, acronym, address, big, cite, code, + del, dfn, em, img, ins, kbd, q, s, samp, + small, strike, strong, sub, sup, tt, var, + b, u, i, center, + dl, dt, dd, ol, ul, li, + fieldset, form, label, legend, + table, caption, tbody, tfoot, thead, tr, th, td, + article, aside, canvas, details, embed, + figure, figcaption, footer, header, hgroup, + menu, nav, output, ruby, section, summary, + time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; + } + /* HTML5 display-role reset for older browsers */ + article, aside, details, figcaption, figure, + footer, header, hgroup, menu, nav, section { + display: block; + } + body { + line-height: 1; + } + ol, ul { + list-style: none; + } + blockquote, q { + quotes: none; + } + blockquote:before, blockquote:after, + q:before, q:after { + content: ''; + content: none; + } + table { + border-collapse: collapse; + border-spacing: 0; + } + /* END OF RESET CSS */ + + body { + font-family: font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + } +]]> </field> + <field eval=""""Central Journal Report"""" name="name"/> + </record> + </data> +</openerp> === added directory 'account_central_journal/wizard' === added file 'account_central_journal/wizard/__init__.py' --- account_central_journal/wizard/__init__.py 1970-01-01 00:00:00 +0000 +++ account_central_journal/wizard/__init__.py 2014-02-28 10:01:57 +0000 @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2012 ISA s.r.l. (<http://www.isa.it>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 +# 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/>. +# +############################################################################## + +import central_journal_report === added file 'account_central_journal/wizard/central_journal_report.py' --- account_central_journal/wizard/central_journal_report.py 1970-01-01 00:00:00 +0000 +++ account_central_journal/wizard/central_journal_report.py 2014-02-28 10:01:57 +0000 @@ -0,0 +1,135 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2012 ISA s.r.l. (<http://www.isa.it>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 +# 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/>. +# +############################################################################## + +import time +from datetime import datetime, date, timedelta +from osv import osv, fields +from tools.translate import _ + +class central_journal_report(osv.osv_memory): + + _name = 'wizard.central.journal.report' + _description = 'Printing parameters of the Center Journal' + + def _get_fiscal_years(self, cr, uid, context=None): + fiscalyear_obj = self.pool.get('account.fiscalyear') + fiscalyear_ids = fiscalyear_obj.search(cr, uid, [], order="id desc") + fiscalyears = [] + for account_fiscalyear in fiscalyear_obj.browse(cr,uid,fiscalyear_ids) : + fiscalyears.append((account_fiscalyear.id, account_fiscalyear.name)) + return fiscalyears + + def _get_account_fiscalyear_data(self, cr, uid, ids, fiscalyear_id): + fiscalyear_obj = self.pool.get('account.fiscalyear') + fiscalyear_ids=fiscalyear_obj.search(cr,uid,[('id','=',fiscalyear_id),]) + fiscalyear_data=fiscalyear_obj.browse(cr,uid,fiscalyear_ids)[0] + return fiscalyear_data + + def _dates_control(self, str_date_start, str_date_end): + today_date = date.today() + date_start = datetime.strptime(str_date_start,"%Y-%m-%d").date() + date_stop = datetime.strptime(str_date_end,"%Y-%m-%d").date() + if date_start > date_stop: + raise osv.except_osv(_('Wrong dates !'), _("The end date must be greater than the initial date.")) + return False + if date_stop > today_date: + raise osv.except_osv(_('Wrong dates !'), _("The end date can not be greater than today's date.")) + return False + return True + + def _get_report_datas(self, cr, uid, ids, context={}): + wizard_form_datas = self.read(cr, uid, ids)[0] + datas = { + 'ids': [], + 'model': 'account.move.line', + 'form': wizard_form_datas, + } + return datas + + _columns = { + 'date_move_line_from': fields.date('From date', required=True,), + 'date_move_line_from_view': fields.date('From date'), + 'date_move_line_to': fields.date('to date', required=True), + 'fiscalyear': fields.selection(_get_fiscal_years, 'Fiscal Year', required=True), + 'print_state': fields.selection([('draft','Draft'),('print','Ready for printing'),('printed','Printed')],'State',readonly=True), + } + + def onchange_fiscalyear(self, cr, uid, ids, fiscalyear_id=False, context=None): + print_state = 'draft' + date_move_line_from = date_move_line_from_view = False + date_move_line_to = False + if fiscalyear_id: + print_state = 'print' + fiscalyear_data = self._get_account_fiscalyear_data(cr, uid, ids, fiscalyear_id) + #set values + today_date = date.today() + date_start = datetime.strptime(fiscalyear_data.date_start,"%Y-%m-%d").date() + date_stop = datetime.strptime(fiscalyear_data.date_stop,"%Y-%m-%d").date() + #set date_move_line_from + if fiscalyear_data.date_last_print: + date_last_print = datetime.strptime(fiscalyear_data.date_last_print,"%Y-%m-%d").date() + date_move_line_from = date_move_line_from_view = (date_last_print+timedelta(days=1)).__str__() + if date_last_print == date_stop: + date_move_line_from = date_move_line_from_view = date_start.__str__() + print_state = 'printed' + else: + date_move_line_from = date_move_line_from_view = date_start.__str__() + #set date_move_line_to + if today_date > date_stop: + date_move_line_to = date_stop.__str__() + else: + date_move_line_to = (today_date-timedelta(days=1)).__str__() + + return {'value': { + 'date_move_line_from': date_move_line_from, + 'date_move_line_from_view': date_move_line_from_view, + 'date_move_line_to': date_move_line_to, + 'print_state': print_state, + } + } + + def print_report(self, cr, uid, ids, context={}): + datas = self._get_report_datas(cr, uid, ids, context) + if self._dates_control(datas['form']['date_move_line_from'],datas['form']['date_move_line_to']) == False: + return False + datas['print_final'] = False + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'central_journal_report', + 'datas': datas, + } + + def print_report_final(self, cr, uid, ids, context={}): + datas = self._get_report_datas(cr, uid, ids, context) + if self._dates_control(datas['form']['date_move_line_from'],datas['form']['date_move_line_to']) == False: + return False + datas['print_final'] = True + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'central_journal_report', + 'datas': datas, + } + + _defaults = { + 'print_state': 'draft', + } + +central_journal_report() === added file 'account_central_journal/wizard/central_journal_report.xml' --- account_central_journal/wizard/central_journal_report.xml 1970-01-01 00:00:00 +0000 +++ account_central_journal/wizard/central_journal_report.xml 2014-02-28 10:01:57 +0000 @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <!-- + Central Journal Report Filter View + --> + + <record model="ir.ui.view" id="central_journal_report_form_view"> + <field name="name">wizard.central.journal.report.form</field> + <field name="model">wizard.central.journal.report</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Printing parameters of the Center Journal"> + <group colspan="4" col="4"> + <separator colspan="4" string="Reference"/> + <field name="fiscalyear" on_change="onchange_fiscalyear(fiscalyear)"/> + <separator colspan="4" string="Dates movements"/> + <field name="date_move_line_from" invisible="1"/> + <field name="date_move_line_from_view" readonly="1"/> + <field name="date_move_line_to" attrs="{'readonly':[('print_state','!=','print')]}"/> + </group> + <newline/> + <separator colspan="4"/> + <group colspan="4" col="6"> + <field name="print_state"/> + <button special="cancel" string="Cancel" icon='gtk-cancel'/> + <button name="print_report" string="Print" type="object" icon="gtk-print" attrs="{'invisible':[('print_state','=','printed')]}"/> + <button name="print_report_final" string="Final print" type="object" icon="gtk-print" attrs="{'invisible':[('print_state','=','printed')]}"/> + </group> + </form> + </field> + </record> + + <!--action --> + <record model="ir.actions.act_window" id="central_journal_report_action"> + <field name="name">Print Central Journal</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">wizard.central.journal.report</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="target">new</field> + </record> + + <!--this feature works only in this file. Don't move--> + <record model="ir.values" id="central_journal_report_webkit"> + <field name="model_id" ref="account.model_account_move_line" /> + <field name="object" eval="1" /> + <field name="name">central_journal</field> + <field name="key2">client_print_multi</field> + <field name="value" eval="'ir.actions.act_window,' + str(ref('central_journal_report_action'))" /> + <field name="key">action</field> + <field name="model">account.move.line</field> + </record> + + <menuitem id="menu_central_journal_report_action" parent="account.menu_finance_legal_statement" action="central_journal_report_action"/> + + </data> +</openerp>
_______________________________________________ Mailing list: https://launchpad.net/~openobject-italia-core-devs Post to : [email protected] Unsubscribe : https://launchpad.net/~openobject-italia-core-devs More help : https://help.launchpad.net/ListHelp

