# Companies

The **Companies** dashboard allows you to manage information related to your customers' companies. Within this dashboard, you can handle data about the company locations, policies, contacts, or a customer group. You can filter the list by a company name or company type.

<figure><img src="https://3057647601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbTY7EwZtYYQYC6GOcdTj%2Fuploads%2Fgit-blob-d9ad206a9af7eb20b6d8c12b47560e5ecc4370ec%2Fcompanies.png?alt=media" alt=""><figcaption></figcaption></figure>

You can also change the default view by using the options available under the orchestration icon.

<div align="left"><img src="https://3057647601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbTY7EwZtYYQYC6GOcdTj%2Fuploads%2Fgit-blob-7cfcfdf2cec4c375b7575ad6c176c07374395af1%2Forchestration.png?alt=media" alt=""></div>

{% hint style="info" %}
With the table orchestration, you can add custom columns to the list view, by adding **mixin** fields as columns.\
If you have already defined mixin schema for the entity, you'd be able to select the defined mixin fields to display them in the main view.

See example how to do it in the [Displaying mixins in entity list view](https://developer.emporix.io/ce/settings/mixin-schemas#displaying-mixins-in-entity-list-view) documentation.
{% endhint %}

### Creating a company

{% stepper %}
{% step %}
**Choose to add new company**

Go to **Customer Management** -> **Companies** and choose **Add New Company**.
{% endstep %}

{% step %}
**Provide company details**

Add registration country, date, tax, agency and ID.

{% hint style="warning" %}
Only the **Company name** is mandatory for a company creation. You can decide to edit other details later.\
You can also set up a custom company ID in the **Id** field. Otherwise, a unique ID is automatically generated when the company is created.
{% endhint %}
{% endstep %}

{% step %}

#### Optional: Assign restrictions

This step is applicable when you use site permissions or custom restrictions to restrict visibility of entities to different user groups. The company entity (legal entity) itself is not site-aware in its definition, but it can bear a restriction that is passed to and read by other entities, for example quotes. This makes the company restricted to specific groups.

To restrict a company, select specific sites (or restriction values) to a company (legal entity) in the **Restrictions** field.

<figure><img src="https://3057647601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbTY7EwZtYYQYC6GOcdTj%2Fuploads%2Fgit-blob-dba96a127a5201b24d20a8da88146a193697618c%2Fcompany_restriction.png?alt=media" alt="Company restriction" width="300"><figcaption><p>Company restriction</p></figcaption></figure>

{% hint style="warning" %}
The list of sites or restriction values depends on the specific user's restrictions to the site-aware (or restriction-aware) entities assigned through an employee group.

For more information about site permissions, see the [Site permissions](https://developer.emporix.io/ce/system-management/authentication-and-authorization/authorization/site-permissions).
{% endhint %}
{% endstep %}

{% step %}

#### Optional: Assign restrictions

This step is applicable when you use site permissions or custom restrictions to restrict visibility of entities to different user groups. The company entity (legal entity) itself is not site-aware in its definition, but it can bear a restriction that is passed to and read by other entities, for example quotes. This makes the company restricted to specific groups.

To restrict a company, select specific sites (or restriction values) to a company (legal entity) in the **Restrictions** field.

<figure><img src="https://3057647601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbTY7EwZtYYQYC6GOcdTj%2Fuploads%2Fgit-blob-dba96a127a5201b24d20a8da88146a193697618c%2Fcompany_restriction.png?alt=media" alt="Company restriction" width="300"><figcaption><p>Company restriction</p></figcaption></figure>

{% hint style="warning" %}
The list of sites or restriction values depends on the specific user's restrictions to the site-aware (or restriction-aware) entities assigned through an employee group.

For more information about site permissions, see the [Site permissions](https://developer.emporix.io/ce/system-management/authentication-and-authorization/authorization/site-permissions).
{% endhint %}
{% endstep %}

{% step %}
**Save your configuration**

Choose **Save** to create the company. Without saving the general information first, you're not able to move to the next tabs or to add a primary contact. You can add the **Primary Contact** for the company straight away in the **Company details** tab, or later in **Contacts**. If you add it in the **Contacts** tab, it's also visible in the **Company details**.
{% endstep %}

{% step %}
**Add company subsidiaries**

In the **Subsidiaries** tab you can add related companies with their registration countries and tax registration numbers. To create a subsidiary company, you need to go through the same creation process as for the parent company. You can also set up a custom subsidiary ID in the **Id** field. Otherwise, a unique ID is automatically generated when the subsidiary is created.
{% endstep %}

{% step %}
**Add location details**

Use the **Location** tab to add address details of your company. When choosing a location, you can select if it's a headquarter, an office or a warehouse. You can add multiple locations for one company. As in the previous steps, you can also set up a custom location ID in the **Id** field. Otherwise, a unique ID is automatically generated when the location is created.

<figure><img src="https://3057647601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbTY7EwZtYYQYC6GOcdTj%2Fuploads%2Fgit-blob-94ea719c3354cba8432f4ae612f06c3b722b42e8%2Flocations.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

When creating a location, you can also use tags functionality to indicate if the company address is used for shipping or billing purposes. These tags are later used on the storefront during the checkout process. The locations that are tagged as `shipping` are listed as shipping addresses, and locations tagged as `billing` are listed as billing addresses. A customer that is assigned to the company is able to select the relevant tagged locations on checkout.

<figure><img src="https://3057647601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbTY7EwZtYYQYC6GOcdTj%2Fuploads%2Fgit-blob-607b93ea1021a5f1de95050406c33da96fef5e31%2Flocationtags.png?alt=media" alt="" width="466"><figcaption></figcaption></figure>

{% hint style="warning" %}
If registered company locations are not tagged with `shipping` nor `billing`, the checkout lists only the addresses from a customer's address book, instead of company locations.
{% endhint %}
{% endstep %}

{% step %}
**Set up purchasing limits**

In the **Policies** tab, you can set up purchasing limits for the company. You can define the limit for the account and choose the currency in which the limit is provided. If an order done by a customer on a storefront exceeds the configured limit, an additional approval is required to complete the checkout.

The approvals are done according to the roles that the users have in the company. To be able to give the approval for an order, the users have to be assigned to the *Buyer* group (within purchasing limits) or *Admin* group (exceeding purchasing limits). Using Management Dashboard, you can also create an approval group. If an approval group is created, it overrides the standard user roles settings and only the contact assigned to the approval group can accept approvals.

<figure><img src="https://3057647601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbTY7EwZtYYQYC6GOcdTj%2Fuploads%2Fgit-blob-49e21d23498217a25deaa598f1bbe106e93c22d0%2Fpurchase_limits.png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
To check how the Approval process works, go to the [Approvals](https://developer.emporix.io/ce/core-commerce/customer-management/approvals) guide.
{% endhint %}
{% endstep %}

{% step %}
**Assign company customers**

In the **Contacts** tab, you can assign customers to the company as contact persons. When adding the customers, you can choose from the list of people that are already defined as customers. For each company, you can also add a new contact that is not a customer. This contact can be anyone from the company.

<figure><img src="https://3057647601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbTY7EwZtYYQYC6GOcdTj%2Fuploads%2Fgit-blob-a4bfc0a421db88f2448702c4578f27c4822aa1df%2Fcompany_contact.png?alt=media" alt=""><figcaption></figcaption></figure>

When you choose to **Assign Customer**, you can see which customers are already assigned to the company as contact persons.

*Contact* is the default customer assignment. Use the **Type** drop-down menu to choose a different one.

<figure><img src="https://3057647601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbTY7EwZtYYQYC6GOcdTj%2Fuploads%2Fgit-blob-b6fde13d2887de849ff5657ba3373cacdb058bc9%2Fassigned_contact.png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
When assigning customers or adding contact persons, you can set up a custom **Assignment ID**. Otherwise, a unique ID is automatically generated when the assignment is created.
{% endhint %}

The customer assignment to a company is also visible in the Customer details view (**Customer Management -> Customers -> edit customer**).
{% endstep %}

{% step %}
**Manage customer groups**

When you create a new company, default customer groups are automatically created and assigned to the company: *Contact*, *Buyer*, *Requester*, and *Admin*. The company-assigned groups are visible in the **Customer Groups** tab, and from there you can go directly to the **Customer Management -> Groups** node to edit the groups, amend the scopes, and add or remove customers to each group.

<figure><img src="https://3057647601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbTY7EwZtYYQYC6GOcdTj%2Fuploads%2Fgit-blob-0881f1298c5e440d53ac738b4aabd01c070e193b%2Fcompany_customer_groups.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### Converting a contact to a customer

During a company creation, you can define a contact person. But it might turn out that a contact person also acts as a customer, therefore would need access to your storefront. Instead of creating a new customer, you can easily convert a contact to a customer in Management Dashboard.

{% hint style="warning" %}
The conversion option is available only for the `contact` type. If a contact is of `customer` type already, the option is not visible.
{% endhint %}

{% stepper %}
{% step %}
**Go to contacts management**

In **Customer Management** -> **Companies**, select a company and go to the **Contacts** tab.
{% endstep %}

{% step %}
**Choose the contact person**

Select the contact person that you want to convert to a customer and choose **Edit** icon.
{% endstep %}

{% step %}
**Convert the contact**

Choose **Convert contact to customer**.

<figure><img src="https://3057647601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbTY7EwZtYYQYC6GOcdTj%2Fuploads%2Fgit-blob-a30371e53a0ab5025f2083da9f85b5b094ebe39e%2Fconvert_contact.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

**Results**:

* You are taken to the customer view and all the details from the contact are populated to the new customer. You can edit the details if needed and save the new customer. The contact is visible on the list of customers.

  <figure><img src="https://3057647601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbTY7EwZtYYQYC6GOcdTj%2Fuploads%2Fgit-blob-424fcc1e10bc2fc45cdaa036761281910e627528%2Fcontact_to_customer.png?alt=media" alt=""><figcaption></figcaption></figure>
* This operation triggers automatic creation of a customer's account on the storefront. The customer receives two emails: the first one informs about the account activation; the second one contains a link to reset password. Once the customer resets their password, they are able to log in to the storefront and make a purchase as a logged in user.
