SUPRIXX UPGRADE — companies + fiscal years
===========================================

BEFORE YOU UPLOAD (important)
  1. cPanel -> phpMyAdmin -> your offers database -> Export -> Go   (database backup)
  2. cPanel -> File Manager -> the site folder -> select all -> Compress (files backup)

UPLOAD
  Upload every .php file from this zip into the site folder (next to login.php),
  replacing the existing files. (In File Manager: upload this zip, then Extract.)

  NEW files:     suprixx.php, admin_ui.php, companies.php, fiscal_years.php,
                 switch_context.php, app_context.php
  CHANGED files: config.php, offer_counter.php, offer.php, plant-offer.php, amc-offer.php,
                 view_offer.php, view_plant-offer.php, view_amc-offer.php, dashboard.php,
                 offer_bank.php, offer_bank_export.php, users.php, login.php,
                 app_auth.php, app_login.php, offer_status.php, offer_details.php,
                 notifications_feed.php
  Not touched:   logout.php, vendor/, assets/ (and any other files you have)

DATABASE: TWO WAYS (use either one)
  A) Automatic: just upload the files; the first page load upgrades the database.
  B) By hand: phpMyAdmin -> your offers database -> SQL tab -> paste the contents of
     suprixx_upgrade.sql (or Import that file) -> Go. Then upload the files.
     It is safe to run twice, and the website then skips its automatic upgrade.
  Both give exactly the same result.

WHAT HAPPENS ON THE FIRST PAGE LOAD
  The database upgrades itself once (nothing is deleted or renamed):
   - new tables: companies, fiscal_years, user_companies, sx_offer_counters, sx_meta
     (your existing offer_counters table is left exactly as it is)
   - new columns: offers.company_id, offers.fy_id, users.default_company_id
   - Nepal Ion Exchange becomes company #1 (details from your current PDFs)
   - every existing offer -> Nepal Ion Exchange + the fiscal year in its reference
   - every existing user -> access to Nepal Ion Exchange
   - offer numbers continue from the highest number already used in each year

AFTER UPLOADING
  1. Sign in as admin. Top-left shows "Suprixx" and "Nepal Ion Exchange · FY 2083-84".
  2. Companies (menu) -> check Nepal Ion Exchange's details -> Add company for the others
     (upload each company's logo there).
  3. Fiscal Years (menu) -> add next year when it starts, "Make current".
  4. Users -> tick which companies each user may see, and their default company.
  5. Switch company / year any time from the pill at the top-left of every page.

  Company logos are saved in uploads/company_logos/ (created automatically).
  If PHP can't create it, create the folder "uploads/company_logos" yourself in File Manager.

OWN LETTERHEAD PER COMPANY (added in this version)
  Companies -> Edit a company -> "Letterhead on the PDFs":
   - Standard design: logo + name at the top, offices/reg. no./contacts at the bottom
     (made from the company details) -- what every company has by default.
   - Own letterhead: upload the company's letterhead as two images:
       Header image = the top strip of their letterhead
       Footer image = the bottom strip (optional)
     PNG or JPG, full A4 width, at least 2000 px wide, under 5 MB, cropped tightly.
     If the letterhead is a Word/PDF file: open it, cut out the top strip and the
     bottom strip, and save each as PNG.
  Every PDF of that company (Spares, Plant, AMC, on every page) then prints those
  images; the page margins adjust to the images so the text never overlaps them.
  "Preview a sample PDF" shows a 2-page sample before you use it on real offers.
  Images are stored in uploads/company_letterheads/ (created automatically).

  ALREADY UPLOADED THE PREVIOUS ZIP? Then only these 6 files changed:
   suprixx.php, companies.php, admin_ui.php, view_offer.php, view_plant-offer.php, view_amc-offer.php
  (the database adds its 3 letterhead columns by itself on the next page load)

FROM THE APP (admin)
  Profile -> Admin -> "Companies & letterheads" / "Fiscal years" / "Manage Users"
  open these same pages inside the app, already signed in. Home -> the company pill
  switches the company + fiscal year you're working in.
