=== TEG-HVAC ===
Contributors: theeldestgeek
Tags: hvac, heating, air conditioning, field service, invoicing
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 1.9.3
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

The back office of a residential heating and cooling contractor: equipment, refrigerant log, checklists, maintenance agreements, flat-rate quotes and invoices.

== Description ==

For a heating and cooling contractor with one to ten technicians. Customers and the homes they own, the equipment in each home, a week schedule with an unassigned pile, service checklists with readings, a refrigerant log kept for EPA Section 608 record-keeping, maintenance agreements that book their own tune-ups, a flat-rate price book with good / better / best proposals, invoices and payments, van stock and a customer page on your own website.

* Equipment register with age and warranty badges and each unit's service history
* Refrigerant log: technician and 608 certification on every entry, added / recovered / sent for reclamation, 5-50 lb disposal records, monthly and per-technician totals, CSV
* Checklists with readings, the temperature split worked out, out-of-range readings flagged, and a customer report
* Maintenance agreements: tune-ups put on the board weeks ahead, reminders, member discount
* Flat-rate price book with CSV import / export; good / better / best proposals where the customer's pick becomes the job
* A link to your own lender, with the outcome recorded
* Permits and inspections on the job
* TEG Rover (technicians' phones) and TEG Companion (the office phone app)
* Pro: leak-rate log

TEG-HVAC keeps records; it does not make anyone "EPA compliant", and the notes on the record-keeping screens give the date their wording was checked. It does not offer or arrange credit.

Data lives in your own database, in tables this plugin creates. The only outbound request is the license check.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` and activate it.
2. The setup page opens: your business, the public pages, the staff roles, and optional sample data.
3. Work through Settings, then add your technicians with their EPA 608 certification.
4. Website shortcodes: `[teg-hvac-book]`, `[teg-hvac-quote]`, `[teg-hvac-account]`, `[teg-hvac-services]` and `[teg-hvac-sales]` (full list: Help Center > Shortcodes).

== Frequently Asked Questions ==

= Is there a fee per technician? =

No. One license per website, annual or once; no per-technician fee and no contract.

= Does my data leave the site? =

No. It stays in your own WordPress database. The only outbound request is the license check.

= What happens when the trial ends? =

The shop pauses rather than locking. Everything already recorded stays readable and exportable; new entries wait until a license is active.

= Can I delete the plugin without losing everything? =

Yes. Uninstall keeps your tables unless you have explicitly turned that off in Settings, Data and updates.

== Changelog ==

= 1.9.3 =
* The website shortcode [teg-hvac-request] is now [teg-hvac-book] (ask for service). The old name no longer works.

= 1.9.2 =
* A coupon can no longer be used twice when two people at two tills apply it at the same moment; the second till is asked to try again.
* Changed: a coupon that would take off more than the invoice still owes (after a part payment, say) is now refused, with the amount still owed. It was applied before.
* Payments from the phone app that you confirm (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 confirmed payment's note now starts with [TEG Companion #number].
* A customer import that stopped half-way no longer blocks Undo for ever, and two Undo clicks at once can no longer clash.

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

= 1.9.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.
* Help Center and menu refresh.

= 1.8.0 =
* New Language screen in Settings. Each staff member can also choose their own language for the screens they use (Users > Profile).
* The shop now has a language of its own for everything a customer receives: quotes, invoices, service reports, receipts, reminders, e-mails, texts and the payment and customer pages. 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.
* E-mail and reminder wording you never changed now follows the language, and saving one Settings tab no longer stores the standard wording in the language of whoever saved it.
* The phone's quick job list stays quick for English shops; it only hands over to the full list when a shop or a person has chosen another language.
* Shared parts brought up to date: language module 1.1.0, payments 1.5.0, phone payments 1.3.0.

= 1.7.3 =
* The demo and sample data are much richer: about 80 days of invoices, payments and finished jobs, so the dashboard, reports and TEG Companion show real money and a real month.
* Sample equipment now has believable makers, models, serial numbers and install dates, with warranties that end at different times, plus refrigerant records with realistic leak rates.
* Sample service plans no longer show overdue visits; the next visit is due ahead and waiting to be assigned, and each job's history reads in order.
* Reports show readable job types (Tune-up, System replacement) instead of raw codes, and the Technicians report no longer shows -100% when no time is recorded.
* Parts now offer heating and cooling categories (Heating, Cooling, Refrigerant and line sets, Filters, Controls, Motors, Ductwork) instead of electrical ones, so a saved part keeps its category.
* A job's description no longer shows a doubled bracket after the heating type, and the add-a-plan form labels line up.

= 1.7.2 =
* TEG Companion reports can show older months too (this month, last month and up to 10 more; set how many in Companion).
* Shared parts brought up to date: TEG Companion core 2.16.0.

= 1.7.1 =
* Payments: the currency symbol always matches the currency (a US shop never shows £).
* App payments list shows the date your region's way.
* Shared parts brought up to date: payments 1.4.0, app payments 1.2.2.

= 1.7.0 =
* Dates now follow your region: a US shop shows 09/28/2026 and 2:30 pm, a UK shop 28/09/2026 and 14:30, on every screen, print, e-mail, the customer's online pages and TEG Companion. WordPress's own date setting no longer shows through. Leave Settings > Business > Date format and Time format blank to use the region's, or type your own.
* The schedule's day headings follow the same order (Mon Sep 28 in the US, Mon 28 Sep in the UK).
* TEG Companion is told your date format and order, so the app writes dates the way your shop does (app 1.58.0 or later).
* Shared pieces brought up to date: region 1.2.0, TEG Companion core 2.15.0, TEG Rover core 1.10.0, the counter (coupons, sales, Zelle, memberships) 1.4.0, off-site backup and the update notes card 1.1.0, the help center 1.2.0, the installer 1.0.1, and the invoice settings no longer mention urgency to a shop without urgency rates.

= 1.6.0 =
* Invoices and quotes have one labor line: type the hours and it reads "2 hrs @ $80.00 /hr"; every other line reads "1 x $25.00". "+ Labor hour" adds an hour to it. The rate comes from the job: the technician's own rate, the urgent rate for a high-priority job and the emergency rate for an emergency (no emergency rate set: the normal rate plus your emergency uplift %).
* New on Settings > Money: Labor line (Offered / Off), Hourly labor rate, Urgent and Emergency labor rates, Labor lines (Below / Above the parts) and Is labor taxable? (Yes / No). They replace "Labor rate an hour" and "Tax labor"; your saved rate and tax choice carry over.
* Is labor taxable? No now means labor is never taxed and has no Taxable box (before, it only set how a new labor line started). It applies to every draft invoice and quote saved from now on, including invoices made from a job; an invoice or quote that has gone out keeps the tax it went out with.
* Labor goes below the parts (or above them, your choice) in the editor, on the printed invoice and quote, on the customer's online copy and in TEG Companion. Your part picker, the price-book task, a quote's Optional box and a good / better / best proposal's option are still on every line.
* TEG Companion can now edit an invoice or quote's lines, with the same labor line and rules (app 1.49.0).
* Built on the shared invoice core 1.1.0 (WINDOCTOR feat/invoicecore). No database change: labor is stored as before, so the price book, proposals, promotions, memberships and stock work as they did.

= 1.5.17 =
* 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.
* TEG Rover and TEG Companion: an update a phone sends late, after being out of signal, is recorded once with the time it really happened, and the job's timeline says "Recorded offline" when it waited.
* Device pairing works when only TEG Companion is switched on (before, it could refuse with "This shop does not hand out that kind of phone key").
* Online card payments: Square payment notices are no longer missed when the address in your Square dashboard was typed with or without www, and a PayPal payment is checked against the right bill before it is taken.

= 1.5.16 =
* The customer search box follows the shop's region: "name, phone or ZIP code" in a US shop, postcode in the UK and postal code in the EU. The CSV import and Companion address labels say "ZIP code" in a US shop (they read "ZIP / ZIP code").
* Square Terminal: "Send to Square Terminal" now shows on the invoice screen beside the payments, as this readme describes (Square on, a terminal paired, money still owed). Before, only TEG Companion could send a payment to the terminal.

= 1.5.15 =
* The "incoming payments need matching" notice now shows only on TEG-HVAC's own screens and the Dashboard (where it names the shop), not on every admin page of a site that runs several shops (shopcounter 1.3.0).
* 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), the licence check (TEG-MARKETER's new name, the Back Office bank feed add-on) and Get my licence.
* TEG Back Office: checked - it lists the shop's staff (THV_Helpers::staff()); there is no time clock or commission to hand it, so hours stay typed on the payroll run.

= 1.5.14 =
* The Help page no longer breaks the WordPress scripts on it (media library, admin bar menus): a manual section id clashed with a JavaScript name. Fixed a broken "Getting started" link in the FAQ.

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

= 1.5.12 =
* Printed invoices no longer print web addresses: scan the QR code instead. The Zelle note now starts 'To pay by Zelle'.

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

= 1.5.10 =
* 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.
* Field work now sits after Sales & money in the menu, like the other TEG shops.

= 1.5.9 =
* 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.5.8 =
* The licence check and the updater now share one tested core: a slow licence server can no longer slow the shop down.

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

= 1.5.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.5.5 =
* Money in another currency is written with its own symbol on the coupon / promo screens.

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

= 1.5.3 =
* Customer links (invoices, quotes, bookings and the like) only open with their exact key; a link with a blank or altered key opens nothing.

= 1.5.2 =
* TEG Rover collects on an invoice in the currency it was issued in, and its cards count one currency at a time.
* The coupon and sale reports count one currency at a time: coupons and sales used on invoices in an older currency are listed apart.
* The "Not counted above" line writes each currency its own way.

= 1.5.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.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 jobs, equipment, quotes and invoices, with who wrote each one and which came from a technician.
* The general notes are the customer's Notes field and, for each of their properties, its hazards (in red), access notes and notes. The notes from records are the notes on the job timelines, the jobs' risk notes, the permit notes, the technician's checklist notes for the customer, the notes on their equipment, the quotes' office notes, the notes printed on their invoices, the maintenance agreement notes and the financing notes, each saying where it came from. The refrigerant log's notes stay on the EPA record.
* Add a note straight on the customer's screen, or from the Companion app. A note written on a customer or an invoice in the app no longer gets refused; it goes in the customer's notes, and the Notes field you type yourself is left alone.
* On the phone a job also shows its customer's general notes, so the hazards and the access notes are on the job screen.
* Removing the plugin with "delete my data" now also removes the customer notes.

= 1.4.1 =
* Better: a report card on your phone now opens the matching page on the computer. The money cards open Reports at the Money section, the job cards at Jobs, the parts and stock cards at Parts, the quotes card at Quotes, the agreements card opens Agreements, busiest times opens the Diary, waiting for parts opens the list of jobs waiting for parts, and follow-ups and money to come in open your invoices.
* Better: card names that fit HVAC work. "Memberships due" is now "Maintenance agreements due", "Warranty returns" is now "Warranty calls", "Average sale" is now "Average invoice", the turnaround card says "booking to job done" instead of "check-in to ready", and the dead stock card talks about parts not used or sold.
* Better: clearer dates on the cards, such as "October 1" instead of "October 1-1" and "Jan 5-10, 2031" instead of "Jan 5, 2031 to Jan 10, 2031".
* Fixed: a card refund that was still waiting for the payment company to confirm it is checked again after the plugin is turned off and on.
* Phone app updated to the latest TEG Companion.

= 1.4.0 =
* New: report cards on your phone. In the TEG Companion app's Reports tab each person picks the cards they want to see, and the cards are laid out in sections (Every day, Money, Customers, Jobs and work, Stock and items, and more). Only "This month vs last month" is on to start with; switch on the others you want.
* New: a Reports cards page on the computer, in the TEG-HVAC menu under Sales & money. It shows the same cards on one page, compares them with the last period, the same time last year or dates you choose, lets you set a goal for a card and see how close you are, and downloads the figures as a CSV file or prints them.
* New: cards worked out from your own invoices, jobs and parts, counted the same way as your Reports pages: this month against last month and this year against last year, average ticket, sales tax collected, busiest days and hours, repeat customers, how long quotes take, follow-ups due, takings by payment method, today so far, money still to come in, discounts, refunds and voids, regulars to call, gross margin, how long jobs take, jobs waiting for parts, parts that have not sold and how fast your stock turns.
* New: cards made for HVAC work. Maintenance agreements shows the agreements coming up for renewal in the next 30 days, how many are active and which ones ended recently without being renewed. Warranty returns shows how many finished jobs were warranty calls. With TEG Rover switched on, cards for errand spending, time in the field and money collected at the door show too.
* New: "Lost customers after N days" (Settings > Numbering & billing). Choose how long a regular can stay away before the Regulars to call card lists them (30 to 730 days, 90 to start with).
* New: an optional monthly summary e-mail of your cards. It stays off until you set it up and save it on the Reports cards page.
* Fixed: turning the plugin off now also stops its scheduled e-mails, including the monthly summary.
* Phone app updated to the latest TEG Companion.

= 1.3.0 =
* New: TEG Companion now includes Rover, which sends your crew's phones to the right job. It stays off until you switch it on, and the new Phones page is where you pair and manage the phones.
* New: errands. Send a technician to pick up a part or drop something off, and see the stop on the same map and list as the jobs.
* New: a CSV importer (TEG-HVAC > Import from CSV). Bring in customers, properties, equipment units and parts from a spreadsheet: match your columns, do a test run to see what would happen, import, and undo the whole batch if it is not what you wanted.
* Better: the one-click installer and the sample data. Sample customers, jobs and sales can be added without disturbing your own records and removed again later, so the demo pages are not empty.
* Phone app updated to the latest TEG Companion.

= 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 =
* Payments: manual payments are capped at what the job still owes; staff are alerted when a gateway payment arrives for a document that is gone.
* Incoming payments (TEGANSWER) accept only the Incoming payments key, never the read-only API key (counter core 1.1.1).
* Updates: an update whose manifest publishes no SHA-256 checksum is never offered or installed.

= 1.0.0 =
* First release of TEG-HVAC, for residential heating and cooling contractors with one to ten technicians. Built on the TEG-ELECTRIC back office (schedule, customers and sites, quotes, invoices, payments, van stock, reminders, reports, TEG Rover, TEG Companion, backups, Help Center) with the electrical certificates, appliance testing, commercial testing and CIS taken out.
* Getting paid online: Square, Stripe and PayPal on the customer's invoice page, all off until a gateway is switched on and its keys are saved. The amount is always the invoice's balance (part payments optional, with a minimum), in the invoice's own currency; each gateway payment is recorded once however often its webhook is resent. Money that arrives for an invoice that no longer owes it (voided, or paid another way while the checkout was open) is recorded, marked UNAPPLIED and raised as a staff alert to refund or move. Help Center: "Getting paid online".
* Take payment from TEG Companion: the office takes an invoice's money on the phone (service, install deposit, maintenance agreement) - the Square app on an Android phone, the shop's Square Terminal(s), or a Square pay link / QR code. A card payment is recorded only after the site has checked it with Square, once; one Square cannot confirm yet waits as pending verification and is never counted as paid. Zelle, Venmo and PayPal wait for the office's "Confirm received". Settings > Payments > "Take payment in TEG Companion". Built on WINDOCTOR's shared Take payment piece.
* Equipment register: every unit at every property - make, model, serial (found with spaces and case ignored), refrigerant and factory charge, install date and age, parts and labor warranty with badges, photos - and its service history from the jobs it was on.
* Refrigerant log for EPA Section 608 record-keeping: the technician and their 608 certification on every entry; added, recovered and sent for reclamation or destruction; disposal records for 5-50 lb appliances; monthly and per-technician totals; CSV; entries voided with a reason, never deleted; a dated note on what the records are and how long to keep them. An entry from a technician with no 608 card on file is refused (Settings > HVAC records).
* Service checklists: cooling and heating tune-ups, no-cool and no-heat calls, with readings; the temperature split and rise worked out for you; readings outside your ranges flagged; a printable report that also shows on the customer's page.
* Maintenance agreements, built on the clubs: plans with visits a year and a member discount, enrolment per property, tune-up jobs put on the unassigned pile a few weeks before they are due with a reminder, and the member discount on invoices.
* Flat-rate price book with CSV import and export; quote lines picked from it at the member price for members.
* Good / better / best proposals: the customer picks an option on their page (or the office records it) and that option becomes the job.
* Financing: a link to your own lender on proposals, quotes and invoices, and the outcome recorded.
* Permits and inspections on every job.
* TEG Rover: HVAC routes so a technician's phone can see a call's equipment, add a unit by serial, fill in a checklist and log refrigerant (needs the Rover app's HVAC screens).
* TEG Companion: shop kind hvac; a customer shows each property's equipment and whether they are an agreement member.
* Pro: the leak-rate log - the annualized leak rate of each refrigerant addition, flagged at your own threshold.
