Replace country code when VAT is ES

From changeset-b5a24173572e
This commit is contained in:
Raimon Esteve 2017-07-25 09:31:41 +02:00
parent 4082cb2ee5
commit ba68801aff

View file

@ -37,7 +37,7 @@ class BaseTrytonInvoiceMapper(Model):
def counterpart_nif(self, invoice):
if invoice.party.identifiers:
nif = invoice.party.identifiers[0].code
if nif.type == 'eu_vat':
if nif.startswith('ES'):
return nif[2:]
return nif
return ''