diff --git a/addons/l10n_be/company.py b/addons/l10n_be/company.py index 4395f13380e..1a29940ada6 100644 --- a/addons/l10n_be/company.py +++ b/addons/l10n_be/company.py @@ -25,7 +25,7 @@ class res_company(osv.osv): _description = 'res.company' def _get_default_ad(self, addresses): - city = post_code = address = "" + city = post_code = address = country_code = "" for ads in addresses: if ads.type == 'default': city = ads.city or "" @@ -34,7 +34,9 @@ class res_company(osv.osv): address = ads.street or "" if ads.street2: address += " " + ads.street2 - return city, post_code, address + if ads.country_id: + country_code = ads.country_id and ads.country_id.code or "" + return city, post_code, address, country_code res_company() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: 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 9dd5ea5b269..b1674293291 100644 --- a/addons/l10n_be/wizard/l10n_be_account_vat_declaration.py +++ b/addons/l10n_be/wizard/l10n_be_account_vat_declaration.py @@ -32,6 +32,9 @@ class l10n_be_vat_declaration(osv.osv_memory): 'period_id': fields.many2one('account.period','Period', required=True), 'msg': fields.text('File created', size=64, readonly=True), 'file_save': fields.binary('Save File'), + 'ask_resitution': {'type': 'boolean', 'string': 'Ask Restitution',}, + 'ask_payment': {'type': 'boolean', 'string': 'Ask Payment',}, + 'client_nihil': {'type': 'boolean', 'string': 'Last Declaration of Entreprise', 'help': 'Thick this case only if it concerns only the last statement on the civil or cessation of activity'}, } _defaults = { @@ -46,7 +49,7 @@ class l10n_be_vat_declaration(osv.osv_memory): obj_comp = self.pool.get('res.company') obj_data = self.pool.get('ir.model.data') - list_of_tags=['00','01','02','03','45','46','47','48','49','54','55','56','57','59','61','62','63','64','71','81','82','83','84','85','86','87','91'] + list_of_tags=['00','01','02','03','44','45','46','47','48','49','54','55','56','57','59','61','62','63','64','71','81','82','83','84','85','86','87','88','91'] obj_company = obj_user.browse(cr, uid, uid, context=context).company_id user_cmpny = obj_company.name vat_no=obj_company.partner_id.vat @@ -59,26 +62,19 @@ class l10n_be_vat_declaration(osv.osv_memory): ctx['period_id'] = data['period_id'] #added context here tax_info = obj_tax_code.read(cr, uid, tax_code_ids, ['code','sum_period'], context=ctx) - address = post_code = city = '' - if not obj_company.partner_id.address: - address = post_code = city = '' - - city, post_code, address = obj_comp._get_default_ad(obj_company.partner_id.address) + address = post_code = city = country_code = '' + city, post_code, address, country_code = obj_comp._get_default_ad(obj_company.partner_id.address) year_id = obj_fyear.find(cr, uid) account_period = obj_acc_period.browse(cr, uid, data['period_id'], context=context) - current_year = account_period.fiscalyear_id.name period_code = account_period.code - send_ref = user_cmpny - if period_code: - send_ref = send_ref + period_code - + 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\n\t\t'+str(vat_no)+'\n\t\t'+str(obj_company.name)+'\n\t\t
'+address+'
' - data_of_file +='\n\t\t'+post_code+'\n\t\t'+city+'\n\t\t'+send_ref+'\n\t
' - data_of_file +='\n\t\n\t\t1\n\t\t'+str(vat_no)+'\n\t\t\n\t\t\t' - + data_of_file +='\n\t\t'+post_code+'\n\t\t'+city+'\n\t\t'+country_code+'\n\t\t'+send_ref+'\n\t' + data_of_file +='\n\t\n\t\t1\n\t\t'+str(vat_no[2:])+'\n\t\t\n\t\t\t' + starting_month = account_period.date_start[5:7] ending_month = account_period.date_stop[5:7] if starting_month != ending_month: @@ -89,14 +85,16 @@ class l10n_be_vat_declaration(osv.osv_memory): else: data_of_file += '' + starting_month + '\n\t\t\t' data_of_file += '' + str(account_period.date_stop[:4]) + '\n\t\t\n\t\t' + data_of_file += '\n\t\t'+ (data['form']['client_nihil'] and 'YES' or 'NO') +'' data_of_file +='\n\t\t\n\t\t\t' for item in tax_info: if item['code']: + if item['code'] == '71-72': item['code'] = '71' if item['code'] in list_of_tags: - data_of_file +='\n\t\t\t\t' + str(int(item['sum_period']*100)) + '' + data_of_file +='\n\t\t\t\t' + str(abs(int(item['sum_period']*100))) + '' data_of_file +='\n\t\t\t\n\t\t\n\t\n
' data['file_save'] = base64.encodestring(data_of_file) @@ -105,4 +103,4 @@ class l10n_be_vat_declaration(osv.osv_memory): l10n_be_vat_declaration() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: 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 56f8b6477f9..3f33448f8d3 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 @@ -15,6 +15,9 @@
+ + +