Skip to content
7 changes: 5 additions & 2 deletions common/cordis/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,13 @@ def parse_organization(ctx: SourceContext, record: SDict):
country = "gb"
country = get_country_code(country)
name = record.pop("name")
vat_id, org_id = record.pop("organisationID"), record.pop("vatNumber")
org_id, vat_id = record.pop("organisationID"), record.pop("vatNumber")
if vat_id:
if country and not vat_id.lower().startswith(country):
vat_id = f"{country.upper()}{vat_id}"
if country and vat_id.lower().startswith("el"):
pass
else:
vat_id = f"{country.upper()}{vat_id}"
proxy.id = ctx.make_slug(vat_id)
proxy.add("taxNumber", vat_id)
proxy.add("vatCode", vat_id)
Expand Down
2 changes: 1 addition & 1 deletion common/ocds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ ContractAward: eu-ted-award-ocds-213czf-award2

## See Also

- `util/ocds/eu_ted/` - TED-specific OCDS extraction
- `common/ocds/eu_ted/` - TED-specific OCDS extraction
- [OCDS 1.1.5 Schema](https://standard.open-contracting.org/schema/1__1__5/)
- [FollowTheMoney Schema](https://followthemoney.tech/explorer/schemata/)
- [investigraph Documentation](https://investigraph.dev/)
Loading
Loading