Pharmacy POS for macOS
For Macs with Apple Silicon (M1 and newer) and macOS 15 or newer.

INSTALL
1. Drag "Pharmacy POS" into the Applications folder.
2. Open it. The first start creates the database and takes about half a minute
   (the window says it is starting). Then the till opens in the app's own
   window. Receipts print through the Mac's print panel: choose the receipt
   printer there. View > Open in a Browser Window opens the till in Chrome.
3. Fill in the setup wizard: what the shop is (a pharmacy, a supermarket, …)
   and where, its name, currency and the owner's account.

The till's address is http://localhost:8780 (only this Mac can reach it, until
you allow other devices as described below).

EVERY DAY
- The server starts by itself when you log in. Opening Pharmacy POS only opens
  the window; closing the window leaves the server running.
- macOS shows it under System Settings > General > Login Items as a background
  item. Switching it off there stops it from starting at login.

YOUR DATA
- Database, backups and passphrase: ~/Library/Application Support/Pharmacy POS
  (in Finder: Go > Go to Folder..., then paste the path).
- A backup is made every night at 23:30 Damascus time; if the Mac is off then,
  a few minutes after it is on again. Also whenever you click "Make a backup
  now" under Settings > Backups & licence. When there has been none for more
  than a day, the Overview page says so.
- Backups are encrypted with the passphrase in secrets/backup-passphrase.
  "Show backup passphrase" under Settings > Backups & licence shows it on this
  Mac. Write it down and keep it away from the Mac: without it no backup can be
  restored. Right after installing, also copy the whole secrets folder to a USB
  stick; if a file in it goes missing, put it back from that copy.
- To restore a backup (after a mistake, or on a new Mac): while Pharmacy POS
  runs, double-click "Restore Backup.command" (next to the app in the download,
  and in Pharmacy POS.app/Contents/Resources). A window asks for the backup, a
  confirmation, and the backup's passphrase if it came from another computer; the
  program restarts by itself with the backup's data, and what was entered after the
  backup is kept aside, not deleted. Only the Mac user Pharmacy POS runs for can
  do this.
- Logs: ~/Library/Logs/Pharmacy POS (server.log, postgresql.log).

A SECOND TILL, A TABLET OR A PHONE
- Other devices on the shop's network can sell too, each person under their
  own name: as the owner, Settings > Network > "Let other devices connect to
  this computer". The page shows the address to open on the other device (for
  example http://192.168.1.10:8780) and a code to scan.
- The Mac must stay on and awake: the other devices work through it.
- If the macOS firewall is on, it asks once whether "java" may accept incoming
  connections: click Allow.

IF THE OWNER FORGETS THE PASSWORD
- Another owner can reset it under Settings > Users. Keep a second owner
  account for someone you trust: it is the quickest way back.
- If no owner remembers a password: while Pharmacy POS runs, double-click
  "Reset Owner Password.command" (it is next to the app in the download, and
  inside the app: Pharmacy POS.app/Contents/Resources). A window asks which
  owner and the new password twice. Only the Mac user Pharmacy POS runs for can
  do this. The owner is logged out on every device; the reset is in the audit
  log.

UPDATE
Replace the app in Applications with the new version and open it. The data
stays where it is and the database is upgraded on the first start.

UNINSTALL
Double-click "Uninstall Pharmacy POS.command". It stops the server, removes
the background item and asks before deleting any data. Then drag the app to
the Bin.

IF MACOS SAYS THE APP CANNOT BE OPENED
The app isn't signed by an Apple-registered developer yet. Open System
Settings > Privacy & Security, scroll down and click "Open Anyway" next to
Pharmacy POS. This is needed once.
