| # | Phone model | CASE | GLASS | Waiting orders | Can sell | Sheet row |
|---|
Orders → Picking list
Upload a Pancake order export (.xlsx/.csv: Order ID, Products, Status, Note) or a simple list (Order ID | Phone model | Qty). One sold case = 1 CASE + 1 GLASS. Staff can download the list; only Admin can deduct stock.
Accepts the Stock_In_Out ledger (tabs STOCK_OUT / STOCK_IN: Phone model + Type + Qty) or a simple file with columns Phone model, Case qty, Glass qty.
🔗 Shared cases: models whose note/comment says they use the same case are grouped. Stock of all members is added together, sales and days-left are counted for the whole group, and the whole order suggestion is placed under one name only: the best-selling model of the group (the others show "→ order as …"). The pre-order file lists that one name.
| # | Phone model | Sold | /day | CASE | GLASS | Shares case with | Group CASE / GLASS | Days left | Runs out | Order CASE | Order GLASS | Status |
|---|
🔗 Stock ↔ TikTok Shop
Can sell = min(CASE, GLASS) on the sheet − waiting orders. Waiting orders = cases the workshop printed on days that no stock-out file has deducted yet + open TikTok orders (paid, not shipped) whose case is not printed yet. Updated every 5 minutes from TikTok and Lark.
Print days → deducted from stock?
The app compares each stock-out receipt with the cases printed each day (Lark DATE PRINT). A day matched by a receipt is already deducted. A day not deducted is subtracted from "Can sell" until its stock-out file is uploaded.
| Print day | Cases printed | Status | Matched receipt |
|---|
Update TikTok stock
Sets each TikTok variant (phone model) on both shops to "Can sell". A model at 0 can no longer be ordered, so no more cancelled orders. Variants that are not a phone model on the sheet are never touched.
🔗 Link TikTok variants to sheet models
A TikTok variant is linked only when its name is the same as a sheet model, or listed as sharing a case with it on the sheet ("…" in the note). Variants below are not linked and are never changed on TikTok. If one is the same phone or shares a case with a sheet model, pick that model and press Link.
Orders with a model name not found on the sheet
Not counted in "Can sell". Add the name to a sheet note in quotes (shares case with "…") or fix the model name in Lark.
TikTok update log
Applied receipts
| # | Time | Type | File | Note | Lines | CASE | GLASS | Status |
|---|
Google Sheet connection
Access PINs
Admin PIN = full access. Staff PIN = Stock tab + Orders → Picking list (download only, no stock deduction).
TikTok link
The order server (op.binhdesign.uk) holds the TikTok and Lark keys; this app asks it for open orders, print dates and TikTok variants.
Reorder defaults
Shared case & glass names
How this version protects the stock
- Duplicate check is by whole file only (same file already applied and not undone → warning). Lines are never skipped because a similar line existed in another day's receipt.
- Undo returns exactly the amounts that were written (recorded per line), and a receipt can be undone only once.
- Sheet check after every sync: duplicate or near-duplicate model names, rows with a name but no CASE/GLASS label, models that disappeared, totals jumping more than 30%, negative stock. Duplicated models are locked for writing until the sheet is fixed.
- Fresh-read lock: right before writing, the sheet is read again; if any affected model changed since the preview, nothing is written.
- Large-change tick: a receipt that moves ≥30 cases of one model, ≥50% of its stock, or ≥300 cases in total needs an explicit checkbox.
- Writing runs in the background with a receipt key; if the connection drops, the same key is retried and the Apps Script refuses to write twice. The receipt is recorded before writing starts.
Server version: kho-v2.17 2026-11-16