=== CodeBold Commerce - POS and Inventory for WooCommerce ===
Contributors: codeboldtech
Tags: point of sale, pos, inventory, woocommerce, restaurant
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Requires Plugins: woocommerce
WC requires at least: 8.0
WC tested up to: 11.0
Stable tag: 0.9.15
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sell over the counter from the same WooCommerce shop you sell online from. One till, one stock figure, one set of orders.

== Description ==

A shop that sells in person and online usually ends up running two systems and reconciling
them by hand. This puts the counter inside WooCommerce instead: a sale rung up at the till
is a WooCommerce order, and it takes stock from the same number the website is selling
against.

= The till =

* Ring up sales on a tablet, laptop or phone
* Works offline. Sales made while the connection is down are queued and sent when it
  returns, so a broken router does not close the shop
* Shifts: open a till with a float, count the cash at the end, and see the difference
* Cash in, cash out and safe drops, recorded rather than remembered
* Discounts, price overrides, voids and refunds — each behind its own permission
* Receipts, with a preview so the layout can be checked before a customer sees one

= Inventory =

* One stock figure for the shop and the website. There is no second number to reconcile
* Stock Central: everything you have, what is on order, and what it cost, on one screen
* Multiple outlets and warehouses, with transfers between them (Pro)
* Purchase orders, including a size-by-colour grid for ordering garments
* Suppliers, receiving, and stock takes
* Weighted-average costing, so margin is a real number rather than the last price paid.
  The cost is kept for every shop; the valuation reports that read it are Pro
* A ledger behind every movement: every change to stock says who, when and why

= Restaurant (Pro) =

Everything in this section is part of CodeBold Commerce Pro, not this plugin.

* Table service with open tabs
* Order types — eat in, takeaway, delivery
* Modifiers: "no onions", "extra bacon", priced and printed on the ticket
* Kitchen tickets on a screen, in the order they were sent. Each round is its own
  ticket, so the kitchen sees what is new rather than a reprint of the whole bill
* Tickets colour themselves as they age, so the one in trouble is obvious from the door
* A line pulled after it was sent shows as cancelled rather than quietly disappearing —
  somebody has already started cooking it
* Recipes: a burger sells, and a bun, a patty and a slice of cheese leave stock. There is
  no shelf of burgers, which is why an ordinary shop plugin watches a restaurant's stock
  never move
* Recipes nest — a sauce is made of things, and dishes use the sauce. What leaves the
  shelf is what the sauce is made of
* A dish costs what its ingredients cost today, so a price rise reaches every dish using
  it without editing a single recipe
* Refunding a meal puts its ingredients back

= Orders stay WooCommerce orders =

Sales are written through WooCommerce's own order system, not a private table. So they
appear in WooCommerce → Orders alongside online sales, they count in WooCommerce's reports,
and every plugin that reads orders keeps working. Till sales are labelled "Point of Sale"
so they can be told apart.

= What is free, and what is not =

This plugin is free, and free means finished rather than sampled. There is no trial, no
countdown, and nothing switched off waiting for a card number. A single shop with a counter
can run all of it, for ever, without paying anything:

* The till — selling, cash and card, split payments, discounts, parked sales, voids,
  refunds and receipts
* **Working offline**, which is the feature most likely to be held back elsewhere and is
  not held back here. A shop with a bad connection is exactly the shop that needs it
* One location, one register, and stock tracked for thirty products
* Shifts, the cash drawer, and X and Z reports
* Sales reports: by day, by product, by hour, and by staff member
* Stock Central and the movement ledger behind it
* Customers: search by name, email or phone, and create one mid-sale
* Batch and expiry dates
* Suppliers, purchase orders, receiving and stock takes
* Importing your stock from a CSV, because charging to let somebody bring their own data
  in is charging at the exact moment they are deciding whether to trust you
* Barcode labels, up to 50 in one print run
* Roles and permissions

**CodeBold Commerce Pro** is a separate plugin, for shops that have outgrown that: more
locations and registers, transfers between them, stock valuation, restaurant service,
unlimited label printing, and sales reporting split by outlet.

It is a separate plugin rather than a licence key on this one, deliberately. A key that
unlocks dormant code means the paid work is sitting inside everybody's copy of the free
plugin — which WordPress.org does not allow, and which would make the word "free" above
considerably less true.

Switching from one to the other loses nothing either way. Everything this plugin records
stays where it is.

= Works with the rest of the range =

* **CodeBold Smart Filters** — product filters for the shop and category pages
* **CodeBold Members** — edit what each of your roles is allowed to do. This plugin's
  permissions appear there under their proper names

Neither is required.

== Installation ==

1. Install and activate WooCommerce, then this plugin.
2. Follow the setup screen: choose your outlet, register and receipt details.
3. Open **POS** in the admin menu and start a shift.

== Frequently Asked Questions ==

= Does the till really work without internet? =

Yes, once it has been loaded. The screen, the products and the prices are cached, and
sales made offline are queued on the device and sent when the connection returns. Card
terminals are a separate matter — those need their own connection.

= Will it fight with my other plugins? =

It writes stock through one path and orders through WooCommerce's own, so anything else
reading either keeps working. Its own styles are prefixed, so it does not restyle screens
belonging to other plugins.

= Can I stop a cashier giving discounts? =

Yes. Discounts, price overrides, voids, refunds, seeing cost prices and opening the drawer
are separate permissions. Install CodeBold Members to change them with checkboxes rather
than code.

= Does it support more than one shop? =

Yes — outlets and warehouses, each with their own stock, and transfers between them.

= What happens to my stock numbers if I deactivate it? =

They stay. Stock lives on the WooCommerce product, as it always did.

= My barcode labels print in the wrong place on the sheet =

Four settings in the browser's print dialog decide this, and every one of them defaults to
the wrong value for label paper:

* Paper size — A4 for sheets. For a label roll, pick the roll's own size, not A4, or you
  get one label per page.
* Margins — None. The page already contains the exact margins your sheet needs. Adding the
  browser's on top shifts every label down and right.
* Scale — 100%. "Fit to page" is usually the default and shrinks everything by a few per
  cent, which is enough to miss the die cut and enough to make a barcode unreadable.
* Headers and footers — off, or the page title prints across your top row.

Rather than guess, use **Print a test sheet** on the Barcode labels screen. It prints the
same grid as outlines on plain paper, with a 100mm ruler. Measure the ruler to check the
scale, then hold the page against a sheet of labels to check the position. A test sheet
costs one piece of paper; getting it wrong costs the labels.

If every label is shifted the same way, the margins are the problem. If they drift further
out as they go down the page, the scale is.

= Which printer does it print to? =

Whichever one you choose in that dialog. WordPress cannot select a printer — no plugin can,
because the browser owns printing — so what this does instead is lay the page out correctly
in millimetres for the stock you picked, and tell you what to set.

Thermal label printers and ordinary office printers both work. The label sizes on offer
cover A4 sheets of 65 and of 24, and a 58 × 40mm continuous roll.

= How many labels can I print at once? =

Fifty per run in the free version, which covers labelling a shelf or a small delivery. If a
run would go over, it prints the first fifty and tells you how many were left out — nothing
is lost, and you can print the rest in a second run. The paid version removes the limit.

Every label size is available at every tier. If you have bought a label printer, telling
you the printer is a premium feature would be a poor way to meet you.

== Screenshots ==

1. The till, ringing up a sale
2. Stock Central — everything you have, on one screen
3. A purchase order as a size-by-colour grid
4. Closing a shift and counting the cash
5. The receipt preview

== Changelog ==

= 0.9.15 =
* A **Help and support** screen under the till menu, and a "Get help" link on the Plugins
  page. Three buttons — something is broken, I need something it does not do, a question
  before I buy — each open your own email program with a message already addressed to
  support@codeboldcommerce.com and the facts we would otherwise have to ask for (WordPress,
  PHP, WooCommerce and plugin versions, theme, active plugins) already at the bottom.
  Nothing is sent from the screen itself; you see every word first and can delete any of it
* The customer display no longer bounces to the sign-in page when a till opens it on a
  second screen before a cashier has signed in on the first

= 0.9.14 =
Everything from 0.9.7 to 0.9.14, which were the versions reviewed for the WordPress.org
directory:

* Every cap is gone. There is no product limit, no register limit and no label limit in this
  plugin — a plugin hosted on WordPress.org is free software, and free software does not
  have a meter. The paid features live in a separate plugin, CodeBold Commerce Pro, and
  nothing here waits on it
* Renamed to CodeBold POS for WooCommerce, which is what it is
* Loyalty points: earned on a sale, spent on a later one
* A customer-facing display for a second screen, showing the sale as it is rung up
* CSV export of sales, and a PIN so a shared till can tell cashiers apart without a
  WordPress sign-in each
* A dark admin on the website's palette, and a pass over every screen for how it reads:
  form controls that stay visible under the mouse, six control states that had never been
  styled, money lined up on the right everywhere it appears, and Stock Central that scrolls
  inside its own grid rather than the whole page sideways
* Stylesheets are enqueued the WordPress way rather than printed into the page
* Coding standards: the directory's own checker passes, and every remaining exclusion in the
  ruleset says why it is there

= 0.9.6 =
* The till and the stockroom are now switches of their own, under a new **Modules** heading
  on the Add-ons screen. A shop that only wants a counter switches the stockroom off; one
  that only wants stock management switches the till off. Neither deletes anything
* Switching a module off takes its options with it — no more answering "yes, stock counts
  are on" for a shop with no stockroom — but it never overwrites what you chose. Switch it
  back on and every option is exactly where you left it, and the screen says so while it
  waits
* Stock still moves with the stockroom switched off. The write path is not a feature and
  cannot be switched off; a sale still takes stock off the shelf. You simply stop having
  screens to manage it on
* Add-ons can no longer hide its own switch. It used to live under the stockroom menu, so
  switching that off would have left the database as the only way back. It now follows
  whichever menu exists, and becomes a menu of its own if neither does
* Outlets & Registers follows the same rule, because an outlet is where stock lives and a
  register is how it sells — a shop needs that screen whichever half it is running
* The till switch now reaches the till itself, not only its menus. Switching Point of sale
  off closes the register's address and its endpoints, rather than hiding the menu while
  `/pos/` carried on taking money
* It will not switch off from under an open shift. That is a counted drawer with somebody
  stood behind it, and taking the screens away first would leave a database edit as the
  only way to close it. The refusal names the register, who is on it and how long for, and
  links to Login Sessions so it takes a few seconds to clear
* No equivalent guard on the stockroom, deliberately. An open stock take is a document and
  it keeps; nobody is holding cash for it
* `/pos/` shows a plain page rather than a 404. That address is bookmarked and pinned to
  home screens on machines nobody has signed into for months, and a browser finding nothing
  there reports a broken shop
* Sales taken offline still land after the till is switched off. They already happened —
  the customer has the goods and the receipt, and the money is in the drawer — so refusing
  them would not undo the sale, only lose the record of it. The page at `/pos/` finds what
  a device is still holding and sends it. New sales are refused; work already done is not
* Stopping a person selling is still a permission, not a switch. Take `codebold_use_pos`
  off their role: it applies to that person, immediately, and a bookmark does not get round
  it
* **Sales reports can be read one outlet at a time.** They could not before, which was a
  problem worth naming rather than quietly fixing: more locations is what the paid plugin
  is sold on, and every figure on the reports screen was answering for the whole business.
  A manager with two branches has one question — which one is making money — and the
  screen could not answer it. Takings, sales, items, best sellers, hourly, daily, per
  cashier and the shifts table are all scoped now, including the fallback query used on
  hosts without MySQL's timezone tables
* The outlet picker only appears when there is more than one outlet, so a single shop sees
  nothing new
* Where the free plugin stops is now written down in one place rather than implied. One
  location, one register, thirty tracked products and fifty labels a print run, with the
  till — offline selling included — complete and free. Restaurant service, transfers, stock valuation, more
  locations and unlimited labels are CodeBold Commerce Pro, a separate plugin
* The Add-ons screen lists what Pro adds rather than hiding it, as a labelled row with a
  link instead of a switch that does nothing when pressed
* Switching Pro off loses screens, never records. What a shop chose is remembered while it
  is gone, so renewing puts everything back rather than starting them over

= 0.9.5 =
* No more "translation loading was triggered too early" in the log. Two places built a
  translated catalogue only to read its keys: the capability list, and the shop-type list
  behind every "what kind of shop is this?" question. Both now answer from a plain list of
  names, and the labelled versions are built only for the screens that show them
* Role names are stored untranslated, as WordPress core stores its own. add_role() freezes
  whatever it is given, so translating it guessed the site language once and kept that
  answer forever. CodeBold Members renames a role to anything you like, which is a better
  answer than a guess

= 0.9.4 =
* Barcode labels: a test sheet. It prints the same grid as outlines on plain paper with a
  100mm ruler, so the scale and the position can both be checked before a sheet of labels
  is committed. A test sheet costs one piece of paper; getting it wrong costs the labels
* The four print-dialog settings that decide whether a sheet is usable are now named on the
  screen itself, where they are needed, rather than in a manual nobody opens
* The label size, quantity and chosen fields are remembered per user, so the daily job is
  two clicks. Remembered per user rather than per site: two people stocking shelves may be
  feeding two different printers
* The screen says how many labels a run will produce before it is printed, so nobody meets
  a limit for the first time on a printed sheet
* One run prints at most 50 labels. Over that it prints the first 50 and says how many were
  left out and what to do about it — the purchase-order picker's rule, that truncation is
  reported rather than silent, applied here too. Every label size stays available

= 0.9.3 =
* The inventory Dashboard opens. It was registered before the menu that owns it, so
  WordPress filed its page under one name and looked it up under another. The menu item
  drew correctly and answered a click by refusing access
* Reports no longer come back empty when asked for a range that already carries a time.
  The time was appended a second time, the result could not be parsed, and an unparseable
  date was being read as 1970 — so a trading day reported nothing
* Units sold, best sellers and the X and Z reports count order lines rather than stock
  ledger rows. A shop that does not track stock, or has not switched tracking on yet, now
  sees its real figures instead of zeroes beside real takings
* A product nobody has counted yet is no longer reported as out of stock. It was counted
  twice over — once as untracked, and once, in red, as out
* The shifts table no longer prints the opening float under a heading reading "Expected".
  Expected cash is worked out when a shift closes; until then that column is blank, as the
  two columns beside it already were

= 0.9.2 =
* The till beeps when an item goes on the sale, and gives a lower double note when
  something is refused. A shop floor is noisy and a cashier is looking at the customer,
  not the screen
* The sound is synthesised rather than played from a file, so it still works with the
  register offline and adds nothing to download
* A speaker button in the toolbar turns it off, remembered on that device

= 0.9.1 =
* The till shows a garment's size as its own badge instead of appending it to the product
  name, where a two-line caption cut it off. A rail of one dress in six sizes is six tiles
  with the same photograph — the size was the only thing telling them apart, and it was
  the part being hidden
* Attribute values show the name the shop typed, not the slug: "Extra Large", not
  "extra-large"

= 0.9.0 =
* Recipes. Set what a dish is made of on the product's own Recipe tab; selling it takes
  the ingredients out of stock, through the same single write path as everything else
* Recipes can nest, and a recipe that would contain itself is refused when it is saved
* A dish's cost is worked out from its ingredients rather than stored, so it never
  goes stale
* Refunding a meal returns its ingredients

= 0.8.0 =
* Kitchen tickets: send a round to the kitchen, watch it on a screen, mark it started,
  ready and served
* Sending is safe to retry. A till that lost its connection and sent again does not put
  the same food on twice
* Cancelling a line after it was sent shows the kitchen a cancellation instead of
  removing the row

= 0.7.5 =
* Added this readme, and corrected the plugin description: product filters and memberships
  are separate plugins and were never part of this one
* The suite now tells any installed role editor what its permissions are called

= 0.7.4 =
* Stock Central uses the full width of the screen, and its columns can be chosen
* The POS landing page explains itself, and opens the till in a new tab
* Purchase orders can be entered as a size-by-colour grid

== Upgrade Notice ==
