# Piekarnia Demo Kraków: set-up and simulation plan

> **Gamma ERP business simulation.** A plan for Claude (Claude Code with the Gamma ERP connector) to set up a made-up business in your own Gamma ERP, enter its work and show the reports. Everything runs on your computer; all names and numbers are invented. Gamma ERP is open source (AGPL-3.0): https://github.com/Gamma-Wallet/GammaERP. More simulations: https://blog.gamma-wallet.com/en/erp/simulations

The full plan for setting up and simulating a small bakery in Kraków, Poland, as the **second company of the group "Grupa Demo Kraków"**, in the local Gamma ERP, through the group's connector. The group and its first company (the security installer) are made by `OCHRONA-KRAKOW-SIMULATION-PLAN.md`: do that plan's step 0 first. The same logic as the other plans applies: one step at a time, a table before every change, a yes before every change and before every posting.

This plan tests:
- **Adding a company to a group** (`add_company_to_group`), from the country's pack. The group's administrator works in both companies with one connector.
- **Inter-company trade:** the bakery buys its CCTV from the installer, and sells catering to the installer for its staff day. Each side's document is in its own company, and the two partners are linked as group companies (`group_setup` link-partners).
- **Production from customer orders:** cafés and offices order bread and pastries the day before. The bakery produces exactly what the orders need (`produce` with the order), and then invoices the orders.
- **Daily production for the shop** (bread and pastries made at night) and composite sandwiches.
- **Sales orders before invoices,** and orders left open.
- **Unit conversion:** flour bought in 25 kg sacks and used by the kilo.
- **Negative stock refused:** the company's setting is that stock may not go negative, so a bill selling more than was made is refused.

## 1. Where it runs

| Item | Value |
|---|---|
| ERP screens | http://127.0.0.1:8090 |
| Claude connector | `gamma-erp-grupa` (the same as the installer's), signed in as `grupa.owner`; `choose_workplace` `PIEKKRK` for this plan |
| Company | Piekarnia Demo Kraków, code `PIEKKRK`, Polish pack, currency PLN, in the group Grupa Demo Kraków |
| Credentials | `grupa-credentials.txt` in the working folder |

## 2. Rules for the session

1. Use only the `mcp__gamma-erp-grupa__*` tools (or the same server over HTTP, see the install section).
2. `list_workplaces`; adding the company is done at the group's workplace; everything else at `PIEKKRK`.
3. Before every change, show a table and wait for a yes; then `confirm=true`. Posting, production and till payments are final: say so before asking.
4. Nothing is deleted; read the guide (stock (production, orders to produce, recipes, convert stock, negative stock), documents (orders, flows), company (groups), point-of-sale) instead of guessing.
5. What the ERP can't do goes on the "Missing / not possible" list (section 16).
6. Show each week's drafts as one group; post only after a yes. The Polish chart keeps Polish account names.

## Install the ERP and run everything in one go

The bakery has no install of its own: it joins the group made by `OCHRONA-KRAKOW-SIMULATION-PLAN.md`.

1. If the group doesn't exist yet, follow that plan's section "Install the ERP and run everything in one go" first (install, `create-company --corporate "Grupa Demo Kraków"`, the connector `gamma-erp-grupa`). The same connector serves the bakery.
2. Check: `list_workplaces` lists the group and `OCHRKRK`. If the bakery `PIEKKRK` is listed too, it already exists: skip step 0 of this plan.
3. Ask the user's yes, then do step 0 of this plan (add the bakery to the group, link the group partners), `choose_workplace` `PIEKKRK`, and go on with "How to insert the sample data". One-go mode works as in the installer's plan.

## How to insert the sample data

Every table in this plan is sample data to put into the ERP. These steps say how, for the Claude session that does it with the `gamma-erp-grupa` connector. Everything is made up (names with "Demo", placeholder tax numbers): never use a real person's or company's data.

### Before the first step

1. Check the connector: `list_workplaces` must answer with the workplace `PIEKKRK`, and the tool list must include `save_register_row`, `produce`, `stay`, `book_seats` and `report`. If they are missing, the ERP is older than v0.1.5-gamma: update it (`docker compose pull && docker compose up -d`), then reconnect the connector or start a new chat.
2. The group and the ERP come from the installer's plan (OCHRONA-KRAKOW-SIMULATION-PLAN.md): do its install and step 0 first. Then add the bakery to the group (section 4 of this plan): it needs the user's yes, because it can't be undone.
3. Read the guide pages named in section 2, and `read_configuration` for what the pack already has (VAT groups, document types, posting scenarios, point-of-sale settings). Use the pack's own rows wherever they fit; add only what is missing.
4. Open a progress log: a file `piekarnia-progress.md` in the working folder. After every step, write what was made (each row's code and id), what was refused and why, and what is next. A new session reads it first and carries on from there.

### For each step

1. **Look first.** Before making a row, check that it isn't there already (`find_partners`, `find_products`, `find_cost_centers`, `get_register_row`, `register_setup`, `list_documents`). A row that exists is changed only if the plan says something different; it is never made twice.
2. **Show the table.** Show the user the step's rows exactly as they will be saved: codes, names, types, categories, VAT groups, prices, quantities, dates. Say which rows already exist and are only checked.
3. **Wait for the yes.** Call the changing tools with `confirm=true` only after an explicit yes for that step. One yes covers the whole table shown, not the next step.
4. **Make the rows in order, a few at a time.** Parents before children (company → places → tills; categories → types → products → recipes → prices). After each group, read the rows back and compare them with the table.
5. **When the ERP refuses,** stop that row, show the refusal word for word, and change nothing to work around it. If the plan was wrong (a wrong code, a missing parent), correct the plan's row, show it and ask again. If the ERP can't do it at all, add it to the "Missing / not possible" list and go on with the rest.
6. **Check the step.** Read the step's result with the read tools (`register_setup`, `get_register_row`, `calculate_production`, `pos_info`, `stock`, `trial_balance`…) and show a short summary: made, already there, refused. Write it to the progress log.

### Documents and postings

1. **Drafts first.** Make each week's documents as drafts (`save_draft_document`, the repairs board, `save_journal_sheet`), dated on their real day in October. Show the week as one table: each document's type, date, sides, lines and total, with the week's totals per type.
2. **Post after a yes.** Posting is final, and so are productions, unit splits, till payments, check-outs and seat bookings: say so before asking. Post in date order: purchases and production before the sales that use their stock, invoices before the payments against them.
3. **Check after posting.** After each week, show `stock` (nothing should be negative), `open_items`, and the trial balance up to that day (debit = credit). If something is off, stop and show it: a wrong posted document is corrected only by a reversal (`reverse_document`), after the user's yes.
4. **Never make the same document twice.** Before each document, check with `list_documents` (type, day, external number) that it isn't there already, for example after a lost connection.

### Amounts and dates

- Use the amounts in the plan's tables. Where a table gives a range (sales of a day, people at a show), choose values inside it, vary them from day to day so the weeks look real, and show them before making anything.
- Prices with "VAT incl." go on lines as the value with VAT; prices "excl. VAT" as the price. Round to cents; keep counts whole.
- Every document carries its own day in October 2026. The live items at the end (a shift, a stay, a seat booking, a repair job) are dated today on purpose.

### When it's done

1. Go through the status table (section 3): every step done, or listed as missing with its reason.
2. Show the reports of the "Reports to show at the end" section.
3. Finish the progress log with the final figures (revenue, costs, result, stock value, open items) and the "Missing / not possible" list.

## 3. Status

| Step | What | Status |
|---|---|---|
| 0 | Install if needed; the group exists (the installer's plan); add the bakery to the group | To do: needs the user's yes |
| 1 | Company details, bank, cash desk, the bakehouse (production point), the shop with one till, the shop's settings, negative stock refused | To do |
| 2 | Users, menus, rights (the owner works in both companies) | To do |
| 3 | Partners (9), the group partners linked | To do |
| 4 | Categories, types, the sack unit and its conversion | To do |
| 5 | Products: 9 ingredients, 8 baked goods, 2 sandwiches, 1 catering | To do |
| 6 | Recipes; prices; the shop's menu | To do |
| 7 | Opening | To do |
| 8 | Simulation, weeks 1 and 2 | To do |
| 9 | Month end | To do |
| 10 | Reports | To do |

## 4. Step 0: add the bakery to the group

At the group's workplace (`choose_workplace` the group "Grupa Demo Kraków"):

`add_company_to_group` with name "Piekarnia Demo Kraków", country PL, code PIEKKRK, activity GENERAL, a cash desk "Kasa sklepu" and a bank account "Bank – rachunek bieżący". It loads the Polish pack for the new company. Then `group_setup` action link-partners, so each company is a partner of the other.

## 5. Step 1: places and settings

| What | Code | Detail |
|---|---|---|
| Company details | PIEKKRK | Trade name Piekarnia Demo; ul. Starowiślna, 31-038 Kraków; NIP placeholder |
| Bank, cash desk | (made with the company) | PLN |
| Ingredient store (WAREHOUSE) | WH_SUR | "Magazyn surowców" (raw materials store) |
| Bakehouse (PRODUCTION_POINT) | PP_PIEC | "Piekarnia – piec" (the oven): the night's production and the orders |
| The shop, a point of sale of kind Shop, with one till | POS_SKLEP0, TILL0 | "Sklep" (shop), open 06:00–19:00; cash desk Kasa sklepu |
| Negative stock refused | – | The company's setting that stock of products may not go negative (see the guide, stock › negative stock): `save_configuration_row` |
| "Bills need an open shift" = No | – | For back-dated October bills |

## 6. Step 2: users and access

| User name | Name | Role | Place |
|---|---|---|---|
| grupa.owner | Owner (the group's administrator) | Administrator | both companies |
| piekarnia.ksiegowa | Accountant (the same office as the installer's, another user) | Finance | PIEKKRK |
| piekarnia.sklep.rano | Shop, morning (06:00–12:30) | Cashier | TILL0 |
| piekarnia.sklep.popol | Shop, afternoon (12:30–19:00) | Cashier | TILL0 |

The 4 workers:
- Night (22:00–06:00): 2 bakers (no user). The owner records their production.
- Day: 2 shop sellers, one per shift (the two Cashier users).

## 7. Step 3: partners

| Name | Category | Payment days | Supplies / buys |
|---|---|---|---|
| Młyn Demo (flour mill) | Suppliers | 14 | Wheat and rye flour in 25 kg sacks |
| Hurtownia Spożywcza Demo (food wholesaler) | Suppliers | 14 | Yeast, salt, sugar, butter, eggs, poppy seeds, ham, cheese |
| Mleczarnia Demo (dairy) | Suppliers | 7 | Milk |
| Systemy Ochrony Demo Kraków (the group's installer) | Suppliers and Clients | 14 | Sells the bakery its CCTV; buys catering for its staff day |
| Kawiarnia Demo Rynek (café) | Clients | 14 | Daily order of bread and pastries |
| Biuro Demo Podgórze (office) | Clients | 14 | Daily order of sandwiches and pastries |
| Najem Demo Starowiślna (landlord) | Suppliers | 0 | Rent 5,200 PLN/month |
| Energia Demo SA (electricity) | Suppliers | 30 | About 2,400 PLN/month (the oven) |
| Biuro Rachunkowe Demo (accountant) | Suppliers | 30 | Fee 900 PLN/month |

## 8. Step 4: categories, types and units

| What | Proposal |
|---|---|
| Categories | Surowce (ingredients), Pieczywo (bread), Wypieki (pastries), Kanapki (sandwiches), Catering |
| Types | Goods for ingredients; "Wyrób" (baked goods, unit piece, made in house, VAT 5 %); "Kanapka" (sandwiches, **composite**, VAT 5 %); "Usługa cateringowa" (catering, VAT 8 %) |
| Units | kg, piece exist; **add "worek 25 kg" (SACK25)** with the conversion 1 SACK25 = 25 kg; flour is bought by the sack and split with `convert_stock` |

## 9. Step 5: products

VAT (the Polish pack has 23 %, 8 %, 5 %, 0 %): bread and pastries 5 %, ingredients 5 %, catering service 8 %, rent, electricity and accountant 23 %.

| Code | Name | Unit | Cost (excl. VAT) | Price (VAT incl.) |
|---|---|---|---|---|
| SUR-MPS | Mąka pszenna (wheat flour) | kg (bought by SACK25) | 2.20 PLN | – |
| SUR-MZY | Mąka żytnia (rye flour) | kg (SACK25) | 2.60 PLN | – |
| SUR-DRO | Drożdże (yeast) | kg | 12 PLN | – |
| SUR-SOL | Sól (salt) | kg | 1.50 PLN | – |
| SUR-CUK | Cukier (sugar) | kg | 4.20 PLN | – |
| SUR-MAS | Masło (butter) | kg | 32 PLN | – |
| SUR-JAJ | Jajka (eggs) | piece | 0.75 PLN | – |
| SUR-MLE | Mleko (milk) | kg | 3.80 PLN | – |
| SUR-MAK | Mak (poppy seeds) | kg | 28 PLN | – |
| SUR-SZY | Szynka (ham) | kg | 38 PLN | – |
| SUR-SER | Ser żółty (cheese) | kg | 30 PLN | – |
| PIE-CHL | Chleb pszenny 500 g (wheat loaf) | piece | (production) | 6.50 PLN |
| PIE-ZYT | Chleb żytni 700 g (rye loaf) | piece | (production) | 9.50 PLN |
| PIE-BUL | Bułka (roll) | piece | (production) | 1.20 PLN |
| PIE-OBW | Obwarzanek krakowski (Kraków ring) | piece | (production) | 2.50 PLN |
| WYP-ROG | Rogal maślany (butter croissant) | piece | (production) | 4.50 PLN |
| WYP-DRO | Drożdżówka (sweet yeast bun) | piece | (production) | 4.00 PLN |
| WYP-MAK | Makowiec 1 kg (poppy-seed roll) | piece | (production) | 38.00 PLN |
| WYP-PAC | Pączek (doughnut) | piece | (production) | 3.50 PLN |
| KAN-SZY | Kanapka z szynką (ham sandwich) | piece | (composite) | 9.90 PLN |
| KAN-SER | Kanapka z serem (cheese sandwich) | piece | (composite) | 8.90 PLN |
| CAT-DZI | Catering na dzień firmowy (staff-day catering, per person) | piece | – | 45 PLN |

## 10. Step 6: recipes, prices, menu

Recipes (`product-recipes`, per 1 piece, waste 2 % on flour rows):

| Product | Recipe per piece |
|---|---|
| Chleb pszenny | Wheat flour 0.30 kg, yeast 0.006 kg, salt 0.006 kg |
| Chleb żytni | Rye flour 0.35 kg, wheat flour 0.08 kg, yeast 0.005 kg, salt 0.008 kg |
| Bułka | Wheat flour 0.045 kg, yeast 0.001 kg, salt 0.001 kg |
| Obwarzanek | Wheat flour 0.07 kg, yeast 0.001 kg, salt 0.001 kg, poppy seeds 0.003 kg |
| Rogal maślany | Wheat flour 0.04 kg, butter 0.02 kg, sugar 0.005 kg, milk 0.01 kg, yeast 0.001 kg |
| Drożdżówka | Wheat flour 0.05 kg, sugar 0.01 kg, butter 0.008 kg, eggs 0.2, milk 0.02 kg, yeast 0.002 kg |
| Makowiec | Wheat flour 0.35 kg, poppy seeds 0.30 kg, sugar 0.15 kg, butter 0.08 kg, eggs 3, milk 0.1 kg, yeast 0.01 kg |
| Pączek | Wheat flour 0.05 kg, sugar 0.012 kg, butter 0.006 kg, eggs 0.3, milk 0.02 kg, yeast 0.002 kg |
| Kanapka z szynką (composite) | Roll 1, butter 0.01 kg, ham 0.04 kg |
| Kanapka z serem (composite) | Roll 1, butter 0.01 kg, cheese 0.04 kg |

Prices from 2026-10-01: the shop's prices above; the café and the office get 15 % less (their own sale prices); the installer (group) 10 % less. The shop's menu: Pieczywo, Wypieki, Kanapki.

## 11. Opening (12 October)

| Document | Detail |
|---|---|
| Owner's capital | 40,000 PLN into the bank |
| Till float | 400 PLN into Kasa sklepu |
| First ingredients (purchase invoices, into WH_SUR) | Wheat flour 20 SACK25, rye flour 6 SACK25, yeast 5 kg, salt 10 kg, sugar 25 kg, butter 15 kg, eggs 360, milk 40 kg, poppy seeds 8 kg, ham 5 kg, cheese 5 kg |

## 12. Simulation

Period: **Monday 12 to Sunday 25 October 2026**, month end on 31 October.

### 12.1 Every evening: the customers' orders for tomorrow

| Client | Order (a sales order, `save_draft_document` order type, posted: it books nothing) |
|---|---|
| Kawiarnia Demo Rynek | Croissants 30, sweet buns 20, rolls 40 (Monday–Saturday) |
| Biuro Demo Podgórze | Ham sandwiches 15, cheese sandwiches 10, doughnuts 12 (Monday–Friday) |

### 12.2 Every night: production

1. **Flour:** `convert_stock` of the sacks the night needs into kg (WH_SUR), then a goods transfer of the night's ingredients from WH_SUR to PP_PIEC.
2. **The orders:** `produce` with the order (`order` = the order's id, place PP_PIEC): it makes what is left of each order.
3. **The shop's bake:** `produce` at PP_PIEC, delivered to the shop (`toPlace` POS_SKLEP0):

| Product | Monday–Friday | Saturday | Sunday |
|---|---|---|---|
| Wheat loaf | 60 | 90 | 50 |
| Rye loaf | 30 | 45 | 25 |
| Rolls | 200 | 300 | 150 |
| Kraków rings | 80 | 120 | 100 |
| Croissants | 40 | 60 | 40 |
| Sweet buns | 30 | 50 | 30 |
| Doughnuts | 40 | 80 | 50 |
| Poppy-seed roll | 4 | 10 | 6 |

All productions post at once and are never reversed: show each week's productions first.

### 12.3 Every day: invoices and the shop

- **The orders, invoiced:** `make_next_document` from each order to its sales invoice (order → invoice), the morning it is delivered; post it. The café and the office pay at 14 days.
- **The shop:** one bill per shift per day (two bills a day on TILL0, morning and afternoon), then `pay_pos_bills`. A bill can't sell more than the shop holds: with negative stock refused, the ERP refuses it. Show one such refusal once, then lower the quantity.

| Day | Shop sales (VAT incl.) | Morning | Afternoon |
|---|---|---|---|
| Monday–Friday | 1,600–2,300 PLN | about 65 % | about 35 % |
| Saturday | 2,500–3,400 PLN | about 70 % | about 30 % |
| Sunday | 1,500–2,000 PLN | about 75 % | about 25 % |

- **Left over:** bread not sold by evening stays in stock and is sold the next morning at half price (on the bill's line).

### 12.4 Inter-company

- **Thu 22 Oct:** the installer invoices the bakery its CCTV (in the installer's company). In the bakery: the matching **purchase invoice** from "Systemy Ochrony Demo Kraków" (cameras, recorder, installation, 3,900 PLN less 10 %), posted; the equipment is the bakery's fixed asset (register it, 60 months).
- **Fri 23 Oct:** the bakery invoices the installer catering for its staff day (20 persons × 45 PLN less 10 %, VAT 8 %); in the installer's company, the matching purchase invoice.
- Each company pays the other at 14 days: open at the end of October.

### 12.5 Purchases and payments

- Flour: Monday (Młyn Demo, 10 SACK25 wheat, 3 rye); food wholesaler on Monday and Thursday; milk every second day.
- Pay Młyn Demo and the wholesaler by hand against each invoice number; the dairy every Monday.

## 13. Month end (31 October)

1. **Recurring cost sheet** (31 Oct) and **payment sheet** (5 Nov): rent 5,200, electricity 2,400, accountant 900 PLN; total 8,500 PLN; both repeated for November, not posted.
2. **Depreciation** of the CCTV bought from the installer (company book), and its journal.
3. **Wages:** 4 × 5,800 PLN = 23,200 PLN, one journal entry.
4. **Stock:** `stock` at WH_SUR, PP_PIEC and the shop.
5. **The group:** at the group's workplace, show the trial balance of the group (both companies) and the inter-company balances (each company's balance with the other).

## 14. Reports to show at the end

| Report | Tool |
|---|---|
| Trial balance, profit and loss, balance sheet of the bakery (October) | `trial_balance`, `profit_and_loss`, `balance_sheet` |
| The same for the group (both companies together, at the group's workplace) | the same tools at the group |
| Orders: ordered, produced, invoiced, left open | `list_documents` (orders), `document_details` made |
| Production per product and its cost per piece | the Production documents, `calculate_production` |
| Flour: sacks bought, split, used | `stock`, `report` item-tracking for flour |
| Shop sales by shift, and the refused bill | `sales_lines`, the progress log |
| Inter-company: the bakery's and the installer's invoices to each other | `sales_lines`, `open_items` in each company |
| Open items, VAT return | `open_items`, `vat_return` |

## 15. Order of work and approvals

| # | Step | Approval |
|---|---|---|
| 0 | The group exists; add the bakery; link the group partners | Yes first (can't be undone) |
| 1 | Places, settings, negative stock refused | One yes |
| 2 | Users and access | One yes |
| 3 | Partners | One yes |
| 4 | Categories, types, the sack unit and conversion | One yes |
| 5 | 22 products | One yes |
| 6 | Recipes, prices, menu | One yes |
| 7 | Opening | Yes before posting |
| 8 | Each week: orders, conversions, transfers, productions, invoices, shop bills, inter-company, payments | Yes per week before posting |
| 9 | Month end | Yes before each posting |

## 16. Missing / not possible

| What | What is done instead |
|---|---|
| Writing off bread that can't be sold | No write-off document: left-overs sold the next day at half price; what remains stays in stock |
| Automatic elimination of inter-company sales in the group's reports | The group's reports show both companies; the inter-company sales are listed for the user |
| Night-shift production planning (a bake plan from the orders) | Each order is produced with `produce`; the shop's bake is typed from the plan's table |
| A stock count document | The `stock` report |
| Payroll | One journal entry |
| Polish KSeF e-invoices | Check the guide; list it if missing |
