From 5f7879e13676ef82a513cbfb91fef4027fc503c3 Mon Sep 17 00:00:00 2001 From: "Bharat Devnani (OpenERP)" Date: Mon, 23 Jan 2012 17:55:12 +0530 Subject: [PATCH] [IMP] improved the Periodical VAT Declaration Wizard bzr revid: bde@tinyerp.com-20120123122512-lq77vlcbmayp08k1 --- .../wizard/l10n_be_account_vat_declaration.py | 30 ++++++++++++------- .../l10n_be_account_vat_declaration_view.xml | 6 ++++ 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/addons/l10n_be/wizard/l10n_be_account_vat_declaration.py b/addons/l10n_be/wizard/l10n_be_account_vat_declaration.py index 5a3e68aaa3c..91fed379c1c 100644 --- a/addons/l10n_be/wizard/l10n_be_account_vat_declaration.py +++ b/addons/l10n_be/wizard/l10n_be_account_vat_declaration.py @@ -48,6 +48,10 @@ class l10n_be_vat_declaration(osv.osv_memory): 'ask_restitution': fields.boolean('Ask Restitution',help='It indicates whether a resitution is to made or not?'), 'ask_payment': fields.boolean('Ask Payment',help='It indicates whether a payment is to made or not?'), 'client_nihil': fields.boolean('Last Declaration of Enterprise',help='Tick this case only if it concerns only the last statement on the civil or cessation of activity'), + 'vat_declarations_nbr': fields.integer('VATDeclarationsNbr'), + 'comments': fields.text('Comments'), + 'identification_type': fields.selection([('tin','TIN'), ('nvat','NVAT'), ('other','Other')], 'Identification Type', required=True), + 'other': fields.char('Specify', size=16), } _defaults = { 'msg': 'Save the File with '".xml"' extension.', @@ -85,15 +89,21 @@ class l10n_be_vat_declaration(osv.osv_memory): name, email, phone, city, post_code, address, country_code = self.pool.get('res.company')._get_default_ad(obj_company.partner_id.address) account_period = obj_acc_period.browse(cr, uid, data['period_id'][0], context=context) - + issued_by = vat_no[:2] + comments = data['comments'] or '' + type = data['identification_type'] or '' + val = data['other'] or '' + send_ref = str(obj_company.partner_id.id) + str(account_period.date_start[5:7]) + str(account_period.date_stop[:4]) - data_of_file = '\n' - data_of_file +='\n\t'+ obj_company.name +'' - data_of_file +='\n\t'+ send_ref +'' - data_of_file +='\n\t' - data_of_file +='\n\t\t''' + + data_of_file = '\n' + print "val", val + data_of_file +='\n\t \n\t\t'+obj_company.company_registry+' \n\t\t'+obj_company.name+' \n\t\t'+address+' \n\t\t'+post_code+' \n\t\t'+city+' \n\t\t'+country_code+' \n\t\t'+email+' \n\t\t'+phone+' \n\t' + data_of_file +='\n\t' + data_of_file +='\n\t' + data_of_file +='\n\t\t' data_of_file +='\n\t\t\n\t\t\t'+str(vat_no)+'' - data_of_file +='\n\t\t\t'+name+'' + data_of_file +='\n\t\t\t'+obj_company.name+'' data_of_file +='\n\t\t\t'+address+'' data_of_file +='\n\t\t\t'+post_code+'' data_of_file +='\n\t\t\t'+city+'' @@ -114,7 +124,6 @@ class l10n_be_vat_declaration(osv.osv_memory): data_of_file += '\t'+starting_month+'\n\t\t\t' data_of_file += '' + str(account_period.date_stop[:4]) + '\n\t\t\n' data_of_file +='\t\t\t' - data_of_file +='\n\t\t\t\t' cases_list = [] for item in tax_info: @@ -131,14 +140,13 @@ class l10n_be_vat_declaration(osv.osv_memory): cases_list.append(item) cases_list.sort() for item in cases_list: - data_of_file +='\n\t\t\t\t' + str(abs(int(round(item['sum_period']*100)))) + '' + data_of_file +='\n\t\t\t' + str(abs(int(round(item['sum_period']*100)))) + '' - data_of_file +='\n\t\t\t\t' data_of_file += '\n\t\t' data_of_file += '\n\t\t'+ (data['client_nihil'] and 'YES' or 'NO') +'' data_of_file += '\n\t\t' data_of_file +='\n\t\t''' - data_of_file +='\n\t\t''' + data_of_file +='\n\t\t'+ comments +'' data_of_file += '\n\t \n' model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_vat_save')], context=context) resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id'] diff --git a/addons/l10n_be/wizard/l10n_be_account_vat_declaration_view.xml b/addons/l10n_be/wizard/l10n_be_account_vat_declaration_view.xml index 4b46b737a39..e09c9e3e38f 100644 --- a/addons/l10n_be/wizard/l10n_be_account_vat_declaration_view.xml +++ b/addons/l10n_be/wizard/l10n_be_account_vat_declaration_view.xml @@ -16,7 +16,10 @@ + + + @@ -24,8 +27,11 @@ +