ProPOS v1.3.2 — Complete Point of Sale System
============================================

WHAT'S NEW IN v1.3.2 (MOBILE UX OVERHAUL)
--------------------------------------------
Comprehensive fix for all mobile layout and overflow issues.

1) POS PAGE — CHECKOUT BUTTON NOT VISIBLE (FIXED)
   Root cause: on mobile the cart was stacked under the product grid
   (grid became 1 column). The cart's height was set to 100% of its
   parent, but the parent had no fixed height on mobile, so 100%
   resolved to "auto", the cart items grew without bound, and the
   Checkout button got pushed out of view (clipped by max-height +
   overflow:hidden).
   Fix: on mobile, the cart is now a FIXED BOTTOM SHEET — the product
   grid fills the whole screen, and a floating cart button (FAB) in the
   bottom-right corner shows the running total and item count. Tapping
   it slides the cart up from the bottom as a sheet. The cart sheet is
   properly bounded (max-height 92svh), so the checkout button is always
   visible at the bottom inside the sheet. Tapping outside the sheet or
   pressing ✕ closes it.

2) INVOICE MODAL — MOBILE FRIENDLY
   After checkout, the invoice is now displayed as a bottom sheet on
   mobile (same slide-up pattern), and switches to a centered dialog
   on wider screens.

3) TOPBAR OVERFLOW FIXED
   Long page titles can no longer push the theme/language/user buttons
   off-screen — title truncates with an ellipsis instead.

4) RESPONSIVE OVERHAUL
   - Tables: proper touch-scroll everywhere (webkit-overflow-scrolling)
   - Card heads: flex-wrap so title + action button stack cleanly on
     small screens instead of overflowing
   - Filter bars: already handled; now tighter padding on very small screens
   - Stat cards: 2-column grid on mobile (was collapsing to 1 column on
     480px; now stays 2-column so more stats fit on screen)
   - Pagination: wraps cleanly on small screens
   - All modal improvements from v1.2.1 are retained

ProPOS v1.3.1 — Complete Point of Sale System
============================================

WHAT'S NEW IN v1.3.1 (DEMO DATA)
-----------------------------------
Fresh install now includes comprehensive demo data so you can explore
every feature immediately after setup — no need to manually enter test
data first.

DEMO ACCOUNTS:
  Super Admin  → username: admin      / password: admin123
  Manager      → username: manager1   / password: manager123
  Cashier      → username: cashier1   / password: cashier123

DEMO DATA INCLUDED:
  • 5 categories (Printing, Design Services, Stationery, Office
    Supplies, Packaging)
  • 15 products — mix of stocked items (A4 Paper, Pens, Notebooks,
    Stapler, Tape, Courier Bags, Envelopes, File Folders), service
    items with no stock tracking (Business Cards, Logo Design,
    Brochure Design, Social Media Design), and custom-priced items
    where the cashier enters the price at time of sale (Flex Banner,
    Offset Printing, Lamination)
  • 5 customers + 1 Walk-in customer (across Bhaluka/Mymensingh area)
  • 2 suppliers
  • 20 sales spread across the last 28 days, with a mix of cash /
    mobile banking / card payments, some fully paid, some partial dues
  • 3 purchase orders with items linked to suppliers
  • 13 expenses (rent, utilities, staff welfare, maintenance, supplies)
  • 4 salary payment records for the two staff members

DEFAULT SETTINGS: Language set to Bangla, business name "ডিজাইন পয়েন্ট"
(Design Point), Bhaluka, Mymensingh — update these in Settings after
login to match your actual business.

ProPOS v1.3.0 — Complete Point of Sale System
============================================

WHAT'S NEW IN v1.3.0
------------------------
1) POS PAGE — PRODUCTS NOT SHOWING (FIXED)
   The POS page only listed products with stock_quantity > 0. If a
   product's stock was 0 (or wasn't being tracked at all — common for
   printing-press / made-to-order businesses), it never appeared, which
   could make the POS page look empty. Products now appear correctly,
   and you can mark individual products as "Track Stock: off" (see #3)
   so service/custom items are never hidden by stock count.

2) SMS NOTIFICATIONS (NEW)
   - Settings → SMS: configure any Bangladeshi SMS gateway (BulkSMSBD,
     Alpha SMS, Mimsms, SSL Wireless, etc.) via a simple URL template
     with {api_key} {sender_id} {number} {message} placeholders.
   - Automatic welcome SMS when a new customer is added.
   - Automatic purchase-confirmation SMS after every sale, with amount/
     invoice/paid/due details (only sent if the customer has a phone).
   - New "Send SMS" page: send a custom message to all customers, only
     customers with a due balance, or a single customer — plus a
     one-click "Send Due Reminders to All" bulk action.
   - All 3 message templates (Welcome / Purchase / Due Reminder) are
     fully editable in Settings → SMS → Templates, with placeholders.
   - Every SMS attempt (sent or failed) is logged and viewable on the
     Send SMS page for troubleshooting.
   - NOTE: you need an SMS gateway account/API key from a provider —
     ProPOS does not include SMS credits itself, it just sends the
     request to whichever gateway you configure.

3) CUSTOM-PRICED / SERVICE PRODUCTS (NEW)
   Product edit form now has two new toggles:
   - "Track Stock" — turn off for services or made-to-order items
     (e.g. custom print jobs) so they're always available in POS
     regardless of stock count, and sales don't try to deduct stock.
   - "Custom Price" — turn on for products whose price is decided per
     order. In POS, tapping such a product now prompts the cashier to
     enter the price for that specific sale instead of using a fixed
     price.

ALSO FIXED: saving any one Settings tab (e.g. Business) was silently
blanking out every other tab's saved values (e.g. Invoice, SMS)
because the shared settings form only submits the fields for the tab
currently open. Settings tabs are now fully independent — saving one
tab no longer touches the others.

ProPOS v1.2.1 — Complete Point of Sale System
============================================

WHAT'S NEW IN v1.2.1 (MOBILE MODAL FIX)
-------------------------------------------
- Fixed: on Add/Edit popups (employees, products, customers, suppliers,
  expenses, categories, salary payments) with longer forms, the Save/
  Cancel buttons could be pushed off-screen on mobile, making them hard
  or impossible to reach.
  ROOT CAUSE: every modal wraps its body + footer inside a <form> tag.
  A plain <form> isn't a flex container, so the CSS rule meant to make
  the modal body scroll internally (keeping the footer pinned visible)
  never actually applied — the form just grew to fit all its fields,
  pushing the Save/Cancel buttons past the bottom of the screen.
  Fixed by making the <form> itself part of the modal's flex layout, so
  long forms now scroll inside the modal body while Save/Cancel always
  stay visible and reachable at the bottom — on every device size.
- Also tightened modal padding on mobile and used the dynamic small-
  viewport-height unit (svh) so the modal sizes correctly even when the
  on-screen keyboard or mobile browser toolbar is showing.

ProPOS v1.2.0 — Complete Point of Sale System
============================================

⚠️ IMPORTANT — v1.2.0 (REAL FIX FOR "????" BANGLA TEXT)
-----------------------------------------------------------
The earlier "font fix" releases (v1.1.1 / v1.1.2) were not the actual
cause of Bengali text disappearing. The screenshots showed literal "?"
characters (not invisible/tofu boxes) — that is the classic sign of a
DATABASE CHARSET problem, not a font problem.

ROOT CAUSE: On most cPanel hosts, you must create the MySQL database
yourself before running the installer. cPanel often creates that
database with a default charset of `latin1`, not `utf8mb4`. Several of
ProPOS's CREATE TABLE statements didn't explicitly force `utf8mb4`, so
they silently inherited the database's `latin1` default. Any Bengali
character has no `latin1` equivalent, so MySQL replaced it with a
literal "?" the moment it was saved — this happened at the database
level, not the browser/display level, which is why no font fix could
ever solve it.

WHAT'S FIXED:
- Every table in the installer now explicitly forces
  `CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci`, regardless of what
  charset the underlying database has.
- The installer now also runs `ALTER DATABASE ... CHARACTER SET
  utf8mb4` to force-correct the database itself, even if it already
  existed with a different charset.
- The app now runs `SET NAMES utf8mb4` on every database connection
  as a safety net (some PHP/MySQL driver combos on shared hosting
  silently ignore the charset option passed at connection time).
- A ONE-TIME AUTOMATIC REPAIR now runs the first time any page loads
  after this update: it converts your existing database and every
  existing table to utf8mb4, so all NEW Bengali text you type from now
  on will save and display correctly. No manual SQL needed — just
  upload these files and load any page once (e.g. the login page).

⚠️ DATA ALREADY SHOWING "????" CANNOT BE AUTO-RECOVERED:
If a field already shows "?" or "??? ??????", the original Bengali
text was destroyed at the moment it was first saved (MySQL replaced
the actual bytes with "?" — there's nothing left to recover). After
updating to v1.2.0, please re-type and re-save those specific fields
once (Settings → Business Name (বাংলা)/Address (বাংলা)/Footer/Invoice
Note, any product/category Bengali names, etc.) — going forward they
will save and display correctly.

WHAT'S NEW IN v1.1.2 (cosmetic font fallback — kept, but was not the
real fix)
------------------------------------------------------------------------
- Bengali text was still missing on the Settings page and a few others
  when the device/network couldn't reach Google Fonts (common on some
  shared hosting / restricted networks in Bangladesh). Fixed by adding
  a full system-font fallback chain everywhere Bengali text appears:
    'Hind Siliguri', 'Noto Sans Bengali', 'Nirmala UI', 'Vrinda', sans-serif
  'Nirmala UI' ships with Windows 10/11 and 'Noto Sans Bengali' ships
  with most Android/Linux systems — so Bengali now renders correctly
  even if the Google Fonts CDN is blocked or slow.
- Added the Google Fonts <link> (with preconnect) to the Login page too,
  not just the dashboard pages.

WHAT'S NEW IN v1.1.1 (FONT FIX)
---------------------------------
- Fixed: Bengali numerals/text were invisible in amount, date, and
  quantity columns across the app. Cause: those fields use the
  'JetBrains Mono' font (for a clean monospaced number look), but that
  font has no Bengali glyphs — and it had no fallback font configured,
  so Bengali digits rendered as blank/empty boxes. Added 'Hind Siliguri'
  (which supports Bengali) as the fallback everywhere 'JetBrains Mono'
  is used, and switched font loading from CSS @import to a proper
  <link> tag in <head> for more reliable loading on shared hosting.

WHAT'S NEW IN v1.1
-------------------
- More dashboard stat cards: suppliers, employees, monthly purchases,
  net profit/loss, salary paid this month, total due, today's expenses
- All numbers & dates now render in proper Bengali digits/month names
  site-wide (Bangla mode) — amounts, quantities, invoice counts, dates
- New "Salary Payments" module (Superadmin only): record partial/ad-hoc
  salary payments per employee, see paid-this-month & remaining balance,
  full payment history with filters
- Professional invoice redesign: store info + customer info side-by-side,
  bilingual labels, and a "Download PDF" button (in addition to Print)
- Full Bengali translation pass across dashboard, employees, reports,
  invoices, customers, suppliers, expenses, purchases, products, categories
- Self-healing DB migration — upgrading an existing install will
  auto-create the new `salary_payments` table on first page load,
  no manual SQL needed

INSTALLATION
------------
1. Upload the entire "pos" folder to your web server
   e.g. public_html/pos  OR  htdocs/pos  OR  www/pos
2. Open in browser: http://yourdomain.com/pos/install/
3. Step 1: Check requirements
4. Step 2: Enter MySQL credentials & test
5. Step 3: Click "Install ProPOS Now"
6. Done! Login at: http://yourdomain.com/pos/

UPGRADING FROM v1.0
--------------------
Just replace your files with this new version — keep your existing
includes/config.php (or merge the new constants if you customized it).
The `salary_payments` table is created automatically the first time
any page loads after the upgrade. No reinstall needed.

NOTE: BASE_URL is automatically detected — works on any
host, subdirectory, or localhost without any changes.

DEFAULT LOGIN
-------------
  Username : admin
  Password : admin123
  ⚠ Change password after first login!

USER ROLES
----------
  superadmin  — Everything including settings & employees
  admin       — Everything except settings/employees
  manager     — Sales + Inventory/Purchases
  cashier     — POS sales & invoices only
  inventory   — Products & Purchases only

FEATURES
--------
  ✔ POS Terminal with barcode scanner
  ✔ Invoice with Print & PDF
  ✔ Products with image upload
  ✔ Categories, Stock management
  ✔ Customers & Suppliers
  ✔ Purchase orders with auto stock update
  ✔ Expense tracking
  ✔ Sales Reports with charts
  ✔ Employee management with roles
  ✔ Bengali/English bilingual (toggle anytime)
  ✔ Dark/Light theme
  ✔ Business info, logo, address editable
  ✔ 100% Responsive (Mobile/Tablet/Desktop)
  ✔ CSS-only sidebar, dropdown, theme toggle (minimal JS)

REQUIREMENTS
------------
  PHP  >= 7.4
  MySQL >= 5.7
  Extensions: PDO, PDO_MySQL, mbstring, GD

SECURITY AFTER INSTALL
-----------------------
  1. Delete the /install/ folder
  2. Change default admin password
  3. Set strong MySQL password

