# Restaurant Manager Workbook

A free, offline-first, single-file workbook for small Saudi restaurants.

One HTML file does the whole job: stock, recipes, production, sales, bilingual
invoices with a ZATCA Phase 1 QR code, salaries, cash, bank matching, VAT and
reports. No install, no account, no subscription, no server. Open the file in
a browser and it runs entirely on your device.

**Current version: 7.0.0**

## Who it is for

Small restaurants in Saudi Arabia that want one place for their daily numbers
without paying for a monthly system or putting their data on someone else's
server. The words are plain, the screens are in English and Arabic, and the
demo business lets you try everything before you enter your own data.

## Features

- **Stock** — goods received, raw materials, weighted-average cost, reorder
  alerts, expiry notes, wastage and stock adjustments.
- **Recipes** — ingredient costs, yield, portion prices, prep (sub-)recipes
  and size variants.
- **Production** — record what the kitchen cooked; sales check against the
  portions actually produced.
- **Sales and invoices** — bilingual invoices (English and Arabic), credit
  notes, split payments, frozen invoice records that never change after
  issue, and a ZATCA Phase 1 QR code on every invoice.
- **ZATCA Phase 2, vendor-ready** — the workbook prepares simplified UBL 2.1
  XML offline and keeps a per-invoice submission status. It never sends
  anything itself; live submission needs a ZATCA-approved provider of your
  choice. See [docs/ZATCA.md](docs/ZATCA.md).
- **Salaries** — Saudi overtime (Labour Law article 107), GOSI fields,
  attendance, payslips and a Ramadan working-hours rule.
- **Cash** — tills, shift sessions, cash-ups, Z-reports, payout-statement
  import by invoice reference, and bank statement matching.
- **Reports** — dashboard with profit and loss, forecast, break-even, VAT
  summary, zakat estimate, Nitaqat ratio and 36 automatic checks.
- **Food safety** — fridge/freezer temperature logs, opening and closing
  checklists, and a printable inspection pack.
- **Roles and PINs** — master password, Owner / Manager / Cashier roles and
  per-person PINs for convenience sign-in.
- **Arabic interface** — right-to-left layout and Arabic translations for the
  main screens. (The setup wizard, pop-up messages and hints are still in
  English.)
- **Offline app (PWA)** — install it from the browser and use it with no
  internet. The single file works fully on its own, with no install.

## Quick start

**Try it online:** open `app.html` in your browser.

**Use it offline:** download
[`downloads/restaurant-manager-v7.0.0.html`](downloads/restaurant-manager-v7.0.0.html),
save it on your computer or phone, and double-click it. That is the whole
install.

1. Open the file. The demo business loads first, with sample data, so you can
   explore safely.
2. When you are ready, use **Set up a new business** in the demo banner (or
   the setup wizard) and follow the steps. The wizard asks for a backup
   before it finishes — keep that file somewhere safe.
3. Work day to day from the menu: Stock, Recipes, Production, Sales, Cash,
   Employees, Salary, Dashboard.

Full step-by-step help is in the [User Guide](docs/USER-GUIDE.md).

## Your data survives updates

A backup file (`.json`) exported by any older version loads in any newer
version. To update:

1. In the old file: **Settings → Export data** and save the `.json` file.
2. Download the new workbook file.
3. In the new file: **Settings → Import data** and choose the `.json` file.

Older files always load: the app fills in defaults for new fields and renames
old payment-method names to the current generic categories. It never silently
deletes your records. See [docs/DATA-FORMAT.md](docs/DATA-FORMAT.md).

## Privacy

The workbook runs entirely in your browser. It makes no network calls, has
no account and sends nothing anywhere. The only things that ever leave your
device are the files you choose to export or share. See
[docs/PRIVACY.md](docs/PRIVACY.md).

## Honest limits

Please read these before relying on the workbook for real filings:

- **No live ZATCA submission.** The workbook prepares invoices offline only.
  Live clearance needs a ZATCA-approved provider of your choice.
- **Simplified UBL XML, not certified ZATCA XML.** The XML is checked offline
  for shape and required fields; full clearance compliance is the provider's
  check.
- **GOSI phased rates need confirmation with GOSI** before real payslips.
- **Ramadan 2027 dates are expected, not official.**
- **Zakat and Nitaqat figures are estimates**, not filings.
- **PINs are convenience sign-in, not security.** They never replace the
  master password.
- **Browser autosave and snapshots are not encrypted.** Only exported files
  are encrypted (when a master password is set).
- **No real-phone / iOS test yet.** The app is verified in Node and headless
  Chromium only.

## Main screens

No screenshots exist yet — this list is the guide until they are added.

| Screen | What it is for |
| --- | --- |
| Dashboard | Sales, profit and loss, forecast, break-even, VAT, zakat estimate, and an attention summary of the checks. |
| Controls | 36 automatic checks across the whole workbook, each naming the record to fix. |
| Sales & Invoices | Issue invoices and credit notes, take split payments, print or share documents. |
| Stock | Raw materials, quantities, costs, reorder alerts and expiry. |
| Goods Received | Record deliveries against purchase orders. |
| Recipes | Recipe costs, yield and portion prices. |
| Production | Record cooked batches; sales check against what was produced. |
| Cash | Tills, shifts, cash-ups, Z-reports, payout import and bank matching. |
| Employees | Staff records, nationality (for the Nitaqat ratio) and GOSI details. |
| Attendance | Daily attendance and overtime hours. |
| Salary | Monthly pay runs, overtime, deductions and payslips. |
| Forecast | Sales forecast by recipe, including a Ramadan daypart forecast when Ramadan mode is on. |
| Settings | Business details, VAT, payment methods, roles and passwords, backups, e-invoicing providers. |
| Guide | Built-in help, including the vendor interface for e-invoicing providers. |

## Repository layout

```
app.html                  The workbook itself (single file, version 7.0.0)
index.html                Public landing page
downloads/                Released .html files (one per version)
docs/                     User Guide, data format, ZATCA, privacy, development
tests/                    Test suites (see docs/DEVELOPMENT.md)
manifest.webmanifest      Offline app (PWA) manifest
sw.js                     Offline app service worker
icon-192.png icon-512.png Offline app icons
```

## Contributing

Contributions are welcome. Please read
[CONTRIBUTING.md](CONTRIBUTING.md) first — in particular the no-brand-names
rule, the no-personal-data rule, and the requirement to keep the app
offline-first and single-file. Test before submitting; see
[docs/DEVELOPMENT.md](docs/DEVELOPMENT.md).

## Licence

MIT licence. See [LICENSE](LICENSE).
