Merge lp:~icsergio/openobject-italia/adding_account_vat_period_end_statement into lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0
- adding_account_vat_period_end_statement
- Merge into italian-addons-7.0
Proposed by
Sergio Corato
Status: | Merged |
---|---|
Merged at revision: | 212 |
Proposed branch: | lp:~icsergio/openobject-italia/adding_account_vat_period_end_statement |
Merge into: | lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0 |
Diff against target: |
2432 lines (+2327/-0) 20 files modified
account_vat_period_end_statement/AUTHORS.txt (+3/-0) account_vat_period_end_statement/__init__.py (+26/-0) account_vat_period_end_statement/__openerp__.py (+61/-0) account_vat_period_end_statement/account.py (+576/-0) account_vat_period_end_statement/account_view.xml (+134/-0) account_vat_period_end_statement/i18n/account_vat_period_end_statement.pot (+379/-0) account_vat_period_end_statement/i18n/it.po (+432/-0) account_vat_period_end_statement/report/__init__.py (+23/-0) account_vat_period_end_statement/report/vat_period_end_statement.mako (+193/-0) account_vat_period_end_statement/report/vat_period_end_statement.py (+96/-0) account_vat_period_end_statement/reports.xml (+16/-0) account_vat_period_end_statement/security/ir.model.access.csv (+9/-0) account_vat_period_end_statement/statement_workflow.xml (+60/-0) account_vat_period_end_statement/test/account_tax.xml (+68/-0) account_vat_period_end_statement/test/tax_computation.yml (+69/-0) account_vat_period_end_statement/wizard/__init__.py (+25/-0) account_vat_period_end_statement/wizard/add_period.py (+49/-0) account_vat_period_end_statement/wizard/add_period.xml (+27/-0) account_vat_period_end_statement/wizard/remove_period.py (+54/-0) account_vat_period_end_statement/wizard/remove_period.xml (+27/-0) |
To merge this branch: | bzr merge lp:~icsergio/openobject-italia/adding_account_vat_period_end_statement |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Lorenzo Battistini | Approve | ||
Review via email: mp+153660@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Sergio Corato (icsergio) wrote : | # |
- 209. By Sergio Corato
-
[FIX] period vat move set equal to date vat period statement
- 210. By Sergio Corato
-
[FIX] code for 7.0
- 211. By Sergio Corato
-
[FIX] other code for 7.0
- 212. By Sergio Corato
-
[FIX] other code for 7.0
Revision history for this message
Sergio Corato (icsergio) wrote : | # |
> Se hai voglia: https:/
> italia/
Adesso dovrebbe essere a posto
Revision history for this message
Lorenzo Battistini (elbati) wrote : | # |
Anche qui, puoi aggiungere il copyright dell'associazione?
Grazie
- 213. By Sergio Corato
-
[FIX] copyright
Revision history for this message
Sergio Corato (icsergio) wrote : | # |
Dovrebbe essere a posto adesso
- 214. By Sergio Corato
-
[FIX] author
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added directory 'account_vat_period_end_statement' |
2 | === added file 'account_vat_period_end_statement/AUTHORS.txt' |
3 | --- account_vat_period_end_statement/AUTHORS.txt 1970-01-01 00:00:00 +0000 |
4 | +++ account_vat_period_end_statement/AUTHORS.txt 2013-05-06 22:09:27 +0000 |
5 | @@ -0,0 +1,3 @@ |
6 | +Lorenzo Battistini <lorenzo.battistini@domsense.com> |
7 | +Marco Marchiori <marcomarkiori@gmail.com> |
8 | +Sergio Corato <sergiocorato@gmail.com> |
9 | |
10 | === added file 'account_vat_period_end_statement/__init__.py' |
11 | --- account_vat_period_end_statement/__init__.py 1970-01-01 00:00:00 +0000 |
12 | +++ account_vat_period_end_statement/__init__.py 2013-05-06 22:09:27 +0000 |
13 | @@ -0,0 +1,26 @@ |
14 | +# -*- coding: utf-8 -*- |
15 | +############################################################################## |
16 | +# |
17 | +# OpenERP, Open Source Management Solution |
18 | +# Copyright (C) 2011-2012 Domsense s.r.l. (<http://www.domsense.com>). |
19 | +# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>) |
20 | +# Copyright (C) 2013 Associazione OpenERP Italia |
21 | +# (<http://www.openerp-italia.org>). |
22 | +# |
23 | +# This program is free software: you can redistribute it and/or modify |
24 | +# it under the terms of the GNU Affero General Public License as |
25 | +# published by the Free Software Foundation, either version 3 of the |
26 | +# License, or (at your option) any later version. |
27 | +# |
28 | +# This program is distributed in the hope that it will be useful, |
29 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
30 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
31 | +# GNU Affero General Public License for more details. |
32 | +# |
33 | +# You should have received a copy of the GNU Affero General Public License |
34 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
35 | +# |
36 | +############################################################################## |
37 | +import account |
38 | +import report |
39 | +import wizard |
40 | |
41 | === added file 'account_vat_period_end_statement/__openerp__.py' |
42 | --- account_vat_period_end_statement/__openerp__.py 1970-01-01 00:00:00 +0000 |
43 | +++ account_vat_period_end_statement/__openerp__.py 2013-05-06 22:09:27 +0000 |
44 | @@ -0,0 +1,61 @@ |
45 | +# -*- coding: utf-8 -*- |
46 | +############################################################################## |
47 | +# |
48 | +# OpenERP, Open Source Management Solution |
49 | +# Copyright (C) 2011-2012 Domsense s.r.l. (<http://www.domsense.com>). |
50 | +# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>) |
51 | +# Copyright (C) 2013 Associazione OpenERP Italia |
52 | +# (<http://www.openerp-italia.org>). |
53 | +# |
54 | +# This program is free software: you can redistribute it and/or modify |
55 | +# it under the terms of the GNU Affero General Public License as |
56 | +# published by the Free Software Foundation, either version 3 of the |
57 | +# License, or (at your option) any later version. |
58 | +# |
59 | +# This program is distributed in the hope that it will be useful, |
60 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
61 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
62 | +# GNU Affero General Public License for more details. |
63 | +# |
64 | +# You should have received a copy of the GNU Affero General Public License |
65 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
66 | +# |
67 | +############################################################################## |
68 | + |
69 | + |
70 | +{ |
71 | + "name": "Period End VAT Statement", |
72 | + "version": "0.3", |
73 | + 'category': 'Generic Modules/Accounting', |
74 | + "depends": ["account_voucher", "report_webkit"], |
75 | + "author": ["Agile Business Group", "OpenERP Italian Community"], |
76 | + "description": """ |
77 | + |
78 | +This module helps to register the VAT statement of period end. |
79 | + |
80 | +In order to load correct amount from tax code, the tax code has to be associated to account involved in statement, through tax code form. |
81 | + |
82 | +The 'VAT statement' object allows to specify every amount and relative account used by the statement. |
83 | +By default, amounts of debit and credit taxes are automatically loaded from tax codes of selected periods. |
84 | +Previous debit or credit is loaded from previous VAT statement, according to its payments status. |
85 | +Confirming the statement, the 'account.move' is created. If you select a payment term, the due date(s) will be set. |
86 | + |
87 | +The 'tax authority' tab contains information about payment(s). You can see statement's result ('authority VAT amount') and residual amount to pay ('Balance'). |
88 | +The statement can be paid like every other debit: by voucher or 'move.line' reconciliation. |
89 | + |
90 | +Specification: http://wiki.openerp-italia.org/doku.php/moduli/vat_period_end_statement |
91 | + |
92 | +""", |
93 | + 'website': 'http://www.agilebg.com', |
94 | + 'data': [ |
95 | + 'wizard/add_period.xml', |
96 | + 'wizard/remove_period.xml', |
97 | + 'account_view.xml', |
98 | + 'statement_workflow.xml', |
99 | + 'security/ir.model.access.csv', |
100 | + 'reports.xml', |
101 | + ], |
102 | + 'demo': [], |
103 | + 'installable': True, |
104 | + 'active': False, |
105 | +} |
106 | |
107 | === added file 'account_vat_period_end_statement/account.py' |
108 | --- account_vat_period_end_statement/account.py 1970-01-01 00:00:00 +0000 |
109 | +++ account_vat_period_end_statement/account.py 2013-05-06 22:09:27 +0000 |
110 | @@ -0,0 +1,576 @@ |
111 | +# -*- coding: utf-8 -*- |
112 | +############################################################################## |
113 | +# |
114 | +# OpenERP, Open Source Management Solution |
115 | +# Copyright (C) 2011-2012 Domsense s.r.l. (<http://www.domsense.com>). |
116 | +# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>) |
117 | +# Copyright (C) 2013 Associazione OpenERP Italia |
118 | +# (<http://www.openerp-italia.org>). |
119 | +# |
120 | +# This program is free software: you can redistribute it and/or modify |
121 | +# it under the terms of the GNU Affero General Public License as |
122 | +# published by the Free Software Foundation, either version 3 of the |
123 | +# License, or (at your option) any later version. |
124 | +# |
125 | +# This program is distributed in the hope that it will be useful, |
126 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
127 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
128 | +# GNU Affero General Public License for more details. |
129 | +# |
130 | +# You should have received a copy of the GNU Affero General Public License |
131 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
132 | +# |
133 | +############################################################################## |
134 | + |
135 | +from openerp.osv import orm, fields |
136 | +from tools.translate import _ |
137 | +import math |
138 | +import decimal_precision as dp |
139 | +import netsvc |
140 | +from datetime import datetime |
141 | +from dateutil.relativedelta import relativedelta |
142 | + |
143 | +class account_vat_period_end_statement(orm.Model): |
144 | + |
145 | + def _compute_authority_vat_amount(self, cr, uid, ids, field_name, arg, context): |
146 | + res={} |
147 | + for i in ids: |
148 | + statement = self.browse(cr, uid, i) |
149 | + debit_vat_amount = 0.0 |
150 | + credit_vat_amount = 0.0 |
151 | + generic_vat_amount = 0.0 |
152 | + for debit_line in statement.debit_vat_account_line_ids: |
153 | + debit_vat_amount += debit_line.amount |
154 | + for credit_line in statement.credit_vat_account_line_ids: |
155 | + credit_vat_amount += credit_line.amount |
156 | + for generic_line in statement.generic_vat_account_line_ids: |
157 | + generic_vat_amount += generic_line.amount |
158 | + authority_amount = (debit_vat_amount - credit_vat_amount - generic_vat_amount |
159 | + - statement.previous_credit_vat_amount + statement.previous_debit_vat_amount) |
160 | + res[i] = authority_amount |
161 | + return res |
162 | + |
163 | + def _compute_payable_vat_amount(self, cr, uid, ids, field_name, arg, context): |
164 | + res={} |
165 | + for i in ids: |
166 | + statement = self.browse(cr, uid, i) |
167 | + debit_vat_amount = 0.0 |
168 | + for debit_line in statement.debit_vat_account_line_ids: |
169 | + debit_vat_amount += debit_line.amount |
170 | + res[i] = debit_vat_amount |
171 | + return res |
172 | + |
173 | + def _compute_deductible_vat_amount(self, cr, uid, ids, field_name, arg, context): |
174 | + res={} |
175 | + for i in ids: |
176 | + statement = self.browse(cr, uid, i) |
177 | + credit_vat_amount = 0.0 |
178 | + for credit_line in statement.credit_vat_account_line_ids: |
179 | + credit_vat_amount += credit_line.amount |
180 | + res[i] = credit_vat_amount |
181 | + return res |
182 | + |
183 | + # Workflow stuff |
184 | + ################# |
185 | + |
186 | + def _reconciled(self, cr, uid, ids, name, args, context=None): |
187 | + res = {} |
188 | + for id in ids: |
189 | + res[id] = self.test_paid(cr, uid, [id]) |
190 | + return res |
191 | + |
192 | + def move_line_id_payment_gets(self, cr, uid, ids, *args): |
193 | + res = {} |
194 | + if not ids: return res |
195 | + cr.execute('SELECT statement.id, l.id '\ |
196 | + 'FROM account_move_line l '\ |
197 | + 'LEFT JOIN account_vat_period_end_statement statement ON (statement.move_id=l.move_id) '\ |
198 | + 'WHERE statement.id IN %s '\ |
199 | + 'AND l.account_id=statement.authority_vat_account_id', |
200 | + (tuple(ids),)) |
201 | + for r in cr.fetchall(): |
202 | + res.setdefault(r[0], []) |
203 | + res[r[0]].append( r[1] ) |
204 | + return res |
205 | + |
206 | + # return the ids of the move lines which has the same account than the statement |
207 | + # whose id is in ids |
208 | + def move_line_id_payment_get(self, cr, uid, ids, *args): |
209 | + if not ids: return [] |
210 | + result = self.move_line_id_payment_gets(cr, uid, ids, *args) |
211 | + return result.get(ids[0], []) |
212 | + |
213 | + def test_paid(self, cr, uid, ids, *args): |
214 | + res = self.move_line_id_payment_get(cr, uid, ids) |
215 | + if not res: |
216 | + return False |
217 | + ok = True |
218 | + for id in res: |
219 | + cr.execute('select reconcile_id from account_move_line where id=%s', (id,)) |
220 | + ok = ok and bool(cr.fetchone()[0]) |
221 | + return ok |
222 | + |
223 | + def _get_statement_from_line(self, cr, uid, ids, context=None): |
224 | + move = {} |
225 | + for line in self.pool.get('account.move.line').browse(cr, uid, ids, context=context): |
226 | + if line.reconcile_partial_id: |
227 | + for line2 in line.reconcile_partial_id.line_partial_ids: |
228 | + move[line2.move_id.id] = True |
229 | + if line.reconcile_id: |
230 | + for line2 in line.reconcile_id.line_id: |
231 | + move[line2.move_id.id] = True |
232 | + statement_ids = [] |
233 | + if move: |
234 | + statement_ids = self.pool.get('account.vat.period.end.statement').search( |
235 | + cr, uid, [('move_id','in',move.keys())], context=context) |
236 | + return statement_ids |
237 | + |
238 | + def _get_statement_from_move(self, cr, uid, ids, context=None): |
239 | + move = {} |
240 | + statement_ids = [] |
241 | + for move in self.pool.get('account.move').browse(cr, uid, ids, context=context): |
242 | + found_ids = self.pool.get('account.vat.period.end.statement').search( |
243 | + cr, uid, [('move_id','=',move.id)], context=context) |
244 | + for found_id in found_ids: |
245 | + if found_id not in statement_ids: |
246 | + statement_ids.append(found_id) |
247 | + return statement_ids |
248 | + |
249 | + def _get_statement_from_reconcile(self, cr, uid, ids, context=None): |
250 | + move = {} |
251 | + for r in self.pool.get('account.move.reconcile').browse(cr, uid, ids, context=context): |
252 | + for line in r.line_partial_ids: |
253 | + move[line.move_id.id] = True |
254 | + for line in r.line_id: |
255 | + move[line.move_id.id] = True |
256 | + |
257 | + statement_ids = [] |
258 | + if move: |
259 | + statement_ids = self.pool.get('account.vat.period.end.statement').search( |
260 | + cr, uid, [('move_id','in',move.keys())], context=context) |
261 | + return statement_ids |
262 | + |
263 | + def _get_credit_line(self, cr, uid, ids, context=None): |
264 | + result = {} |
265 | + for line in self.pool.get('statement.credit.account.line').browse(cr, uid, ids, context=context): |
266 | + result[line.statement_id.id] = True |
267 | + return result.keys() |
268 | + |
269 | + def _get_debit_line(self, cr, uid, ids, context=None): |
270 | + result = {} |
271 | + for line in self.pool.get('statement.debit.account.line').browse(cr, uid, ids, context=context): |
272 | + result[line.statement_id.id] = True |
273 | + return result.keys() |
274 | + |
275 | + def _get_generic_line(self, cr, uid, ids, context=None): |
276 | + result = {} |
277 | + for line in self.pool.get('statement.generic.account.line').browse(cr, uid, ids, context=context): |
278 | + result[line.statement_id.id] = True |
279 | + return result.keys() |
280 | + |
281 | + def _amount_residual(self, cr, uid, ids, name, args, context=None): |
282 | + result = {} |
283 | + for statement in self.browse(cr, uid, ids, context=context): |
284 | + result[statement.id] = 0.0 |
285 | + if statement.move_id: |
286 | + for m in statement.move_id.line_id: |
287 | + if m.account_id.type in ('receivable','payable'): |
288 | + result[statement.id] += m.amount_residual_currency |
289 | + return result |
290 | + |
291 | + def _compute_lines(self, cr, uid, ids, name, args, context=None): |
292 | + result = {} |
293 | + for statement in self.browse(cr, uid, ids, context=context): |
294 | + src = [] |
295 | + lines = [] |
296 | + if statement.move_id: |
297 | + for m in statement.move_id.line_id: |
298 | + temp_lines = [] |
299 | + if m.reconcile_id: |
300 | + temp_lines = map(lambda x: x.id, m.reconcile_id.line_id) |
301 | + elif m.reconcile_partial_id: |
302 | + temp_lines = map(lambda x: x.id, m.reconcile_partial_id.line_partial_ids) |
303 | + lines += [x for x in temp_lines if x not in lines] |
304 | + src.append(m.id) |
305 | + |
306 | + lines = filter(lambda x: x not in src, lines) |
307 | + result[statement.id] = lines |
308 | + return result |
309 | + |
310 | + _name = "account.vat.period.end.statement" |
311 | + _rec_name = 'date' |
312 | + _columns = { |
313 | + 'debit_vat_account_line_ids': fields.one2many('statement.debit.account.line', 'statement_id', 'Debit VAT', help='The accounts containing the debit VAT amount to write-off', required=True, states={'confirmed': [('readonly', True)], 'paid': [('readonly', True)], 'draft': [('readonly', False)]}), |
314 | + |
315 | + 'credit_vat_account_line_ids': fields.one2many('statement.credit.account.line', 'statement_id', 'Credit VAT', help='The accounts containing the credit VAT amount to write-off', required=True, states={'confirmed': [('readonly', True)], 'paid': [('readonly', True)], 'draft': [('readonly', False)]}), |
316 | + |
317 | + 'previous_credit_vat_account_id': fields.many2one('account.account', 'Previous Credits VAT', help='Credit VAT from previous periods', states={'confirmed': [('readonly', True)], 'paid': [('readonly', True)], 'draft': [('readonly', False)]}), |
318 | + 'previous_credit_vat_amount': fields.float('Previous Credits VAT Amount', states={'confirmed': [('readonly', True)], 'paid': [('readonly', True)], 'draft': [('readonly', False)]}, |
319 | + digits_compute=dp.get_precision('Account')), |
320 | + |
321 | + 'previous_debit_vat_account_id': fields.many2one('account.account', 'Previous Debits VAT', help='Debit VAT from previous periods', states={'confirmed': [('readonly', True)], 'paid': [('readonly', True)], 'draft': [('readonly', False)]}), |
322 | + 'previous_debit_vat_amount': fields.float('Previous Debits VAT Amount', states={'confirmed': [('readonly', True)], 'paid': [('readonly', True)], 'draft': [('readonly', False)]}, |
323 | + digits_compute=dp.get_precision('Account')), |
324 | + |
325 | + 'generic_vat_account_line_ids': fields.one2many('statement.generic.account.line', 'statement_id', 'Other VAT Credits / Debits or Tax Compensations', states={'confirmed': [('readonly', True)], 'paid': [('readonly', True)], 'draft': [('readonly', False)]}), |
326 | + |
327 | + 'authority_partner_id': fields.many2one('res.partner', 'Tax Authority Partner', states={'confirmed': [('readonly', True)], 'paid': [('readonly', True)], 'draft': [('readonly', False)]}), |
328 | + 'authority_vat_account_id': fields.many2one('account.account', 'Tax Authority VAT Account', required=True, states={'confirmed': [('readonly', True)], 'paid': [('readonly', True)], 'draft': [('readonly', False)]}), |
329 | + 'authority_vat_amount': fields.function(_compute_authority_vat_amount, method=True, string='Authority VAT Amount'), |
330 | + 'payable_vat_amount': fields.function(_compute_payable_vat_amount, method=True, string='Payable VAT Amount'), |
331 | + 'deductible_vat_amount': fields.function(_compute_deductible_vat_amount, method=True, string='Deductible VAT Amount'), |
332 | + |
333 | + 'journal_id': fields.many2one('account.journal', 'Journal', required=True, states={'confirmed': [('readonly', True)], 'paid': [('readonly', True)], 'draft': [('readonly', False)]}), |
334 | + 'date': fields.date('Date', required=True, states={'confirmed': [('readonly', True)], 'paid': [('readonly', True)], 'draft': [('readonly', False)]}), |
335 | + 'move_id': fields.many2one('account.move', 'VAT statement move', readonly=True), |
336 | + #'voucher_id': fields.many2one('account.voucher', 'VAT payment', readonly=True), |
337 | + |
338 | + 'state': fields.selection([ |
339 | + ('draft', 'Draft'), |
340 | + ('confirmed', 'Confirmed'), |
341 | + ('paid', 'Paid'), |
342 | + ], 'State', readonly=True), |
343 | + |
344 | + 'payment_term_id': fields.many2one('account.payment.term', 'Payment Term', |
345 | + states={'confirmed': [('readonly', True)], 'paid': [('readonly', True)], |
346 | + 'draft': [('readonly', False)]}), |
347 | + |
348 | + 'reconciled': fields.function(_reconciled, string='Paid/Reconciled', type='boolean', |
349 | + store={ |
350 | + 'account.vat.period.end.statement': (lambda self, cr, uid, ids, c={}: ids, None, 50), |
351 | + 'account.move.line': (_get_statement_from_line, None, 50), |
352 | + 'account.move.reconcile': (_get_statement_from_reconcile, None, 50), |
353 | + }, help="It indicates that the statement has been paid and the journal entry of the statement has been reconciled with one or several journal entries of payment."), |
354 | + 'residual': fields.function(_amount_residual, digits_compute=dp.get_precision('Account'), string='Balance', |
355 | + store={ |
356 | + 'account.vat.period.end.statement': (lambda self, cr, uid, ids, c={}: ids, |
357 | + ['debit_vat_account_line_ids', 'credit_vat_account_line_ids', |
358 | + 'generic_vat_account_line_ids', 'move_id', 'state'], 50), |
359 | + 'statement.credit.account.line': (_get_credit_line, ['amount','statement_id'], 50), |
360 | + 'statement.debit.account.line': (_get_debit_line, ['amount','statement_id'], 50), |
361 | + 'statement.generic.account.line': (_get_generic_line, ['amount','statement_id'], 50), |
362 | + 'account.move': (_get_statement_from_move, None, 50), |
363 | + 'account.move.line': (_get_statement_from_line, None, 50), |
364 | + 'account.move.reconcile': (_get_statement_from_reconcile, None, 50), |
365 | + }, |
366 | + help="Remaining amount due."), |
367 | + 'payment_ids': fields.function(_compute_lines, relation='account.move.line', type="many2many", string='Payments'), |
368 | + 'period_ids': fields.one2many('account.period','vat_statement_id','Periods'), |
369 | + } |
370 | + |
371 | + _defaults = { |
372 | + 'date': fields.date.context_today, |
373 | + } |
374 | + |
375 | + def _get_tax_code_amount(self, cr, uid, tax_code_id, period_id, context): |
376 | + if not context: |
377 | + context={} |
378 | + context['period_id'] = period_id |
379 | + return self.pool.get('account.tax.code').browse(cr, uid, tax_code_id, context)._sum_period( |
380 | + None, None, context)[tax_code_id] |
381 | + |
382 | + def unlink(self, cr, uid, ids, context=None): |
383 | + if isinstance(ids, (long,int)): |
384 | + ids = [ids] |
385 | + for statement in self.browse(cr, uid, ids, context): |
386 | + if statement.state == 'confirmed' or statement.state == 'paid': |
387 | + raise orm.except_orm(_('Error!'), _('You cannot delete a confirmed or paid statement')) |
388 | + res = super(account_vat_period_end_statement, self).unlink(cr, uid, ids, context) |
389 | + return res |
390 | + |
391 | + def statement_draft(self, cr, uid, ids, context=None): |
392 | + for statement in self.browse(cr, uid, ids, context): |
393 | + if statement.move_id: |
394 | + statement.move_id.unlink() |
395 | + ''' |
396 | + if statement.voucher_id: |
397 | + statement.voucher_id.unlink() |
398 | + ''' |
399 | + self.write(cr, uid, ids , {'state': 'draft'}) |
400 | + |
401 | + def statement_paid(self, cr, uid, ids, context=None): |
402 | + self.write(cr, uid, ids , {'state': 'paid'}) |
403 | + |
404 | + def create_move(self, cr, uid, ids, context=None): |
405 | + move_obj = self.pool.get('account.move') |
406 | + term_pool = self.pool.get('account.payment.term') |
407 | + line_obj = self.pool.get('account.move.line') |
408 | + period_obj = self.pool.get('account.period') |
409 | + for statement in self.browse(cr, uid, ids, context): |
410 | + period_ids = period_obj.find(cr, uid, dt=statement.date, context=context) |
411 | + if len(period_ids) != 1: |
412 | + raise orm.except_orm(_('Encoding error'), _('No period found or more than one period found for the given date.')) |
413 | + move_data = { |
414 | + 'name': _('VAT statement') + ' - ' + statement.date, |
415 | + 'date': statement.date, |
416 | + 'journal_id': statement.journal_id.id, |
417 | + 'period_id' : period_ids[0], |
418 | + } |
419 | + move_id = move_obj.create(cr, uid, move_data) |
420 | + statement.write({'move_id': move_id}) |
421 | + |
422 | + for debit_line in statement.debit_vat_account_line_ids: |
423 | + debit_vat_data = { |
424 | + 'name': _('Debit VAT'), |
425 | + 'account_id': debit_line.account_id.id, |
426 | + 'move_id': move_id, |
427 | + 'journal_id': statement.journal_id.id, |
428 | + 'debit': 0.0, |
429 | + 'credit': 0.0, |
430 | + 'date': statement.date, |
431 | + 'period_id': period_ids[0], |
432 | + } |
433 | + if debit_line.amount > 0: |
434 | + debit_vat_data['debit'] = math.fabs(debit_line.amount) |
435 | + else: |
436 | + debit_vat_data['credit'] = math.fabs(debit_line.amount) |
437 | + line_obj.create(cr, uid, debit_vat_data) |
438 | + |
439 | + for credit_line in statement.credit_vat_account_line_ids: |
440 | + credit_vat_data = { |
441 | + 'name': _('Credit VAT'), |
442 | + 'account_id': credit_line.account_id.id, |
443 | + 'move_id': move_id, |
444 | + 'journal_id': statement.journal_id.id, |
445 | + 'debit': 0.0, |
446 | + 'credit': 0.0, |
447 | + 'date': statement.date, |
448 | + 'period_id': period_ids[0], |
449 | + } |
450 | + if credit_line.amount < 0: |
451 | + credit_vat_data['debit'] = math.fabs(credit_line.amount) |
452 | + else: |
453 | + credit_vat_data['credit'] = math.fabs(credit_line.amount) |
454 | + line_obj.create(cr, uid, credit_vat_data) |
455 | + |
456 | + if statement.previous_credit_vat_amount: |
457 | + previous_credit_vat_data = { |
458 | + 'name': _('Previous Credits VAT'), |
459 | + 'account_id': statement.previous_credit_vat_account_id.id, |
460 | + 'move_id': move_id, |
461 | + 'journal_id': statement.journal_id.id, |
462 | + 'debit': 0.0, |
463 | + 'credit': 0.0, |
464 | + 'date': statement.date, |
465 | + 'period_id': period_ids[0], |
466 | + } |
467 | + if statement.previous_credit_vat_amount < 0: |
468 | + previous_credit_vat_data['debit'] = math.fabs(statement.previous_credit_vat_amount) |
469 | + else: |
470 | + previous_credit_vat_data['credit'] = math.fabs(statement.previous_credit_vat_amount) |
471 | + line_obj.create(cr, uid, previous_credit_vat_data) |
472 | + |
473 | + if statement.previous_debit_vat_amount: |
474 | + previous_debit_vat_data = { |
475 | + 'name': _('Previous Debits VAT'), |
476 | + 'account_id': statement.previous_debit_vat_account_id.id, |
477 | + 'move_id': move_id, |
478 | + 'journal_id': statement.journal_id.id, |
479 | + 'debit': 0.0, |
480 | + 'credit': 0.0, |
481 | + 'date': statement.date, |
482 | + 'period_id': period_ids[0], |
483 | + } |
484 | + if statement.previous_debit_vat_amount > 0: |
485 | + previous_debit_vat_data['debit'] = math.fabs(statement.previous_debit_vat_amount) |
486 | + else: |
487 | + previous_debit_vat_data['credit'] = math.fabs(statement.previous_debit_vat_amount) |
488 | + line_obj.create(cr, uid, previous_debit_vat_data) |
489 | + |
490 | + for generic_line in statement.generic_vat_account_line_ids: |
491 | + generic_vat_data = { |
492 | + 'name': _('Other VAT Credits / Debits'), |
493 | + 'account_id': generic_line.account_id.id, |
494 | + 'move_id': move_id, |
495 | + 'journal_id': statement.journal_id.id, |
496 | + 'debit': 0.0, |
497 | + 'credit': 0.0, |
498 | + 'date': statement.date, |
499 | + 'period_id': period_ids[0], |
500 | + } |
501 | + if generic_line.amount < 0: |
502 | + generic_vat_data['debit'] = math.fabs(generic_line.amount) |
503 | + else: |
504 | + generic_vat_data['credit'] = math.fabs(generic_line.amount) |
505 | + line_obj.create(cr, uid, generic_vat_data) |
506 | + |
507 | + end_debit_vat_data = { |
508 | + 'name': _('Tax Authority VAT'), |
509 | + 'account_id': statement.authority_vat_account_id.id, |
510 | + 'partner_id': statement.authority_partner_id.id, |
511 | + 'move_id': move_id, |
512 | + 'journal_id': statement.journal_id.id, |
513 | + 'date': statement.date, |
514 | + 'period_id': period_ids[0], |
515 | + } |
516 | + if statement.authority_vat_amount > 0: |
517 | + end_debit_vat_data['debit'] = 0.0 |
518 | + end_debit_vat_data['credit'] = math.fabs(statement.authority_vat_amount) |
519 | + if statement.payment_term_id: |
520 | + due_list = term_pool.compute( |
521 | + cr, uid, statement.payment_term_id.id, math.fabs(statement.authority_vat_amount), |
522 | + date_ref=statement.date, context=context) |
523 | + if len(due_list) == 0: |
524 | + raise orm.except_orm(_('Error'), |
525 | + _('The payment term %s does not have due dates') |
526 | + % statement.payment_term_id.name) |
527 | + for term in due_list: |
528 | + current_line = end_debit_vat_data |
529 | + current_line['credit'] = term[1] |
530 | + current_line['date_maturity'] = term[0] |
531 | + line_obj.create(cr, uid, current_line) |
532 | + else: |
533 | + line_obj.create(cr, uid, end_debit_vat_data) |
534 | + elif statement.authority_vat_amount < 0: |
535 | + end_debit_vat_data['debit'] = math.fabs(statement.authority_vat_amount) |
536 | + end_debit_vat_data['credit'] = 0.0 |
537 | + line_obj.create(cr, uid, end_debit_vat_data) |
538 | + |
539 | + self.write(cr, uid, statement.id , {'state': 'confirmed'}) |
540 | + |
541 | + return True |
542 | + |
543 | + """ |
544 | + def open_chart_of_taxes(self, cr, uid, ids, context=None): |
545 | + result = {} |
546 | + if context is None: |
547 | + context = {} |
548 | + for statement in self.browse(cr, uid, ids, context): |
549 | + mod_obj = self.pool.get('ir.model.data') |
550 | + act_obj = self.pool.get('ir.actions.act_window') |
551 | + period_obj = self.pool.get('account.period') |
552 | + period_ids = period_obj.find(cr, uid, dt=statement.date, context=context) |
553 | + if len(period_ids)> 1: |
554 | + raise orm.except_orm(_('Error'), _('Too many periods for date %s') % str(statement.date)) |
555 | + period = period_obj.browse(cr, uid, period_ids[0], context) |
556 | + result = mod_obj.get_object_reference(cr, uid, 'account', 'action_tax_code_tree') |
557 | + id = result and result[1] or False |
558 | + result = act_obj.read(cr, uid, [id], context=context)[0] |
559 | + |
560 | + fiscalyear_id = period.fiscalyear_id.id |
561 | + result['context'] = str({'period_id': period.id, \ |
562 | + 'fiscalyear_id': fiscalyear_id, \ |
563 | + 'state': 'posted'}) |
564 | + |
565 | + period_code = period.code |
566 | + result['name'] += period_code and (':' + period_code) or '' |
567 | + result['nodestroy'] = True |
568 | + return result |
569 | + """ |
570 | + |
571 | + def compute_amounts(self, cr, uid, ids, context=None): |
572 | + debit_line_pool=self.pool.get('statement.debit.account.line') |
573 | + credit_line_pool=self.pool.get('statement.credit.account.line') |
574 | + for statement in self.browse(cr, uid, ids, context): |
575 | + statement.write({'previous_debit_vat_amount': 0.0}) |
576 | + prev_statement_ids = self.search(cr, uid, [('date', '<', statement.date)], order='date') |
577 | + if prev_statement_ids: |
578 | + prev_statement = self.browse(cr, uid, prev_statement_ids[len(prev_statement_ids)-1], context) |
579 | + if prev_statement.residual > 0 and prev_statement.authority_vat_amount > 0: |
580 | + statement.write({'previous_debit_vat_amount': prev_statement.residual}) |
581 | + elif prev_statement.authority_vat_amount < 0: |
582 | + statement.write({'previous_credit_vat_amount': - prev_statement.authority_vat_amount}) |
583 | + |
584 | + credit_line_ids = [] |
585 | + debit_line_ids = [] |
586 | + tax_code_pool = self.pool.get('account.tax.code') |
587 | + debit_tax_code_ids = tax_code_pool.search(cr, uid, [ |
588 | + ('vat_statement_account_id', '!=', False), |
589 | + ('vat_statement_type', '=', 'debit'), |
590 | + ], context=context) |
591 | + for debit_tax_code_id in debit_tax_code_ids: |
592 | + debit_tax_code = tax_code_pool.browse(cr, uid, debit_tax_code_id, context) |
593 | + total = 0.0 |
594 | + for period in statement.period_ids: |
595 | + context['period_id'] = period.id |
596 | + total += tax_code_pool.browse(cr, uid, debit_tax_code_id, context).sum_period |
597 | + debit_line_ids.append({ |
598 | + 'account_id': debit_tax_code.vat_statement_account_id.id, |
599 | + 'tax_code_id': debit_tax_code.id, |
600 | + 'amount': total * debit_tax_code.vat_statement_sign, |
601 | + }) |
602 | + |
603 | + credit_tax_code_ids = tax_code_pool.search(cr, uid, [ |
604 | + ('vat_statement_account_id', '!=', False), |
605 | + ('vat_statement_type', '=', 'credit'), |
606 | + ], context=context) |
607 | + for credit_tax_code_id in credit_tax_code_ids: |
608 | + credit_tax_code = tax_code_pool.browse(cr, uid, credit_tax_code_id, context) |
609 | + total = 0.0 |
610 | + for period in statement.period_ids: |
611 | + context['period_id'] = period.id |
612 | + total += tax_code_pool.browse(cr, uid, credit_tax_code_id, context).sum_period |
613 | + credit_line_ids.append({ |
614 | + 'account_id': credit_tax_code.vat_statement_account_id.id, |
615 | + 'tax_code_id': credit_tax_code.id, |
616 | + 'amount': total * credit_tax_code.vat_statement_sign, |
617 | + }) |
618 | + |
619 | + for debit_line in statement.debit_vat_account_line_ids: |
620 | + debit_line.unlink() |
621 | + for credit_line in statement.credit_vat_account_line_ids: |
622 | + credit_line.unlink() |
623 | + for debit_vals in debit_line_ids: |
624 | + debit_vals.update({'statement_id': statement.id}) |
625 | + debit_line_pool.create(cr, uid, debit_vals, context=context) |
626 | + for credit_vals in credit_line_ids: |
627 | + credit_vals.update({'statement_id': statement.id}) |
628 | + credit_line_pool.create(cr, uid, credit_vals, context=context) |
629 | + return True |
630 | + |
631 | + def on_change_partner_id(self, cr, uid, ids, partner_id, context=None): |
632 | + partner = self.pool.get('res.partner').browse(cr, uid, partner_id, context) |
633 | + return {'value': {'authority_vat_account_id': partner.property_account_payable.id}} |
634 | + |
635 | +class statement_debit_account_line(orm.Model): |
636 | + _name='statement.debit.account.line' |
637 | + _columns = { |
638 | + 'account_id': fields.many2one('account.account', 'Account', required=True), |
639 | + 'tax_code_id': fields.many2one('account.tax.code', 'Tax Code', required=True), |
640 | + 'statement_id': fields.many2one('account.vat.period.end.statement', 'VAT statement'), |
641 | + 'amount': fields.float('Amount', digits_compute= dp.get_precision('Account'), required=True), |
642 | + } |
643 | + |
644 | +class statement_credit_account_line(orm.Model): |
645 | + _name='statement.credit.account.line' |
646 | + _columns = { |
647 | + 'account_id': fields.many2one('account.account', 'Account', required=True), |
648 | + 'tax_code_id': fields.many2one('account.tax.code', 'Tax Code', required=True), |
649 | + 'statement_id': fields.many2one('account.vat.period.end.statement', 'VAT statement'), |
650 | + 'amount': fields.float('Amount', digits_compute= dp.get_precision('Account'), required=True), |
651 | + } |
652 | + |
653 | +class statement_generic_account_line(orm.Model): |
654 | + _name='statement.generic.account.line' |
655 | + _columns = { |
656 | + 'account_id': fields.many2one('account.account', 'Account', required=True), |
657 | + 'statement_id': fields.many2one('account.vat.period.end.statement', 'VAT statement'), |
658 | + 'amount': fields.float('Amount', digits_compute= dp.get_precision('Account'), required=True), |
659 | + } |
660 | + |
661 | + def on_change_vat_account_id(self, cr, uid, ids, vat_account_id=False, context=None): |
662 | + res = {} |
663 | + res['value'] = {} |
664 | + if not vat_account_id: |
665 | + return res |
666 | + res['value']['amount'] = self.pool.get('account.account').browse(cr, uid, vat_account_id, |
667 | + context).balance |
668 | + return res |
669 | + |
670 | +class account_tax_code(orm.Model): |
671 | + _inherit = "account.tax.code" |
672 | + _columns = { |
673 | + 'vat_statement_account_id': fields.many2one('account.account', "Account used for VAT statement"), |
674 | + 'vat_statement_type': fields.selection([('credit','Credit'),('debit','Debit')], 'Type', help="This establish whether amount will be loaded as debit or credit"), |
675 | + 'vat_statement_sign': fields.integer('Sign used in statement', help="If tax code period sum is usually negative, set '-1' here"), |
676 | + } |
677 | + _defaults = { |
678 | + 'vat_statement_type': 'debit', |
679 | + 'vat_statement_sign': 1, |
680 | + } |
681 | + |
682 | +class account_period(orm.Model): |
683 | + _inherit = "account.period" |
684 | + _columns = { |
685 | + 'vat_statement_id': fields.many2one('account.vat.period.end.statement', "VAT statement"), |
686 | + } |
687 | |
688 | === added file 'account_vat_period_end_statement/account_view.xml' |
689 | --- account_vat_period_end_statement/account_view.xml 1970-01-01 00:00:00 +0000 |
690 | +++ account_vat_period_end_statement/account_view.xml 2013-05-06 22:09:27 +0000 |
691 | @@ -0,0 +1,134 @@ |
692 | +<?xml version="1.0" encoding="utf-8"?> |
693 | +<openerp> |
694 | + <data> |
695 | + |
696 | +<!-- Statement --> |
697 | + |
698 | + <record id="view_account_vat_period_end_statement" model="ir.ui.view"> |
699 | + <field name="name">account.vat.period.end.statement.form</field> |
700 | + <field name="model">account.vat.period.end.statement</field> |
701 | + <field name="type">form</field> |
702 | + <field name="arch" type="xml"> |
703 | + <form string="Vat statement"> |
704 | + <field name="journal_id" widget="selection" select="1"/> |
705 | + <group col="2" colspan="2"> |
706 | + <field name="date" select="1" /> |
707 | + <!-- TODO check if it's manageable |
708 | + <button name="open_chart_of_taxes" string="View chart of taxes for selected period" type="object"/> |
709 | + --> |
710 | + </group> |
711 | + <field name="move_id" select="1"/> |
712 | + <field name="payment_term_id" select="1"/> |
713 | + <notebook colspan="4"> |
714 | + <page string="Periods"> |
715 | + <button type='action' name="%(action_add_period)d" string="Add period" colspan="2" attrs="{'readonly': [('state', 'in', ('confirmed', 'paid'))]}"></button> |
716 | + <button type='action' name="%(action_remove_period)d" string="Remove period" colspan="2" attrs="{'readonly': [('state', 'in', ('confirmed', 'paid'))]}"></button> |
717 | + <field name="period_ids" colspan="4" nolabel="1" readonly="1"/> |
718 | + </page> |
719 | + <page string="Accounts"> |
720 | + <group colspan="4" col="3"> |
721 | + <group col="2" colspan="3"> |
722 | + <field name="debit_vat_account_line_ids" nolabel="1" > |
723 | + <tree editable="bottom" string="Debit Account Lines"> |
724 | + <field name="tax_code_id" /> |
725 | + <field name="account_id" /> |
726 | + <field name="amount" /> |
727 | + </tree> |
728 | + <form> |
729 | + <field name="tax_code_id" /> |
730 | + <field name="account_id" /> |
731 | + <field name="amount" /> |
732 | + </form> |
733 | + </field> |
734 | + <field name="credit_vat_account_line_ids" nolabel="1"> |
735 | + <tree editable="bottom" string="Credit Account Lines"> |
736 | + <field name="tax_code_id" /> |
737 | + <field name="account_id" /> |
738 | + <field name="amount" /> |
739 | + </tree> |
740 | + <form> |
741 | + <field name="tax_code_id" /> |
742 | + <field name="account_id" /> |
743 | + <field name="amount" /> |
744 | + </form> |
745 | + </field> |
746 | + </group> |
747 | + <separator colspan="3" string="Previous Credits VAT"/> |
748 | + <field name="previous_credit_vat_account_id" attrs="{'required':[('previous_credit_vat_amount','!=',0)]}"/> |
749 | + <field name="previous_credit_vat_amount" nolabel="1"/> |
750 | + <separator colspan="3" string="Previous Debits VAT"/> |
751 | + <field name="previous_debit_vat_account_id" attrs="{'required':[('previous_debit_vat_amount','!=',0)]}"/> |
752 | + <field name="previous_debit_vat_amount" nolabel="1"/> |
753 | + <separator colspan="3" string="Other VAT Credits / Debits or Tax Compensations (Positive amounts for credits, negative for debits)"/> |
754 | + <field name="generic_vat_account_line_ids" colspan="3" nolabel="1"> |
755 | + <tree editable="bottom" string="Account Lines"> |
756 | + <field name="account_id" on_change="on_change_vat_account_id(account_id)"/> |
757 | + <field name="amount" /> |
758 | + </tree> |
759 | + <form > |
760 | + <field name="account_id" /> |
761 | + <field name="amount" /> |
762 | + </form> |
763 | + </field> |
764 | + </group> |
765 | + <button type="object" name="compute_amounts" string="Recompute amounts" states="draft"></button> |
766 | + </page> |
767 | + <page string="Tax Authority"> |
768 | + <field name="authority_partner_id" select="1" on_change="on_change_partner_id(authority_partner_id)"/> |
769 | + <field name="authority_vat_amount" /> |
770 | + <field name="authority_vat_account_id" select="1" /> |
771 | + <field name="residual" /> |
772 | + <separator string="Payments" colspan="4"/> |
773 | + <field name="payment_ids" nolabel="1" colspan="4"/> |
774 | + </page> |
775 | + </notebook> |
776 | + <field name="state" select="1"/> |
777 | + <field name="reconciled"/> |
778 | + <button name="create_move" states="draft" string="Create Move" colspan="2"/> |
779 | + <button name="set_draft" states="confirmed,paid" string="Set to draft" colspan="2"/> |
780 | + </form> |
781 | + </field> |
782 | + </record> |
783 | + <record id="view_account_vat_period_end_statement_tree" model="ir.ui.view"> |
784 | + <field name="name">account.vat.period.end.statement.tree</field> |
785 | + <field name="model">account.vat.period.end.statement</field> |
786 | + <field name="type">tree</field> |
787 | + <field name="arch" type="xml"> |
788 | + <tree string="Vat statement"> |
789 | + <field name="date" /> |
790 | + <field name="journal_id" /> |
791 | + <field name="authority_vat_amount" /> |
792 | + <field name="state" /> |
793 | + </tree> |
794 | + </field> |
795 | + </record> |
796 | + |
797 | + <record id="action_account_vat_period_end_statement" model="ir.actions.act_window"> |
798 | + <field name="name">Vat statement</field> |
799 | + <field name="res_model">account.vat.period.end.statement</field> |
800 | + </record> |
801 | + |
802 | + <menuitem id="menu_account_vat_period_end_statement" action="action_account_vat_period_end_statement" |
803 | + name="VAT statements" parent="account.menu_account_end_year_treatments"/> |
804 | + |
805 | +<!-- tax code --> |
806 | + |
807 | + <record id="view_tax_code_form" model="ir.ui.view"> |
808 | + <field name="name">account.tax.code.form</field> |
809 | + <field name="model">account.tax.code</field> |
810 | + <field name="inherit_id" ref="account.view_tax_code_form"></field> |
811 | + <field name="type">form</field> |
812 | + <field name="arch" type="xml"> |
813 | + <separator string="Description" position="before"> |
814 | + <group colspan="2" col="2"> |
815 | + <separator string="VAT statement" colspan="4"/> |
816 | + <field name="vat_statement_account_id"/> |
817 | + <field name="vat_statement_type"/> |
818 | + <field name="vat_statement_sign"/> |
819 | + </group> |
820 | + </separator> |
821 | + </field> |
822 | + </record> |
823 | + |
824 | + </data> |
825 | +</openerp> |
826 | |
827 | === added directory 'account_vat_period_end_statement/i18n' |
828 | === added file 'account_vat_period_end_statement/i18n/account_vat_period_end_statement.pot' |
829 | --- account_vat_period_end_statement/i18n/account_vat_period_end_statement.pot 1970-01-01 00:00:00 +0000 |
830 | +++ account_vat_period_end_statement/i18n/account_vat_period_end_statement.pot 2013-05-06 22:09:27 +0000 |
831 | @@ -0,0 +1,379 @@ |
832 | +# Translation of OpenERP Server. |
833 | +# This file contains the translation of the following modules: |
834 | +# * account_vat_period_end_statement |
835 | +# |
836 | +msgid "" |
837 | +msgstr "" |
838 | +"Project-Id-Version: OpenERP Server 6.0.3\n" |
839 | +"Report-Msgid-Bugs-To: support@openerp.com\n" |
840 | +"POT-Creation-Date: 2011-09-10 08:34+0000\n" |
841 | +"PO-Revision-Date: 2011-09-10 08:34+0000\n" |
842 | +"Last-Translator: <>\n" |
843 | +"Language-Team: \n" |
844 | +"MIME-Version: 1.0\n" |
845 | +"Content-Type: text/plain; charset=UTF-8\n" |
846 | +"Content-Transfer-Encoding: \n" |
847 | +"Plural-Forms: \n" |
848 | + |
849 | +#. module: account_vat_period_end_statement |
850 | +#: field:account.vat.period.end.statement,voucher_id:0 |
851 | +msgid "VAT payment" |
852 | +msgstr "" |
853 | + |
854 | +#. module: account_vat_period_end_statement |
855 | +#: selection:account.vat.period.end.statement,state:0 |
856 | +msgid "Confirmed" |
857 | +msgstr "" |
858 | + |
859 | +#. module: account_vat_period_end_statement |
860 | +#: view:account.vat.period.end.statement:0 |
861 | +msgid "Credit Account Lines" |
862 | +msgstr "" |
863 | + |
864 | +#. module: account_vat_period_end_statement |
865 | +#: model:ir.model,name:account_vat_period_end_statement.model_statement_generic_account_line |
866 | +msgid "statement.generic.account.line" |
867 | +msgstr "" |
868 | + |
869 | +#. module: account_vat_period_end_statement |
870 | +#: code:addons/account_vat_period_end_statement/account.py:225 |
871 | +#, python-format |
872 | +msgid "Other VAT Credits / Debits" |
873 | +msgstr "" |
874 | + |
875 | +#. module: account_vat_period_end_statement |
876 | +#: model:ir.model,name:account_vat_period_end_statement.model_account_tax_code |
877 | +msgid "Tax Code" |
878 | +msgstr "" |
879 | + |
880 | +#. module: account_vat_period_end_statement |
881 | +#: model:ir.model,name:account_vat_period_end_statement.model_account_vat_period_end_statement |
882 | +msgid "account.vat.period.end.statement" |
883 | +msgstr "" |
884 | + |
885 | +#. module: account_vat_period_end_statement |
886 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:18 |
887 | +msgid "Payable VAT" |
888 | +msgstr "" |
889 | + |
890 | +#. module: account_vat_period_end_statement |
891 | +#: view:account.vat.period.end.statement:0 |
892 | +#: field:account.vat.period.end.statement,previous_debit_vat_account_id:0 |
893 | +#: code:addons/account_vat_period_end_statement/account.py:208 |
894 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:58 |
895 | +#, python-format |
896 | +msgid "Previous Debits VAT" |
897 | +msgstr "" |
898 | + |
899 | +#. module: account_vat_period_end_statement |
900 | +#: view:account.vat.period.end.statement:0 |
901 | +msgid "Set to draft" |
902 | +msgstr "" |
903 | + |
904 | +#. module: account_vat_period_end_statement |
905 | +#: help:account.vat.period.end.statement,previous_credit_vat_account_id:0 |
906 | +msgid "Credit VAT from previous periods" |
907 | +msgstr "" |
908 | + |
909 | +#. module: account_vat_period_end_statement |
910 | +#: view:account.vat.period.end.statement:0 |
911 | +msgid "Tax Authority" |
912 | +msgstr "" |
913 | + |
914 | +#. module: account_vat_period_end_statement |
915 | +#: field:account.vat.period.end.statement,state:0 |
916 | +msgid "State" |
917 | +msgstr "" |
918 | + |
919 | +#. module: account_vat_period_end_statement |
920 | +#: selection:account.vat.period.end.statement,state:0 |
921 | +msgid "Draft" |
922 | +msgstr "" |
923 | + |
924 | +#. module: account_vat_period_end_statement |
925 | +#: view:account.vat.period.end.statement:0 |
926 | +msgid "Load chargeable VAT" |
927 | +msgstr "" |
928 | + |
929 | +#. module: account_vat_period_end_statement |
930 | +#: selection:account.tax.code,vat_statement_type:0 |
931 | +msgid "Debit" |
932 | +msgstr "" |
933 | + |
934 | +#. module: account_vat_period_end_statement |
935 | +#: code:addons/account_vat_period_end_statement/account.py:241 |
936 | +#, python-format |
937 | +msgid "Tax Authority VAT" |
938 | +msgstr "" |
939 | + |
940 | +#. module: account_vat_period_end_statement |
941 | +#: model:ir.ui.menu,name:account_vat_period_end_statement.menu_account_vat_period_end_statement |
942 | +msgid "VAT statements" |
943 | +msgstr "" |
944 | + |
945 | +#. module: account_vat_period_end_statement |
946 | +#: field:account.tax.code,vat_statement_type:0 |
947 | +msgid "Type" |
948 | +msgstr "" |
949 | + |
950 | +#. module: account_vat_period_end_statement |
951 | +#: field:account.vat.period.end.statement,previous_debit_vat_amount:0 |
952 | +msgid "Previous Debits VAT Amount" |
953 | +msgstr "" |
954 | + |
955 | +#. module: account_vat_period_end_statement |
956 | +#: field:account.vat.period.end.statement,credit_vat_account_line_ids:0 |
957 | +#: code:addons/account_vat_period_end_statement/account.py:174 |
958 | +#, python-format |
959 | +msgid "Credit VAT" |
960 | +msgstr "" |
961 | + |
962 | +#. module: account_vat_period_end_statement |
963 | +#: view:account.vat.period.end.statement:0 |
964 | +msgid "Debit Account Lines" |
965 | +msgstr "" |
966 | + |
967 | +#. module: account_vat_period_end_statement |
968 | +#: field:account.vat.period.end.statement,journal_id:0 |
969 | +msgid "Journal" |
970 | +msgstr "" |
971 | + |
972 | +#. module: account_vat_period_end_statement |
973 | +#: field:account.vat.period.end.statement,payable_vat_amount:0 |
974 | +msgid "Payable VAT Amount" |
975 | +msgstr "" |
976 | + |
977 | +#. module: account_vat_period_end_statement |
978 | +#: selection:account.vat.period.end.statement,state:0 |
979 | +msgid "Paid" |
980 | +msgstr "" |
981 | + |
982 | +#. module: account_vat_period_end_statement |
983 | +#: view:account.tax.code:0 |
984 | +#: code:addons/account_vat_period_end_statement/account.py:147 |
985 | +#: field:statement.credit.account.line,statement_id:0 |
986 | +#: field:statement.debit.account.line,statement_id:0 |
987 | +#: field:statement.generic.account.line,statement_id:0 |
988 | +#, python-format |
989 | +msgid "VAT statement" |
990 | +msgstr "" |
991 | + |
992 | +#. module: account_vat_period_end_statement |
993 | +#: model:ir.module.module,description:account_vat_period_end_statement.module_meta_information |
994 | +msgid "This module helps to register the VAT statement of period end. The 'VAT statement' object allows to specify every amount and relative account used by the statement.\n" |
995 | +"By default, the amounts of debit and credit taxes are automatically loaded from the tax codes of the selected period. Previous debit or credit is loaded from previous VAT statement.\n" |
996 | +"In order to load the correct amount from tax code, the tax code has to be associated to the account involved in the statement, through the tax code form.\n" |
997 | +"Confirming the statement, the account.move is created along with a draft payment voucher.\n" |
998 | +"\n" |
999 | +"Specification: http://wiki.openerp-italia.org/doku.php/moduli/vat_period_end_statement" |
1000 | +msgstr "" |
1001 | + |
1002 | +#. module: account_vat_period_end_statement |
1003 | +#: model:ir.model,name:account_vat_period_end_statement.model_statement_credit_account_line |
1004 | +msgid "statement.credit.account.line" |
1005 | +msgstr "" |
1006 | + |
1007 | +#. module: account_vat_period_end_statement |
1008 | +#: code:addons/account_vat_period_end_statement/account.py:119 |
1009 | +#: code:addons/account_vat_period_end_statement/account.py:142 |
1010 | +#, python-format |
1011 | +msgid "Error!" |
1012 | +msgstr "" |
1013 | + |
1014 | +#. module: account_vat_period_end_statement |
1015 | +#: field:account.vat.period.end.statement,move_id:0 |
1016 | +msgid "VAT statement move" |
1017 | +msgstr "" |
1018 | + |
1019 | +#. module: account_vat_period_end_statement |
1020 | +#: code:addons/account_vat_period_end_statement/account.py:119 |
1021 | +#, python-format |
1022 | +msgid "You cannot delete a confirmed or paid statement" |
1023 | +msgstr "" |
1024 | + |
1025 | +#. module: account_vat_period_end_statement |
1026 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:10 |
1027 | +#: model:ir.actions.report.xml,name:account_vat_period_end_statement.print_vat_period_end_statement |
1028 | +msgid "VAT Statement Summary" |
1029 | +msgstr "" |
1030 | + |
1031 | +#. module: account_vat_period_end_statement |
1032 | +#: view:account.vat.period.end.statement:0 |
1033 | +msgid "Account Lines" |
1034 | +msgstr "" |
1035 | + |
1036 | +#. module: account_vat_period_end_statement |
1037 | +#: field:statement.credit.account.line,account_id:0 |
1038 | +#: field:statement.debit.account.line,account_id:0 |
1039 | +#: field:statement.generic.account.line,account_id:0 |
1040 | +msgid "Account" |
1041 | +msgstr "" |
1042 | + |
1043 | +#. module: account_vat_period_end_statement |
1044 | +#: field:account.vat.period.end.statement,generic_vat_account_line_ids:0 |
1045 | +msgid "Other VAT Credits / Debits or Tax Compensations" |
1046 | +msgstr "" |
1047 | + |
1048 | +#. module: account_vat_period_end_statement |
1049 | +#: help:account.tax.code,vat_statement_type:0 |
1050 | +msgid "This establish whether amount will be loaded as debit or credit" |
1051 | +msgstr "" |
1052 | + |
1053 | +#. module: account_vat_period_end_statement |
1054 | +#: view:account.vat.period.end.statement:0 |
1055 | +#: field:account.vat.period.end.statement,previous_credit_vat_account_id:0 |
1056 | +#: code:addons/account_vat_period_end_statement/account.py:191 |
1057 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:54 |
1058 | +#, python-format |
1059 | +msgid "Previous Credits VAT" |
1060 | +msgstr "" |
1061 | + |
1062 | +#. module: account_vat_period_end_statement |
1063 | +#: field:account.vat.period.end.statement,authority_vat_account_id:0 |
1064 | +msgid "Tax Authority VAT Account" |
1065 | +msgstr "" |
1066 | + |
1067 | +#. module: account_vat_period_end_statement |
1068 | +#: model:ir.module.module,shortdesc:account_vat_period_end_statement.module_meta_information |
1069 | +msgid "Period End VAT Statement" |
1070 | +msgstr "" |
1071 | + |
1072 | +#. module: account_vat_period_end_statement |
1073 | +#: field:account.vat.period.end.statement,previous_credit_vat_amount:0 |
1074 | +msgid "Previous Credits VAT Amount" |
1075 | +msgstr "" |
1076 | + |
1077 | +#. module: account_vat_period_end_statement |
1078 | +#: field:account.tax.code,vat_statement_account_id:0 |
1079 | +msgid "Account used for VAT statement" |
1080 | +msgstr "" |
1081 | + |
1082 | +#. module: account_vat_period_end_statement |
1083 | +#: model:ir.model,name:account_vat_period_end_statement.model_statement_debit_account_line |
1084 | +msgid "statement.debit.account.line" |
1085 | +msgstr "" |
1086 | + |
1087 | +#. module: account_vat_period_end_statement |
1088 | +#: field:account.vat.period.end.statement,deductible_vat_amount:0 |
1089 | +msgid "Deductible VAT Amount" |
1090 | +msgstr "" |
1091 | + |
1092 | +#. module: account_vat_period_end_statement |
1093 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:15 |
1094 | +#: field:statement.credit.account.line,amount:0 |
1095 | +#: field:statement.debit.account.line,amount:0 |
1096 | +#: field:statement.generic.account.line,amount:0 |
1097 | +msgid "Amount" |
1098 | +msgstr "" |
1099 | + |
1100 | +#. module: account_vat_period_end_statement |
1101 | +#: help:account.vat.period.end.statement,previous_debit_vat_account_id:0 |
1102 | +msgid "Debit VAT from previous periods" |
1103 | +msgstr "" |
1104 | + |
1105 | +#. module: account_vat_period_end_statement |
1106 | +#: code:addons/account_vat_period_end_statement/account.py:142 |
1107 | +#, python-format |
1108 | +msgid "The current period has VAT statement yet" |
1109 | +msgstr "" |
1110 | + |
1111 | +#. module: account_vat_period_end_statement |
1112 | +#: field:account.vat.period.end.statement,authority_partner_id:0 |
1113 | +msgid "Tax Authority Partner" |
1114 | +msgstr "" |
1115 | + |
1116 | +#. module: account_vat_period_end_statement |
1117 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:72 |
1118 | +msgid "Amount to pay" |
1119 | +msgstr "" |
1120 | + |
1121 | +#. module: account_vat_period_end_statement |
1122 | +#: view:account.vat.period.end.statement:0 |
1123 | +msgid "Load deductible VAT" |
1124 | +msgstr "" |
1125 | + |
1126 | +#. module: account_vat_period_end_statement |
1127 | +#: view:account.tax.code:0 |
1128 | +msgid "Description" |
1129 | +msgstr "" |
1130 | + |
1131 | +#. module: account_vat_period_end_statement |
1132 | +#: view:account.vat.period.end.statement:0 |
1133 | +msgid "View chart of taxes for selected period" |
1134 | +msgstr "" |
1135 | + |
1136 | +#. module: account_vat_period_end_statement |
1137 | +#: help:account.vat.period.end.statement,debit_vat_account_line_ids:0 |
1138 | +msgid "The accounts containing the debit VAT amount to write-off" |
1139 | +msgstr "" |
1140 | + |
1141 | +#. module: account_vat_period_end_statement |
1142 | +#: constraint:account.tax.code:0 |
1143 | +msgid "Error ! You can not create recursive accounts." |
1144 | +msgstr "" |
1145 | + |
1146 | +#. module: account_vat_period_end_statement |
1147 | +#: selection:account.tax.code,vat_statement_type:0 |
1148 | +msgid "Credit" |
1149 | +msgstr "" |
1150 | + |
1151 | +#. module: account_vat_period_end_statement |
1152 | +#: view:account.vat.period.end.statement:0 |
1153 | +#: model:ir.actions.act_window,name:account_vat_period_end_statement.action_account_vat_period_end_statement |
1154 | +msgid "Vat statement" |
1155 | +msgstr "" |
1156 | + |
1157 | +#. module: account_vat_period_end_statement |
1158 | +#: field:account.vat.period.end.statement,debit_vat_account_line_ids:0 |
1159 | +#: code:addons/account_vat_period_end_statement/account.py:157 |
1160 | +#, python-format |
1161 | +msgid "Debit VAT" |
1162 | +msgstr "" |
1163 | + |
1164 | +#. module: account_vat_period_end_statement |
1165 | +#: model:ir.model,name:account_vat_period_end_statement.model_account_voucher |
1166 | +msgid "Accounting Voucher" |
1167 | +msgstr "" |
1168 | + |
1169 | +#. module: account_vat_period_end_statement |
1170 | +#: field:account.vat.period.end.statement,period_id:0 |
1171 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:11 |
1172 | +msgid "Period" |
1173 | +msgstr "" |
1174 | + |
1175 | +#. module: account_vat_period_end_statement |
1176 | +#: view:account.vat.period.end.statement:0 |
1177 | +msgid "General" |
1178 | +msgstr "" |
1179 | + |
1180 | +#. module: account_vat_period_end_statement |
1181 | +#: field:account.vat.period.end.statement,authority_vat_amount:0 |
1182 | +msgid "Authority VAT Amount" |
1183 | +msgstr "" |
1184 | + |
1185 | +#. module: account_vat_period_end_statement |
1186 | +#: view:account.vat.period.end.statement:0 |
1187 | +msgid "Other VAT Credits / Debits or Tax Compensations (Positive amounts for credits, negative for debits)" |
1188 | +msgstr "" |
1189 | + |
1190 | +#. module: account_vat_period_end_statement |
1191 | +#: view:account.vat.period.end.statement:0 |
1192 | +msgid "Create Move" |
1193 | +msgstr "" |
1194 | + |
1195 | +#. module: account_vat_period_end_statement |
1196 | +#: help:account.vat.period.end.statement,credit_vat_account_line_ids:0 |
1197 | +msgid "The accounts containing the credit VAT amount to write-off" |
1198 | +msgstr "" |
1199 | + |
1200 | +#. module: account_vat_period_end_statement |
1201 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:28 |
1202 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:46 |
1203 | +msgid "Total" |
1204 | +msgstr "" |
1205 | + |
1206 | +#. module: account_vat_period_end_statement |
1207 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:36 |
1208 | +msgid "Deductible VAT" |
1209 | +msgstr "" |
1210 | + |
1211 | |
1212 | === added file 'account_vat_period_end_statement/i18n/it.po' |
1213 | --- account_vat_period_end_statement/i18n/it.po 1970-01-01 00:00:00 +0000 |
1214 | +++ account_vat_period_end_statement/i18n/it.po 2013-05-06 22:09:27 +0000 |
1215 | @@ -0,0 +1,432 @@ |
1216 | +# Translation of OpenERP Server. |
1217 | +# This file contains the translation of the following modules: |
1218 | +# * account_vat_period_end_statement |
1219 | +# |
1220 | +msgid "" |
1221 | +msgstr "" |
1222 | +"Project-Id-Version: OpenERP Server 6.1\n" |
1223 | +"Report-Msgid-Bugs-To: \n" |
1224 | +"POT-Creation-Date: 2012-06-22 10:31+0000\n" |
1225 | +"PO-Revision-Date: 2012-06-22 12:35+0100\n" |
1226 | +"Last-Translator: Lorenzo Battistini <lorenzo.battistini@agilebg.com>\n" |
1227 | +"Language-Team: \n" |
1228 | +"MIME-Version: 1.0\n" |
1229 | +"Content-Type: text/plain; charset=UTF-8\n" |
1230 | +"Content-Transfer-Encoding: 8bit\n" |
1231 | +"Plural-Forms: \n" |
1232 | + |
1233 | +#. module: account_vat_period_end_statement |
1234 | +#: code:addons/account_vat_period_end_statement/report/vat_period_end_statement.py:35 |
1235 | +#, python-format |
1236 | +msgid "Too many occurences of tax code %s" |
1237 | +msgstr "Troppe occorrenze del codice impotsa %s" |
1238 | + |
1239 | +#. module: account_vat_period_end_statement |
1240 | +#: selection:account.vat.period.end.statement,state:0 |
1241 | +msgid "Confirmed" |
1242 | +msgstr "Confermato" |
1243 | + |
1244 | +#. module: account_vat_period_end_statement |
1245 | +#: view:account.vat.period.end.statement:0 |
1246 | +msgid "Credit Account Lines" |
1247 | +msgstr "Righe conti di credito" |
1248 | + |
1249 | +#. module: account_vat_period_end_statement |
1250 | +#: model:ir.model,name:account_vat_period_end_statement.model_statement_generic_account_line |
1251 | +msgid "statement.generic.account.line" |
1252 | +msgstr "statement.generic.account.line" |
1253 | + |
1254 | +#. module: account_vat_period_end_statement |
1255 | +#: code:addons/account_vat_period_end_statement/account.py:381 |
1256 | +#, python-format |
1257 | +msgid "Other VAT Credits / Debits" |
1258 | +msgstr "Altri Crediti / Debiti per IVA" |
1259 | + |
1260 | +#. module: account_vat_period_end_statement |
1261 | +#: help:account.vat.period.end.statement,reconciled:0 |
1262 | +msgid "It indicates that the statement has been paid and the journal entry of the statement has been reconciled with one or several journal entries of payment." |
1263 | +msgstr "It indicates that the statement has been paid and the journal entry of the statement has been reconciled with one or several journal entries of payment." |
1264 | + |
1265 | +#. module: account_vat_period_end_statement |
1266 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:42 |
1267 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:70 |
1268 | +#: model:ir.model,name:account_vat_period_end_statement.model_account_tax_code |
1269 | +#: field:statement.credit.account.line,tax_code_id:0 |
1270 | +#: field:statement.debit.account.line,tax_code_id:0 |
1271 | +msgid "Tax Code" |
1272 | +msgstr "Codice imposta" |
1273 | + |
1274 | +#. module: account_vat_period_end_statement |
1275 | +#: field:account.vat.period.end.statement,authority_partner_id:0 |
1276 | +msgid "Tax Authority Partner" |
1277 | +msgstr "Partner Erario" |
1278 | + |
1279 | +#. module: account_vat_period_end_statement |
1280 | +#: view:account.vat.period.end.statement:0 |
1281 | +#: field:account.vat.period.end.statement,previous_debit_vat_account_id:0 |
1282 | +#: code:addons/account_vat_period_end_statement/account.py:364 |
1283 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:134 |
1284 | +#, python-format |
1285 | +msgid "Previous Debits VAT" |
1286 | +msgstr "IVA debiti precedenti" |
1287 | + |
1288 | +#. module: account_vat_period_end_statement |
1289 | +#: code:addons/account_vat_period_end_statement/report/vat_period_end_statement.py:43 |
1290 | +#, python-format |
1291 | +msgid "No base code found for tax code %s" |
1292 | +msgstr "Nessun codice imponibile trovato per il codice imposta %s" |
1293 | + |
1294 | +#. module: account_vat_period_end_statement |
1295 | +#: help:account.vat.period.end.statement,previous_credit_vat_account_id:0 |
1296 | +msgid "Credit VAT from previous periods" |
1297 | +msgstr "IVA a credito da periodi precedenti" |
1298 | + |
1299 | +#. module: account_vat_period_end_statement |
1300 | +#: view:account.vat.period.end.statement:0 |
1301 | +msgid "Tax Authority" |
1302 | +msgstr "Erario" |
1303 | + |
1304 | +#. module: account_vat_period_end_statement |
1305 | +#: field:account.vat.period.end.statement,state:0 |
1306 | +msgid "State" |
1307 | +msgstr "Stato" |
1308 | + |
1309 | +#. module: account_vat_period_end_statement |
1310 | +#: selection:account.vat.period.end.statement,state:0 |
1311 | +msgid "Draft" |
1312 | +msgstr "Bozza" |
1313 | + |
1314 | +#. module: account_vat_period_end_statement |
1315 | +#: field:account.vat.period.end.statement,reconciled:0 |
1316 | +msgid "Paid/Reconciled" |
1317 | +msgstr "Pagato/Riconciliato" |
1318 | + |
1319 | +#. module: account_vat_period_end_statement |
1320 | +#: selection:account.tax.code,vat_statement_type:0 |
1321 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:99 |
1322 | +msgid "Debit" |
1323 | +msgstr "Debito" |
1324 | + |
1325 | +#. module: account_vat_period_end_statement |
1326 | +#: code:addons/account_vat_period_end_statement/account.py:397 |
1327 | +#, python-format |
1328 | +msgid "Tax Authority VAT" |
1329 | +msgstr "IVA Erario" |
1330 | + |
1331 | +#. module: account_vat_period_end_statement |
1332 | +#: help:account.vat.period.end.statement,residual:0 |
1333 | +msgid "Remaining amount due." |
1334 | +msgstr "Importo dovuto rimanente" |
1335 | + |
1336 | +#. module: account_vat_period_end_statement |
1337 | +#: view:account.vat.period.end.statement:0 |
1338 | +msgid "General" |
1339 | +msgstr "Generale" |
1340 | + |
1341 | +#. module: account_vat_period_end_statement |
1342 | +#: field:account.tax.code,vat_statement_type:0 |
1343 | +msgid "Type" |
1344 | +msgstr "Tipo" |
1345 | + |
1346 | +#. module: account_vat_period_end_statement |
1347 | +#: field:account.vat.period.end.statement,previous_debit_vat_amount:0 |
1348 | +msgid "Previous Debits VAT Amount" |
1349 | +msgstr "Importo IVA debiti precedenti" |
1350 | + |
1351 | +#. module: account_vat_period_end_statement |
1352 | +#: field:account.vat.period.end.statement,credit_vat_account_line_ids:0 |
1353 | +#: code:addons/account_vat_period_end_statement/account.py:330 |
1354 | +#, python-format |
1355 | +msgid "Credit VAT" |
1356 | +msgstr "IVA a credito" |
1357 | + |
1358 | +#. module: account_vat_period_end_statement |
1359 | +#: model:ir.ui.menu,name:account_vat_period_end_statement.menu_account_vat_period_end_statement |
1360 | +msgid "VAT statements" |
1361 | +msgstr "Liquidazioni IVA" |
1362 | + |
1363 | +#. module: account_vat_period_end_statement |
1364 | +#: view:account.vat.period.end.statement:0 |
1365 | +msgid "Debit Account Lines" |
1366 | +msgstr "Righe conti di debito" |
1367 | + |
1368 | +#. module: account_vat_period_end_statement |
1369 | +#: field:account.vat.period.end.statement,journal_id:0 |
1370 | +msgid "Journal" |
1371 | +msgstr "Sezionale" |
1372 | + |
1373 | +#. module: account_vat_period_end_statement |
1374 | +#: field:account.vat.period.end.statement,payable_vat_amount:0 |
1375 | +msgid "Payable VAT Amount" |
1376 | +msgstr "Importo IVA Esigibile" |
1377 | + |
1378 | +#. module: account_vat_period_end_statement |
1379 | +#: selection:account.vat.period.end.statement,state:0 |
1380 | +msgid "Paid" |
1381 | +msgstr "Pagato" |
1382 | + |
1383 | +#. module: account_vat_period_end_statement |
1384 | +#: view:account.tax.code:0 |
1385 | +#: code:addons/account_vat_period_end_statement/account.py:303 |
1386 | +#: field:statement.credit.account.line,statement_id:0 |
1387 | +#: field:statement.debit.account.line,statement_id:0 |
1388 | +#: field:statement.generic.account.line,statement_id:0 |
1389 | +#, python-format |
1390 | +msgid "VAT statement" |
1391 | +msgstr "Liquidazione IVA" |
1392 | + |
1393 | +#. module: account_vat_period_end_statement |
1394 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:39 |
1395 | +msgid "Sales" |
1396 | +msgstr "Vendite" |
1397 | + |
1398 | +#. module: account_vat_period_end_statement |
1399 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:43 |
1400 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:71 |
1401 | +msgid "Base" |
1402 | +msgstr "Imponibile" |
1403 | + |
1404 | +#. module: account_vat_period_end_statement |
1405 | +#: model:ir.model,name:account_vat_period_end_statement.model_statement_credit_account_line |
1406 | +msgid "statement.credit.account.line" |
1407 | +msgstr "statement.credit.account.line" |
1408 | + |
1409 | +#. module: account_vat_period_end_statement |
1410 | +#: code:addons/account_vat_period_end_statement/account.py:273 |
1411 | +#: code:addons/account_vat_period_end_statement/account.py:298 |
1412 | +#, python-format |
1413 | +msgid "Error!" |
1414 | +msgstr "Errore!" |
1415 | + |
1416 | +#. module: account_vat_period_end_statement |
1417 | +#: field:account.vat.period.end.statement,move_id:0 |
1418 | +msgid "VAT statement move" |
1419 | +msgstr "Movimento liquidazione IVA" |
1420 | + |
1421 | +#. module: account_vat_period_end_statement |
1422 | +#: code:addons/account_vat_period_end_statement/report/vat_period_end_statement.py:48 |
1423 | +#, python-format |
1424 | +msgid "Not every tax linked to tax code %s is linked the same base code" |
1425 | +msgstr "Non tutte le imposte collegate al codice imposta %s sono collegate allo stesso codice imponibile" |
1426 | + |
1427 | +#. module: account_vat_period_end_statement |
1428 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:34 |
1429 | +#: model:ir.actions.report.xml,name:account_vat_period_end_statement.print_vat_period_end_statement |
1430 | +msgid "VAT Statement Summary" |
1431 | +msgstr "Prospetto liquidazione IVA" |
1432 | + |
1433 | +#. module: account_vat_period_end_statement |
1434 | +#: view:account.vat.period.end.statement:0 |
1435 | +msgid "Account Lines" |
1436 | +msgstr "Righe conti" |
1437 | + |
1438 | +#. module: account_vat_period_end_statement |
1439 | +#: field:statement.credit.account.line,account_id:0 |
1440 | +#: field:statement.debit.account.line,account_id:0 |
1441 | +#: field:statement.generic.account.line,account_id:0 |
1442 | +msgid "Account" |
1443 | +msgstr "Conto" |
1444 | + |
1445 | +#. module: account_vat_period_end_statement |
1446 | +#: field:account.vat.period.end.statement,generic_vat_account_line_ids:0 |
1447 | +msgid "Other VAT Credits / Debits or Tax Compensations" |
1448 | +msgstr "Altri Crediti / Debiti per IVA o compensazioni di imposta" |
1449 | + |
1450 | +#. module: account_vat_period_end_statement |
1451 | +#: help:account.tax.code,vat_statement_type:0 |
1452 | +msgid "This establish whether amount will be loaded as debit or credit" |
1453 | +msgstr "Questo stabilisce se il saldo debba essere caricato come debito o come credito" |
1454 | + |
1455 | +#. module: account_vat_period_end_statement |
1456 | +#: view:account.vat.period.end.statement:0 |
1457 | +#: field:account.vat.period.end.statement,previous_credit_vat_account_id:0 |
1458 | +#: code:addons/account_vat_period_end_statement/account.py:347 |
1459 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:129 |
1460 | +#, python-format |
1461 | +msgid "Previous Credits VAT" |
1462 | +msgstr "IVA crediti precedenti" |
1463 | + |
1464 | +#. module: account_vat_period_end_statement |
1465 | +#: field:account.vat.period.end.statement,authority_vat_account_id:0 |
1466 | +msgid "Tax Authority VAT Account" |
1467 | +msgstr "Conto IVA Erario" |
1468 | + |
1469 | +#. module: account_vat_period_end_statement |
1470 | +#: code:addons/account_vat_period_end_statement/account.py:273 |
1471 | +#, python-format |
1472 | +msgid "You cannot delete a confirmed or paid statement" |
1473 | +msgstr "Non è possibile eliminare una liquidazione confermata o pagata" |
1474 | + |
1475 | +#. module: account_vat_period_end_statement |
1476 | +#: field:account.vat.period.end.statement,previous_credit_vat_amount:0 |
1477 | +msgid "Previous Credits VAT Amount" |
1478 | +msgstr "Importo IVA crediti precedenti" |
1479 | + |
1480 | +#. module: account_vat_period_end_statement |
1481 | +#: field:account.tax.code,vat_statement_account_id:0 |
1482 | +msgid "Account used for VAT statement" |
1483 | +msgstr "Conto utilizzato per la liquidazione IVA" |
1484 | + |
1485 | +#. module: account_vat_period_end_statement |
1486 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:95 |
1487 | +msgid "Summary" |
1488 | +msgstr "Riepilogo" |
1489 | + |
1490 | +#. module: account_vat_period_end_statement |
1491 | +#: model:ir.model,name:account_vat_period_end_statement.model_statement_debit_account_line |
1492 | +msgid "statement.debit.account.line" |
1493 | +msgstr "statement.debit.account.line" |
1494 | + |
1495 | +#. module: account_vat_period_end_statement |
1496 | +#: field:account.vat.period.end.statement,deductible_vat_amount:0 |
1497 | +msgid "Deductible VAT Amount" |
1498 | +msgstr "Importo IVA Deducibile" |
1499 | + |
1500 | +#. module: account_vat_period_end_statement |
1501 | +#: field:statement.credit.account.line,amount:0 |
1502 | +#: field:statement.debit.account.line,amount:0 |
1503 | +#: field:statement.generic.account.line,amount:0 |
1504 | +msgid "Amount" |
1505 | +msgstr "Importo" |
1506 | + |
1507 | +#. module: account_vat_period_end_statement |
1508 | +#: code:addons/account_vat_period_end_statement/account.py:414 |
1509 | +#, python-format |
1510 | +msgid "The payment term %s does not have due dates" |
1511 | +msgstr "Il termine di pagamento %s non ha date di scadenza" |
1512 | + |
1513 | +#. module: account_vat_period_end_statement |
1514 | +#: view:account.vat.period.end.statement:0 |
1515 | +#: field:account.vat.period.end.statement,payment_ids:0 |
1516 | +msgid "Payments" |
1517 | +msgstr "Pagamenti" |
1518 | + |
1519 | +#. module: account_vat_period_end_statement |
1520 | +#: code:addons/account_vat_period_end_statement/account.py:413 |
1521 | +#: code:addons/account_vat_period_end_statement/report/vat_period_end_statement.py:35 |
1522 | +#: code:addons/account_vat_period_end_statement/report/vat_period_end_statement.py:43 |
1523 | +#: code:addons/account_vat_period_end_statement/report/vat_period_end_statement.py:48 |
1524 | +#, python-format |
1525 | +msgid "Error" |
1526 | +msgstr "Errore" |
1527 | + |
1528 | +#. module: account_vat_period_end_statement |
1529 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:146 |
1530 | +msgid "Amount to pay" |
1531 | +msgstr "Totale da pagare" |
1532 | + |
1533 | +#. module: account_vat_period_end_statement |
1534 | +#: field:account.vat.period.end.statement,residual:0 |
1535 | +msgid "Balance" |
1536 | +msgstr "Saldo" |
1537 | + |
1538 | +#. module: account_vat_period_end_statement |
1539 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:44 |
1540 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:72 |
1541 | +msgid "VAT" |
1542 | +msgstr "IVA" |
1543 | + |
1544 | +#. module: account_vat_period_end_statement |
1545 | +#: view:account.tax.code:0 |
1546 | +msgid "Description" |
1547 | +msgstr "Descrizione" |
1548 | + |
1549 | +#. module: account_vat_period_end_statement |
1550 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:67 |
1551 | +msgid "Purchases" |
1552 | +msgstr "Acquisti" |
1553 | + |
1554 | +#. module: account_vat_period_end_statement |
1555 | +#: help:account.vat.period.end.statement,debit_vat_account_line_ids:0 |
1556 | +msgid "The accounts containing the debit VAT amount to write-off" |
1557 | +msgstr "I conti contenenti l'IVA a debito da stornare" |
1558 | + |
1559 | +#. module: account_vat_period_end_statement |
1560 | +#: help:account.vat.period.end.statement,previous_debit_vat_account_id:0 |
1561 | +msgid "Debit VAT from previous periods" |
1562 | +msgstr "IVA a debito da periodi precedenti" |
1563 | + |
1564 | +#. module: account_vat_period_end_statement |
1565 | +#: model:ir.model,name:account_vat_period_end_statement.model_account_vat_period_end_statement |
1566 | +msgid "account.vat.period.end.statement" |
1567 | +msgstr "account.vat.period.end.statement" |
1568 | + |
1569 | +#. module: account_vat_period_end_statement |
1570 | +#: selection:account.tax.code,vat_statement_type:0 |
1571 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:100 |
1572 | +msgid "Credit" |
1573 | +msgstr "Credito" |
1574 | + |
1575 | +#. module: account_vat_period_end_statement |
1576 | +#: view:account.vat.period.end.statement:0 |
1577 | +#: model:ir.actions.act_window,name:account_vat_period_end_statement.action_account_vat_period_end_statement |
1578 | +msgid "Vat statement" |
1579 | +msgstr "Liquidazione IVA" |
1580 | + |
1581 | +#. module: account_vat_period_end_statement |
1582 | +#: field:account.vat.period.end.statement,debit_vat_account_line_ids:0 |
1583 | +#: code:addons/account_vat_period_end_statement/account.py:313 |
1584 | +#, python-format |
1585 | +msgid "Debit VAT" |
1586 | +msgstr "IVA a debito" |
1587 | + |
1588 | +#. module: account_vat_period_end_statement |
1589 | +#: field:account.vat.period.end.statement,payment_term_id:0 |
1590 | +msgid "Payment Term" |
1591 | +msgstr "Termine di pagamento" |
1592 | + |
1593 | +#. module: account_vat_period_end_statement |
1594 | +#: field:account.vat.period.end.statement,period_id:0 |
1595 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:35 |
1596 | +msgid "Period" |
1597 | +msgstr "Periodo" |
1598 | + |
1599 | +#. module: account_vat_period_end_statement |
1600 | +#: constraint:account.tax.code:0 |
1601 | +msgid "Error ! You can not create recursive accounts." |
1602 | +msgstr "Errore! Non puoi creare conti ricorsivi" |
1603 | + |
1604 | +#. module: account_vat_period_end_statement |
1605 | +#: view:account.vat.period.end.statement:0 |
1606 | +msgid "View chart of taxes for selected period" |
1607 | +msgstr "Visualizza i conti imposta per il periodo selezionato" |
1608 | + |
1609 | +#. module: account_vat_period_end_statement |
1610 | +#: field:account.vat.period.end.statement,authority_vat_amount:0 |
1611 | +msgid "Authority VAT Amount" |
1612 | +msgstr "Importo IVA Erario" |
1613 | + |
1614 | +#. module: account_vat_period_end_statement |
1615 | +#: view:account.vat.period.end.statement:0 |
1616 | +msgid "Other VAT Credits / Debits or Tax Compensations (Positive amounts for credits, negative for debits)" |
1617 | +msgstr "Altri crediti / debiti per IVA o compensazioni di imposta (importi positivi per i crediti, negativi per i debiti)" |
1618 | + |
1619 | +#. module: account_vat_period_end_statement |
1620 | +#: view:account.vat.period.end.statement:0 |
1621 | +msgid "Create Move" |
1622 | +msgstr "Crea movimento" |
1623 | + |
1624 | +#. module: account_vat_period_end_statement |
1625 | +#: help:account.vat.period.end.statement,credit_vat_account_line_ids:0 |
1626 | +msgid "The accounts containing the credit VAT amount to write-off" |
1627 | +msgstr "I conti contenenti l'IVA a credito da stornare" |
1628 | + |
1629 | +#. module: account_vat_period_end_statement |
1630 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:59 |
1631 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:87 |
1632 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:111 |
1633 | +#: report:addons/account_vat_period_end_statement/report/vat_period_end_statement.mako:124 |
1634 | +msgid "Total" |
1635 | +msgstr "Totale" |
1636 | + |
1637 | +#. module: account_vat_period_end_statement |
1638 | +#: view:account.vat.period.end.statement:0 |
1639 | +msgid "Set to draft" |
1640 | +msgstr "Imposta a bozza" |
1641 | + |
1642 | +#. module: account_vat_period_end_statement |
1643 | +#: code:addons/account_vat_period_end_statement/account.py:298 |
1644 | +#, python-format |
1645 | +msgid "The current period has VAT statement yet" |
1646 | +msgstr "Il periodo selezionato ha già una dichiarazione IVA" |
1647 | + |
1648 | |
1649 | === added directory 'account_vat_period_end_statement/report' |
1650 | === added file 'account_vat_period_end_statement/report/__init__.py' |
1651 | --- account_vat_period_end_statement/report/__init__.py 1970-01-01 00:00:00 +0000 |
1652 | +++ account_vat_period_end_statement/report/__init__.py 2013-05-06 22:09:27 +0000 |
1653 | @@ -0,0 +1,23 @@ |
1654 | +# -*- coding: utf-8 -*- |
1655 | +############################################################################## |
1656 | +# |
1657 | +# OpenERP, Open Source Management Solution |
1658 | +# Copyright (C) 2011 Domsense s.r.l. (<http://www.domsense.com>). |
1659 | +# Copyright (C) 2013 Associazione OpenERP Italia |
1660 | +# (<http://www.openerp-italia.org>). |
1661 | +# |
1662 | +# This program is free software: you can redistribute it and/or modify |
1663 | +# it under the terms of the GNU Affero General Public License as |
1664 | +# published by the Free Software Foundation, either version 3 of the |
1665 | +# License, or (at your option) any later version. |
1666 | +# |
1667 | +# This program is distributed in the hope that it will be useful, |
1668 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1669 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1670 | +# GNU Affero General Public License for more details. |
1671 | +# |
1672 | +# You should have received a copy of the GNU Affero General Public License |
1673 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1674 | +# |
1675 | +############################################################################## |
1676 | +import vat_period_end_statement |
1677 | |
1678 | === added file 'account_vat_period_end_statement/report/vat_period_end_statement.mako' |
1679 | --- account_vat_period_end_statement/report/vat_period_end_statement.mako 1970-01-01 00:00:00 +0000 |
1680 | +++ account_vat_period_end_statement/report/vat_period_end_statement.mako 2013-05-06 22:09:27 +0000 |
1681 | @@ -0,0 +1,193 @@ |
1682 | +<html> |
1683 | +<head> |
1684 | + <style type="text/css"> |
1685 | + ${css} |
1686 | +table.tax_codes { |
1687 | + border-width: 1px; |
1688 | + border-spacing: 2px; |
1689 | + border-style: outset; |
1690 | + border-color: gray; |
1691 | + border-collapse: collapse; |
1692 | + background-color: white; |
1693 | + margin-right:auto; |
1694 | + margin-left:auto; |
1695 | +} |
1696 | +table.tax_codes th { |
1697 | + border-width: 1px; |
1698 | + padding: 4px; |
1699 | + border-style: inset; |
1700 | + border-color: gray; |
1701 | + background-color: white; |
1702 | +} |
1703 | +table.tax_codes td { |
1704 | + border-width: 1px; |
1705 | + padding: 4px; |
1706 | + border-style: inset; |
1707 | + border-color: gray; |
1708 | + background-color: white; |
1709 | +} |
1710 | +tr { |
1711 | + page-break-inside: avoid; |
1712 | +} |
1713 | + </style> |
1714 | +</head> |
1715 | +<body> |
1716 | +<% setLang(company.partner_id.lang) %> |
1717 | +% for statement in objects: |
1718 | +<h1 style="text-align: center;">${_("VAT Statement Summary")} </h1> |
1719 | +<h2 style="text-align: center;">${_("Date")}: ${formatLang(statement.date, date=True)|entity} </h2> |
1720 | + |
1721 | +<table width="100%" class="tax_codes"> |
1722 | + <tr > |
1723 | + <th colspan="3">${ _('Sales') }</th> |
1724 | + </tr> |
1725 | + <tr > |
1726 | + <th >${ _('Tax Code') }</th> |
1727 | + <th >${ _('Base') }</th> |
1728 | + <th >${ _('VAT') }</th> |
1729 | + </tr> |
1730 | + <% debit_total_base = 0.0 %> |
1731 | + <% debit_total_vat = 0.0 %> |
1732 | + <% totals_by_tax_code = {} %> |
1733 | + %for period in statement.period_ids: |
1734 | + <tr > |
1735 | + <td style="text-align:left" colspan="3"><strong>${ _('Period') + ' ' + period.name}</strong></td> |
1736 | + </tr> |
1737 | + <% debit_amounts = tax_codes_amounts(period.id, [l.tax_code_id.id for l in statement.debit_vat_account_line_ids]) %> |
1738 | + %for tax_code in debit_amounts : |
1739 | + <% if tax_code not in totals_by_tax_code: totals_by_tax_code[tax_code]={'base':0.0,'vat':0.0} %> |
1740 | + <% totals_by_tax_code[tax_code]['base'] += debit_amounts[tax_code]['base'] %> |
1741 | + <% totals_by_tax_code[tax_code]['vat'] += debit_amounts[tax_code]['vat'] %> |
1742 | + <tr > |
1743 | + <td style="text-align:left">${ tax_code|entity }</td> |
1744 | + <td style="text-align:right">${ formatLang(debit_amounts[tax_code]['base'])|entity }</td> |
1745 | + <td style="text-align:right">${ formatLang(debit_amounts[tax_code]['vat'])|entity }</td> |
1746 | + <% debit_total_base += debit_amounts[tax_code]['base'] %> |
1747 | + <% debit_total_vat += debit_amounts[tax_code]['vat'] %> |
1748 | + </tr> |
1749 | + %endfor |
1750 | + %endfor |
1751 | + <tr > |
1752 | + <td style="text-align:left" colspan="3"><strong>${ _('Totals')}</strong></td> |
1753 | + </tr> |
1754 | + %for tax_code in totals_by_tax_code: |
1755 | + <tr > |
1756 | + <td style="text-align:left">${ tax_code|entity }</td> |
1757 | + <td style="text-align:right">${ formatLang(totals_by_tax_code[tax_code]['base'])|entity }</td> |
1758 | + <td style="text-align:right">${ formatLang(totals_by_tax_code[tax_code]['vat'])|entity }</td> |
1759 | + </tr> |
1760 | + %endfor |
1761 | + <tr > |
1762 | + <td style="text-align:left"></td> |
1763 | + <td style="text-align:right"><strong>${ formatLang(debit_total_base)|entity }</strong></td> |
1764 | + <td style="text-align:right"><strong>${ formatLang(debit_total_vat)|entity }</strong></td> |
1765 | + </tr> |
1766 | +</table> |
1767 | +<br/><br/> |
1768 | +<table width="100%" class="tax_codes"> |
1769 | + <tr > |
1770 | + <th colspan="3">${ _('Purchases') }</th> |
1771 | + </tr> |
1772 | + <tr > |
1773 | + <th >${ _('Tax Code') }</th> |
1774 | + <th >${ _('Base') }</th> |
1775 | + <th >${ _('VAT') }</th> |
1776 | + </tr> |
1777 | + <% credit_total_base = 0.0 %> |
1778 | + <% credit_total_vat = 0.0 %> |
1779 | + <% totals_by_tax_code = {} %> |
1780 | + %for period in statement.period_ids: |
1781 | + <tr > |
1782 | + <td style="text-align:left" colspan="3"><strong>${ _('Period') + ' ' + period.name}</strong></td> |
1783 | + </tr> |
1784 | + <% credit_amounts = tax_codes_amounts(period.id, [l.tax_code_id.id for l in statement.credit_vat_account_line_ids]) %> |
1785 | + %for tax_code in credit_amounts : |
1786 | + <% if tax_code not in totals_by_tax_code: totals_by_tax_code[tax_code]={'base':0.0,'vat':0.0} %> |
1787 | + <% totals_by_tax_code[tax_code]['base'] += credit_amounts[tax_code]['base'] %> |
1788 | + <% totals_by_tax_code[tax_code]['vat'] += credit_amounts[tax_code]['vat'] %> |
1789 | + <tr > |
1790 | + <td style="text-align:left">${ tax_code|entity }</td> |
1791 | + <td style="text-align:right">${ formatLang(credit_amounts[tax_code]['base'])|entity }</td> |
1792 | + <td style="text-align:right">${ formatLang(credit_amounts[tax_code]['vat'])|entity }</td> |
1793 | + <% credit_total_base += credit_amounts[tax_code]['base'] %> |
1794 | + <% credit_total_vat += credit_amounts[tax_code]['vat'] %> |
1795 | + </tr> |
1796 | + %endfor |
1797 | + %endfor |
1798 | + <tr > |
1799 | + <td style="text-align:left" colspan="3"><strong>${ _('Totals')}</strong></td> |
1800 | + </tr> |
1801 | + %for tax_code in totals_by_tax_code: |
1802 | + <tr > |
1803 | + <td style="text-align:left">${ tax_code|entity }</td> |
1804 | + <td style="text-align:right">${ formatLang(totals_by_tax_code[tax_code]['base'])|entity }</td> |
1805 | + <td style="text-align:right">${ formatLang(totals_by_tax_code[tax_code]['vat'])|entity }</td> |
1806 | + </tr> |
1807 | + %endfor |
1808 | + <tr > |
1809 | + <td style="text-align:left"></td> |
1810 | + <td style="text-align:right"><strong>${ formatLang(credit_total_base)|entity }</strong></td> |
1811 | + <td style="text-align:right"><strong>${ formatLang(credit_total_vat)|entity }</strong></td> |
1812 | + </tr> |
1813 | +</table> |
1814 | +<br/><br/> |
1815 | +<table class="tax_codes" width="100%" > |
1816 | + <tr > |
1817 | + <th colspan="3">${_("Summary")}</th> |
1818 | + </tr> |
1819 | + <tr> |
1820 | + <th></th> |
1821 | + <th> ${ _('Debit') }</th> |
1822 | + <th> ${ _('Credit') }</th> |
1823 | + </tr> |
1824 | + %for debit_line in statement.debit_vat_account_line_ids : |
1825 | + <tr > |
1826 | + <td>${ debit_line.account_id.name|entity }</td> |
1827 | + <td>${ formatLang(debit_line.amount)|entity }</td> |
1828 | + <td></td> |
1829 | + </tr> |
1830 | + %endfor |
1831 | + <!-- |
1832 | + <tr > |
1833 | + <td>${_("Total")}</td> |
1834 | + <td>${ statement.payable_vat_amount|entity }</td> |
1835 | + </tr> |
1836 | + --> |
1837 | + %for credit_line in statement.credit_vat_account_line_ids : |
1838 | + <tr > |
1839 | + <td>${ credit_line.account_id.name|entity }</td> |
1840 | + <td></td> |
1841 | + <td>${ formatLang(credit_line.amount)|entity }</td> |
1842 | + </tr> |
1843 | + %endfor |
1844 | + <!-- |
1845 | + <tr > |
1846 | + <td>${_("Total")}</td> |
1847 | + <td>${ statement.deductible_vat_amount|entity }</td> |
1848 | + </tr> |
1849 | + --> |
1850 | + <tr > |
1851 | + <td>${_("Previous Credits VAT")}</td> |
1852 | + <td></td> |
1853 | + <td>${ formatLang(statement.previous_credit_vat_amount)|entity }</td> |
1854 | + </tr> |
1855 | + <tr > |
1856 | + <td>${_("Previous Debits VAT")}</td> |
1857 | + <td>${ formatLang(statement.previous_debit_vat_amount)|entity }</td> |
1858 | + <td></td> |
1859 | + </tr> |
1860 | + %for generic_line in statement.generic_vat_account_line_ids : |
1861 | + <tr > |
1862 | + <td>${ generic_line.account_id.name|entity }</td> |
1863 | + <td>${ generic_line.amount < 0 and formatLang(generic_line.amount) or ''|entity }</td> |
1864 | + <td>${ generic_line.amount > 0 and formatLang(generic_line.amount) or ''|entity }</td> |
1865 | + </tr> |
1866 | + %endfor |
1867 | + <tr > |
1868 | + <td><strong>${_("Amount to pay")}</strong></td> |
1869 | + <td colspan="2" style="text-align:center"><strong>${ formatLang(statement.authority_vat_amount)|entity }</strong></td> |
1870 | + </tr> |
1871 | +</table> |
1872 | +%endfor |
1873 | +</body> |
1874 | +</html> |
1875 | |
1876 | === added file 'account_vat_period_end_statement/report/vat_period_end_statement.py' |
1877 | --- account_vat_period_end_statement/report/vat_period_end_statement.py 1970-01-01 00:00:00 +0000 |
1878 | +++ account_vat_period_end_statement/report/vat_period_end_statement.py 2013-05-06 22:09:27 +0000 |
1879 | @@ -0,0 +1,96 @@ |
1880 | +# -*- coding: utf-8 -*- |
1881 | +############################################################################## |
1882 | +# |
1883 | +# OpenERP, Open Source Management Solution |
1884 | +# Copyright (C) 2011-2012 Domsense s.r.l. (<http://www.domsense.com>). |
1885 | +# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>) |
1886 | +# Copyright (C) 2013 Associazione OpenERP Italia |
1887 | +# (<http://www.openerp-italia.org>). |
1888 | +# |
1889 | +# This program is free software: you can redistribute it and/or modify |
1890 | +# it under the terms of the GNU Affero General Public License as |
1891 | +# published by the Free Software Foundation, either version 3 of the |
1892 | +# License, or (at your option) any later version. |
1893 | +# |
1894 | +# This program is distributed in the hope that it will be useful, |
1895 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1896 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1897 | +# GNU Affero General Public License for more details. |
1898 | +# |
1899 | +# You should have received a copy of the GNU Affero General Public License |
1900 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1901 | +# |
1902 | +############################################################################## |
1903 | + |
1904 | +import time |
1905 | +from report import report_sxw |
1906 | +from tools.translate import _ |
1907 | + |
1908 | +class print_vat_period_end_statement(report_sxw.rml_parse): |
1909 | + _name = 'parser.vat.period.end.statement' |
1910 | + |
1911 | + def _build_codes_dict(self, tax_code, res={}, context=None): |
1912 | + if context is None: |
1913 | + context = {} |
1914 | + tax_pool = self.pool.get('account.tax') |
1915 | + if tax_code.sum_period: |
1916 | + if res.get(tax_code.name, False): |
1917 | + raise orm.except_orm(_('Error'), _('Too many occurences of tax code %s') % tax_code.name) |
1918 | + # search for taxes linked to that code |
1919 | + tax_ids = tax_pool.search(self.cr, self.uid, [('tax_code_id', '=', tax_code.id)], context=context) |
1920 | + if tax_ids: |
1921 | + tax = tax_pool.browse(self.cr, self.uid, tax_ids[0], context=context) |
1922 | + # search for the related base code |
1923 | + base_code = tax.base_code_id or tax.parent_id and tax.parent_id.base_code_id or False |
1924 | + if not base_code: |
1925 | + raise orm.except_orm(_('Error'), _('No base code found for tax code %s') % tax_code.name) |
1926 | + # check if every tax is linked to the same tax code and base code |
1927 | + for tax in tax_pool.browse(self.cr, self.uid, tax_ids, context=context): |
1928 | + test_base_code = tax.base_code_id or tax.parent_id and tax.parent_id.base_code_id or False |
1929 | + if test_base_code.id != base_code.id: |
1930 | + raise orm.except_orm(_('Error'), _('Not every tax linked to tax code %s is linked the same base code') % tax_code.name) |
1931 | + res[tax_code.name] = { |
1932 | + 'vat': tax_code.sum_period, |
1933 | + 'base': base_code.sum_period, |
1934 | + } |
1935 | + for child_code in tax_code.child_ids: |
1936 | + res = self._build_codes_dict(child_code, res=res, context=context) |
1937 | + return res |
1938 | + |
1939 | + def _get_tax_codes_amounts(self, period_id, tax_code_ids=[], context=None): |
1940 | + if context is None: |
1941 | + context = {} |
1942 | + res = {} |
1943 | + code_pool = self.pool.get('account.tax.code') |
1944 | + context['period_id'] = period_id |
1945 | + for tax_code in code_pool.browse(self.cr, self.uid, tax_code_ids, context=context): |
1946 | + res = self._build_codes_dict(tax_code, res=res, context=context) |
1947 | + return res |
1948 | + |
1949 | + def find_period(self, date,context=None): |
1950 | + if context is None: |
1951 | + context = {} |
1952 | + period_pool = self.pool.get('account.period') |
1953 | + period_ids = period_pool.find(self.cr, self.uid, dt=date, context=context) |
1954 | + if len(period_ids)> 1: |
1955 | + raise orm.except_orm(_('Error'), _('Too many periods for date %s') % str(date)) |
1956 | + return period_ids[0] |
1957 | + |
1958 | + def __init__(self, cr, uid, name, context=None): |
1959 | + if context is None: |
1960 | + context = {} |
1961 | + super(print_vat_period_end_statement, self).__init__(cr, uid, name, context=context) |
1962 | + self.localcontext.update( { |
1963 | + 'time': time, |
1964 | + 'tax_codes_amounts': self._get_tax_codes_amounts, |
1965 | + 'find_period': self.find_period, |
1966 | + }) |
1967 | + self.context = context |
1968 | + |
1969 | +report_sxw.report_sxw('report.account.print.vat.period.end.statement', |
1970 | + 'account.vat.period.end.statement', |
1971 | + 'addons/account_vat_period_end_statement/report/vat_period_end_statement.mako', |
1972 | + parser=print_vat_period_end_statement) |
1973 | + |
1974 | + |
1975 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
1976 | |
1977 | === added file 'account_vat_period_end_statement/reports.xml' |
1978 | --- account_vat_period_end_statement/reports.xml 1970-01-01 00:00:00 +0000 |
1979 | +++ account_vat_period_end_statement/reports.xml 2013-05-06 22:09:27 +0000 |
1980 | @@ -0,0 +1,16 @@ |
1981 | +<?xml version="1.0"?> |
1982 | +<openerp> |
1983 | + <data> |
1984 | + |
1985 | + <report |
1986 | + auto="False" |
1987 | + id="print_vat_period_end_statement" |
1988 | + model="account.vat.period.end.statement" |
1989 | + name="account.print.vat.period.end.statement" |
1990 | + file="account_vat_period_end_statement/report/vat_period_end_statement.mako" |
1991 | + string="VAT Statement Summary" |
1992 | + report_type="webkit" /> |
1993 | + |
1994 | + </data> |
1995 | +</openerp> |
1996 | + |
1997 | |
1998 | === added directory 'account_vat_period_end_statement/security' |
1999 | === added file 'account_vat_period_end_statement/security/ir.model.access.csv' |
2000 | --- account_vat_period_end_statement/security/ir.model.access.csv 1970-01-01 00:00:00 +0000 |
2001 | +++ account_vat_period_end_statement/security/ir.model.access.csv 2013-05-06 22:09:27 +0000 |
2002 | @@ -0,0 +1,9 @@ |
2003 | +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" |
2004 | +"access_account_vat_period_end_statement_accountant","access_account_vat_period_end_statement_accountant","model_account_vat_period_end_statement","account.group_account_user","1","1","1","1" |
2005 | +"access_account_vat_period_end_statement_manager","access_account_vat_period_end_statement_manager","model_account_vat_period_end_statement","account.group_account_manager","1","1","1","1" |
2006 | +"access_statement_debit_account_line_accountant","access_statement_debit_account_line_accountant","model_statement_debit_account_line","account.group_account_user","1","1","1","1" |
2007 | +"access_statement_debit_account_line_manager","access_statement_debit_account_line_manager","model_statement_debit_account_line","account.group_account_manager","1","1","1","1" |
2008 | +"access_statement_credit_account_line_accountant","access_statement_credit_account_line_accountant","model_statement_credit_account_line","account.group_account_user","1","1","1","1" |
2009 | +"access_statement_credit_account_line_manager","access_statement_credit_account_line_manager","model_statement_credit_account_line","account.group_account_manager","1","1","1","1" |
2010 | +"access_statement_generic_account_line_accountant","access_statement_generic_account_line_accountant","model_statement_generic_account_line","account.group_account_user","1","1","1","1" |
2011 | +"access_statement_generic_account_line_manager","access_statement_generic_account_line_manager","model_statement_generic_account_line","account.group_account_manager","1","1","1","1" |
2012 | |
2013 | === added file 'account_vat_period_end_statement/statement_workflow.xml' |
2014 | --- account_vat_period_end_statement/statement_workflow.xml 1970-01-01 00:00:00 +0000 |
2015 | +++ account_vat_period_end_statement/statement_workflow.xml 2013-05-06 22:09:27 +0000 |
2016 | @@ -0,0 +1,60 @@ |
2017 | +<?xml version="1.0"?> |
2018 | +<openerp> |
2019 | + <data> |
2020 | + <record model="workflow" id="wkf_vat_period_end_statement"> |
2021 | + <field name="name">workflow.vat.period.end.statement</field> |
2022 | + <field name="osv">account.vat.period.end.statement</field> |
2023 | + <field name="on_create">True</field> |
2024 | + </record> |
2025 | + |
2026 | + <record model="workflow.activity" id="act_draft"> |
2027 | + <field name="wkf_id" ref="wkf_vat_period_end_statement" /> |
2028 | + <field name="flow_start">True</field> |
2029 | + <field name="name">draft</field> |
2030 | + <field name="kind">function</field> |
2031 | + <field name="action">statement_draft()</field> |
2032 | + </record> |
2033 | + |
2034 | + <record model="workflow.activity" id="act_move_created"> |
2035 | + <field name="wkf_id" ref="wkf_vat_period_end_statement" /> |
2036 | + <field name="name">created</field> |
2037 | + <field name="kind">function</field> |
2038 | + <field name="action">create_move()</field> |
2039 | + </record> |
2040 | + |
2041 | + <record model="workflow.activity" id="act_statement_paid"> |
2042 | + <field name="wkf_id" ref="wkf_vat_period_end_statement" /> |
2043 | + <field name="name">paid</field> |
2044 | + <field name="kind">function</field> |
2045 | + <field name="action">statement_paid()</field> |
2046 | +<!-- <field name="flow_stop">True</field> --> |
2047 | + </record> |
2048 | + |
2049 | + <record model="workflow.transition" id="t1"> |
2050 | + <field name="act_from" ref="act_draft" /> |
2051 | + <field name="act_to" ref="act_move_created" /> |
2052 | + <field name="signal">create_move</field> |
2053 | + </record> |
2054 | + |
2055 | + <record model="workflow.transition" id="t2"> |
2056 | + <field name="act_to" ref="act_draft" /> |
2057 | + <field name="act_from" ref="act_move_created" /> |
2058 | + <field name="signal">set_draft</field> |
2059 | + </record> |
2060 | + |
2061 | + <record id="t3" model="workflow.transition"> |
2062 | + <field name="act_to" ref="act_statement_paid" /> |
2063 | + <field name="act_from" ref="act_move_created" /> |
2064 | + <field name="trigger_model">account.move.line</field> |
2065 | + <field name="trigger_expr_id">move_line_id_payment_get()</field> |
2066 | + <field name="condition">test_paid()</field> |
2067 | + </record> |
2068 | + |
2069 | + <record model="workflow.transition" id="t4"> |
2070 | + <field name="act_to" ref="act_draft" /> |
2071 | + <field name="act_from" ref="act_statement_paid" /> |
2072 | + <field name="signal">set_draft</field> |
2073 | + </record> |
2074 | + |
2075 | + </data> |
2076 | +</openerp> |
2077 | |
2078 | === added directory 'account_vat_period_end_statement/test' |
2079 | === added file 'account_vat_period_end_statement/test/account_tax.xml' |
2080 | --- account_vat_period_end_statement/test/account_tax.xml 1970-01-01 00:00:00 +0000 |
2081 | +++ account_vat_period_end_statement/test/account_tax.xml 2013-05-06 22:09:27 +0000 |
2082 | @@ -0,0 +1,68 @@ |
2083 | +<?xml version="1.0" encoding="utf-8"?> |
2084 | +<openerp> |
2085 | + <data noupdate="1"> |
2086 | + |
2087 | + <!-- Tax codes --> |
2088 | + |
2089 | + <record id="account_tax_code_21" model="account.tax.code"> |
2090 | + <field name="name">21 %</field> |
2091 | + <field name="vat_statement_type">debit</field> |
2092 | + <field name="vat_statement_account_id">account.ova</field> |
2093 | + </record> |
2094 | + <record id="account_tax_code_21_imp" model="account.tax.code"> |
2095 | + <field name="name">21 % IMP</field> |
2096 | + </record> |
2097 | + |
2098 | + <record id="account_tax_code_21_credit" model="account.tax.code"> |
2099 | + <field name="name">21 % (credit)</field> |
2100 | + <field name="vat_statement_type">credit</field> |
2101 | + <field name="vat_statement_account_id">account.iva</field> |
2102 | + </record> |
2103 | + <record id="account_tax_code_21_imp_credit" model="account.tax.code"> |
2104 | + <field name="name">21 % IMP</field> |
2105 | + </record> |
2106 | + |
2107 | + <!-- taxes --> |
2108 | + |
2109 | + <record id="account_tax_21" model="account.tax"> |
2110 | + <field name="name">21 %</field> |
2111 | + <field name="amount">0.21</field> |
2112 | + <field name="tax_code_id" ref="account_tax_code_21"></field> |
2113 | + <field name="base_code_id" ref="account_tax_code_21_imp"></field> |
2114 | + </record> |
2115 | + |
2116 | + <record id="account_tax_21_credit" model="account.tax"> |
2117 | + <field name="name">21 % (credit)</field> |
2118 | + <field name="amount">0.21</field> |
2119 | + <field name="tax_code_id" ref="account_tax_code_21_credit"></field> |
2120 | + <field name="base_code_id" ref="account_tax_code_21_imp_credit"></field> |
2121 | + </record> |
2122 | + |
2123 | + <!-- account --> |
2124 | + |
2125 | + <record id="vat_authority" model="account.account"> |
2126 | + <field name="code">VAT AUTH</field> |
2127 | + <field name="name">VAT Authority</field> |
2128 | + <field ref="cli" name="parent_id"/> |
2129 | + <field name="type">payable</field> |
2130 | + <field eval="True" name="reconcile"/> |
2131 | + <field name="user_type" ref="data_account_type_payable"/> |
2132 | + </record> |
2133 | + |
2134 | + <!-- |
2135 | + Payment term |
2136 | + --> |
2137 | + <record id="account_payment_term" model="account.payment.term"> |
2138 | + <field name="name">16 Days End of Month</field> |
2139 | + <field name="note">16 Days End of Month</field> |
2140 | + </record> |
2141 | + <record id="account_payment_term_line" model="account.payment.term.line"> |
2142 | + <field name="name">16 Days End of Month</field> |
2143 | + <field name="value">balance</field> |
2144 | + <field eval="16" name="days"/> |
2145 | + <field eval="-1" name="days2"/> |
2146 | + <field eval="account_payment_term" name="payment_id"/> |
2147 | + </record> |
2148 | + |
2149 | + </data> |
2150 | +</openerp> |
2151 | |
2152 | === added file 'account_vat_period_end_statement/test/tax_computation.yml' |
2153 | --- account_vat_period_end_statement/test/tax_computation.yml 1970-01-01 00:00:00 +0000 |
2154 | +++ account_vat_period_end_statement/test/tax_computation.yml 2013-05-06 22:09:27 +0000 |
2155 | @@ -0,0 +1,69 @@ |
2156 | +- |
2157 | + I create a new customer invoice |
2158 | +- |
2159 | + !record {model: account.invoice, id: account_invoice_customer_0}: |
2160 | + account_id: account.a_recv |
2161 | + address_contact_id: base.res_partner_address_zen |
2162 | + address_invoice_id: base.res_partner_address_zen |
2163 | + company_id: base.main_company |
2164 | + currency_id: base.EUR |
2165 | + date_invoice: !eval time.strftime('%Y-%m-%d') |
2166 | + type: out_invoice |
2167 | + invoice_line: |
2168 | + - account_id: account.a_sale |
2169 | + name: '100' |
2170 | + price_unit: 100 |
2171 | + quantity: 1.0 |
2172 | + invoice_line_tax_id: |
2173 | + - account_tax_21 |
2174 | + journal_id: account.sales_journal |
2175 | + partner_id: base.res_partner_3 |
2176 | + |
2177 | +- |
2178 | + I confirm and open the invoice |
2179 | +- |
2180 | + !workflow {model: account.invoice, ref: account_invoice_customer_0, action: invoice_open} |
2181 | +- |
2182 | + I create a new supplier invoice |
2183 | +- |
2184 | + !record {model: account.invoice, id: account_invoice_supplier_0}: |
2185 | + account_id: account.a_pay |
2186 | + address_contact_id: base.res_partner_address_7 |
2187 | + address_invoice_id: base.res_partner_address_7 |
2188 | + company_id: base.main_company |
2189 | + currency_id: base.EUR |
2190 | + date_invoice: !eval time.strftime('%Y-%m-%d') |
2191 | + type: in_invoice |
2192 | + invoice_line: |
2193 | + - account_id: account.a_expense |
2194 | + name: '50' |
2195 | + price_unit: 50 |
2196 | + quantity: 1.0 |
2197 | + invoice_line_tax_id: |
2198 | + - account_tax_21_credit |
2199 | + journal_id: account.expenses_journal |
2200 | + partner_id: base.res_partner_4 |
2201 | + |
2202 | +- |
2203 | + I confirm and open the invoice |
2204 | +- |
2205 | + !workflow {model: account.invoice, ref: account_invoice_supplier_0, action: invoice_open} |
2206 | + |
2207 | +- |
2208 | + I create the vat statement |
2209 | +- |
2210 | + !python {model: account.vat.period.end.statement}: | |
2211 | + period_id = self.pool.get('account.period').find(cr, uid, dt=time.strftime('%Y-%m-%d')) |
2212 | + on_change_res = self.on_change_period_id(cr, uid, [], period_id) |
2213 | + |
2214 | + !record {model: account.vat.period.end.statement, id: account_vat_statement_0}: |
2215 | + period_id: period_id |
2216 | + journal_id: account.miscellaneous_journal |
2217 | + debit_vat_account_line_ids: on_change_res['value']['debit_vat_account_line_ids'] |
2218 | + credit_vat_account_line_ids: on_change_res['value']['credit_vat_account_line_ids'] |
2219 | + authority_vat_account_id: vat_authority |
2220 | + payment_term_id: account_payment_term |
2221 | +- |
2222 | + I confirm and open the statement |
2223 | +- |
2224 | + !workflow {model: account.vat.period.end.statement, ref: account_vat_statement_0, action: create_move} |
2225 | |
2226 | === added directory 'account_vat_period_end_statement/wizard' |
2227 | === added file 'account_vat_period_end_statement/wizard/__init__.py' |
2228 | --- account_vat_period_end_statement/wizard/__init__.py 1970-01-01 00:00:00 +0000 |
2229 | +++ account_vat_period_end_statement/wizard/__init__.py 2013-05-06 22:09:27 +0000 |
2230 | @@ -0,0 +1,25 @@ |
2231 | +# -*- coding: utf-8 -*- |
2232 | +############################################################################## |
2233 | +# |
2234 | +# OpenERP, Open Source Management Solution |
2235 | +# Copyright (C) 2012 Domsense s.r.l. (<http://www.domsense.com>). |
2236 | +# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>) |
2237 | +# Copyright (C) 2013 Associazione OpenERP Italia |
2238 | +# (<http://www.openerp-italia.org>). |
2239 | +# |
2240 | +# This program is free software: you can redistribute it and/or modify |
2241 | +# it under the terms of the GNU Affero General Public License as |
2242 | +# published by the Free Software Foundation, either version 3 of the |
2243 | +# License, or (at your option) any later version. |
2244 | +# |
2245 | +# This program is distributed in the hope that it will be useful, |
2246 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2247 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2248 | +# GNU Affero General Public License for more details. |
2249 | +# |
2250 | +# You should have received a copy of the GNU Affero General Public License |
2251 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2252 | +# |
2253 | +############################################################################## |
2254 | +import add_period |
2255 | +import remove_period |
2256 | |
2257 | === added file 'account_vat_period_end_statement/wizard/add_period.py' |
2258 | --- account_vat_period_end_statement/wizard/add_period.py 1970-01-01 00:00:00 +0000 |
2259 | +++ account_vat_period_end_statement/wizard/add_period.py 2013-05-06 22:09:27 +0000 |
2260 | @@ -0,0 +1,49 @@ |
2261 | +# -*- coding: utf-8 -*- |
2262 | +############################################################################## |
2263 | +# |
2264 | +# OpenERP, Open Source Management Solution |
2265 | +# Copyright (C) 2012 Domsense s.r.l. (<http://www.domsense.com>). |
2266 | +# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>) |
2267 | +# Copyright (C) 2013 Associazione OpenERP Italia |
2268 | +# (<http://www.openerp-italia.org>). |
2269 | +# |
2270 | +# This program is free software: you can redistribute it and/or modify |
2271 | +# it under the terms of the GNU Affero General Public License as |
2272 | +# published by the Free Software Foundation, either version 3 of the |
2273 | +# License, or (at your option) any later version. |
2274 | +# |
2275 | +# This program is distributed in the hope that it will be useful, |
2276 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2277 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2278 | +# GNU Affero General Public License for more details. |
2279 | +# |
2280 | +# You should have received a copy of the GNU Affero General Public License |
2281 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2282 | +# |
2283 | +############################################################################## |
2284 | + |
2285 | +from openerp.osv import orm, fields |
2286 | +from tools.translate import _ |
2287 | + |
2288 | +class add_period(orm.Model): |
2289 | + |
2290 | + _name = 'add.period.to.vat.statement' |
2291 | + |
2292 | + _columns = { |
2293 | + 'period_id': fields.many2one('account.period','Period', required=True), |
2294 | + } |
2295 | + |
2296 | + def add_period(self, cr, uid, ids, context=None): |
2297 | + if 'active_id' not in context: |
2298 | + raise orm.except_orm(_('Error'), _('Current statement not found')) |
2299 | + statement_pool=self.pool.get('account.vat.period.end.statement') |
2300 | + wizard = self.browse(cr, uid, ids, context)[0] |
2301 | + if wizard.period_id.vat_statement_id: |
2302 | + raise orm.except_orm(_('Error'), _('Period %s is associated to statement %s yet') % (wizard.period_id.name, wizard.period_id.vat_statement_id.date)) |
2303 | + wizard.period_id.write({'vat_statement_id': context['active_id']}) |
2304 | + statement_pool.compute_amounts(cr, uid, [context['active_id']], context=context) |
2305 | + return { |
2306 | + 'type': 'ir.actions.act_window_close', |
2307 | + } |
2308 | + |
2309 | + |
2310 | |
2311 | === added file 'account_vat_period_end_statement/wizard/add_period.xml' |
2312 | --- account_vat_period_end_statement/wizard/add_period.xml 1970-01-01 00:00:00 +0000 |
2313 | +++ account_vat_period_end_statement/wizard/add_period.xml 2013-05-06 22:09:27 +0000 |
2314 | @@ -0,0 +1,27 @@ |
2315 | +<?xml version="1.0" ?> |
2316 | +<openerp> |
2317 | + <data> |
2318 | + <record id="add_period" model="ir.ui.view"> |
2319 | + <field name="name">add_period</field> |
2320 | + <field name="model">add.period.to.vat.statement</field> |
2321 | + <field name="type">form</field> |
2322 | + <field name="arch" type="xml"> |
2323 | + <form string="Add period"> |
2324 | + <field name="period_id"></field> |
2325 | + <group col="2" colspan="4"> |
2326 | + <button icon="gtk-cancel" special="cancel" string="Cancel"/> |
2327 | + <button icon="gtk-ok" name="add_period" string="Add" type="object"/> |
2328 | + </group> |
2329 | + </form> |
2330 | + </field> |
2331 | + </record> |
2332 | + <record id="action_add_period" model="ir.actions.act_window"> |
2333 | + <field name="name">Add period</field> |
2334 | + <field name="type">ir.actions.act_window</field> |
2335 | + <field name="res_model">add.period.to.vat.statement</field> |
2336 | + <field name="view_type">form</field> |
2337 | + <field name="view_mode">form</field> |
2338 | + <field name="target">new</field> |
2339 | + </record> |
2340 | + </data> |
2341 | +</openerp> |
2342 | |
2343 | === added file 'account_vat_period_end_statement/wizard/remove_period.py' |
2344 | --- account_vat_period_end_statement/wizard/remove_period.py 1970-01-01 00:00:00 +0000 |
2345 | +++ account_vat_period_end_statement/wizard/remove_period.py 2013-05-06 22:09:27 +0000 |
2346 | @@ -0,0 +1,54 @@ |
2347 | +# -*- coding: utf-8 -*- |
2348 | +############################################################################## |
2349 | +# |
2350 | +# OpenERP, Open Source Management Solution |
2351 | +# Copyright (C) 2012 Domsense s.r.l. (<http://www.domsense.com>). |
2352 | +# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>) |
2353 | +# Copyright (C) 2013 Associazione OpenERP Italia |
2354 | +# (<http://www.openerp-italia.org>). |
2355 | +# |
2356 | +# This program is free software: you can redistribute it and/or modify |
2357 | +# it under the terms of the GNU Affero General Public License as |
2358 | +# published by the Free Software Foundation, either version 3 of the |
2359 | +# License, or (at your option) any later version. |
2360 | +# |
2361 | +# This program is distributed in the hope that it will be useful, |
2362 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2363 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2364 | +# GNU Affero General Public License for more details. |
2365 | +# |
2366 | +# You should have received a copy of the GNU Affero General Public License |
2367 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2368 | +# |
2369 | +############################################################################## |
2370 | + |
2371 | +from openerp.osv import orm, fields |
2372 | +from tools.translate import _ |
2373 | + |
2374 | +class remove_period(orm.Model): |
2375 | + |
2376 | + def _get_period_ids(self, cr, uid, context=None): |
2377 | + statement_obj = self.pool.get('account.vat.period.end.statement') |
2378 | + res = [] |
2379 | + if context.has_key('active_id'): |
2380 | + statement = statement_obj.browse(cr, uid, context['active_id'], context) |
2381 | + for period in statement.period_ids: |
2382 | + res.append((period.id, period.name)) |
2383 | + return res |
2384 | + |
2385 | + _name = 'remove.period.from.vat.statement' |
2386 | + |
2387 | + _columns = { |
2388 | + 'period_id': fields.selection(_get_period_ids, 'Period', required=True), |
2389 | + } |
2390 | + |
2391 | + def remove_period(self, cr, uid, ids, context=None): |
2392 | + if 'active_id' not in context: |
2393 | + raise orm.except_orm(_('Error'), _('Current statement not found')) |
2394 | + self.pool.get('account.period').write(cr, uid, [int(self.browse(cr, uid, ids, context)[0].period_id)], {'vat_statement_id': False}, context=context) |
2395 | + self.pool.get('account.vat.period.end.statement').compute_amounts(cr, uid, [context['active_id']], context=context) |
2396 | + return { |
2397 | + 'type': 'ir.actions.act_window_close', |
2398 | + } |
2399 | + |
2400 | + |
2401 | |
2402 | === added file 'account_vat_period_end_statement/wizard/remove_period.xml' |
2403 | --- account_vat_period_end_statement/wizard/remove_period.xml 1970-01-01 00:00:00 +0000 |
2404 | +++ account_vat_period_end_statement/wizard/remove_period.xml 2013-05-06 22:09:27 +0000 |
2405 | @@ -0,0 +1,27 @@ |
2406 | +<?xml version="1.0" ?> |
2407 | +<openerp> |
2408 | + <data> |
2409 | + <record id="remove_period" model="ir.ui.view"> |
2410 | + <field name="name">remove_period</field> |
2411 | + <field name="model">remove.period.from.vat.statement</field> |
2412 | + <field name="type">form</field> |
2413 | + <field name="arch" type="xml"> |
2414 | + <form string="Remove period"> |
2415 | + <field name="period_id"></field> |
2416 | + <group col="2" colspan="4"> |
2417 | + <button icon="gtk-cancel" special="cancel" string="Cancel"/> |
2418 | + <button icon="gtk-ok" name="remove_period" string="Remove" type="object"/> |
2419 | + </group> |
2420 | + </form> |
2421 | + </field> |
2422 | + </record> |
2423 | + <record id="action_remove_period" model="ir.actions.act_window"> |
2424 | + <field name="name">Remove period</field> |
2425 | + <field name="type">ir.actions.act_window</field> |
2426 | + <field name="res_model">remove.period.from.vat.statement</field> |
2427 | + <field name="view_type">form</field> |
2428 | + <field name="view_mode">form</field> |
2429 | + <field name="target">new</field> |
2430 | + </record> |
2431 | + </data> |
2432 | +</openerp> |
Funziona bene anche con l'l10n_it alternativo :)