# Guard rails — what stops a mistake, and what each warning means

The CODE stops losses and contradictions. TravelClip explains them. If the system refuses something, it is protecting the books.

## On Fees & margins (#/earn)
- **Live check before saving**: change a number and the system tries every kind of our own sale (small, usual and double ticket). Red banner "Not saved like this — it would cause a loss" = Save is held back; change the numbers until it turns green. Green "every kind of our own sale still makes money" = safe to save.
- "That would make our own sales lose money, so it is not saved" — the server's refusal (same test).
- "Saved — but look at these: existing agreements now lose us money" — allowed (their deals stand), but renegotiate those agents/clients.
- "A platform fee on our own packages is not used" — the 70/30 package rule is the only rule for our own packages.
- Changing the split, card collector or mail settings after go-live needs two-step sign-in.

## On an agent's deal
- "Their deal is not complete (missing: …)" — fill every term; nothing is filled in for you.
- A deal that would make any sale type lose money cannot be agreed.
- A deal cannot start inside a month already on their statement.
- "Can trade: no — their application is not approved / login suspended / deal not agreed" — the three conditions to sell.

## On corporate clients
- "Write down our service fee for every sector — still blank: …" — all fees required (0 means no fee).
- Booker message "Your company's booking terms are still being set up" — their fees are not all written; nothing was charged.

## On packages
- "Off sale: no net cost" — enter the net cost; it returns to sale at once.
- "Would sell at a loss" — price, a season or a discount is below net cost + gateway fees.
- Agents: "This package is live" — money fields locked; an admin changes them.

## On payments and bookings
- The server works out every amount; a payment that does not match is refused (status amount_mismatch) and shown to the customer as failed.
- Above R5 000 the customer's billing address is required (full tax invoice).
- A successful payment is never overwritten; a booking is only saved after payment.

## Dashboard "Needs you" money checks (red !)
- Live sectors not on sale: no margin set → Fees & margins step 4.
- Some agents' sites cannot sell live bookings → their deal has a 0 margin.
- Live packages would sell at a loss / off sale for no net cost → Packages.
- Corporate clients with no service fees → their Fees tab.
- Gateway fees are 0% → Fees & margins step 3 (the loss checks need it).
- Card payments with no booking (money taken, booking not saved) → refund or book by hand.
- Card payments whose bookings do not add up → check the payment and bookings.
- Bookings where payment and sale differ.
- Cancelled bookings still holding money → record the refund.
- An old platform fee on our own packages is still on → switch it off.
- Scheduled jobs not running (live server) → add the cron job (every 15 minutes: tools/cron.php).
- The books check: every balance, statement, refund, invoice sequence and a sample sale of every type on every deal.

## Things the system will never let anyone do
Sell on account or pay later · change a past invoice, refund, statement or payment · delete a person, package or customer with money history · sell a sector with no margin · put a package on sale without a net cost · let an agent sell without an agreed complete deal · let an agent see another agent's money or the owners' shares.
