# Allocation on screen, step by step: destinations, Grid and delivery by branch

> Split an order among the customer's branches on screen: Grid view, adding and identifying destinations, delivery address and billing by branch.

Source: https://vendria.com/en/ajuda/rateio-na-tela-passo-a-passo

## Where to find it

On an allocated order, open the quote in **Quotes**. Above the items table, on the
line of the **Order summary** title, sits the **Summary | Grid** selector. Right
below the items comes the **Allocation by store** section, with one card for each branch
(or destination) of the order.

The allocation can only be edited with the quote open in the editor (draft). Outside it, the screen
shows the allocation read-only.

## Grid and Summary: the two views of the allocated order

- **Summary** is the view that opens by default: the consolidated table, with the
  total quantity of each product in a single column.
- **Grid** shows the products in the rows and one column per destination. You type
  each destination's quantity in the cell, and the line's quantity is the sum of the
  cells.

In the Grid view, **Tab** saves the cell and opens the next destination's, and **Enter** saves
and moves down to the row below. To bring in a spreadsheet column, copy one destination's
values and paste them into the first cell: they go down one per row, in the
same destination. Empty rows, zeros and text are left out (pasting never zeroes a
cell), and the screen says how many values were left out or didn't fit in the grid.
In **Packages**, the pasted value counts boxes. Paste one destination at a time: a block
with several columns isn't distributed.

In both views, the **Allocation by store** cards stay below: that is where
each branch's delivery, address and actions are.

In the Grid view, a row with quantity not yet distributed gets the
**Check before sending** warning, with the reason **no company** (on the cart's order by store,
**no store**): while no cell has a quantity, that item doesn't
go into any destination's order, and the send to the ERP is refused. On the quote, clicking
the warning takes you to the row in the **Summary**, where all its warnings are. A row that
just came in, still at zero, has no warning: it waits for each
destination's quantity.

## Add a new item through the Grid view

In the editor, the Grid view has the **Add item** control at the end of the grid. It opens the
search in the catalog of the order's store; once the product is picked, the row goes into the
grid ready for you to distribute the quantity among the destinations. When the quick
search doesn't find it, it offers the full search.

## Build a purchase group in the cart, from scratch

The chain order that arrives on paper with one column per store can be built
straight in the **Cart**, without saving the quote first and without any item:

1. In the customer block, click **Purchase group**. The order is born in the store
   you are in; if there is no way to tell which one, the question
   **Which store does the order ship from?** shows right below.
2. The grid shows right away, still without columns. If you want, pick the customer in
   **Parent company (optional)**.
3. Click **Add the first store**, at the top of the empty grid. The
   window lists the customer's branches: check one to start or use **Check
   all**. A store that isn't registered yet goes in **Unregistered store (name
   only)**.
4. Click **Create column** (or **Create N columns**).
5. In **Add item**, at the end of the grid, search for the products and type each
   store's quantity in the cell.

To type the sheet from the keyboard: **Tab** moves to the next store and **Enter** moves down
to the row below. On the last row, Enter saves and stays in the cell; the next code
comes in through **Add item**. Entering a cell that already has a number and typing replaces
the number.

A code the catalog doesn't have: in the search, click **Add "code" unregistered**
(or press Enter). The row comes in with the **not registered** badge, takes each
store's quantities and stays out of the total until you swap it for the right product, with the
swap product button on the row itself.

To add stores later, use the **+ store** in the grid header, which shows up
as soon as the first column exists: it opens the same list, with the stores that are already
columns checked. While no cell
has a quantity, going back to **One destination** removes the columns.

On an order built this way, typing in one store changes only that store, and the
line's quantity is the sum of the stores. On an order that had a total and was split
afterwards, though, what you type in one store comes out of the first store, so the total doesn't
change.

With products from more than one Vendria store in the same cart, each order gets the
same columns; to split, save and open the quote.

## Start an allocation on a quote that isn't allocated yet

1. With the quote in the editor, in the customer block, pick **Purchase group** (instead
   of **One destination**).
2. Click **Add first destination…**.
3. In the **First destination of the order** window, pick one of the customer's branches, another
   company, or write just the destination's name.
4. Click **Split into this destination**.

If the button is gray, the sentence right below it says why. With no customer
picked you can write the companies' names; with a customer, the window lists their
branches.

An order that arrives from a spreadsheet or a photo already with one column per store is born
allocated; there is no need to start by hand.

## Add destination to order

1. Click **Add destination to order**: the button sits below the cards, and
   in the Grid view it is the **+** in the grid header.
2. In **How you'd write it in the block**, write the name the way the customer writes it
   (e.g.: "Bazar do Guaíra").
3. Pick the registration, if there is one:
   - **A branch of this customer**: search in **Search branch…** and click.
   - **Or choose another company**: search in **Search company…**. The company
     goes in as its own destination and **doesn't become a branch of the customer**; their registration
     doesn't change. With an ERP, the list also brings companies **In the ERP — not yet
     registered in Vendria**.
4. With no registration at all, click **Add with just the name**.

A column with just the name works on the order, but **doesn't become an invoice** until it gets a
registration. If the company or branch you picked is already the destination of another
column, the screen warns that it will **merge the two into a single order**: check **Yes, it's the
same store — merge the two destinations** and click **Merge destinations**, or click
**Choose another**.

## Identify the customer of a destination that came in with just the name

The card of an unregistered destination shows the **Unregistered destination — its
order doesn't become an invoice.** strip, with the **Identify the customer** link. In the Grid view, the
same shortcut is the amber icon next to the column's name.

The **Identify the customer** window gives the column a registration without touching the quantities
already typed. On a column already identified, the same path becomes **Change who
receives this column**: the items move to the chosen destination, in a column with
its name, and the current column leaves the order. To turn a column back into "name only",
use **Remove the registry link**.

## Each branch's actions (the card's ⋮ menu)

In the card's corner, the **⋮** button opens that branch's actions:

- **Change destination**: moves the card's items to another destination.
- **Duplicate**: copies the card's items to a new destination. The message says
  **Items duplicated in "<name>". The order total went up — identify the
  customer of this destination to be able to send it.**, with **Undo** next to it.
- **Delivery address and date**: opens the delivery window (see below).
- **See customer record (unlink branch)**: takes you to the customer's record.
- **Remove branch from order**: asks for confirmation in **Remove branch**. Items
  that are also in other destinations stay; the ones that only existed in that branch
  leave the order.

## Change a branch's delivery address

Each card has the **From this branch** box, with **Delivery at**, **Date** and
**Invoiced at**.

1. Next to the address, click **Change address** (or **Enter
   address**, when there is none).
2. In the **Delivery — <branch>** window, pick:
   - **Only in this order**: applies to this order; the branch's registration doesn't change.
   - **Always (registry)**: saves the address in the branch's registration.
3. Fill in the **Delivery date (optional)** and the **Delivery address**, and click
   **Save**.

⚠️ Changing the registration is a task for whoever manages the company. If **Always
(registry)** is refused for your account, save with **Only in this order** and ask
the administrator for the permanent change.

When the address was changed on this order, the card shows a pencil badge
next to it. If **This branch's registry record has no address** shows up, that
branch's order goes out without a delivery address.

## Invoiced at: which registration the branch is billed to

The **Invoiced at** block shows the legal name, trade name, CNPJ, ERP code
and city of the registration that destination will be billed to. That is where you check,
before sending, whether the column is tied to the right company: in chains with several
stores with the same trade name, the CNPJ and the city are what tell them apart. **Blocked in the
ERP** in amber warns that the registration is blocked there.

To change the billing registration, use **Change destination**; the block itself can't
be edited.

## Items without a branch

If some item of the allocated order isn't in any destination, the card
**N item(s) without a branch — assign to a branch of the allocation** shows up. On each row, use
**Assign branch…** to send the whole quantity to one of the destinations.

## Branches in the ERP: check and reprocess

In a store integrated with an ERP that reports branches, the quote outside the editor shows the
**Branches in the ERP** panel, with the counter "N branches · N to review". Each destination
shows with a badge: the branch found, **Needs a choice** or **Branch not
found**.

- Click the row to compare **On the document** with **In the ERP (verified)** or
  **In the ERP (search suggestion)**.
- Where there is doubt, pick in **Select the branch…** and click **Confirm**.
- **Reprocess** redoes the branch search in the ERP, useful after fixing the
  customer or a destination.

After the order is confirmed, the panel becomes a record: collapsed by default, only
with the resolved branches.

## Send only some branches

There is no send button on the branch card. When your store sends orders to the
ERP, the choice is made at confirmation: **All remaining ones** sends all the
ready destinations; **Choose branches** lets you uncheck the ones that should stay.
⚠️ Unchecking holds the branch right away, and after the send it doesn't move again
on this order; to sell it, duplicate the order.

## When it goes wrong

- **"The allocation is closed: the orders were already sent to the ERP"**: the allocation
  doesn't change anymore after the send.
- **"Saving the change… the allocation controls come back when the server
  answers."**: the controls turn gray while saving; wait.
- **Message "Use "Give registration" on the destination card."**: the button with that name
  doesn't exist anymore; the path is **Identify the customer**, on the card's strip.
- **The destination doesn't go out in the send**: check the card's strip: an unregistered destination
  doesn't become an invoice, and "All in pre-sale" means there is nothing to write on
  that destination's normal order.

The allocation concept and the rules the system keeps are in [Allocation: split a line's quantity among the customer's branches](/en/ajuda/rateio-entre-filiais).
