Merge lp:~openerp-dev/openobject-addons/trunk-bug-731671-skh into lp:openobject-addons

Proposed by Somesh Khare
Status: Merged
Approved by: Mustufa Rangwala (Open ERP)
Approved revision: 4613
Merge reported by: qdp (OpenERP)
Merged at revision: not available
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-731671-skh
Merge into: lp:openobject-addons
Diff against target: 82 lines (+10/-10)
2 files modified
l10n_be/wizard/l10_be_partner_vat_listing.py (+8/-8)
l10n_be/wizard/l10n_be_account_vat_declaration.py (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-731671-skh
Reviewer Review Type Date Requested Status
Mustufa Rangwala (Open ERP) (community) Approve
Somesh Khare (community) Needs Resubmitting
qdp (OpenERP) Pending
Review via email: mp+55723@code.launchpad.net

Description of the change

Hello,

Fix : incorrect xml for Annual Listing Of VAT-Subjected Customers.

Thanks,
skh

To post a comment you must log in.
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

check modified query

review: Needs Fixing
4613. By Somesh Khare

[FIX] incorrect xml for Annual Listing Of VAT-Subjected Customers

Revision history for this message
Somesh Khare (somesh.khare) wrote :

Hello,

[Fix] : I have made the changes, Please check

review: Needs Resubmitting
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

@ qdp: please check the modified query as it is customers so it takes sum(l.credit) ... I am not sure about this change.

other things are ok.

thanks,
mra

review: Approve
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

We have proper fixed as per the changes also from 5.0 and that proposal to be merge for l10n_be fix.

thanks,
mra

Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_be/wizard/l10_be_partner_vat_listing.py'
2--- l10n_be/wizard/l10_be_partner_vat_listing.py 2011-01-14 00:11:01 +0000
3+++ l10n_be/wizard/l10_be_partner_vat_listing.py 2011-04-04 13:39:32 +0000
4@@ -58,8 +58,8 @@
5 obj_vat_lclient = self.pool.get('vat.listing.clients')
6 obj_model_data = self.pool.get('ir.model.data')
7 data = self.read(cursor, user, ids)[0]
8- period = obj_period.search(cursor, user, [('fiscalyear_id', '=', data['fyear'])], context=context)
9- p_id_list = obj_partner.search(cursor, user, [('vat_subjected', '!=', False)], context=context)
10+ period = obj_period.search(cursor, user, [('fiscalyear_id', '=', data['fyear'][0])], context=context)
11+ p_id_list = obj_partner.search(cursor, user, [('vat_subjected', '=', True),('customer','=',True)], context=context)
12 if not p_id_list:
13 raise osv.except_osv(_('Data Insufficient!'), _('No partner has a VAT Number asociated with him.'))
14 partners = []
15@@ -77,7 +77,8 @@
16 break
17 if not go_ahead:
18 continue
19- cursor.execute('select b.code, sum(credit)-sum(debit) from account_move_line l left join account_account a on (l.account_id=a.id) left join account_account_type b on (a.user_type=b.id) where b.code IN %s and l.partner_id=%s and l.period_id IN %s group by b.code',(('produit','tax'),obj_partner.id,tuple(period),))
20+# cursor.execute('select b.code,sum(credit)-sum(debit) from account_move_line l left join account_account a on (l.account_id=a.id) left join account_account_type b on (a.user_type=b.id) where b.code IN %s and l.partner_id=%s and l.period_id IN %s group by b.code,l.credit, l.debit',(('produit','tax'),obj_partner.id,tuple(period),))
21+ cursor.execute('select b.code, sum(l.credit) from account_move_line l left join account_account a on (l.account_id=a.id) left join account_account_type b on (a.user_type=b.id) where b.code IN %s and l.partner_id=%s and l.period_id IN %s group by b.code,l.credit, l.debit',(('produit','tax'),obj_partner.id,tuple(period),))
22 line_info = cursor.fetchall()
23 if not line_info:
24 continue
25@@ -87,9 +88,10 @@
26 #it seems that this listing is only for belgian customers
27 record['country'] = 'BE'
28
29- record['amount'] = 0
30- record['turnover'] = 0
31+ record['amount'] = 0.0
32+ record['turnover'] = 0.0
33 record['name'] = obj_partner.name
34+
35 for item in line_info:
36 if item[0] == 'produit':
37 record['turnover'] += item[1]
38@@ -156,7 +158,7 @@
39
40 cref = company_vat + seq_controlref
41 dnum = cref + seq_declarantnum
42- obj_year= obj_fyear.browse(cursor, user, context['fyear'], context=context)
43+ obj_year= obj_fyear.browse(cursor, user, context['fyear'][0], context=context)
44 street = zip_city = country = ''
45 addr = obj_partner.address_get(cursor, user, [obj_cmpny.partner_id.id], ['invoice'])
46 if addr.get('invoice',False):
47@@ -171,7 +173,6 @@
48 street += ads.street2
49 if ads.country_id:
50 country = ads.country_id.code
51-
52 sender_date = time.strftime('%Y-%m-%d')
53 comp_name = obj_cmpny.name
54 data_file = '<?xml version="1.0"?>\n<VatList xmlns="http://www.minfin.fgov.be/VatList" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.minfin.fgov.be/VatList VatList.xml" RecipientId="VAT-ADMIN" SenderId="'+ str(company_vat) + '"'
55@@ -206,7 +207,6 @@
56 sum_tax += line['amount']
57 sum_turnover += line['turnover']
58 data_clientinfo += '\n<ClientList SequenceNum="'+str(seq)+'">\n\t<CompanyInfo>\n\t\t<VATNum>'+line['vat'] +'</VATNum>\n\t\t<Country>' + line['country'] +'</Country>\n\t</CompanyInfo>\n\t<Amount>'+str(int(round(line['amount'] * 100))) +'</Amount>\n\t<TurnOver>'+str(int(round(line['turnover'] * 100))) +'</TurnOver>\n</ClientList>'
59-
60 data_decl ='\n<DeclarantList SequenceNum="1" DeclarantNum="'+ dnum + '" ClientNbr="'+ str(seq) +'" TurnOverSum="'+ str(int(round(sum_turnover * 100))) +'" TaxSum="'+ str(int(round(sum_tax * 100))) +'" />'
61 data_file += data_decl + data_comp + str(data_period) + data_clientinfo + '\n</VatList>'
62 msg = 'Save the File with '".xml"' extension.'
63
64=== modified file 'l10n_be/wizard/l10n_be_account_vat_declaration.py'
65--- l10n_be/wizard/l10n_be_account_vat_declaration.py 2011-01-14 00:11:01 +0000
66+++ l10n_be/wizard/l10n_be_account_vat_declaration.py 2011-04-04 13:39:32 +0000
67@@ -71,13 +71,13 @@
68 tax_code_ids = obj_tax_code.search(cr, uid, [], context=context)
69 ctx = context.copy()
70 data = self.read(cr, uid, ids)[0]
71- ctx['period_id'] = data['period_id'] #added context here
72+ ctx['period_id'] = data['period_id'][0] #added context here
73 tax_info = obj_tax_code.read(cr, uid, tax_code_ids, ['code','sum_period'], context=ctx)
74
75 address = post_code = city = country_code = ''
76 city, post_code, address, country_code = self.pool.get('res.company')._get_default_ad(obj_company.partner_id.address)
77
78- account_period = obj_acc_period.browse(cr, uid, data['period_id'], context=context)
79+ account_period = obj_acc_period.browse(cr, uid, data['period_id'][0], context=context)
80
81 send_ref = str(obj_company.partner_id.id) + str(account_period.date_start[5:7]) + str(account_period.date_stop[:4])
82 data_of_file = '<?xml version="1.0"?>\n<VATSENDING xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="MultiDeclarationTVA-NoSignature-16.xml">'

Subscribers

People subscribed via source and target branches

to all changes: