# Systemy Ochrony 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 security systems installer (alarms and CCTV) in Kraków, Poland, in the local Gamma ERP, through Claude and a connector for its company. It follows the same logic as the other plans: one step at a time, a table before every change, a yes before every change and before every posting.

This plan tests the parts of the ERP the shop plans didn't:
- **A group of companies.** The installer is the first company of the group "Grupa Demo Kraków". The group's second company is a bakery (`PIEKARNIA-KRAKOW-SIMULATION-PLAN.md`), and the two sell to each other.
- **CRM:** leads and opportunities on the pipeline board, moved stage by stage, with a forecast.
- **Offers → orders → invoices:** each installation goes through the document flows (`make_next_document`).
- **Contracts:** monthly monitoring contracts with a billing plan, the invoice run and renewals.
- **Serial numbers:** every camera, alarm panel and recorder.
- **Equipment at the client:** rented cameras stay the company's fixed assets while they sit at the client's place, and keep depreciating.
- **Foreign currency:** cameras are imported from a supplier in USD, and alarm panels from Germany in EUR, at the day's exchange rates. The company's own currency is PLN.
- **Approvals:** a purchase order over a limit waits for the owner's approval.
- **Unit conversion:** cable bought by the 305 m box and used by the metre.
- **Bank statements:** imported from a file and matched.

## 1. Where it runs

| Item | Value |
|---|---|
| ERP screens | http://127.0.0.1:8090 (also http://localhost:8090) |
| Claude connector (new) | `gamma-erp-grupa` → `http://127.0.0.1:8090/mcp`, signed in as `grupa.owner`, the group's administrator: one connector for the group, the installer and the bakery (`choose_workplace` switches between them) |
| Other connectors | Don't use any other Gamma ERP connector you may have (another company's) |
| Database | PostgreSQL on 127.0.0.1:5433, database `gamma_erp` |
| Group and company | Group "Grupa Demo Kraków"; company Systemy Ochrony Demo Kraków, code `OCHRKRK`, Polish pack, currency PLN |
| Credentials | `grupa-credentials.txt` in the working folder. Never repeat a password or token in chat |

## 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. Call `list_workplaces` first, then `choose_workplace` `OCHRKRK` for this plan. Group work (adding the bakery, the group's books) is done at the group's workplace.
3. Before every change, show a table of exactly what will be created and wait for a yes. Only then call the tool with `confirm=true`.
4. Posting and reversing are final. Till payments and depreciation journals post at once. Say so before asking.
5. Nothing is deleted: a wrong row is switched off and corrected.
6. Read the guide instead of guessing (`gamma-erp://guide/README.md`, then crm, documents (flows, approvals, contracts, payments and open invoices), contracts, stock (serial numbers, convert stock), fixed assets, currencies-and-payments, accounting, company (groups) and users-and-rights).
7. Use only what the ERP supports. When something can't be done, don't work around it: add it to the "Missing / not possible" list (section 16) and carry on.
8. Show draft documents in groups (one week at a time) and post them only after a yes.
9. The Polish chart keeps its account names in Polish. Products and partners are named in Polish, with the English in brackets in the tables shown to the user.

## Install the ERP and run everything in one go

These steps are for a Claude Code session on the user's computer, with a shell and Docker. In one run Claude installs Gamma ERP (if it isn't running yet), makes the company, connects itself to it, and then inserts the sample data of this plan, step by step. Nothing is sent outside this computer: the ERP runs on 127.0.0.1 only.

### What it needs

| Need | Check |
|---|---|
| Docker Desktop (or Docker Engine with Compose v2), running | `docker compose version` |
| Git, or a way to download two files from GitHub | `git --version` |
| Free ports 8090 (screens, API, MCP) and 5433 (database) on 127.0.0.1 | `curl -s http://127.0.0.1:8090/health` answers nothing yet, or "Healthy" if the ERP is already there |
| About 2 GB of disk for the images and the database | – |

### One yes first

Before doing anything, Claude shows the user this whole section as one plan (install, company, connector, then the data steps) and asks for one yes. Making the company can't be undone (the ERP deletes nothing), so it is named in that question. **One-go mode:** if the user answers "do it all", that one yes covers every set-up step of this plan; Claude still shows each step's table as it goes, stops on any refusal, and asks again before each posting group (posting is final).

### 1. Install the ERP (skip if it already answers "Healthy")

```sh
# a folder of its own, e.g. ~/gamma-erp
git clone --depth 1 https://github.com/Gamma-Wallet/GammaERP.git gamma-erp
cd gamma-erp/deploy
cp .env.example .env
```

Then set `.env` for a local install (edit the file; on Windows use the editor or PowerShell, not `sed -i`):

| Setting | Local value |
|---|---|
| `ERP_TAG` | `gamma` (the latest release) |
| `POSTGRES_PASSWORD` | a long random password (generate it; keep it only in `.env`) |
| `AUTH_REDIRECT_URI` | `http://127.0.0.1:8090/signed-in` |
| `AUTH_REQUIRE_HTTPS` | `false` (local test, no TLS) |
| `MCP_RESOURCE` | `http://127.0.0.1:8090/mcp` |
| `AUTH_SIGNING_CERTIFICATE`, `AUTH_ENCRYPTION_CERTIFICATE`, `AUTH_CERTIFICATE_PASSWORD` | empty (without certificates a restart signs everyone out, which is fine locally) |
| `MAIL_HOST` | empty (e-mail off) |

```sh
docker compose up -d                 # pulls the images from ghcr.io; if the pull is refused, use: docker compose up -d --build
curl -s http://127.0.0.1:8090/health # wait until it answers "Healthy" (the first start runs the migrations: up to a minute)
```

If the ERP is already installed in another folder, use that folder's `deploy` directory for the commands below (`docker ps` shows the containers `gamma-erp-web-1`, `gamma-erp-erp-1`, `gamma-erp-db-1`).

### 2. Make the company (skip if it already exists)

```sh
docker compose exec erp dotnet /app/Gamma.Erp.Api.dll create-company --company "Systemy Ochrony Demo Kraków" --code OCHRKRK --country PL --username grupa.owner --corporate "Grupa Demo Kraków" --activity GENERAL
```

It prints three lines: `Company … made, … configuration rows loaded. grupa.owner is its administrator.`, then `First password: …` and `First Claude token: GE_…`. Both secrets are shown only once:
- Save them in `grupa-credentials.txt` in the working folder (not in the project, never in git), and never repeat them in chat.
- Tell the user where the file is: the password is for signing in at http://127.0.0.1:8090, and must be changed at the first sign-in.

"Refused: … already …" means the user name or company is already there: don't make it again. Ask the user for that company's Claude token, or make a new token for `grupa.owner` on the screens (account menu › Claude tokens).

### 3. Connect Claude to the company

```sh
claude mcp add --transport http gamma-erp-grupa http://127.0.0.1:8090/mcp --header "Authorization: Bearer <the GE_ token>"
```

This adds the connector `gamma-erp-grupa` to the user's Claude configuration; the other connectors stay as they are. Pass the token from the credentials file without printing it.

A connector added during a session is often loaded only in a new session. **To carry on in the same run**, call the same MCP server over HTTP with a small script: a JSON-RPC `initialize`, then `notifications/initialized`, then `tools/call` with the tool's name and arguments, each a POST to `http://127.0.0.1:8090/mcp` with the headers `Authorization: Bearer <token>`, `Content-Type: application/json`, `Accept: application/json, text/event-stream`, and `Mcp-Session-Id` from the first answer. Keep the script and the token in the working folder. The tools, their checks and their answers are exactly those of the connector. Otherwise, tell the user to start a new chat and continue from the progress log.

### 4. Check, then insert the data

1. `list_workplaces` answers with the workplace `OCHRKRK`; `tools/list` includes `save_register_row`, `produce`, `stay`, `book_seats` and `report`.
2. Follow "How to insert the sample data" below, from the first step not yet done (the status table and the progress log say which).
3. At the end, show the user: the address http://127.0.0.1:8090, the user name `grupa.owner` and where the first password is, the users made (their passwords are in the same credentials file), and the end reports.

### To start again from scratch

Only on the user's explicit request, because it deletes every company in this local ERP: `docker compose down -v` in the `deploy` folder removes the containers and the database volumes. Then begin at step 1.

## 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 `OCHRKRK`, 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. Step 0 makes the company on the server: it needs the user's yes first, because it can't be undone. Then the new connector is added and reloaded (section 4).
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 `grupa-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; make the group and its first company with `create-company --corporate`; connect `gamma-erp-grupa` | To do: needs the user's yes (it can't be undone) |
| 1 | Company details, bank (PLN), bank (EUR), cash desk, the warehouse, a van, the office till, settings | To do |
| 2 | Users, roles, menus, rights, approval limits | To do |
| 3 | Partners (10), the 2 technicians as employees | To do |
| 4 | Categories and types: equipment with serials, rental equipment as fixed assets | To do |
| 5 | Products: 8 devices, 4 materials, 5 services, 2 monitoring plans | To do |
| 6 | Currencies and exchange rates (USD, EUR), unit conversion for cable | To do |
| 7 | CRM: stages, leads, opportunities | To do |
| 8 | Prices | To do |
| 9 | Opening: capital, first stock | To do |
| 10 | Simulation, weeks 1 and 2 | To do |
| 11 | Month end: depreciation, contract invoice run, recurring sheets, bank statement | To do |
| 12 | Reports | To do |

## 4. Step 0: the group and the company

Follow "Install the ERP and run everything in one go" above. The company is made **with its group**:

`create-company --company "Systemy Ochrony Demo Kraków" --code OCHRKRK --country PL --username grupa.owner --corporate "Grupa Demo Kraków" --activity GENERAL`

Then, at the group's workplace (`choose_workplace` the group):
- `group_setup` action books-needed, and if needed action books with country PL: the group's own books.
- The bakery is added later, from its own plan, with `add_company_to_group`.

## 5. Step 1: company, money and places

| What | Code | Detail |
|---|---|---|
| Company details (`set_company_details`) | OCHRKRK | Trade name Systemy Ochrony Demo; address ul. Wielicka, 30-552 Kraków, Polska; NIP 0000000000 and REGON (placeholders) |
| Bank account PLN (`add_cost_center`, BANK) | BANK_PLN | "Bank – rachunek bieżący PLN", PLN, on the pack's bank account; **takes bank statements** |
| Bank account EUR (BANK) | BANK_EUR | "Bank – rachunek walutowy EUR", EUR, for the German supplier |
| Cash desk (CASH_DESK) | CASH_DESK0 | "Kasa biura" (office cash desk), PLN |
| Warehouse (WAREHOUSE) | WH0 | "Magazyn" (warehouse): devices and materials |
| Service van (WAREHOUSE) | VAN1 | "Samochód serwisowy 1" (service van): what a technician takes to a job |
| The office, a point of sale of kind Shop (POS_SHOP) with one till | POS_BIURO0, TILL0 | "Biuro – sprzedaż" (office counter): small sales of batteries and sensors; settings: cash desk = Kasa biura |

## 6. Step 2: users, roles, approval limits

### 6.1 Users (`add_user`)

| User name | Name | Role | Place |
|---|---|---|---|
| grupa.owner | Owner (made in step 0) | Administrator | the group (and both companies) |
| ochrona.ksiegowa | Accountant (księgowa, off-site) | Finance | OCHRKRK |
| ochrona.biuro.rano | Office and sales, morning (08:00–13:00) | Cashier, Sales | OCHRKRK, TILL0 |
| ochrona.biuro.popol | Office and sales, afternoon (13:00–18:00) | Cashier, Sales | OCHRKRK, TILL0 |

The 4 workers, 2 per shift:
- Morning: 1 office seller (CRM, offers, orders) + 1 installation technician, "Piotr Demo".
- Afternoon: 1 office seller + 1 installation technician, "Anna Demo".

The two technicians are employees, not users (`save_register_row` register `employees`): they're named on the jobs. Users are not employees: never link them.

### 6.2 Menus and rights (`role_access`, then `set_role_access`)

| Role | Menu |
|---|---|
| Finance | Dashboard; Documents › Purchases, Sales, Cash desk, Bank, Journal, Recurring journal, Reversals; Contracts › Invoice run; Fixed assets; Bank statements; all accounting and VAT reports |
| Sales (the office) | CRM › Pipeline, Opportunities; Documents › Offers, Orders, Contracts, Sales; Point of sale; POS shifts |
| Administrator | Everything, including Approvals |

### 6.3 Approval limits and document types

- `document_type_settings`: the **purchase order** type has "needs approval" on (the base pack sets it; check).
- Approval limits (`save_configuration_row`, model approval-limits): role Sales up to 5,000 PLN with VAT; role Finance up to 20,000 PLN; above that only the administrator approves.
- `set_document_type_users`: Sales gets offers, orders, contracts, sales invoices (services and goods), purchase requests and orders; Finance gets purchases, payments, receipts, journals and the recurring sheet.

## 7. Step 3: partners and employees

| Name | Category | Currency | Payment days | Supplies / buys |
|---|---|---|---|---|
| Shenzhen Demo Security Co. Ltd (camera maker, China) | Suppliers | **USD** | 30 | IP cameras, recorders |
| Sicherheitstechnik Demo GmbH (Germany) | Suppliers | **EUR** | 30 | Alarm panels, sensors, sirens |
| Hurtownia Elektryczna Demo Sp. z o.o. (electrical wholesaler) | Suppliers | PLN | 14 | Cable, connectors, batteries |
| Najem Demo Sp. z o.o. (landlord) | Suppliers | PLN | 0 | Rent 6,500 PLN/month (office and warehouse) |
| Energia Demo SA (electricity) | Suppliers | PLN | 30 | About 700 PLN/month |
| Wodociągi Demo Kraków (water) | Suppliers | PLN | 30 | About 120 PLN/month |
| Biuro Rachunkowe Demo (accountant) | Suppliers | PLN | 30 | Fee 1,200 PLN/month |
| Sklep Demo Kazimierz (a shop) | Clients | PLN | 14 | Installation + monitoring contract |
| Biuro Demo Rynek Sp. z o.o. (an office) | Clients | PLN | 14 | Installation with rented cameras + monitoring |
| Piekarnia Demo Kraków (the group's bakery) | Clients | PLN | 14 | CCTV for the bakery: an inter-company sale |

Employees: Piotr Demo and Anna Demo (type WORKER, category STAFF, or as `register_setup` employees shows).

## 8. Step 4: categories and types

| What | Proposal |
|---|---|
| Product categories | Urządzenia (devices), Materiały (materials), Usługi (services), Abonamenty (monitoring plans), Sprzęt w wynajmie (rental equipment) |
| Types | "Urządzenie" (devices: unit piece, VAT 23 %, **tracks serial numbers**); Goods for materials; "Usługa" (services); "Abonament" (monitoring, unit month); "Sprzęt wynajmowany" (rental cameras: **fixed asset**, tracks serial numbers) |
| Units | piece, m, month exist. **Add "box 305 m" (BOX305)** for cable, with a conversion 1 BOX305 = 305 m (unit conversion in the configuration) |

## 9. Step 5: products

VAT: everything at 23 % (the Polish pack has 23 %, 8 %, 5 % and 0 %).

| Code | Name | Unit | Cost | Sale price (excl. VAT) |
|---|---|---|---|---|
| URZ-KAM | Kamera IP 4 MP (IP camera) | piece | USD 38.00 | 520 PLN |
| URZ-KAP | Kamera IP PTZ (PTZ camera) | piece | USD 120.00 | 1,450 PLN |
| URZ-REJ | Rejestrator NVR 8 kanałów (8-channel recorder) | piece | USD 95.00 | 1,200 PLN |
| URZ-CEN | Centrala alarmowa (alarm panel) | piece | EUR 85.00 | 950 PLN |
| URZ-CZU | Czujka ruchu PIR (motion sensor) | piece | EUR 9.50 | 120 PLN |
| URZ-SYR | Syrena zewnętrzna (outdoor siren) | piece | EUR 22.00 | 260 PLN |
| URZ-DYS | Dysk 2 TB (hard disk for the recorder) | piece | 260 PLN | 420 PLN |
| URZ-ZAS | Zasilacz buforowy (backup power supply) | piece | 140 PLN | 240 PLN |
| MAT-KAB | Kabel UTP kat. 6 (cable) | m (bought in BOX305) | 1.10 PLN/m | 3.50 PLN/m |
| MAT-WTY | Wtyki RJ45 (connectors, pack of 100) | piece | 45 PLN | – (used on jobs) |
| MAT-AKU | Akumulator 12 V 7 Ah (battery) | piece | 38 PLN | 85 PLN |
| MAT-KOR | Korytka kablowe (cable trunking) | m | 4.00 PLN | 12 PLN |
| USL-MON | Montaż (installation labour) | hour | – | 160 PLN |
| USL-KON | Konfiguracja systemu (configuration) | piece | – | 350 PLN |
| USL-SER | Serwis / przegląd (service visit) | piece | – | 280 PLN |
| USL-DOJ | Dojazd (travel) | piece | – | 60 PLN |
| USL-AUD | Audyt bezpieczeństwa (security survey, the offer's first step) | piece | – | 0 PLN (free) |
| ABO-MON | Monitoring 24/7 (alarm monitoring) | month | – | 149 PLN |
| ABO-WYN | Wynajem kamery (camera rental with monitoring) | month | – | 89 PLN per camera |
| SWW-KAM | Kamera IP 4 MP – wynajem (rental camera, a fixed asset) | piece | USD 38.00 | – (rented, not sold) |

## 10. Step 6: currencies, rates and the cable unit

1. `list_currencies`: USD and EUR are in the pack; the company's own currency is PLN.
2. `set_exchange_rates`: one rate a day for USD and EUR from 12 to 31 October 2026 (one unit in PLN, e.g. USD 3.98–4.05, EUR 4.28–4.33). The ERP doesn't fetch rates: ask the user for the source (e.g. the National Bank of Poland's table A), or use plausible rates shown first.
3. The cable conversion: 1 BOX305 = 305 m (configuration, unit conversions). Each job's cable comes out of the warehouse in metres after a `convert_stock` of a box.

## 11. Step 7: CRM and prices

1. **Opportunity stages** (`read_configuration` opportunity-stages): use the pack's (e.g. Qualify, Propose, Negotiate, Won, Lost).
2. **Opportunities** (`save_register_row` register `opportunities`), 8 in October:

| Opportunity | Client | Amount (PLN) | Expected close | Path |
|---|---|---|---|---|
| CCTV for the shop | Sklep Demo Kazimierz | 4,800 + monitoring | 20 Oct | Qualify → Propose → Won |
| Rented cameras for the office | Biuro Demo Rynek | 2,400 + rental | 23 Oct | Qualify → Propose → Negotiate → Won |
| CCTV for the bakery | Piekarnia Demo Kraków | 3,900 | 22 Oct | Propose → Won (inter-company) |
| Alarm for a flat (private) | a lead "Jan Kowalski Demo" | 2,900 + monitoring | 28 Oct | Qualify → Propose → Won |
| Warehouse CCTV | a lead "Magazyny Demo" | 18,500 | 15 Nov | Qualify → Propose (stays open) |
| School alarm | a lead "Szkoła Demo" | 9,800 | 30 Nov | Qualify (stays open) |
| Restaurant cameras | a lead "Restauracja Demo" | 3,200 | 21 Oct | Propose → Lost ("chose a cheaper offer") |
| Garage alarm | a lead "Garaż Demo" | 1,600 | 25 Oct | Qualify → Lost ("project postponed") |

Move each with `move_opportunity` on its days (a lost one needs the reason). Leads become clients (`save_register_row` partners) when they are Won.

3. **Prices** (`save_configuration_row` sale prices): the sale prices above, from 2026-10-01; the bakery (inter-company) at 10 % less.

## 12. Opening (12 October)

| Document | Detail |
|---|---|
| Owner's capital | 80,000 PLN into BANK_PLN; 5,000 EUR into BANK_EUR (in EUR at the day's rate) |
| Cash float | 500 PLN into Kasa biura |
| First stock (purchase invoices, into WH0, each device's **serial numbers** on its line) | From Shenzhen Demo (USD): cameras 20, PTZ 4, recorders 6, rental cameras 8. From Sicherheitstechnik Demo (EUR): alarm panels 6, sensors 40, sirens 6. From the wholesaler (PLN): cable 4 BOX305, connectors 5, batteries 10, trunking 100 m, disks 6, power supplies 6 |
| Serial numbers | e.g. cameras `KAM4-2610-0001` … `0020`, PTZ `PTZ-2610-01` … `04`, recorders `NVR8-2610-01` … `06`, panels `CEN-DE-2610-01` … `06`, rental cameras `WYN-KAM-01` … `08` |
| The rental cameras as assets (`run_depreciation` register, company and tax books) | 8 cameras at their purchase value in PLN, start 12 October, 36 months |

The USD and EUR purchases are made in their currency (`currency` on the lines), at the day's rate; their payments are made from BANK_EUR (EUR) and BANK_PLN (USD, converted by the bank).

## 13. Simulation

Period: **Monday 12 to Friday 30 October 2026** (three working weeks, Monday to Friday), month end on 31 October.

### 13.1 An installation, step by step (document flows)

For each Won opportunity:

| # | Document | Tool | Detail |
|---|---|---|---|
| 1 | Offer (oferta) | `save_draft_document` (offer type), linked to the opportunity | Devices, materials, labour hours, configuration, travel; post it (an offer books nothing) |
| 2 | Order (zamówienie) | `make_next_document` from the posted offer (the flow offer → order), post it | The client accepted |
| 3 | Goods to the van | Goods transfer WH0 → VAN1, devices with their serials, cable in metres | Before the installation day |
| 4 | Sales invoice | `make_next_document` from the order (order → invoice), dated the installation day | The devices leave the van with their serials; post it (final) |
| 5 | Monitoring contract | `save_draft_document` (contract type), monthly lines (monitoring, or rental cameras), start the day after installation, end in 12 months; post it; then `run_contract_billing` action plan: every 1 month, next date 1 November | Rental cameras are not sold: the contract bills their rent |
| 6 | Receipt | Client receipt against the invoice number, in 14 days | Some paid in October, the rest open |

The installations, with the technician of each:

| Day | Client | Technician | Devices (serials from the stock) |
|---|---|---|---|
| Tue 20 Oct | Sklep Demo Kazimierz | Piotr | 4 cameras, 1 recorder, 1 disk, 1 power supply, 60 m cable |
| Thu 22 Oct | Piekarnia Demo Kraków (inter-company) | Anna | 3 cameras, 1 recorder, 1 disk, 45 m cable |
| Fri 23 Oct | Biuro Demo Rynek | Piotr | 4 rental cameras (assets, at the client), 1 recorder, 1 disk, 50 m cable; contract: rental 4 × 89 PLN + monitoring |
| Wed 28 Oct | Jan Kowalski Demo (a new client) | Anna | 1 alarm panel, 5 sensors, 1 siren, 1 battery; contract: monitoring 149 PLN |

The rental cameras at Biuro Demo Rynek stay the company's assets at the client's place: they keep depreciating, and the stock report shows them at the client.

### 13.2 Purchases with approval

1. On Mon 19 Oct the office makes a **purchase order** to Shenzhen Demo for 30 cameras and 6 recorders (about 6,900 PLN with VAT, over the Sales limit).
2. It waits: `approvals` lists it; the owner approves it (`approve_document`).
3. It is made into the purchase invoice (`make_next_document`) when the goods arrive (Mon 26 Oct), in USD at that day's rate, with serials.

A second, small purchase order (cable and connectors, 1,200 PLN) is under the limit and goes through without approval.

### 13.3 Counter sales and services

- Small counter sales on TILL0 a few days a week (batteries, sensors), one bill a day, paid by card or cash.
- Two service visits (`USL-SER` + travel), invoiced directly (sales invoice, services).

### 13.4 Payments

- The wholesaler (14 days) paid by hand, against each invoice number.
- Sicherheitstechnik Demo (EUR) paid from BANK_EUR on 29 Oct for the opening invoice: in EUR at that day's rate (the difference from the invoice's rate is the exchange gain or loss).
- Shenzhen Demo (USD): open at the end of October.

### 13.5 Approval

Show each week's drafts as one group (opportunity moves, offers, orders, transfers, invoices, contracts, purchases, payments), with totals in PLN and in the foreign currency. Post only after a yes.

## 14. Month end (31 October)

1. **Contract invoice run** for November's monitoring and rental (`contract_billing` due until 1 Nov, then `run_contract_billing` run): it makes one draft invoice per contract; check them and post them. Then `contract_billing` renewals for 400 days: nothing ends yet; renew one test contract to show it (`run_contract_billing` renew), only on a yes.
2. **Depreciation** of the rental cameras (both books, 31 October): calculate, run, and the company book's journal.
3. **Bank statement:** make a statement file for BANK_PLN for October (the pack's format "Date, text, reference, amount": the opening capital, the receipts and the payments, one line each), import it (`bank_statement_options`, `import_bank_statement`), and match each line to its document (`decide_statement_line`); ignore the bank's fee line.
4. **Recurring cost sheet** (31 Oct) and **payment sheet** (5 Nov), as in the other plans: rent 6,500, electricity 700, water 120, accountant 1,200 PLN; total 8,520 PLN; both repeated for November with `repeat_document`, not posted.
5. **Wages** of the 4 workers: one journal entry, 4 × 6,500 PLN = 26,000 PLN, not payroll.
6. **Stock and serials:** `stock` (warehouse and van) and `lots_and_serials` (serials list: which serial is where: warehouse, van, sold to which client, or at Biuro Demo Rynek as a rental).

## 15. Reports to show at the end

| Report | Tool |
|---|---|
| Trial balance, profit and loss, balance sheet (October) | `trial_balance`, `profit_and_loss`, `balance_sheet` |
| The pipeline and the forecast; won and lost with their reasons | `pipeline`, `forecast`, `report` opportunity-documents |
| Each installation's flow: opportunity → offer → order → invoice → contract | `document_details` made / flows, `get_document` |
| Contracts due and the November invoices | `contract_billing` due, `list_documents` |
| Serial numbers: where each device is | `lots_and_serials` serial list and moves |
| Rental cameras at the client: asset value, depreciation, book value | `depreciation` assets |
| Foreign-currency purchases and payments, and the exchange difference | `account_ledger` (the suppliers, the exchange difference account), `exchange_rates` |
| The purchase order that waited for approval | `approvals` (now empty), `document_details` history |
| Bank statement lines and what each was matched to | `bank_statements` |
| The inter-company sale to the bakery | `sales_lines` (partner Piekarnia Demo) |
| Open items (clients and the USD supplier), VAT return | `open_items`, `vat_return` |

## 16. Missing / not possible

| What | What is done instead |
|---|---|
| Fetching exchange rates (e.g. from the NBP) | Typed rates, from the source the user names |
| A technician's own calendar and job scheduling | The installation day is the documents' date; the technician is named on the job |
| Alarm monitoring itself (the monitoring centre's software) | Only the monthly contract is in the ERP |
| A stock count document | The `stock` report |
| Payroll | Wages are one journal entry |
| Polish KSeF e-invoices and JPK files | Check the guide; if the ERP has none, list it |

## 17. Order of work and approvals

| # | Step | Approval |
|---|---|---|
| 0 | Install if needed; group and company; connector; the group's books | Yes first (can't be undone) |
| 1 | Places, banks, warehouse, van, till | One yes |
| 2 | Users, menus, rights, approval limits, document types | One yes |
| 3 | Partners and the 2 technicians | One yes |
| 4 | Categories, types (serials, fixed assets), the box unit and its conversion | One yes |
| 5 | 20 products with VAT | One yes |
| 6 | Exchange rates for 12–31 October | One yes (with the rates' source) |
| 7 | Opportunities and prices | One yes |
| 8 | Opening and the first stock with serials; register the rental cameras | Yes before posting (final) |
| 9 | Each week: opportunity moves, offers, orders, transfers, invoices, contracts, the approved purchase, payments | Yes per week before posting |
| 10 | Month end: invoice run, depreciation, bank statement, recurring sheets, wages, stock and serials | Yes before each posting |
| 11 | Reports and the missing list | – |
