As you have added another condition, and to accomodate other countries, code can be refactored to:
if company: country_code = company_vat[0:2].upper() if country_code == 'BE': party_identifier = company_vat[2:].replace(' ', '') elif country_code == 'ES': party_identifier = company.sepa_creditor_identifier
Regards.
« Back to merge proposal
As you have added another condition, and to accomodate other countries, code can be refactored to:
if company: vat[0:2] .upper( )
party_ identifier = company_ vat[2:] .replace( ' ', '')
party_ identifier = company. sepa_creditor_ identifier
country_code = company_
if country_code == 'BE':
elif country_code == 'ES':
Regards.