=== TEG-CLEANING — Residential & Commercial Cleaning ===
Contributors: theeldestgeek
Tags: cleaning, maid service, house cleaning, janitorial, booking
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 1.12.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

The back office for a house cleaner, a maid service or a small janitorial firm: homes and their access info kept sealed, a price list with add-ons and frequency discounts, online quotes and booking with an optional deposit, a recurring schedule, checklists with before and after photos, invoices with tips that go to the cleaners, cleaner pay, supplies and a customer portal.

== Description ==

A clean is a visit to somebody's home. It has a window the customer is waiting for, a checklist the customer is paying for, and a way in that is the most private thing the business holds. TEG-CLEANING is built around that.

* **Homes** - bedrooms, bathrooms (halves allowed), square feet, floors, pets, parking, notes for the team and alerts. One customer can have several homes or sites.
* **Access info, sealed** - how the team gets in (lockbox, keypad, garage, key, concierge) and the codes, encrypted with this site's secret keys. Only people with the access-info permission can open it (administrators and team leads by default), every look and change is logged with who, when and from where, and it never appears in the portal, e-mails, exports, the booking page or a backup in readable form.
* **Services and add-ons** - priced by size, by square feet, flat or hourly, with a minimum and the minutes each takes. Add-ons (inside the oven, inside the fridge, interior windows, baseboards...) add their price, time and checklist line. Frequency discounts for weekly, every-2-weeks and every-4-weeks customers; extras are charged in full unless you say otherwise.
* **Online quote and booking** - `[teg-cleaning-book]`: the customer picks the service, the home's size, the add-ons and how often, sees the price live, chooses a day and an arrival window, and books. The server works the price out again; windows fill to the capacity you set; closed days are never offered. An optional deposit (fixed or a percentage) is paid online and credited on the first invoice.
* **Recurring schedule** - plans make the visits weeks ahead; skip, move, pause, holidays (move to the next working day or skip), teams with their working days, a route of the day in a sensible order.
* **Checklists and photos** - room by room per service, plus the home's own lines and notes the team reads; before and after photos kept in a private folder the web server refuses to serve.
* **Quality** - a free re-clean inside the window you set (24 hours by default), asked for from the portal; private ratings, OFF by default and never published.
* **Invoices** - per visit or one a month per customer, tax on taxable lines only, a supplies charge per home if you charge one, lockout and late-cancel fees that are off until you turn them on. No card on file, no overdue reminders, no late fees.
* **Tips** - on the invoice or handed over, split between the cleaners on the visit, never revenue and never taxed.
* **Cleaner pay** - per visit, hourly or a percentage of the visit, frozen when the visit is done; a pay report and CSV; picked up (people, hours, per-visit and percent pay) by TEG-SHOP-PAYROLL when it is installed.
* **Supplies** - a light stock list with reorder levels.
* **Customer portal** - `[teg-cleaning-account]`, signed in with a one-time link: upcoming visits with skip and move until the cutoff, invoices with pay and tip, a re-clean request, their homes (never the codes).
* **Getting paid online** - Square, Stripe or PayPal (keys you add; test mode first), cash, check, transfer, Zelle, Venmo; one ledger so a webhook sent twice is booked once.
* **TEG Companion and TEG Rover** - the phone apps: today's visits and the route, the home card, the checklist, before and after photos, On my way (texts the customer), arrive and done, could-not-get-in, clock in and out, the cleaner's own pay and tips, the access info only for the permission and the person's own visits (and logged), and Take payment (Square Terminal, a payment link as a QR code, or cash).
* **Region** - United States, United Kingdom or the European Union: money, dates, tax wording; every invoice keeps the region it was issued in.
* **Reports, permissions, backups, site move, Help Center** - revenue per team hour including driving, homes that do not pay, re-cleans, tips; a permission grid per role; nightly backups with an off-site copy; moving the shop to another site; a searchable manual with a "?" on every screen.

* **Text messages** - through Vonage, to customers who agreed ("May be texted"): the day-before reminder, a visit moved or skipped, "on my way", the visit done, booking received / confirmed, a quote, an invoice with its pay link, a payment received. STOP / START / HELP, quiet hours, a rate limit, replies landing on the visit as a note, an inbox; test mode until you turn it on. Never a home's access info.

Data lives in the site's own tables (wp_tcn_*), not in posts.

= License =

TEG-CLEANING is licensed like The Eldest Geek's Doctor tools. A 30-day Pro trial comes in the plugin and starts on first use; there is nothing to sign up for. A purchased code from theeldestgeek.com (annual or lifetime) is entered under Settings > License. It is bound to the name and e-mail on the order and verified offline against a public key; a paid code is re-checked with the license server once a day and keeps working when the server cannot be reached.

Without a valid license, adding and changing records pauses. Nothing is lost: everything already recorded stays readable, backups can be downloaded, and customers can still use their portal and pay their invoices; the booking form says to call instead of taking a booking.

== Installation ==

1. Plugins > Add New > Upload Plugin, choose the zip, and activate. The tables are created.
2. TEG-CLEANING > Settings: Business, Region, Pricing, Schedule, Online booking, Payments.
3. Add your services and add-ons, your teams and cleaners, then your customers and their homes.
4. Make a page with `[teg-cleaning-book]` and one with `[teg-cleaning-account]` and pick them under Settings > Business. `[teg-cleaning-quote]` shows one quote from its link (full list: Help Center > Shortcodes).
5. To look around first, load the sample shop (Mendez House Cleaning) at the foot of Settings > Business.

Later versions arrive through Dashboard > Updates. The download is checked against its published SHA-256 before it is installed, and an update replaces the files in place without touching your data.

== Frequently Asked Questions ==

= Who can see a home's door code? =

Administrators and team leads by default. Change it under Settings > Access and staff. Every look is logged.

= Are ratings published? =

No. They are off by default and, when on, only the office sees them.

= Does it chase late payers? =

No. It never sends overdue reminders or adds late fees.

== Changelog ==

= 1.12.3 =
* The customer page shortcodes are renamed: [teg-cleaning-portal] is now [teg-cleaning-account] and [teg-cleaning-estimate] is now [teg-cleaning-quote]. The old names stop working, so put the new ones on your pages.

= 1.12.2 =
* Phone payments the office confirms (Zelle, Venmo, PayPal) no longer get stuck if the confirm is interrupted. The shop works out whether the payment was recorded, and if it cannot tell, it shows two "I checked" buttons on the payment so you decide.
* A customer import that stopped half-way no longer blocks Undo for ever, and two Undo clicks at once can no longer clash.
* A text message's delivery report that arrives late can no longer move its status backwards (delivered stays delivered), and a held text can no longer be sent twice when two runs release it at the same moment.
* A site move import can no longer be started twice at the same moment.

= 1.12.1 =
* "What's new" no longer opens by itself after an update. The dashboard has a button "What's new in <version>"; press it to read the notes.

= 1.12.0 =
* Send with Rover: a visit that is still to be done now has a Send with Rover button. It makes a draft call for a cleaner with the customer, the home, the arrival window and the visit's own checklist. A visit never has two open calls of the same kind (the New call screen refuses and names the open one). The button is hidden while your license is paused.
* This needs the TEG Rover phone app version 1.63 or newer, which is on its way to the app stores. Until the cleaners have it, keep using the phone as before.
* When a cleaner cannot do a visit they now pick a reason on the phone: nobody answered, could not get in, the key or door code did not work, a pet was loose, it was not safe, the customer canceled (or canceled at the door), or something else. The reason is written in the home's notes in words.
* "Nobody answered", "no way in" and "the key or door code did not work" record the visit as Could not get in, once, with your lockout fee if you charge one.
* "The customer canceled at the door" records a late cancellation, once. It is billed only if you have turned the late-cancellation fee on, and never with the lockout fee.
* No message goes to the customer from either of these.
* The Rover setting "Add a note to the customer's notes" says it is not needed here: every finished visit already gets a note on the home.
* Nothing else changes for your customers: they get the same On my way and Visit done texts as before, once each, and one note is written on the home for each finished visit.
* Phones still send where the cleaner is when they start or end a shift, set off, arrive and finish, and every few minutes while on shift, as before. The help now says so.
* The Rover screen is now called Visits & deliveries.

= 1.11.0 =
* The TEG Companion and TEG Rover phone apps can show their screens in another language when your shop has the Pro edition and a language pack. This needs the next update of the apps; until then nothing changes.
* A quote or invoice opened on the phone always shows exactly what your customer gets, in the shop language.
* The lines a finished visit puts on an invoice (supplies, a lockout or late cancellation fee, the booking deposit credit) are always written in the shop language, whoever marks the visit done.
* Help Center and menu refresh.

= 1.10.0 =
* New Language screen in Settings. Each staff member can choose their own language for the screens they use.
* The shop also has a language of its own for what customers receive: invoices, estimates, booking pages, the customer portal, e-mails and text messages. What a customer gets no longer depends on who clicked the button.
* Language packs (Spanish first) arrive later and need the Pro edition. With no pack installed everything stays in English exactly as before.
* Texts and e-mails you have not changed on the SMS screen are no longer saved as if you had typed them, so they follow the language when a pack is installed.

= 1.9.3 =
* The demo and the "Add the sample data" button now build a believable three months of history: past cleans, invoices issued over the weeks (paid, part paid, open and past due), so the reports and "vs last month" comparisons show real figures.
* The sample homes now have door codes and access notes (kept sealed), phone numbers and payment terms, and every sample home is placed on the map.
* The dashboard "Re-cleans this month" card now counts re-cleans booked for the rest of the month, matching the Reports page.
* The Teams page shows working days in plain words (for example "Mon-Fri 08:00-17:00").
* A fridge or other add-on no longer adds a second "Kitchen" group to a visit's checklist; it joins the kitchen group.
* The Companion visit form says "Minutes (planned, then on site)" so a scheduled visit's planned time is clear.
* Loading the demo no longer sends real e-mails to the sample customers.

= 1.9.2 =
* TEG Companion reports can show older months too (this month, last month and up to 10 more; set how many in Companion).

= 1.9.1 =
* Payments: the currency symbol always matches the currency (a US shop never shows £).
* The app payments list shows the date your region's way.

= 1.9.0 =
* Dates now follow your region: US shops see 11/09/2026 and 2:30 pm, UK shops 09/11/2026 and 14:30, each EU country its own - on every screen, invoice, e-mail, the customer portal and the phone apps. Leave the date format blank under Settings > Region to use your region's, or type your own. An invoice keeps the region it was issued in (a UK invoice stays day first after a move to the US).
* The Companion app is told your date format, so the phone shows dates the same way as the shop.
* Report cards, Customer notes, the TEG Rover screens (dispatch, the route, the visit record) and the off-site backup panel's last and next run write their dates your region's way too.
* Help: links to a question in the manual now land on it.

= 1.8.0 =
* Labor on invoices: when a clean takes longer than the price covers, put the extra time on the invoice as hours at your hourly rate. An open invoice has an Add labor button (hours, rate, description); pressing it again adds to the same labor line. The customer sees "2 hrs @ $40.00 /hr" on their copy, and every line now shows how it adds up ("1 x $25.00").
* New settings under Settings > Invoices and tips: Labor line (Offered by default, or Off), Hourly labor rate (starts at 0 - type yours in), labor lines below or above the other lines, and Is labor taxable? (No = labor is never taxed and has no Taxable box). One rate for every visit: no urgent or emergency rates.
* An open invoice's lines are now a small editor: labor and the lines you added by hand can be changed or removed; the lines the visits made, deposit credits and tips are locked and stay exactly as they were (tips still go to the cleaners, deposits still come off, neither is ever taxed).
* TEG Companion: the invoice opens in the phone's invoice editor with Add labor (the shared invoice core, module "invoices").

= 1.7.1 =
* Square Terminal: a payment cancelled from TEG Companion is only shown as cancelled once Square confirms it; unconfirmed cancels are retried automatically and a forgotten checkout is cancelled after 15 minutes.

= 1.7.0 =
* TEG Companion for the cleaners (the cleaning screens, 1.1): today's visits in route order and the day's route with the drive between stops; On my way, which texts the customer; Arrive, which starts the clock on the visit, and Done, which works out the time on site from the arrival; Clock in and Clock out; My pay (their own visits, pay, tips and clocked hours for the month); and recording a tip the customer handed over in cash or by check (split between the visit's cleaners, never on the invoice).
* TEG Rover: when a cleaner taps On the way, the customer gets the same On my way text.
* Door and lockbox codes open on the phone only for a home on the person's own team's visits (yesterday to tomorrow), still only with the access-info permission and every look logged. Whoever runs the schedule opens them as before.
* Customers can switch off the day-before reminder e-mail themselves: a link at the foot of the e-mail, or a button in their portal. The office has the same box on the customer ("No reminder e-mails"). Texts still follow "May be texted" and STOP.
* Fixed: a route's stops did not load (the list asked for columns a cleaning home does not have), so routes showed no stops and were not renumbered or totalled.
* Fixed: no "translation loaded too early" notice in the debug log on the first page load after an update that changes the database.

= 1.6.13 =
* The licence check is faster and never holds a page up waiting for the licence server (the family's bounded licence gate: a short timeout on automatic checks, the verdict cached between requests and dropped the moment it changes); it also knows TEG-MARKETER's new name and the Back Office bank feed add-on.
* Shared pieces brought up to date: payments 1.2.0 ('transfer' is the one key for a bank transfer, 'wire' reads as it), TEG Companion core 2.13.0 (report card dates follow the shop's date format), TEG Rover core 1.8.0 (device pairing masks IP addresses) and Get my licence.
* TEG Back Office: checked - it still reads the cleaners, the hourly cleaners' visit minutes and the per-visit and percent pay from this shop; tips stay on the cleaner pay report.

= 1.6.12 =
* Licence check knows the new TEG Total Auction Management (TAM) product.

= 1.6.11 =
* Back Office shows as Back Office in Setup; the pairing page is called Device pairing everywhere.

= 1.6.10 =
* Fresh installs now get the 30-day Pro trial the readme promised. Earlier zips shipped an empty trial file, so a new site was paused until a licence was entered.

= 1.6.9 =
* The admin menu is grouped the same way as the other TEG shops: Help is now "Help & Tutorials", the phone pairing page is "Device pairing", and Settings is the last row of Setup.
* Moving the shop to another site keeps who wrote each home note.

= 1.6.8 =
* In the Companion app, Zelle, Venmo and PayPal payments wait for the office to confirm them; a manager can apply them at once.
* Invoices can show pay-by-QR codes (Venmo, Cash App, Zelle) under Ways to pay - Settings > Payments.

= 1.6.7 =
* The sample customer is now James Rockford.

= 1.6.6 =
* Money in another currency is always written with its own symbol.
* Product names in the licence screen use the new spelling (TEG-DELI, TEG-FOODTRUCK, TEG-BUTCHER, TEG-BAKERY).
* Take payment from TEG Companion charges in the invoice's own currency and refuses a card in a different currency before anything is charged.

= 1.6.5 =
* Money in another currency is written with its own symbol on the TEG Rover cards.

= 1.6.4 =
* Customer links (invoices, quotes, bookings and the like) only open with their exact key; a link with a blank or altered key opens nothing.
* A rating link only opens with its exact key; a blank or invisible key can no longer rate a visit that was never sent a rating link.

= 1.6.3 =
* TEG Rover collects on an invoice in the currency it was issued in, and its cards count one currency at a time.
* Taking a payment on an invoice no longer recalculates its tax at today's rate: the invoice keeps the totals it was issued with.
* The "Owed to customers" card counts deposits held in today's currency only; deposits in another currency are kept apart.

= 1.6.2 =
* A booking deposit is now charged in the shop's current currency after a region switch.

= 1.6.1 =
* Totals and reports now count one currency at a time: after a region switch, money in the old currency is listed apart instead of being added in. The TEG Companion app shows every invoice in the currency it was issued in.

= 1.6.0 =
* Notes on a home or visit now remember the person who wrote them. In the Customer notes box, a note the office writes on the desktop shows that person's name, and a cleaner's note from the phone or TEG Rover shows the cleaner's name with their team, for example "Ana (North team)", and the Cleaner mark.
* The same name is shown in the Companion app's list of notes on a visit and in the "Notes about this home" list on the home screen (its column is now called "Written by").
* Notes written before this update still show the team's name, as before. A text from the customer still shows "The customer (text message)".
* The database gets one small addition (who wrote each home note). It is added by itself when the plugin updates; nothing is lost.

= 1.5.0 =
* Every customer now has one Customer notes box, on the desktop and in the Companion app: the general notes first, then the notes from their visits, homes and bookings, with who wrote each one and which came from a Cleaner.
* The general notes are the customer's Alerts (in red) and Notes, and for each home its Alerts (in red), Notes for the team, Pets, Parking and the home's own checklist notes. The sealed access info is never shown there.
* The notes from records are the team's notes on the homes and visits, the visits' notes, a cleaner's note on a checklist task and what the customer wrote on the booking form. Each one says "From Visit ...", "From Home ..." or "From Booking ...".
* In the Companion app, a note written on a customer or an invoice is now kept, instead of being refused with "Notes go on a visit". The customer's Notes field is never added to. A note on a visit still goes on the home's notes, as before.
* The whole staff (cleaners and the office) can now read and write notes in the Companion app. Before, only people who may clean could.
* The home screen now lists the notes about that home and has a form to add one. The note handler was there before but had no form.

= 1.4.2 =
* Report cards now use cleaning words in the small print too: the re-cleans card says "of 5 visits done" instead of "of 5 jobs finished", the cleaner utilization card says "on site 3.0 of 4.0 h" instead of "billed", and the lockouts card says "No visits this month yet" when there are none.
* Report cards leave out rows that do not apply to a cleaning firm: "Gift cards" on the owed to customers card, and "Payment plans" and "Deposits due" on the cash flow card are no longer shown while they are 0. The totals are the same as before.

= 1.4.1 =
* Report cards on the phone now open the matching page on the computer: sales and re-cleans open Reports, overdue invoices, cash flow and refunds open Invoices, quotes open Quotes, cleaner hours open Cleaner pay and tips, lost customers open Customers, and booked ahead opens Bookings.
* Card names now fit a cleaning firm: "Warranty returns" is now "Re-cleans", "First-time fix" is "Right first time" (visits that needed no re-clean), "Technician utilization" is "Cleaner utilization", "No-shows" is "Lockouts and late cancellations", the margin card says "Supplies used", and the gift card, payment plan and deposit rows say plainly that there are none or that deposits are paid when booking.
* Clearer dates when comparing: one day reads "October 1" and a few days read "Jan 5-10".

= 1.4.0 =
* New: report cards in the TEG Companion app. Each person picks the cards they want to see on their own phone, and the cards are grouped in sections such as Every day, Money, Customers, Bookings and Staff.
* New: a Reports cards page on the computer, under TEG-CLEANING beside Reports. It shows the same cards, lets you compare with the last period, the same time last year or dates you choose, set goals, download any card as a CSV file, and print it or save it as a PDF.
* New cards for a cleaning firm include: how much of the next 7 and 30 days is already booked, re-cleans against regular visits, customers who booked their next visit straight away, lockouts and late cancellations with what they cost, which services are busiest on which day and hour, cleaner hours on site against hours clocked, booking deposits you still hold, overdue invoices and quotes waiting for an answer, and where your new customers came from.
* New: Settings, Invoices and tips has a "Lost customers after N days" setting. It decides when a regular who has not been back shows up on the lost customers card (90 days unless you change it).
* New: an optional monthly summary e-mail of your cards. It stays off until you switch it on and save it on the Reports cards page.
* Fix: when an invoice was voided and the visit invoiced again, the booking deposit the customer had paid was left off the new invoice, so they were billed the full price. The deposit is now taken off again. Invoices made before this update are not changed; check any visit you re-invoiced after a void.
* Turning the plugin off now also stops its scheduled e-mails and background checks, including the card payment check.

= 1.3.1 =
* Fix: Import from CSV now follows the licence like the rest of the shop (it was usable while the plugin was paused).

= 1.3.0 =
* New: bring your lists in from a spreadsheet. The new Import from CSV page takes a CSV file of customers, homes, services or supplies, shows you a test run first (what would be added and what is wrong, nothing saved), and lets you undo a whole import afterwards if it is not what you wanted.
* New: TEG Rover is now included. It is off until you switch it on, and the new Phones page is where you pair each phone. Once on, the office sees where each cleaner is on shift, and phones can be sent on errands (a supply run, a key pick-up) that they mark done as they go.
* The TEG Companion app is updated to the family's latest version.
* Easier set-up: the one-click install can add sample customers, homes and visits for you to look around with, and remove only those again when you are ready, leaving your own work alone.

= 1.2.0 =
* New: E-mail test mode (Settings > E-mail test mode). Turn it on before going live and every e-mail the site sends - invoices, receipts, reminders, status notes, staff alerts - goes to one address you choose and to nobody else. The subject starts with [TEST to ...] so you can see who it was meant for; the message is exactly what the customer would get. Administrators can switch it from the TEG Companion app too (Settings > E-mail test mode), and a red notice shows on every admin page while it is on. Text messages are not e-mail and still go out.
* TEG Companion: shared Companion core 2.4.0.

= 1.1.3 =
* Square Terminal: on a bill that still owes money, staff can press "Send to Square Terminal" to take the card on the shop's paired Square Terminal; the payment is recorded once and a tip is noted, never billed. Pair the terminal under Settings > Payments.
* Card payments taken on a Clover or Elavon terminal can be recorded by hand (US shops, off until ticked in Settings > Payments). They count as card in the totals, and a whole card number typed into the note is refused.

= 1.1.2 =
* Payments now run on the TEG family's one shared payments engine: money that arrives for a document that no longer owes it is kept as unapplied money for the office to refund or move; a demo site never takes a payment; staff are alerted when a gateway payment is lost; a manual payment is capped at what is still owed; and each bill is locked while a payment is recorded, so two payments at the same moment cannot both land on it.
* Region: the region is inferred only from a currency the shop typed, never from the factory default currency it shipped with.

= 1.1.1 =
* Demo sites never take a real payment: on a demo (Demo mode, or the TEG SHOPS demo) the pay area says This is a demo - no payment is taken, every pay link and webhook is refused and nothing is recorded as paid.

= 1.1.0 =
* Invoice numbers are locked unique (checked on activation and every upgrade; repeats are listed for the administrator).
* Monthly plans keep their day of the month (Jan 31, Feb 28, Mar 31).
* Add-on prices are stored on the visit when it is made.
* Booking deposits count as revenue when they are paid.
* Customer screen: Merge a duplicate into this customer.
* Payments: a manual payment cannot exceed what the document still owes; staff are alerted when a gateway payment arrives for a document that is gone.
* Updates: an update whose manifest publishes no SHA-256 checksum is never offered or installed. DB 1.1.0.

= 1.0.0 =
* First release: homes with sealed access info and an access log; services, add-ons and frequency discounts; online instant quote and booking with an optional deposit; recurring plans with skip, reschedule, pause and holidays; teams with their working days and a route of the day; room-by-room checklists with private before and after photos; free re-cleans inside a window and private ratings (off by default); invoices per visit or monthly with tips for the cleaners, a supplies charge and lockout / late-cancel fees (off by default); cleaner pay per visit, hourly or percent with a report; supplies; the customer portal with one-time-link sign-in.
* Getting paid online (Square, Stripe, PayPal and the manual ways) on one ledger; Take payment on TEG Companion (Square Terminal, payment link, cash).
* TEG Companion's cleaning module and TEG Rover: today's visits, the home card, the checklist and photos, done and could-not-get-in, the access info behind its permission.
* Text messages (the family's shared texting module): consent per number, STOP / START / HELP, quiet hours, replies on the visit, test mode by default.
* Region (US, UK, EU), the grouped menu, backups with an off-site copy, moving the shop to another site, the Help Center.
