Merge lp:~agilebg/openobject-italia/7.0-bug-1214971-elbati into lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0

Proposed by Lorenzo Battistini
Status: Merged
Merged at revision: 223
Proposed branch: lp:~agilebg/openobject-italia/7.0-bug-1214971-elbati
Merge into: lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0
Diff against target: 66 lines (+13/-3)
4 files modified
l10n_it_vat_registries/invoice.py (+10/-0)
l10n_it_vat_registries/templates/registro_iva_acquisti.mako (+1/-1)
l10n_it_vat_registries/templates/registro_iva_corrispettivi.mako (+1/-1)
l10n_it_vat_registries/templates/registro_iva_vendite.mako (+1/-1)
To merge this branch: bzr merge lp:~agilebg/openobject-italia/7.0-bug-1214971-elbati
Reviewer Review Type Date Requested Status
Leonardo Pistone (community) Approve
Review via email: mp+181349@code.launchpad.net
To post a comment you must log in.
224. By Lorenzo Battistini

[FIX] estendo fix per acquisti e corrispettivi

Revision history for this message
Leonardo Pistone (lepistone) wrote :

LGTM, no test.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_it_vat_registries/invoice.py'
2--- l10n_it_vat_registries/invoice.py 2013-05-09 15:48:45 +0000
3+++ l10n_it_vat_registries/invoice.py 2013-08-22 11:10:20 +0000
4@@ -65,6 +65,15 @@
5 res.append(tax_item)
6 index += 1
7 return res
8+
9+ def _get_invoice_total(self, move):
10+ total = 0.0
11+ for move_line in move.line_id:
12+ if move_line.account_id.type == 'receivable':
13+ total += move_line.debit or ( - move_line.credit)
14+ elif move_line.account_id.type == 'payable':
15+ total += ( - move_line.debit) or move_line.credit
16+ return abs(total)
17
18 def build_parent_tax_codes(self, tax_code):
19 res={}
20@@ -132,6 +141,7 @@
21 'used_tax_codes': {},
22 'start_date': self._get_start_date,
23 'end_date': self._get_end_date,
24+ 'invoice_total': self._get_invoice_total,
25 })
26
27 def set_context(self, objects, data, ids, report_type=None):
28
29=== modified file 'l10n_it_vat_registries/templates/registro_iva_acquisti.mako'
30--- l10n_it_vat_registries/templates/registro_iva_acquisti.mako 2013-05-09 15:48:45 +0000
31+++ l10n_it_vat_registries/templates/registro_iva_acquisti.mako 2013-08-22 11:10:20 +0000
32@@ -102,7 +102,7 @@
33 </td><td class="right_without_line">
34 %endif
35 %if line['index']==0:
36- ${ formatLang(object.amount) | entity}
37+ ${ formatLang(invoice_total(object)) | entity}
38 %endif
39 </td>
40 %if line['index']==0:
41
42=== modified file 'l10n_it_vat_registries/templates/registro_iva_corrispettivi.mako'
43--- l10n_it_vat_registries/templates/registro_iva_corrispettivi.mako 2013-05-03 14:05:15 +0000
44+++ l10n_it_vat_registries/templates/registro_iva_corrispettivi.mako 2013-08-22 11:10:20 +0000
45@@ -66,7 +66,7 @@
46 </td><td class="right_without_line">
47 %endif
48 %if line['index']==0:
49- ${ formatLang(object.amount) | entity}
50+ ${ formatLang(invoice_total(object)) | entity}
51 %endif
52 </td>
53 %if line['index']==0:
54
55=== modified file 'l10n_it_vat_registries/templates/registro_iva_vendite.mako'
56--- l10n_it_vat_registries/templates/registro_iva_vendite.mako 2013-05-03 14:05:15 +0000
57+++ l10n_it_vat_registries/templates/registro_iva_vendite.mako 2013-08-22 11:10:20 +0000
58@@ -93,7 +93,7 @@
59 </td><td class="right_without_line">
60 %endif
61 %if line['index']==0:
62- ${ formatLang(object.amount) | entity}
63+ ${ formatLang(invoice_total(object)) | entity}
64 %endif
65 </td>
66 %if line['index']==0:

Subscribers

People subscribed via source and target branches