Merge lp:~vauxoo/openerp-mexico-localization/7.0-l10n_mx_diot_checkup_amounts-dev_luis into lp:openerp-mexico-localization/7.0

Proposed by Luis Torres - http://www.vauxoo.com
Status: Merged
Merged at revision: 318
Proposed branch: lp:~vauxoo/openerp-mexico-localization/7.0-l10n_mx_diot_checkup_amounts-dev_luis
Merge into: lp:openerp-mexico-localization/7.0
Diff against target: 84 lines (+24/-2)
2 files modified
l10n_mx_diot_report/wizard/wizard_diot_report.py (+23/-2)
l10n_mx_diot_report/wizard/wizard_diot_report_view.xml (+1/-0)
To merge this branch: bzr merge lp:~vauxoo/openerp-mexico-localization/7.0-l10n_mx_diot_checkup_amounts-dev_luis
Reviewer Review Type Date Requested Status
Moisés López - http://www.vauxoo.com Pending
Julio Serna-http://www.vauxoo.com Pending
Review via email: mp+191535@code.launchpad.net

Description of the change

Se agrego validación de que entre el calculo del monto base de la linea y el monto base capturado no halla una diferencia mayor a los .2 unidades.

Ademas se agrego la opcion de poder imprimir todas las lineas sin importar el estado de su movimiento, o unicamente las lineas a las que pertenecen a movimientos posteados

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_mx_diot_report/wizard/wizard_diot_report.py'
2--- l10n_mx_diot_report/wizard/wizard_diot_report.py 2013-10-11 00:26:18 +0000
3+++ l10n_mx_diot_report/wizard/wizard_diot_report.py 2013-10-16 23:52:11 +0000
4@@ -50,10 +50,13 @@
5 'file_csv': fields.binary('File', readonly=True, help='It will open in your program office, to validate numbers'),
6 'state': fields.selection([('choose', 'Choose'), ('get', 'Get'),
7 ('not_file', 'Not File')]),
8+ 'entries_to_print': fields.selection([('all', 'All Entries'),
9+ ('posted', 'Posted Entries')], 'Entries to show', required=True)
10 }
11
12 _defaults = {
13 'state': 'choose',
14+ 'entries_to_print' : 'all'
15 }
16
17 def default_get(self, cr, uid, fields, context=None):
18@@ -98,13 +101,16 @@
19 account_ids_tax = []
20 for tax in acc_tax_obj.browse(cr, uid, tax_purchase_ids, context=context):
21 account_ids_tax.append(tax.account_paid_voucher_id.id)
22- move_lines_diot = acc_move_line_obj.search(cr, uid, [
23+ attrs = [
24 ('period_id', '=', period.id),
25 ('partner_id', '!=', partner_company_id),
26 ('tax_id_secondary', 'in', tax_purchase_ids),
27 ('state', '=', 'valid'),
28 ('account_id', 'in', account_ids_tax),
29- ('not_move_diot', '=', False)])
30+ ('not_move_diot', '=', False)]
31+ if this.entries_to_print == 'posted':
32+ attrs.append(('move_id.state', '=', 'posted'))
33+ move_lines_diot = acc_move_line_obj.search(cr, uid, attrs, context=context)
34 dic_move_line = {}
35 partner_ids_to_fix = []
36 moves_without_partner = []
37@@ -122,6 +128,7 @@
38 'type': 'ir.actions.act_window',
39 'domain': [('id', 'in', moves_without_partner), ],
40 }
41+ lines_difference_in_amount = []
42 for line in acc_move_line_obj.browse(cr, uid, move_lines_diot,
43 context=context):
44 partner_id = line.partner_id
45@@ -203,6 +210,11 @@
46 dic_move_line.update({
47 partner_vat: matrix_row})
48 matrix_row = []
49+ if category and category in ('IVA', 'IVA-EXENTO') and line.tax_id_secondary:
50+ amount_line = (line.debit or line.credit) / line.tax_id_secondary.amount
51+ difference_amount = abs(amount_line) - abs(amount_base_tax)
52+ if abs(difference_amount) > 0.2:
53+ lines_difference_in_amount.append(line.id)
54 if partner_ids_to_fix:
55 return {
56 'name': 'Suppliers do not have the information necessary'
57@@ -215,6 +227,15 @@
58 'active', '=', False), ('active', '=', True)],
59 }
60 (fileno, fname) = tempfile.mkstemp('.txt', 'tmp')
61+ if lines_difference_in_amount:
62+ return {
63+ 'name': 'Movements with differences in amount base',
64+ 'view_type': 'form',
65+ 'view_mode': 'tree,form',
66+ 'res_model': 'account.move.line',
67+ 'type': 'ir.actions.act_window',
68+ 'domain': [('id', 'in', lines_difference_in_amount)],
69+ }
70 if moves_amount_0:
71 return {
72 'name': 'Movements to corroborate the amounts of taxes',
73
74=== modified file 'l10n_mx_diot_report/wizard/wizard_diot_report_view.xml'
75--- l10n_mx_diot_report/wizard/wizard_diot_report_view.xml 2013-08-26 18:47:16 +0000
76+++ l10n_mx_diot_report/wizard/wizard_diot_report_view.xml 2013-10-16 23:52:11 +0000
77@@ -12,6 +12,7 @@
78 <group states="choose" string="DIOT Report - Statement of transactions with third parties [DIOT]" colspan="4">
79 <field name="company_id" />
80 <field name="period_id" />
81+ <field name="entries_to_print" />
82 </group>
83 <div states="get">
84 <h2>You DIOT report has been successfully created!</h2>