openobject-italia-core-devs team mailing list archive
-
openobject-italia-core-devs team
-
Mailing list archive
-
Message #02255
[Merge] lp:~scigghia/openobject-italia/6.1-openobject-italia-adding-stampa-distinte into lp:openobject-italia/6.1
Andrea Cometa has proposed merging lp:~scigghia/openobject-italia/6.1-openobject-italia-adding-stampa-distinte into lp:openobject-italia/6.1.
Requested reviews:
OpenERP Italia core devs (openobject-italia-core-devs)
For more details, see:
https://code.launchpad.net/~scigghia/openobject-italia/6.1-openobject-italia-adding-stampa-distinte/+merge/220517
ricevute bancarie: aggiunto modulo con stampa riepilogo scadenze per distinta
--
https://code.launchpad.net/~scigghia/openobject-italia/6.1-openobject-italia-adding-stampa-distinte/+merge/220517
Your team OpenERP Italia core devs is requested to review the proposed merge of lp:~scigghia/openobject-italia/6.1-openobject-italia-adding-stampa-distinte into lp:openobject-italia/6.1.
=== added directory 'l10n_it_ricevute_bancarie_report'
=== added file 'l10n_it_ricevute_bancarie_report/__init__.py'
--- l10n_it_ricevute_bancarie_report/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_it_ricevute_bancarie_report/__init__.py 2014-05-21 18:53:21 +0000
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Associazione OpenERP Italia
+# (<http://www.openerp-italia.org>).
+#
+# 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 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 riba_parser
=== added file 'l10n_it_ricevute_bancarie_report/__openerp__.py'
--- l10n_it_ricevute_bancarie_report/__openerp__.py 1970-01-01 00:00:00 +0000
+++ l10n_it_ricevute_bancarie_report/__openerp__.py 2014-05-21 18:53:21 +0000
@@ -0,0 +1,35 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Associazione OpenERP Italia
+# (<http://www.openerp-italia.org>).
+#
+# 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 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": "Reports Ricevute Bancarie",
+ "description": 'Reports Ricevute Bancarie',
+ "version": "0.1",
+ "depends": ["report_webkit", "l10n_it_ricevute_bancarie"],
+ "category": "Reporting",
+ "author": "Andrea Cometa",
+ "url": "http://www.andreacometa.it",
+ "data": ["reports.xml", ],
+ "installable": True,
+ "auto_install": False,
+ "certificate": "",
+ 'images': [],
+}
=== added file 'l10n_it_ricevute_bancarie_report/reports.xml'
--- l10n_it_ricevute_bancarie_report/reports.xml 1970-01-01 00:00:00 +0000
+++ l10n_it_ricevute_bancarie_report/reports.xml 2014-05-21 18:53:21 +0000
@@ -0,0 +1,338 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="riba_portrait_header" model="ir.header_webkit">
+ <field name="footer_html"></field>
+ <field name="orientation">Portrait</field>
+ <field name="format">A4</field>
+ <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-bottom:0px solid lightGray; margin:0;" onload="subst()">
+ ${_debug or ''|n} </body>
+ </html>]]>
+ </field>
+ <field eval="0" name="margin_top"/>
+ <field eval="0" name="margin_bottom"/>
+ <field name="css" ><![CDATA[
+
+ body {
+ font-family:helvetica;
+ font-size:12;
+ }
+
+ .logo {
+ width:100%;
+ text-align:right;
+ }
+
+ .logo_centered {
+ width:100%;
+ text-align:center;
+ }
+
+ hr {
+ width: 100%;
+ align: center;
+ border: 0px;
+ color: #000;
+ background-color: #000;
+ height: 1px;
+ }
+
+ .simple_info {
+ width: 50%;
+ align: left;
+ float: left;
+ margin: 2px 0px;
+ }
+
+ .text_info {
+ width:80%;
+ margin:0px auto;
+ text-align:left;
+ }
+
+ .centered {
+ width:100%;
+ text-align:center;
+ }
+
+ .basic_table{
+ width:100%;
+ text-align:center;
+ border:1px solid #000;
+ border-collapse: collapse;
+ margin:10px 0px;
+ }
+
+ .contract_table {
+ width:100%;
+ text-align:left;
+ border:1px solid #000;
+ border-collapse: collapse;
+ margin:10px 0px;
+ font-size:10;
+ }
+
+ .contract_table td {
+ border:1px solid #000;
+ padding:2px;
+ vertical-align:center;
+ }
+
+ .basic_table td {
+ border:1px solid #000;
+ padding:2px;
+ vertical-align:center;
+ }
+
+ .particulars_main {
+ width:100%;
+ margin-bottom:5px;
+ }
+
+ .particulars {
+ width:50%;
+ float:left;
+ }
+
+ .details {
+ width:80%;
+ text-align:center;
+ margin:10px 0px;
+ }
+
+ .sx {
+ float:left;
+ margin-left:0px;
+ margin-right:auto;
+ }
+
+ .dx {
+ float:right;
+ margin-left:auto;
+ margin-right:0px;
+ }
+
+ .clear {
+ clear:both;
+ }
+
+ .space {
+ margin:20px 0px;
+ }
+
+ .elevate {
+ margin-top:-8px;
+ }
+
+ .page-break {
+ page-break-after: always;
+ }
+
+ .w5 {
+ width: 5%;
+ float: left;
+ }
+
+ .w10 {
+ width: 10%;
+ float: left;
+ }
+
+ .w15 {
+ width: 15%;
+ float: left;
+ }
+
+ .w20 {
+ width: 20%;
+ float: left;
+ }
+
+ .w25 {
+ width: 25%;
+ float: left;
+ }
+
+ .w30 {
+ width: 30%;
+ float: left;
+ }
+
+ .w33 {
+ width: 33%;
+ float: left;
+ }
+
+ .w35 {
+ width: 35%;
+ float: left;
+ }
+
+ .w40 {
+ width: 40%;
+ float: left;
+ }
+
+ .w45 {
+ width: 45%;
+ float: left;
+ }
+
+ .w50 {
+ width: 50%;
+ float: left;
+ }
+
+ .w60 {
+ width: 60%;
+ float: left;
+ }
+
+ .w75 {
+ width: 75%;
+ float: left;
+ }
+
+ .w80 {
+ width: 80%;
+ float: left;
+ }
+
+ .w90 {
+ width: 90%;
+ float: left;
+ }
+
+ .w95 {
+ width: 90%;
+ float: left;
+ }
+
+ .w100 {
+ width: 100%;
+ float: left;
+ }
+
+ .indented {
+ margin-left: 10px;
+ }
+
+ .font_6 {
+ font-size: 6px;
+ }
+
+ .font_7 {
+ font-size: 6px;
+ }
+
+ .font_8 {
+ font-size: 8px;
+ }
+
+ .font_9 {
+ font-size: 9px;
+ }
+
+ .font_10 {
+ font-size: 10px;
+ }
+
+ .font_12 {
+ font-size: 12px;
+ }
+
+ .font_big {
+ font-size: 14px;
+ font-weight: bold;
+ }
+
+ .noborder_table{
+ width:100%;
+ text-align:center;
+ border:0;
+ border-collapse: collapse;
+ margin:10px 0px;
+ }
+
+ .noborder_table td {
+ border:0;
+ padding:2px;
+ vertical-align:center;
+ }
+
+ .noborder_table table {
+ border:1px solid #000;
+ }
+
+ .rotate_90 {
+ -webkit-transform: rotate(-90deg);
+ }
+
+ .bordi_arrotondati {
+ border:1px solid #656565;
+ border-radius: 5px;
+ -webkit-border-radius: 5px;
+ }
+
+ .distance {
+ padding:10px 0px;
+ }
+
+ .separated_bottom {
+ margin-bottom: 5px;
+ }
+
+ .grey_border {
+ border-color:#B5B5B5;
+ }
+
+ .info_table td {
+ border:1px solid;
+ border-radius: 5px;
+ -webkit-border-radius: 5px;
+ border-color:#B5B5B5;
+ }
+
+ .info_table p.data {
+ font-weight:bold;
+ }
+
+ ]]>
+ </field>
+ <field name="name">Ri.Ba. Reports Header</field>
+ </record>
+
+ <report auto="False"
+ id="riba_riepilogo_scadenze"
+ model="riba.distinta"
+ name="riba.report.riepilogo_scadenze"
+ file="l10n_it_ricevute_bancarie_report/templates/riepilogo_scadenze_distinte_riba.mako"
+ string="Riepilogo Scadenze Ri.Ba."
+ report_type="webkit"
+ webkit_header="riba_portrait_header"
+ />
+
+ </data>
+</openerp>
=== added file 'l10n_it_ricevute_bancarie_report/riba_parser.py'
--- l10n_it_ricevute_bancarie_report/riba_parser.py 1970-01-01 00:00:00 +0000
+++ l10n_it_ricevute_bancarie_report/riba_parser.py 2014-05-21 18:53:21 +0000
@@ -0,0 +1,70 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Associazione OpenERP Italia
+# (<http://www.openerp-italia.org>).
+#
+# 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 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 datetime import datetime
+from osv import osv
+from osv import fields
+
+
+class report_riba_webkit(report_sxw.rml_parse):
+
+ def group_riba_data(self, objects):
+ res = {}
+ for distinta in objects:
+ for line in distinta.line_ids:
+ if not line.due_date in res:
+ res.update({line.due_date: [line]})
+ else:
+ res[line.due_date] = res[line.due_date] + [line]
+ print res
+ return res
+
+ def page_number(self, lines, row_limit):
+ if not lines or not row_limit:
+ return 0
+ division = float(len(lines)) / float(row_limit)
+ pn = int(ceil(division))
+ return pn
+
+ def newlined_text(self, text):
+ if text:
+ return text.replace('\n', '<br/>')
+
+ def __init__(self, cr, uid, name, context):
+ super(report_riba_webkit, self).__init__(cr, uid, name,
+ context=context)
+ self.localcontext.update({
+ 'datetime': datetime,
+ 'time': time,
+ 'cr': cr,
+ 'uid': uid,
+ 'group_riba_data': self.group_riba_data,
+ 'newlined_text': self.newlined_text,
+ 'page_number': self.page_number,
+ })
+
+report_sxw.report_sxw(
+ 'report.riba.report.riepilogo_scadenze', 'riba',
+ 'l10n_it_ricevute_bancarie_report/template/\
+riepilogo_scadenze_distinte_riba.mako',
+ parser=report_riba_webkit)
=== added directory 'l10n_it_ricevute_bancarie_report/templates'
=== added file 'l10n_it_ricevute_bancarie_report/templates/riepilogo_scadenze_distinte_riba.mako'
--- l10n_it_ricevute_bancarie_report/templates/riepilogo_scadenze_distinte_riba.mako 1970-01-01 00:00:00 +0000
+++ l10n_it_ricevute_bancarie_report/templates/riepilogo_scadenze_distinte_riba.mako 2014-05-21 18:53:21 +0000
@@ -0,0 +1,47 @@
+<html>
+<head>
+ <style type="text/css">
+ ${css}
+ </style>
+</head>
+<body class="font_10" style="margin:0px;padding:0px;">
+
+ <p class="w100 centered" style="font-size: 24px;"><b>RIEPILOGO DISTINTE RICEVUTE BANCARIE ${datetime.today().strftime("%d/%m/%y")}</b></p>
+
+ <table class="w100">
+ %for due_date,lines in group_riba_data(objects).items():
+ <tr style="background-color: #cecece;">
+ <td colspan="3">${due_date}</td>
+ </tr>
+ <tr>
+ <td>DISTINTA</td>
+ <td>NR RIGA</td>
+ <td>CLIENTE</td>
+ <td>RIF</td>
+ <td>IMPORTO</td>
+ <td>SCADENZA</td>
+ </tr>
+ <%importo=0%>
+ %for l in lines:
+ %if l.due_date == due_date:
+ <%importo+=l.amount%>
+ <tr>
+ <td>${l.distinta_id.name or ''}</td>
+ <td>${l.sequence or ''}</td>
+ <td>${l.partner_id.name or ''}</td>
+ <td>${l.invoice_number or ''}</td>
+ <td>${l.amount or ''}</td>
+ <td>${l.due_date or ''}</td>
+ </tr>
+ %endif
+ %endfor
+ <tr>
+ <td> </td>
+ <td><b>TOTALE:</b></td>
+ <td><b>${importo}</b></td>
+ </tr>
+ %endfor
+
+ </table>
+</body>
+</html>
Follow ups