# Configuring Purchase Order (PO) authorisation/approval/sign-off requirements

By default, anyone in Breww who has access to purchase orders can finalise a purchase order. If your business needs to have purchase orders approved before they can be finalised, you can configure this in Breww.

## Building approval rules

You can define your purchase order approval rules by going to **Settings**  -> **Stock items & purchasing** -> **Purchase order approval rules**. You'll need the **Settings** permission to open this page.

From here, you can build out the rules required. This uses Breww's rules editor, the same tool used for delivery rules and best before rules. For step-by-step help adding conditions and outcomes, drawing lines between them and avoiding dead ends, see [Using the rules editor](https://breww.com/docs/rules-editor/). The rest of this guide covers what's specific to purchase order approval rules.

You have the option to create conditions which direct different possible outcomes, for example, you may:

- Not require approvals on POs valued less than £/$/€100, unless it's from Acme Hop Supplies, in which case it must be approved by John Doe specifically.
- For POs up to £/$/€500, they need approval from one person (say a mid-level manager)
- For POs over £/$/€500, they might need approval from all mid-level managers and one senior manager.

As an example, this could be built out and would look like the following. AA, BB and CC are mid-level mangers and DD and EE are senior managers.

![Screenshot 2024-04-13 at 11.21.35|690x449](https://storage.googleapis.com/breww-user-uploads/markdown-external/e5c97fda651eb4b939db6d316b9e5e71f7ffa93cd02bf168f12600915cbf49f7.jpg)

### The two building blocks

Drag either of the options in the left-hand panel onto the canvas to add it to your rules:

- **Condition** - asks a question about the purchase order. It has two outputs: a green check mark, followed when the purchase order matches the condition, and a red cross, followed when it doesn't.
- **Approval** - the end of a path. It says whether approval is needed and, if so, who from.

Every set of rules begins with a **Start** block, which can't be deleted. Drag a line from one block's output to the next block's input to connect them. Blocks, connections and positions are saved as soon as you make them, so there's no separate save button.

> **Note:**
> The rule builder is much easier to use on a desktop computer or another device with a wide screen.

### What a condition can test

A condition can test any of the following against the purchase order:

| Option                        | What it checks                                                                                                                                                                                |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Total value**               | The purchase order's total, including any additional costs such as delivery, and excluding tax.                                                                                               |
| **Supplier**                  | Which supplier the purchase order is for. Pick one or more suppliers, and either `in` or `not in`.                                                                                            |
| **Includes stock item types** | The types of stock item on the purchase order (Ingredient, Packaging, Chemical, Guest Beer, Merchandise & POS, or Other). This matches if any line on the purchase order is of a chosen type. |
| **Created by**                | The Breww user who raised the purchase order. Useful if you want a manager's own orders handled differently to everyone else's.                                                               |

You can add several tests to a single condition and combine them with `AND` or `OR`, and group them into nested brackets, in the same way as Breww's other rule builders.

> **Warning:**
> **Total value** is compared against the purchase order's total in the purchase order's own currency, even though the rule builder shows your base currency symbol. If you buy in more than one currency, keep this in mind when setting your thresholds.

### How Breww decides which approval applies

Breww follows a single path through your rules, starting at the **Start** block. At each condition it takes the green check mark output if the purchase order matches and the red cross output if it doesn't, until it reaches an **Approval** block. **The first approval block reached is the one that's used**, and Breww never combines two approval blocks together.

This means the order of your conditions matters. If a high-value order from one particular supplier should be treated differently, test for that combination before the more general "is it over £/$/€500?" condition, so that the path reaches the specific approval first.

It also means every output on every condition needs to lead, eventually, to an approval block. If a path has a loose end, anyone trying to finalise a purchase order that follows that path will see an "Invalid purchase order approval rules" error with a link back to this editor, and the purchase order won't be finalised. It's worth tracing each path through after building your rules to check they all end somewhere. [Using the rules editor](https://breww.com/docs/rules-editor/) has a quick checklist for this.

### Setting who needs to approve

Open an **Approval** block to configure it:

- **Label** - an optional name to help you keep track of which block is which while you're building. It has no effect on how the rules work.
- **Require approval** - leave this switched off for an approval block that means "no approval needed". Purchase orders that reach it are finalised straight away.
- With **Require approval** switched on, add one or more rows of approvers. For each row, choose **Any of** or **All of**, then pick the users.

Each row is a separate requirement, and every row must be satisfied before the purchase order is finalised:

- **Any of** - a single approval from anyone in that row is enough.
- **All of** - everyone listed in that row must approve.

So an approval block with a row of "Any of: AA, BB, CC" and a second row of "All of: DD, EE" needs one of the three managers plus both of the senior managers, which is three approvals in total.

A user can only be listed once across all the rows of a single approval block. If you add someone twice, Breww will show an error and ask you to remove the duplicate.

## Raising purchase orders

POs can be raised as normal and when the person creating the PO clicks the finalise button, this will either finalise it (if it doesn't need approval) or request approvals from the appropriate people.

If approval is needed, this will be shown clearly on the PO. This example below would be for a PO of over £1000 in the above example:

![Screenshot 2024-04-13 at 11.26.19|690x158](https://storage.googleapis.com/breww-user-uploads/markdown-external/98f2aa93e45f521c94c4de81811ec0fb6efc88b690159e3ed65ee3bbc8eedb7a.png)

This shows who needs to approve this purchase order.

## Approving purchase orders

When the user with the initials "CC" (for example) is logged into their account, they will now see a blue badge by "Stock items" in the main menu. This indicates how many approvals they are required to make.

![](https://storage.googleapis.com/breww-user-uploads/markdown-external/dc5f741d7ef89ac7870a1c0d88b8e36fdad87d894d2b50c20cc2a378f8b13786.png)

When clicking through to the Stock items list, they will be shown a list of their outstanding approvals at the top of the page.

![Screenshot 2024-04-13 at 11.40.24|690x100](https://storage.googleapis.com/breww-user-uploads/markdown-external/17a96235d9645c32c9e04b94883f18e07ef89a7bf8f4fbb39b4be116dc46dafd.png)

When clicking through to the PO, they'll see an **Approve** button at the top-right of the page.

![Screenshot 2024-04-13 at 11.41.10|690x183](https://storage.googleapis.com/breww-user-uploads/markdown-external/ab634cfd785beeb15df87f9a70f82556203cc391e3f74e21dd1cfa72141865c1.png)

Upon approval from them, this will be reflected in the breakdown of outstanding approvals, with a green check mark against their initials.

![Screenshot 2024-04-13 at 11.42.40|690x157](https://storage.googleapis.com/breww-user-uploads/markdown-external/636e5a86a2927d52e92435d88d206f3a476d7bf6f780cb2c71a9040765a38ed9.png)

When all required approvals have been made, the PO will automatically be finalised.

## Changing your rules later

The approval requirements for a purchase order are worked out once, at the moment it's first finalised, and then stay with that purchase order. Editing your rules therefore won't change anything about a purchase order that's already sitting in "Awaiting approval".

If you do need to re-run a purchase order against your updated rules, return it to draft. This clears the outstanding approval requests, and the rules are evaluated again from scratch the next time it's finalised.
