Merge lp:~michelemilidoni/openobject-italia/openobject-italia into lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0

Proposed by michele
Status: Needs review
Proposed branch: lp:~michelemilidoni/openobject-italia/openobject-italia
Merge into: lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0
Diff against target: 129 lines (+53/-23)
2 files modified
l10n_it_prima_nota_cassa/report/prima_nota_cassa.mako (+48/-22)
l10n_it_prima_nota_cassa/report/prima_nota_cassa.py (+5/-1)
To merge this branch: bzr merge lp:~michelemilidoni/openobject-italia/openobject-italia
Reviewer Review Type Date Requested Status
Lorenzo Battistini Needs Information
Review via email: mp+200224@code.launchpad.net

Description of the change

Ho fixato un bug nel report. Il saldo (balance) corrente non veniva incrementato del saldo precedente.

To post a comment you must log in.
Revision history for this message
michele (michelemilidoni) wrote :

C'è anche da dire che il balance non credo abbia molto senso in presenza di più sezionali, ma non so se questo è il posto giusto in cui discuterne.

232. By michele

Inseriti il numero di fattura cliente e il numero di fattura fornitore

Revision history for this message
michele (michelemilidoni) wrote :

Ho effettuato le seguenti modifiche:
1) aggiunti numero e data fattura cliente
2) aggiunti numero e data fattura fornitore
3) miglioramento generale layout grafico

Revision history for this message
Lorenzo Battistini (elbati) wrote :

Ciao Michele,

puoi spiegare il significato di queste due righe

LEFT JOIN account_move_line l2 on (l2.ref=l.ref AND l2.name IN (select number from account_invoice))
LEFT JOIN account_invoice ii on (l2.name = ii.number)

?

Come mai fai il JOIN su 'ref', 'name' e 'number' invece che sugli ID?

Grazie

review: Needs Information
Revision history for this message
michele (michelemilidoni) wrote :

Certo! La registrazione (sezionale) del pagamento di una fattura ha due voci: fornitore e banca.
La voce della registrazione relativa al fornitore contiene il move_id che permetterebbe di fare la join, tuttavia la voce della banca, che è quella che viene presa dalla query per generare la prima nota, non contiene il move_id. Pertanto, la join esistente

LEFT JOIN account_invoice i on (m.id =i.move_id)

non prende assolutamente nulla.

Di conseguenza, il campo i.number nella select:

i.number AS invoice_number

è sempre vuoto.

Ho studiato le join proposte per ovviare a questo problema perché credo che numero e data fattura sono necessari in una prima nota seria. Non so se c'è un metodo migliore (spero di sì, ma non credo), è stato un po' laborioso arrivare a questa soluzione anche perché non avendo il diagramma delle tabelle SQL è un po' complicato avere una visione globale della struttura.

Revision history for this message
Lorenzo Battistini (elbati) wrote :

Quindi, se ho capito bene, vorresti visualizzare, per ogni move.line di pagamento, numero e data della fattura?
E se un pagamento fa riferimento a più fatture?

In generale ti posso dire che il collegamento fra un pagamento e la fattura che il pagamento chiude è dato dai campi reconcile_id e reconcile_partial_id.

Revision history for this message
Lorenzo Battistini (elbati) wrote :

This project is now hosted on https://github.com/OCA/l10n-italy. Please move your proposal there. This guide may help you https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub

Unmerged revisions

232. By michele

Inseriti il numero di fattura cliente e il numero di fattura fornitore

231. By michele

[FIX] calcolo del balance

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_it_prima_nota_cassa/report/prima_nota_cassa.mako'
2--- l10n_it_prima_nota_cassa/report/prima_nota_cassa.mako 2013-02-12 14:30:53 +0000
3+++ l10n_it_prima_nota_cassa/report/prima_nota_cassa.mako 2014-02-16 22:22:53 +0000
4@@ -2,57 +2,83 @@
5 <head>
6 <style type="text/css">
7 ${css}
8+body {
9+font-size: 10px;
10+}
11+.table_detail tr th {
12+ border-right: 1px solid black;
13+ border-bottom: 1px solid black;
14+}
15+.table_detail tr td {
16+ border-right: 1px solid black;
17+ padding: 2px;
18+ font-size: 0.8em;
19+}
20 </style>
21 </head>
22 <body>
23 <h1 class="title">${_("Prime entry")} </h1>
24
25- <table class="basic_table" width="90%">
26+<div style="position:absolute;width:684px; height: 28px; left: 7px; border: 1px solid black; border-radius: 5px">
27+</div>
28+ <table cellspacing="0" cellpadding="0" width="100%">
29 <tr>
30- <td>${ _("Chart of Account") }</td>
31- <td>${ _("Fiscal Year") }</td>
32- <td>${ _("Jounal")}</td>
33- <td>${ _("Filter By") }</td>
34+ <td style="border-right: 1px solid black;">${ _("Chart of Account") }</td>
35+ <td style="border-right: 1px solid black;">${ _("Fiscal Year") }</td>
36+ <td style="border-right: 1px solid black;">${ _("Jounal")}</td>
37+ <td style="border-right: 1px solid black;">${ _("Filter By") }</td>
38 <td>${ _("Target Moves") }</td>
39 </tr>
40 <tr>
41
42- <td>${ get_account(data) or '' }</td>
43- <td>${ get_fiscalyear(data) or '' }</td>
44- <td>${ ', '.join([ lt or '' for lt in get_journal(data)]) }</td>
45- <td>${ get_filter(data) or '' }</td>
46- <td>${ get_target_move(data) }</td>
47+ <td style="border-right: 1px solid black; border-top: 1px solid black;">${ get_account(data) or '' }</td>
48+ <td style="border-right: 1px solid black; border-top: 1px solid black;">${ get_fiscalyear(data) or '' }</td>
49+ <td style="border-right: 1px solid black; border-top: 1px solid black;">${ ', '.join([ lt or '' for lt in get_journal(data)]) }</td>
50+ <td style="border-right: 1px solid black; border-top: 1px solid black;">${ get_filter(data) or '' }</td>
51+ <td style="border-top: 1px solid black;">${ get_target_move(data) }</td>
52 </tr>
53 </table>
54
55 <br />
56-
57- <div id="results">
58+ <div id="results" style="width:684px; left: 7px; border: 1px solid black; border-radius: 5px">
59 % for a in objects:
60 <% setLang(company.partner_id.lang) %>
61- <table class="list_table" width="90%">
62+ <table class="table_detail" width="100%" cellspacing="0" cellpadding="0">
63 <tr>
64 <th> ${ _('Date') }</th>
65 <th> ${ _('Journal') }</th>
66+ <th> ${ _('Reg.') }</th>
67 <th> ${ _('Partner') }</th>
68- <th> ${ _('Entry') }</th>
69 <th> ${ _('Description') }</th>
70- <th> ${ _('Debit') }</th>
71- <th> ${ _('Credit') }</th>
72- <th> ${ _('Balance') }</th>
73+ <th> ${ _('Entrate') }</th>
74+ <th style="border-right: 0"> ${ _('Uscite') }</th>
75+## <th> ${ _('Balance') }</th>
76 </tr>
77
78+ <% amount = 0 %>
79
80 %for line in lines(a) :
81+ <% amount += line['debit'] - line['credit'] %>
82 <tr style="page-break-inside: avoid; vertical-align:text-top;">
83 <td>${ formatLang(line['ldate'], date=True) or ''|entity }</td>
84 <td>${ line['jname'] or ''|entity }</td>
85+ <td style="font-size: 0.8em;">${ line['move'] or ''|entity }</td>
86 <td>${ line['partner_name'] or ''|entity }</td>
87- <td>${ line['move'] or ''|entity }</td>
88- <td>${ line['lname'] or ''|entity }</td>
89- <td>${ formatLang(line['debit'], digits=get_digits(dp='Account')) |entity}</td>
90- <td>${ formatLang(line['credit'], digits=get_digits(dp='Account')) |entity}</td>
91- <td>${ line['debit'] - line['credit'] |entity}</td>
92+ <td style="font-size: 0.8em;">
93+ % if line['lname'] != '/':
94+ ${ line['lname'] or ''|entity }
95+ % endif
96+ % if line['supplier_invoice_number']:
97+ ${ line['supplier_invoice_number'] or ''|entity }
98+ del ${ formatLang(line['invoice_date'], date=True) or ''|entity }
99+ % elif line['invoice_number']:
100+ ${ line['invoice_number'] or ''|entity }
101+ del ${ formatLang(line['invoice_date'], date=True) or ''|entity }
102+ % endif
103+ </td>
104+ <td style="text-align:right">${ formatLang(line['debit'], digits=get_digits(dp='Account')) |entity}</td>
105+ <td style="border: 0;text-align:right;">${ formatLang(line['credit'], digits=get_digits(dp='Account')) |entity}</td>
106+## <td>${ formatLang(amount, digits=get_digits(dp='Account')) |entity}</td>
107 </tr>
108 %endfor
109 </table>
110
111=== modified file 'l10n_it_prima_nota_cassa/report/prima_nota_cassa.py'
112--- l10n_it_prima_nota_cassa/report/prima_nota_cassa.py 2013-10-19 14:52:15 +0000
113+++ l10n_it_prima_nota_cassa/report/prima_nota_cassa.py 2014-02-16 22:22:53 +0000
114@@ -145,10 +145,14 @@
115 c.symbol AS currency_code,
116 i.id AS invoice_id,
117 i.type AS invoice_type,
118- i.number AS invoice_number,
119+ ii.number AS invoice_number,
120+ ii.supplier_invoice_number,
121+ ii.create_date AS invoice_date,
122 p.name AS partner_name
123 FROM account_move_line l
124 JOIN account_move m on (l.move_id=m.id)
125+ LEFT JOIN account_move_line l2 on (l2.ref=l.ref AND l2.name IN (select number from account_invoice))
126+ LEFT JOIN account_invoice ii on (l2.name = ii.number)
127 LEFT JOIN res_currency c on (l.currency_id=c.id)
128 LEFT JOIN res_partner p on (l.partner_id=p.id)
129 LEFT JOIN account_invoice i on (m.id =i.move_id)

Subscribers

People subscribed via source and target branches