2023-08-04 17:22:55 +02:00
|
|
|
{% macro administrative_center(centre_code, role_type_code, person_type, addrs) %}
|
2018-05-18 09:28:25 +02:00
|
|
|
<AdministrativeCentre>
|
|
|
|
<CentreCode>{{ centre_code }}</CentreCode>
|
|
|
|
<RoleTypeCode>{{ role_type_code }}</RoleTypeCode>
|
2023-08-04 17:22:55 +02:00
|
|
|
<Name>{% if person_type == 'J' %}{{ addrs.party.name and addrs.party.name[:40] }}{% else %}{{ addrs.party.name and addrs.party.name.split(' ', 2)[0][:40] or addrs.party.code[:40] }}{% endif %}</Name>
|
|
|
|
{% if person_type == 'F' %}
|
|
|
|
<FirstSurname>{{ addrs.party.name and addrs.party.name.split(' ', 2)[1][:40] }}</FirstSurname>
|
2018-05-18 09:28:25 +02:00
|
|
|
{% endif %}
|
2023-08-04 17:22:55 +02:00
|
|
|
{% if person_type == 'F' and addrs.party.name.split(' ') | length > 2 %}
|
|
|
|
<SecondSurname>{{ addrs.party.name and addrs.party.name.split(' ', 2)[2][:40] }}</SecondSurname>
|
2018-05-18 09:28:25 +02:00
|
|
|
{% endif %}
|
2023-08-04 17:22:55 +02:00
|
|
|
{% if addrs %}{{ address(addrs) }}{% endif %}
|
|
|
|
{% if addrs.party.contact_mechanisms %}{{ contact(addrs.party) }}{% endif %}
|
2018-05-18 09:28:25 +02:00
|
|
|
<PhysicalGLN/>
|
|
|
|
<LogicalOperationalPoint/>
|
2023-08-04 17:22:55 +02:00
|
|
|
<CentreDescription>{{ addrs.party.name and addrs.party.name.split(' ', 2)[0][:40] or addrs.party.code[:40] }}</CentreDescription>
|
2018-05-18 09:28:25 +02:00
|
|
|
</AdministrativeCentre>
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
{% macro address(address) %}
|
|
|
|
{% if address.country and address.country.code == 'ES' %}
|
|
|
|
<AddressInSpain>
|
|
|
|
<Address>{{ address.street[:80] }}</Address>
|
2021-04-01 16:37:27 +02:00
|
|
|
<PostCode>{{ address.postal_code[:5] }}</PostCode>
|
2018-05-18 09:28:25 +02:00
|
|
|
<Town>{{ address.city[:50] }}</Town>
|
|
|
|
<Province>{{ address.subdivision.name[:20] }}</Province>
|
|
|
|
<CountryCode>{{ address.country.code3 }}</CountryCode>
|
|
|
|
</AddressInSpain>
|
|
|
|
{% else %}
|
|
|
|
<OverseasAddress>
|
|
|
|
<Address>{{ address.street[:80] }}</Address>
|
2021-04-01 16:37:27 +02:00
|
|
|
<PostCodeAndTown>{{ (', '.join([address.postal_code, address.city]))[:50] }}</PostCodeAndTown>
|
2018-05-18 09:28:25 +02:00
|
|
|
<Province>{{ address.subdivision.name[:20] }}</Province>
|
|
|
|
<CountryCode>{{ address.country.code3 }}</CountryCode>
|
|
|
|
</OverseasAddress>
|
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
{% macro contact(party) %}
|
|
|
|
<ContactDetails>
|
|
|
|
{% if party.phone or party.mobile %}
|
|
|
|
<Telephone>{{ (party.phone or party.mobile)[:15] }}</Telephone>
|
|
|
|
{% endif %}
|
|
|
|
{% if party.fax %}
|
|
|
|
<TeleFax>{{ party.fax[:15] }}</TeleFax>
|
|
|
|
{% endif %}
|
|
|
|
{% if party.website %}
|
|
|
|
<WebAddress>{{ party.website[:60] }}</WebAddress>
|
|
|
|
{% endif %}
|
|
|
|
{% if party.email %}
|
|
|
|
<ElectronicMail>{{ party.email[:60] }}</ElectronicMail>
|
|
|
|
{% endif %}
|
|
|
|
{# Optional: not supported
|
|
|
|
<ContactPersons></ContactPersons>
|
|
|
|
<CnoCnae></CnoCnae>
|
|
|
|
<INETownCode></INETownCode>
|
|
|
|
<AdditionalContactDetails></AdditionalContactDetails>
|
|
|
|
#}
|
|
|
|
</ContactDetails>
|
|
|
|
{% endmacro %}
|
2022-11-11 11:31:29 +01:00
|
|
|
|
|
|
|
{% macro registration_data(company) %}
|
|
|
|
{% if company.registration_data_location %}
|
|
|
|
<RegistrationData>
|
2022-11-16 09:17:19 +01:00
|
|
|
<Book>{{ company.registration_data_book and company.registration_data_book[:20] or '0' }}</Book>
|
2022-11-11 11:31:29 +01:00
|
|
|
<RegisterOfCompaniesLocation>{{ company.registration_data_location[:20] }}</RegisterOfCompaniesLocation>
|
|
|
|
<Sheet>{{ company.registration_data_sheet[:20] }}</Sheet>
|
|
|
|
<Folio>{{ company.registration_data_folio[:20] }}</Folio>
|
|
|
|
<Section>{{ company.registration_data_section[:20] }}</Section>
|
|
|
|
<Volume>{{ company.registration_data_volume[:20] }}</Volume>
|
|
|
|
<AdditionalRegistrationData>{{ company.registration_data_additional[:20] }}</AdditionalRegistrationData>
|
|
|
|
</RegistrationData>
|
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|