Skip to content

Need for country common name #112

Open
@8ctopus

Description

The following code:

$countryCode = 'GB';

$iso = (new ISO3166())
    ->alpha2($countryCode);

/** @disregard P1013 */
$buyer = (new Person())
    ->setFirstName($firstName)
    ->setLastName($lastName)
    ->setStreet1($street1)
    ->setStreet2($street2)
    ->setZip($zip)
    ->setCity($city)
    ->setCountry($iso['name'])
    ->setEmail($email);

will end up with something like this in an invoice:

John Doe
St. Johns Street
SS69DQ RAYLEIGH
United Kingdom of Great Britain and Northern Ireland

This is not convenient for invoices as it will end up making the buyer's address field way too long as shown in this screenshot from a pdf:

image

It's common practice to use the common name as the Wikipedia article intro explains: The United Kingdom of Great Britain and Northern Ireland, commonly known as the United Kingdom (UK).

So the idea is to add the common name when it differs from the official one to the array.

        [
            'name' => 'United Kingdom of Great Britain and Northern Ireland',
            'common' => 'United Kingdom',
            'alpha2' => 'GB',
            'alpha3' => 'GBR',
            'numeric' => '826',
            'currency' => [
                'GBP',
            ],
        ],

If you agree to this update, I will happily provide a PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions