%PDF- %PDF-# Advanced Pharmacy Management System Laravel-ready implementation scaffold for the attached PRD. It includes the core domain structure for multi-branch pharmacy operations: staff, medicines, branded variants, batch and expiry stock, suppliers, purchasing, POS billing, customers, prescriptions, stock movement, alerts, and reporting. ## Current Environment Note This workspace does not currently have PHP or Composer installed, so the app cannot be executed here yet. Once PHP 8.3+ and Composer are available, run: ```bash composer install cp .env.example .env php artisan key:generate php artisan migrate --seed php artisan serve ``` ## Included Modules - Role-aware branch operations foundation - Employee, attendance, leave, payroll, and activity-ready data model - Medicine master data with brands, batches, expiry, Rx flag, barcode, and storage requirements - FEFO stock decrement service for POS checkout - Low-stock, expired, and near-expiry alert service - Supplier and purchase order data model with approval-friendly statuses - Customer profile, loyalty points, due balance, and prescription attachments - Dashboard metrics for daily sales, gross profit, top sellers, low stock, and expiry risk - Modern Blade screens for dashboard, inventory, POS, employees, suppliers, and reports - Customer-facing online store on the homepage `/` (home, catalog with search/filters, product pages, cart, checkout, order tracking, about, contact, policy pages) - Customer accounts with order history, loyalty points, and profile management - Admin-managed homepage ad banner slider, newsletter signups, and a contact-message inbox - Online payments: Cash on Delivery, Stripe Checkout, and PayPal - each can be enabled/disabled from Settings - Store admin: Online Orders (status workflow with automatic stock restore on cancel) and Store Products (photos, descriptions, featured/online toggles) ## Online Store The public storefront is the homepage (`/`) and sells live inventory from the branch selected in `Settings > Online Store`. Prices and stock come straight from inventory batches, and orders reserve stock using the same FEFO (first-expiry-first-out) rule as the POS. Configure everything under **Settings**: - **Online Store (Customer Website)** - enable/disable the store, hero text, announcement bar, contact info, delivery fee, and free-delivery threshold. - **Online Payments** - Stripe (publishable + secret key) and PayPal (client ID + secret, sandbox/live mode) each have their own enable checkbox; Cash on Delivery can also be toggled. A gateway only appears at checkout when it is enabled *and* its keys are filled in. Manage incoming orders in **Online Orders** (cancelling an order returns its stock), curate the catalog in **Store Products** (upload photos, descriptions, mark items featured or hide them from the store), and manage the homepage ad slider plus the customer message inbox in **Store Banners**. ### Storefront pages | Route | Page | | --- | --- | | `/` | Home - ad slider, hero, categories, featured & latest products, testimonials | | `/products`, `/products/{id}` | Shop catalog with search, category filters, sorting; product detail | | `/cart`, `/checkout`, `/order/{orderNo}` | Cart, checkout, order confirmation | | `/track-order` | Order tracking by order number + phone | | `/about`, `/contact` | About us (live stats) and contact form | | `/shipping-returns`, `/privacy-policy`, `/terms` | Policy pages (values pulled from Settings) | | `/account/register`, `/account/login`, `/account` | Customer accounts and order history | Customers authenticate on a separate `customer` guard, so staff logins at `/login` and customer logins at `/account/login` never collide. ## Demo Login The seeder creates a first owner account: - Email: `owner@pharmacy.test` - Password: `password` Change this immediately before production use. ## Optional Silent Print Agent For receipt printers that should print without Chrome's print dialog, run this on the POS computer: ```bash node scripts/local-print-agent.js ``` Then set `Settings > Billing Device & Receipt Printer > Connection mode` to `Local silent print agent` and keep the URL as `http://127.0.0.1:9109`. Chrome direct device mode can also reconnect to an approved Web Serial printer after clicking `Connect Device` once on a receipt page.