User Guide - PharmaDesk

Getting Started with PharmaDesk

System Overview & Access

PharmaDesk is a web-based pharmacy management system with the following architecture:

Local Data Storage

All pharmacy data is stored locally in a SQLite database file on the server machine. No internet connection is required to operate the system - data remains completely under your control.

LAN Access

Multiple team members can access PharmaDesk simultaneously via a web browser on your local network (LAN). No client software installation needed - just open a browser and navigate to the server address.

Remote/VPS Access

If PharmaDesk runs on a VPS (Virtual Private Server) with a public IP address, the interface can be accessed globally from anywhere with internet. Perfect for multi-location pharmacies or remote management.

No Dependencies

Zero reliance on external cloud services, internet connectivity, or third-party APIs. PharmaDesk is self-contained and operates independently on your server.

Access Methods:
  • Local Server: Open browser → go to http://localhost:8008 (or your server's IP)
  • LAN Users: Use server's IP address (e.g., http://192.168.1.10:8008) from any computer on the network
  • Remote/VPS: Use public IP or domain name (e.g., http://pharmacy.example.com) from anywhere in the world

Initial Setup

When you first log into PharmaDesk, follow these steps to set up your pharmacy system:

  1. Navigate to Settings (Admin only) to configure your pharmacy information
  2. Create Users for your team members with appropriate roles (Admin, Salesman, Cashier, Pharmacist)
  3. Add Medicines to your pharmacy catalog with pricing and stock information
  4. Add Suppliers for tracking purchase sources and managing purchase orders
  5. Configure Currency Settings to match your local currency (symbol, position, etc.)
  6. Test with sample transactions before going live

Settings Configuration

Access Settings (Admin only) to configure:

Clinic Information

Pharmacy name, address, phone number, and branding

Currency Settings

Currency symbol (e.g., $, £, €) and position (before/after amount)

Payment Methods

Configured payment modes: Cash, Card, Bank Transfer, Other

Business Rules

Stock thresholds, expiry date alerts, and other policies

Master Data Setup

AdminCashier

  • Medicines: Add all medicines with form, strength, unit, and pricing
  • Stock/Batches: Manage stock batches with batch numbers, expiry dates, and quantities
  • Suppliers: Maintain supplier list for purchase management

User Roles & Permissions

PharmaDesk has four distinct user roles, each with specific responsibilities and access levels:

Role Responsibilities Summary

Function Admin Salesman Cashier Pharmacist
Create New Sales
Collect Payments
Process Sales Returns
Create Purchases
Stock Adjustments
View Medicines View
Manage Medicines
Manage Suppliers
Manage Users
System Settings
View Reports

Role Descriptions

Admin — Full System Access

Administrators have complete control over the system and are responsible for overall management, configuration, and oversight.

Dashboard: System-wide dashboard with key metrics

Key Responsibilities:

  • System configuration and settings
  • User account management (create, edit, delete)
  • Complete transaction visibility and management
  • Stock and supplier management
  • Access all reports and analytics
  • Database backup and management

Salesman — Medicine Sales Only

Salesman focus on medicine dispensing and creating sales orders. They maintain medicines and stock information but do not handle payments or financial transactions.

Dashboard: Sales-focused view showing medicines and stock

Key Responsibilities:

  • Create new sales bills for customers
  • View available medicines and stock levels
  • Access sales history for reference
  • Manage medicine details (in collaboration with Admin)

Restrictions: Cannot access pending bills, payment collection, purchases, or stock adjustments

Pharmacist — View-Only Medicine Access

Pharmacists have read-only access to medicine information for reference purposes only.

Dashboard: Pharmacy-focused view showing medicines and stock (view-only)

Key Responsibilities:

  • View available medicines and detailed information
  • Check stock levels and batch information
  • Access medicine reference data

Restrictions: Cannot create sales, access payments, purchases, or modify any data

Cashier — Payment & Inventory Management

Cashiers handle payment collection, inventory management, and purchasing. They work at the counter and manage shelf inventory directly.

Dashboard: Cashier-focused view showing pending bills and transactions

Key Responsibilities:

  • Create new sales (for walk-in customers)
  • Collect payments from pending bills
  • Process sales returns
  • Create and manage purchase orders
  • Perform stock adjustments
  • Manage supplier information
  • Access sales reports

Restrictions: Cannot manage user accounts or access system settings

Role-Specific Workflows with Examples

Salesman Workflow

Typical daily workflow for a salesman creating sales orders:

1
Open Dashboard
Access Pharmacy Dashboard to view daily statistics
2
Click "New Sale"
Create a new bill for a customer
3
Search for Medicines
Type medicine name to search (e.g., "Paracetamol 500mg"). Select from dropdown.
4
Select Batch & Enter Details
The earliest-expiring valid batch is auto-selected (already-expired batches are skipped). You can switch to a different batch using the dropdown if needed. Enter quantity - price auto-fills from the selected batch.
5
Add More Items
Repeat steps 3-4 to add more medicines to the sale
6
Review & Save Sale
Review total amount and click "Save Sale". Bill automatically marked as unpaid.
7
Hand Items to Customer
Give the medicines to the customer and direct them to the cashier for payment

Cashier Workflow

Typical daily workflow for a cashier managing payments and sales:

1
Open Cashier Dashboard
View pending bills waiting for payment collection
2
Click Pending Bill
Select a bill from "Pending Bills to Collect" section. Payment modal opens automatically.
3
Enter Payment Amount
Customer pays. Enter amount received. Change is calculated automatically.
4
Apply Discount (Optional)
Optionally apply cashier discount (amount or %). Final total updates in real-time.
5
Select Payment Mode
Choose payment method: Cash, Card, Bank Transfer, or Other
6
Confirm Payment
Click "Confirm Payment". Bill marked as paid/partial. Success message shows change due.
7
Give Change & Receipt
Provide change to customer. Option to print receipt or bill.

Admin Workflow

Typical admin workflow for managing the pharmacy system:

1
Access System Dashboard
View system-wide metrics and key performance indicators
2
Manage Users
Create new staff accounts, assign roles (Salesman / Cashier / Pharmacist), reset passwords, deactivate users (deactivated users are logged out immediately on their next action)
3
Maintain Master Data
Add/edit medicines, manage stock batches, maintain supplier list
4
Monitor Transactions
Review sales history, pending bills, purchases, and returns
5
Generate Reports
Access detailed reports on sales, revenue, purchases, and stock levels
6
Configure Settings
Update currency, clinic information, and business rules
7
Backup Database
Create regular backups and manage multiple databases

Advanced Workflows

Salesman Cashier — Sales Returns Workflow

Process returns when a customer returns medicines due to damage, wrong item, or other reasons. Returns reduce customer's outstanding balance and restore stock:

1
Access Sales Returns
From navbar: Sales & Returns → Sales Returns
2
View Existing Returns or Create New
Returns List: Shows all processed returns with columns: Return ID, Sale Bill #, Return date, Reason, Qty items returned
Icons: Eye icon = View details, Pencil icon = Edit return, Trash icon = Delete return (restores stock to original sale)
Create New: Click blue "New Sales Return" button at top
3
Search & Select Original Sale
Search field: Type receipt number or customer name to find the sale being returned
Sale details shown: Receipt #, Customer name, Prescription #, Sale date, Total amount, Payment status, Original items list
Note: Can only return from an existing paid or unpaid sale
4
Select Items & Quantities to Return
Items table: Lists all items from the original sale
Columns: Medicine name, Original quantity, Original price, Quantity returning (input field)
Partial returns: Enter any quantity up to original amount (e.g., if 10 items sold, can return 1-10)
Default: All quantities pre-filled with original amount - edit to reduce
5
Set Return Date & Reason
Return date: When the customer brought items back (defaults to today)
Reason field: Dropdown or text explaining why items are being returned:
  • Damaged / Defective
  • Wrong Item
  • Expired
  • Customer Request
  • Other (with explanation)
6
Review & Save Return
Summary shown: Total return value = sum of (qty returned × original price)
Buttons: Green "Save Return" button = record the return, X = cancel
On save: Return is recorded, stock quantities updated, return ID generated
7
View, Edit, or Delete Return (if needed)
View (Eye icon): Opens read-only modal showing return details
Edit (Pencil icon): Opens return form to modify quantities, date, reason - click "Update Return" to save changes
Delete (Trash icon): Removes return from system (restores stock to sale - undoes the return)
Note: Deleted returns cannot be recovered, but original sale remains in system

Sales Returns Interface Details

Return Modal Fields

Sale Selection: Search box for receipt # or customer name
Items Table: Checkbox + quantity fields for each item
Return Date: Date picker (defaults to today)
Reason: Dropdown with predefined reasons

Action Buttons

Blue button: "New Sales Return" - creates new return
Green button: "Save Return" - records in database
Gray button: "Cancel" - closes without saving
Eye/Pencil/Trash: View/Edit/Delete actions

Stock Impact

On Save: Returned quantities are added back to original batches
Batch Selection: System tracks which batch the original sale used
No Selection Needed: Returns automatically go to original batch

Return Status

Visible in: Returns list, Sales detail view
On Sales.html: Return icon appears next to sales with returns
Tracking: All returns linked to original sale permanently

Sales Returns Best Practices

  • Document Reason: Always record why items were returned (helps identify quality issues)
  • Quick Processing: Process returns same day as receipt to maintain accurate stock counts
  • Customer Verification: Verify customer has items and condition before recording return
  • Batch Tracking: System automatically tracks which batch returned items came from
  • Partial Returns OK: Can return just some items from a sale (e.g., 5 of 10 boxes)
  • Edit Before Save: Check quantities and reason before clicking "Save Return" - editing afterwards works too
Stock Auto-Update: When a return is saved, returned quantities automatically added back to their original stock batches. If you delete a return, stock is reduced again (undoing the return). This happens instantly - no manual stock adjustment needed.

Admin Cashier — Stock Adjustments Workflow

Record inventory adjustments for damage, theft, expiry, count corrections, or other discrepancies:

1
Navigate to Stock Adjustments
From navbar: Purchases & Stock → Stock Adjustments
2
Search for Medicine
Type medicine name in search box. Shows matching results with current stock levels.
3
Select Batch
Choose which batch to adjust. Shows batch number, expiry date, and available quantity.
4
Set Adjustment Details
  • Date: When the adjustment occurred
  • Type: Damage, Theft, Expired, Count Correction, or Other
  • Direction: Reduce stock (-) or Add stock (+)
  • Quantity: How many units to adjust
  • Reason: Optional explanation for record keeping
5
Save Adjustment
Click "Save Adjustment". Entry appears in Session Log. Stock updated immediately.

Stock Adjustment Examples

  • Expired Batch: Type=Expired, Direction=Reduce (-), Qty=entire batch quantity. Removes expired items from stock.
  • Damaged Items: Type=Damage, Direction=Reduce (-), Qty=number damaged. Records loss from damage.
  • Count Correction: Type=Count Correction, Direction=Reduce (-) or Add (+). Fixes physical count discrepancies.
  • Theft/Loss: Type=Theft, Direction=Reduce (-), Qty=missing quantity. Records inventory loss.

Admin Cashier — Purchase Returns Workflow

Process returns of items you purchased from suppliers (damaged, expired, wrong items). Returns reduce supplier payable and remove stock:

1
Access Purchase Returns
From navbar: Purchases & Stock → Purchase Returns
2
View Existing Returns or Create New
Returns List: Shows all processed purchase returns with columns: Return ID, Purchase Order #, Supplier name, Return date, Reason, Items returned count
Icons: Eye icon = View details, Pencil icon = Edit return, Trash icon = Delete return (restores stock)
Create New: Click blue "New Purchase Return" button at top, or click Return icon on Purchases list
3
Search & Select Purchase Order
Search field: Type supplier name or PO # to find purchase being returned
Purchase details shown: PO #, Supplier name, Invoice #, Purchase date, Total amount, Payment status, Delivery date
Note: Can return from any purchase regardless of payment status (paid/partial/unpaid)
Supplier info: Displays for reference when creating credit note
4
Select Items & Quantities to Return
Items table: Lists all medicines/batches from the original purchase
Columns: Medicine name, Batch #, Original quantity, Cost/unit, Total cost, Qty returning (input field)
Select items: Check boxes to mark items being returned
Quantities: Enter how many units to return (can be partial, e.g., 5 of 10 boxes)
Cost display: Shows total cost of items being returned for credit calculation
5
Set Return Details
Return date: When items were sent back to supplier (defaults to today)
Reason field: Select reason for return:
  • Damaged / Defective
  • Expired / Expiry Soon
  • Wrong Item / Wrong Quantity
  • Quality Issue
  • Other (with explanation)
Notes: Optional field for supplier communication (e.g., "Received 10/02, packaging damaged, requesting credit note")
6
Review & Save Return
Return summary: Total credit amount = sum of (qty returned × cost per unit)
Buttons: Green "Save Return" button = record return, X = cancel
On save: Return recorded, stock quantities reduced, supplier payable reduced by credit amount
7
View, Edit, or Delete Return
View (Eye icon): Opens modal with all return details (read-only)
Edit (Pencil icon): Opens return form to modify items, quantities, reason, notes - click "Update Return" to save changes
Delete (Trash icon): Removes return from system (restores stock and credit - undoes the return)
Return detail modal: Shows purchase info, items returned, cost credit, reason, and all dates
8
Create Credit Note (if needed)
Option: Some systems require credit note from supplier - manually record in supplier communication
Reference: Use Return ID and credit amount when contacting supplier
Tracking: Note the return in Purchase Returns list for record-keeping and audit trail

Purchase Returns Interface Details

Return Modal Fields

Purchase Selection: Search box for PO # or supplier name
Items Table: Checkboxes + quantity fields with batch details
Return Date: Date picker (defaults to today)
Reason: Dropdown with predefined reasons
Notes: Text field for supplier communication

Credit Calculation

Automatic: System calculates credit = qty × cost per unit
Display: Shows total credit value for return
Tracking: Return reduces supplier payable amount automatically
Partial returns: Supports returning only some items

Stock Impact

On Save: Returned quantities subtracted from stock batches
Batch Tracking: System knows which batch items came from
Auto-update: No manual stock adjustment needed
Reversal: Deleting return adds stock back

Return Status Display

Visible in: Purchase Returns list, Purchases detail view
On Purchases.html: Return icon appears on POs with returns
Linked Data: Returns permanently linked to original purchase
Payment Impact: Reduces supplier's outstanding balance

Purchase Returns Best Practices

  • Quick Processing: Return damaged/wrong items to supplier as soon as identified
  • Document Reason: Always record detailed reason (helps with supplier relationship and quality tracking)
  • Photo Documentation: For damaged items, take photos before returning (keeps supplier honest)
  • Communicate with Supplier: Email or call supplier when processing returns for large amounts
  • Track Credit Notes: Maintain records of credit notes received from suppliers
  • Batch Tracking: System automatically tracks which batch items came from - helps identify quality patterns
  • Partial Returns OK: Can return some items from a purchase (e.g., 5 of 10 defective units)
  • Edit Before Save: Double-check quantities and reasons - editing afterwards is possible but save first
  • Monitor Suppliers: Use Purchase Summary report to see return rates by supplier
Stock & Payable Auto-Update: When you save a purchase return, the system automatically: (1) reduces stock quantities by returned items, (2) reduces supplier payable by credit amount. Both updates happen instantly - no manual adjustment needed. Deleting a return reverses both changes.
Important: Purchase returns affect your inventory count and supplier payment obligations. Ensure quantities are verified before saving. Always maintain communication with suppliers about returns, especially for large amounts or recurring issues.

Salesman — Multi-Bill Management (Draft Sales)

Create and manage multiple sales bills simultaneously:

1
Click "New Sale"
Start a new bill. Tabs appear at top showing multiple draft sales.
2
Create First Bill
Add items, prices, discounts. Draft automatically saved to browser while you work.
3
Click "New" Button
Start a second bill. Previous bill saved. New tab shows "Sale #2 (0)" items.
4
Switch Between Drafts
Click tabs to switch between bills. All changes auto-save. Work on multiple customers simultaneously.
5
Save Each Bill
When ready, click "Save Sale" for current bill. Saved as unpaid, ready for cashier payment collection.
Note: Draft sales are stored in browser only. They are lost if you refresh the page or close the browser. Always save completed bills to the database.

Key Features Explained

Payment Modes

PharmaDesk supports four payment methods for flexibility:

  • Cash: Direct cash payment at counter
  • Card: Credit or debit card payment
  • Bank Transfer: Online bank transfer (for large orders or purchase orders)
  • Other: Alternative payment methods (check, cryptocurrency, etc.)

Medicine Information & Location Tracking

Complete medicine catalog with detailed information:

  • Medicine Details: Name, generic name, form, strength, base unit
  • Storage Location: Physical location identifier (e.g., "Shelf A 2", "Refrigerator 1", "Cabinet B") - helps staff quickly locate items on shelves
  • Active/Inactive Status: Deactivate medicines without deleting transaction history
  • Packing Options: Multiple pack sizes (tablets, capsules, strips, bottles) for same medicine
  • Pricing Per Packing: Different selling and cost prices for each pack size

Stock Management with Batches

Stock is managed at the batch level for better inventory control:

  • Batch Number: Unique identifier for each batch from supplier
  • FEFO Method: First Expire, First Out - system prioritizes the earliest expiry date that is still valid (already-expired batches are skipped when adding to a new bill, even if they happen to be the earliest in the list)
  • Expiry Date: Automatic alerts for expired or expiring medicines
  • Quantity Tracking: Real-time stock quantity per batch
  • Purchase Price & Selling Price: Track margins for profitability analysis
  • Stock Alerts: Low stock warnings and expiring stock notifications on dashboard

Currency Settings

Support for multiple currency formats:

  • Currency Symbol: Configure your currency (USD $, GBP £, EUR €, INR ₹, etc.)
  • Position: Choose whether symbol appears before ($100) or after (100 $)
  • Global Application: All amounts in the system automatically use your configured currency
  • Number Formatting: Automatic locale-based number formatting with 2 decimal places

Session Management & Security

  • Login: Each user logs in with their assigned username and password
  • Password Policy: Minimum 8 characters for security. Forced password change on first login.
  • Session Timeout: Automatic logout after 30 minutes of inactivity. Every action you take resets the 30-minute clock.
  • Instant Lockout on Deactivation: When an admin deactivates a user, that user is logged out immediately on their next action - no waiting for the timeout. Useful for fired or rotating staff.
  • Role-Based Access: Users can only access functions for their assigned role

Pending Bills System

Salesman creates a bill and cashier collects payment later:

  • Bill created by salesman is automatically marked as "Unpaid"
  • Cashier sees all unpaid bills on the Pending Bills screen, auto-refreshing every 30 seconds
  • Cashier confirms payment - full payment required (the system rejects partial payments)
  • The moment of payment is timestamped separately from when the bill was created - useful for cash flow reports
  • Change calculation is automatic

Discount System

Two-level discount system for flexibility:

  • Item Discount: Applied per item at sale creation (by salesman). Stays with the bill from the moment it's saved - cashier confirming payment does not erase it.
  • Cashier Discount: Applied at payment time, in addition to any item discounts. Useful for loyalty or bulk-buy adjustments. Recorded separately from the salesman's item discounts so reports can distinguish them.
  • Bill total updates after payment: When the cashier confirms with a discount, the bill's total amount is recomputed to reflect the final charged amount. So the Sales list always shows what the customer actually paid.
  • Real-Time Updates: Final total updates instantly as you adjust the cashier discount in the payment modal.

Expired Stock Protection

The system protects you from accidentally selling expired stock:

  • When adding a medicine to a bill, the system auto-selects the earliest-expiring batch that is still valid. Expired batches are skipped during auto-selection - though they remain visible in the batch dropdown if you need to view them for stock-adjustment purposes (e.g. writing off expired stock).
  • If you manually select an expired batch and try to save the bill, the system rejects it with a clear message ("Batch X expired on YYYY-MM-DD"). The bill is not saved and no stock is consumed.
  • The Expiry Report shows batches that will expire within your chosen threshold of days
  • The Expiry Loss Report shows the financial value at risk - both cost paid and retail price - plus the supplier and invoice for supplier-credit claims

Keyboard Shortcuts

The system supports keyboard navigation for faster operation:

  • Escape: Closes any open dialog (payment collection, edit forms, confirmation prompts, etc.). Useful when you want to cancel quickly without clicking the close button. The "Bill Created" success dialog after saving a sale is the one exception - it stays open so you can choose Print Slip, New Sale, or Back to Sales.
  • Tab / Shift+Tab: Inside a dialog, Tab moves through the fields and buttons in order. Shift+Tab moves backwards. Focus stays inside the dialog - you can't accidentally tab into the sidebar while a dialog is open.
  • Enter: In the "Bill Created" success dialog, Enter activates the currently highlighted button (Print Slip by default).
  • Arrow keys (Bill Created dialog only): Left / Right / Up / Down cycle between Print Slip, New Sale, and Back to Sales.
  • Click outside a dialog: Clicking on the dark backdrop (outside the dialog) also closes it - except the "Bill Created" success dialog, which stays open until you pick a next action.

Data Management & Deletion Rules

PharmaDesk protects data integrity by enforcing rules on what can be edited or deleted based on transaction history.

Medicine Deletion

Medicines can be deleted or deactivated depending on usage:

Condition Action Effect
Never used in sales or purchases Hard Delete Medicine completely removed. All packings also deleted. Cannot be recovered.
Used in at least one sale or purchase Soft Delete (Deactivate) Medicine marked as inactive. Appears in reports but not available for new transactions. All transaction history preserved.

Packing (Medicine Variant) Editing & Deletion

Packings (different sizes/forms of same medicine) have restrictions to maintain transaction integrity:

Action Never Used Used in Transactions
Edit (units per pack, prices) Allowed Blocked - Changes would affect transaction history
Delete Allowed Blocked - Prevents orphaned references in sales/purchases
Reason: Once a packing is used in a transaction, its details (price, units per pack) are locked to maintain accurate cost/price history. Changing these would distort historical records.

Why These Rules Exist

  • Audit Trail: Protects transaction history for accounting and compliance
  • Data Integrity: Prevents orphaned records (e.g., sales referencing deleted packings)
  • Accuracy: Historical prices and costs remain accurate; changes don't retroactively alter past transactions
  • Recovery: Soft deletes allow recovery of medicine information if needed later

What You CAN Always Edit

  • Medicine Info: Name, generic name, form, strength (even if used in transactions)
  • Medicine Location: Storage location can be updated anytime
  • Packing Details (if never used): Units per package, prices, MRP
  • Supplier Details: Contact info, address, terms

Database Management

Note: Multiple databases allow you to maintain separate records for different locations, accounting periods, or testing. Only the active database is used for live operations.

Create a New Database

To create a new database for a different location or period:

  1. Access Settings (Admin only)
  2. Scroll to Database section
  3. Click "Create New Database"
  4. Enter database name (e.g., "Branch 2 - Jan 2026" or "Test Database")
  5. Confirm creation. A new empty database is created.
  6. The new database is NOT active yet

Backup a Database

Regular backups protect your data from loss:

  1. Access Settings → Database Management
  2. Select the database you want to backup
  3. Click "Backup" button
  4. System creates a timestamped backup file (e.g., "pharmacy_2026-01-15_143022.db")
  5. Backup is saved locally on your server/computer
  6. Best Practice: Backup daily before closing the pharmacy

Mark Database as Active

The active database is the one your staff uses daily:

  1. Access Settings → Database Management
  2. View list of available databases
  3. Click "Mark as Active" for the database you want to use
  4. Confirmation message shows the new active database
  5. Important: Once you switch databases, all new sales, purchases, and data go to the active database
  6. Old data remains in the previous database (not deleted)

Database Scenarios

Scenario 1: New Year / New Accounting Period

What to do: Create a new database for the new year. Mark it as active from January 1st. Backup the previous year's database for archival. This keeps accounting periods separate and organized.

Scenario 2: Multiple Pharmacy Locations

What to do: Create separate databases for each location (e.g., "Downtown Pharmacy", "Airport Pharmacy"). Each location manager marks their database active when they start their shift. No data mixing between locations.

Scenario 3: Testing New Setup

What to do: Create a test database and populate with sample data. Train new staff on the test database. When ready, switch back to active production database. Delete test database when no longer needed.

Scenario 4: Data Recovery

What to do: If current database is corrupted or has errors, restore from a backup. Create a new database from your backup file and mark it as active.

Warning: Before marking a different database as active, ensure all staff are notified. They may experience unexpected data if they're using the wrong database.

Reports & Analytics

PharmaDesk provides comprehensive reporting tools to help you understand your pharmacy's business performance, inventory health, and financial position. All reports include filtering and export capabilities.

Available Reports

Sales & Revenue Reports

1. Sales Summary Report

Purpose: Analyze daily sales revenue, discounts, and customer returns

Key Metrics: Total Sales, Total Discounts, Total Returns, Net Revenue

Filters: Date range (From/To)

Uses: Daily business performance review, identify days with high returns, track discount trends

Access: AdminCashier

2. Sales by Salesman Report

Purpose: Track individual salesman performance and payment collection efficiency

Key Metrics: Transactions created, Revenue, Discounts applied, Paid/Partial/Unpaid count, Outstanding balance, Average transaction value

Filters: Date range, Specific salesman, Payment status (Paid/Partial/Unpaid), Customer/Receipt search

Uses: Salesman performance evaluation, identify top performers, track payment collection, competition between salesmen

Access: Admin

Profitability & Margin Reports

3. Profit & Margin Report

Purpose: Analyze profitability per medicine, including returns impact

Key Metrics: Quantity sold (net of returns), Revenue, Cost, Profit, Profit Margin %, Quantity returned

Filters: Date range (From/To)

Uses: Identify high-margin and low-margin products, pricing strategy decisions, see impact of returns on profitability

Access: Admin

4. P&L Statement

Purpose: Daily Profit & Loss summary - the bottom line for any period

Key Metrics: Gross Revenue, Discounts, Returns, Net Sales, Cost of Goods Sold, Net Profit, Profit Margin %

Filters: Date range (From/To)

Uses: Period-end financial reviews, share with accountant or owner, see if discount strategy is eating into profit

Access: Admin

5. Cash Flow Report

Purpose: See when cash actually moved in (paid sales) and out (supplier payments) - not when bills were created

Key Metrics: Cash In, Cash Out, Net Movement, Running Balance per day

Filters: Date range (From/To)

Uses: Cash management, plan supplier payments around busy/slow days, reconcile with bank deposits

Access: Admin

Returns & Discount Analysis

6. Return Analysis

Purpose: Understand what's coming back through the door and why

Key Metrics: Returns grouped by reason; Top medicines by return value; counts and total refund amounts

Filters: Date range (From/To)

Uses: Spot quality issues, identify medicines with high return rates, discuss with suppliers when one supplier's products dominate returns

Access: Admin

7. Discount Analysis

Purpose: See where margin is leaking through discounts - by salesman and by medicine

Key Metrics: Total discount given, Effective discount %, Average discount per bill, By-salesman breakdown, Top discounted medicines

Filters: Date range (From/To)

Uses: Spot unauthorised discounting, identify a salesman giving away too much, find products that are always discounted (consider lowering the official price)

Access: Admin

Inventory & Stock Reports

4. Stock Valuation Report

Purpose: Current inventory value in terms of cost and retail price

Key Metrics: Medicine name, Current quantity, Cost value, Retail value

Uses: Inventory management, balance sheet valuation, identify high-value items needing better security

Access: Admin

9. Expiry Report

Purpose: Identify medicines expiring soon to prevent loss

Key Metrics: Medicine, Batch number, Expiry date, Days until expiry, Quantity in stock, Storage location

Filters: Days threshold (default 90 days)

Uses: Prevent stock obsolescence, plan promotional sales for slow movers, alert customers about short-dated discounts

Access: AdminCashier

10. Expiry Loss Report

Purpose: Put a money figure on the stock that's expired or expiring soon - useful for supplier credit claims

Key Metrics: Cost value at risk, Retail value at risk, Days until expiry, Supplier name, Original invoice number

Filters: Days threshold (default 30 days)

Uses: Quantify expiry loss for write-offs, file credit claims with suppliers (the invoice number is on every row), prioritise which batches to push first

Access: Admin

11. Stock Movement Report

Purpose: Identify fast-moving vs slow-moving medicines

Key Metrics: Medicine, Units sold, Number of sales, Last sold date, Days since last sale, Current stock, Reorder level, Movement category (Fast/Moderate/Slow)

Uses: Inventory planning, purchasing decisions, identify dead stock candidates for removal

Access: Admin

Purchase & Supplier Reports

12. Purchase Summary Report

Purpose: Analyze supplier spending, returns, and payment tracking

Key Metrics: Supplier name, Total orders, Total spent (gross), Total returns (credit notes), Net spent, Average order value

Filters: Date range (From/To)

Uses: Supplier relationship management, pricing negotiations, identify major suppliers, track return credits

Access: Admin

13. Supplier Performance

Purpose: Per-supplier scorecard - how good is each supplier?

Key Metrics: Orders, Total spent, Average order value, Returns value, Return rate % (red >5%, yellow 2-5%, green ≤2%), Last order date, Days since last order

Filters: Date range (From/To)

Uses: Identify problematic suppliers (high return rate), notice suppliers you haven't ordered from recently, support pricing renegotiation with high-spend suppliers

Note: Deactivated suppliers still appear here when they have historical orders in the selected period - they're shown dimmed with an "inactive" badge so you can still see who you used to buy from.

Access: Admin

14. Payables Aging Report

Purpose: Track overdue supplier payments and outstanding balances

Key Metrics: Purchase order #, Supplier, Invoice #, Total amount, Paid, Outstanding, Due date, Days overdue, Payment status

Filters: Days overdue threshold (0+, 30+, 60+, 90+ days)

Uses: Payment planning, identify payment delays, manage supplier relationships, prevent supply disruptions

Access: Admin

Customer & Receivables Reports

15. Customer Debtors Report

Purpose: Track customer outstanding balances and payment delays

Key Metrics: Bill #, Customer name, Total amount, Paid amount, Outstanding, Sale date, Days since sale, Payment status

Filters: Days outstanding threshold (0+, 7+, 30+, 60+ days)

Uses: Credit management, identify slow-paying customers, follow-up on collections, cash flow planning

Access: Admin

16. Customer Sales

Purpose: Broader view than Customer Debtors - shows all customers (paid & unpaid), with aging buckets

Key Metrics: Bills count, Total sales, Total paid, Outstanding, Average bill, Aging buckets (0-30, 31-60, 61-90, 90+ days), Last sale recency

Filters: Date range (From/To)

Uses: Identify your most valuable customers, spot customers who are slipping (long days-since-last-sale), break outstanding balances down by age for collection priority

Access: Admin

Report Features

Advanced Filtering

Filter reports by date range, user, payment status, supplier, customer, and more to get specific insights

Data Export

Export any report to CSV format for further analysis in Excel or other tools

Print Ready

Print reports directly from browser with proper formatting for filing or distribution

Sortable Columns

Click column headers to sort by any metric for quick analysis

Pagination

Large reports are paginated for easy navigation and browsing

Summary Statistics

Each report shows key metrics and totals for quick overview

Report Tips & Best Practices

  • Sales Summary: Run daily to spot unusual patterns. High returns might indicate quality issues or customer dissatisfaction.
  • Sales by Salesman: Use to motivate and identify training needs. Compare performance across salesmen fairly using same date range.
  • Profit & Margin: Run monthly to understand which medicines are truly profitable. Watch for products with declining margins.
  • P&L Statement: Run monthly and share with the accountant or owner - it summarises the whole period in eight numbers.
  • Cash Flow: Reconcile against your bank deposits at month-end. A negative running balance on consecutive days means you're spending faster than collecting - plan supplier payments accordingly.
  • Return Analysis: Run monthly. If one supplier dominates the by-medicine list, raise it with them.
  • Discount Analysis: Look at the per-salesman effective discount %. Anyone consistently above the team average is worth a conversation.
  • Stock Valuation: Use for inventory management and financial reporting. High-value items may need better security.
  • Expiry Report: Check weekly to prevent stock loss. Use for promotional pricing on items nearing expiry.
  • Expiry Loss: Run before approaching a supplier for credit on expired stock - the invoice number is on every row.
  • Stock Movement: Use the fast/moderate/slow categories to decide what to reorder more or less of.
  • Purchase Summary: Review supplier spending quarterly. Look for opportunities to consolidate suppliers or negotiate better prices.
  • Supplier Performance: Red return-rate cells deserve immediate attention. Suppliers with no recent orders may have stopped responding.
  • Payables Aging: Review weekly to plan cash requirements. Address persistent delays with suppliers.
  • Customer Debtors: Review daily to stay on top of collections. Follow up personally on large outstanding balances.
  • Customer Sales: Use the aging buckets to prioritise collection calls - 90+ days outstanding deserves the first call.
Note: All reports show data only for transactions where you have visibility. Filtering by date range helps focus on relevant periods. The system automatically deducts returns from all calculations (sales returns from revenue, purchase returns from supplier costs).

Report Improvements in Latest Version

Recent enhancements to reporting accuracy and functionality:

  • Sales Summary: Fixed double-discount bug, now correctly shows returns as separate column with net revenue calculation
  • Profit & Margin: Now deducts sales returns from all profit calculations, added quantity returned column, uses base units consistently
  • Stock Valuation: Fixed column reference errors, now shows accurate cost and retail values from correct database sources
  • Purchase Summary: Added return credit tracking, fixed date filtering, added comprehensive filters (salesman, payment status, customer search)
  • Payables Aging: Fixed SQL aggregation error, now correctly filters overdue payments only
  • Customer Debtors: Fixed column name references, now displays customer receipt numbers and payment tracking
  • Sales by Salesman: Completely enhanced with payment status breakdown, added filters for salesman selection, payment status, and customer search. Shows paid/partial/unpaid transaction counts
Tip: All calculations now properly account for returns. A medicine showing high returns rate in Profit & Margin report might indicate quality issues worth investigating with the supplier.

Troubleshooting & FAQs

Common Issues

Issue: "Cannot log in"

Solutions:

  • Verify username and password are correct (case-sensitive)
  • Check if your user account is active (Admin can deactivate accounts)
  • Clear browser cache and cookies, then try again
  • Contact Admin if you've forgotten your password

Issue: "Forced password change on login"

Solution: This is normal for new accounts or password resets. Enter your temporary password, then set a new password with at least 8 characters.

Issue: "Access Denied" to a function

Solution: Your user role doesn't have permission for that function. Contact your Admin to change your role or request access.

Issue: "Medicine not showing in search"

Solutions:

  • Verify the medicine exists in the system (Admin can add it)
  • Try searching by different keywords (form, strength)
  • Check if the medicine is marked as inactive
  • Type at least 2 characters for search to work

Issue: "Stock quantity showing as 0"

Solutions:

  • Check if stock batch has expired (highlighted in red)
  • Verify stock was received from the purchase order
  • Check if stock adjustments were recorded correctly
  • Contact Admin to restock or adjust quantities

Issue: "Cannot collect payment - bill says already paid"

Solution: This bill has already been marked as paid. Check the sales history or ask which bill the customer wants to pay for.

Issue: "Database switched and I see different data"

Solution: Admin switched the active database. Check with your Admin which database should be active. You're now using the correct database for your work.

Frequently Asked Questions

Q: Can I undo a transaction?

A: No, transactions are permanent once saved. However, you can process a "Sales Return" to reverse a sale or refund.

Q: What happens if the system crashes during a transaction?

A: If the system crashes before you click "Save", the transaction is lost and must be re-entered. Always backup regularly and keep server stable.

Q: Can multiple people log in with the same account?

A: Yes, but it's not recommended for audit trail accuracy. Each person should have their own account so transactions are tracked to them.

Q: How long does a session last?

A: Sessions timeout after a period of inactivity for security. You'll be logged out automatically and must log in again.

Q: Can I change my currency mid-year?

A: Yes, but it affects all transactions going forward. Old transactions will show in the old currency. Consider creating a new database for different currencies.

Q: How often should I backup?

A: Daily backups are recommended. Backup at the end of each business day to protect a full day's worth of transactions.

Q: What if I accidentally mark the wrong database as active?

A: Don't worry! Just go back to Settings and mark the correct database as active. Your data is safe; nothing is deleted.

Q: Can I edit a sales return after saving it?

A: Yes! Go to Sales Returns list, click the Edit button on the return. You can change quantities and reason. The system automatically adjusts stock levels when you save the changes.

Q: What happens to stock when I delete a sales return?

A: When you delete a return, the returned quantities are removed from stock again (subtracted). This is because deleting a return means the customer is keeping the items, so they must be back in your stock count.

Q: Can I create a stock adjustment for more quantity than available?

A: Yes, the system allows over-adjusting. However, this is normally only done for "Count Correction" when physical count is less than system count. Be careful with quantities!

Q: Why can't I edit a packing (medicine size) after I've sold it?

A: To maintain accurate transaction history. If you change the price or units-per-pack after a sale, the historical records become incorrect. Packings are locked once used in transactions for data integrity.

Q: Can I have multiple draft bills at the same time?

A: Yes! Click "New" button in Sale Entry to create multiple bills. Each bill is saved as a tab. Switch between them freely. When a customer is ready to pay, click "Save Sale" for that bill.

Q: Do draft bills get saved to database?

A: No, drafts are temporary and stored only in your browser. They are lost if you refresh or close the page. You MUST click "Save Sale" to save to database. Always save before refreshing!

Q: Can I delete a medicine that's already used in sales?

A: The system will soft-delete it (mark as inactive). It won't be available for new sales, but all past transactions remain in the system. Historical records are preserved.

Q: What's the difference between Sales Return and Stock Adjustment?

A: Sales Return = Customer returns items from a specific bill (tracks which sale, which items, quantities). Stock Adjustment = General inventory correction (damage, theft, expiry, count corrections) without linking to a specific sale. Use Sales Return when there's a specific bill involved; use Stock Adjustment for general inventory corrections.

Q: Where can I see the medicine location (storage location)?

A: Location appears in: Medicines list (Location column), Medicine edit form, and Sales entry (shown when you select a medicine). Helps staff quickly find items on shelves.

Sales Returns & Purchase Returns FAQ

Q: Can I return only some items from a sale?

A: Yes! Sales Returns support partial returns. If a customer bought 10 boxes and returns 3, just enter 3 in the Qty Returning field. The other 7 remain sold on the original bill.

Q: What happens to my stock when I save a Sales Return?

A: Automatically restored to the original batch. If customer bought from batch #12345, returned items are added back to that batch. No manual stock adjustment needed - the system handles it instantly.

Q: What happens to customer's outstanding balance when I process a Sales Return?

A: The return reduces their payable amount. If customer owed 500 for 10 items and returns 3 items worth 150, they now owe 350. The system automatically calculates the credit.

Q: Can I edit a Sales Return after saving it?

A: Yes! Click the Pencil (Edit) icon on the return in the Returns list. You can change quantities, date, and reason. Click "Update Return" to save changes. Stock adjusts automatically based on the new quantities.

Q: What happens if I delete a Sales Return?

A: Deletion removes the return from the system and reverses its effects: returned quantities are subtracted from stock again (so items come off inventory), and customer's payable increases. The original sale remains in the system as if the return never happened.

Q: Can I return items from a sale that's already fully paid?

A: Yes! You can return items regardless of payment status (paid/partial/unpaid). The return creates a credit for the customer that can be applied to future purchases or refunded.

Q: How do I know which sales have returns?

A: In Sales list, look for the return icon (↶ symbol) next to sales that have returns. Click it to see return details. Also visible in sales detail view when you click to view a bill.

Q: Can I return items from a Purchase that's not fully paid?

A: Yes! You can return items from a purchase regardless of payment status. The return immediately reduces supplier's payable amount by the credit value.

Q: What happens to my stock when I save a Purchase Return?

A: Stock is automatically reduced by the returned quantities from the original batch. If you received 100 units in batch #9999 and return 20, stock reduces by 20 instantly. Deleting the return adds them back.

Q: How does Purchase Return affect what I owe the supplier?

A: The system reduces supplier payable by the credit amount. If you owed 5000 for a purchase and return items worth 500, you now owe 4500. This is visible in Payables Aging report as reduced outstanding amount.

Q: Can I return only part of the items from a purchase?

A: Yes! Purchase Returns support partial returns. If purchase had 10 batches and you received 5 wrong/damaged, return just those 5. Enter custom quantities in each item's Qty Returning field.

Q: Can I edit a Purchase Return after saving it?

A: Yes! Click the Pencil (Edit) icon on the return. Modify items, quantities, date, reason, and notes. Click "Update Return" to save. Stock and supplier payable adjust automatically.

Q: What happens if I delete a Purchase Return?

A: Deletion removes the return and reverses its effects: stock is increased again (returns items to inventory), supplier payable increases (customer owes more). Original purchase remains as if return never happened.

Q: How should I document damaged items when returning?

A: Use Reason field to explain damage type. In Notes field, provide details like "Received with broken boxes, 5 units unusable" or "Batch expired 2024-12-15". This helps supplier understand the issue and maintain quality standards.

Q: Can I use returns to adjust for quantity discrepancies?

A: For Sales: Yes, return the over-quantity to adjust customer bill. For Purchases: Yes, return items if received wrong quantity. But if this is just inventory counting, consider using Stock Adjustment instead with "Count Correction" type for clarity.

Q: Should I return items before or after they're used in another transaction?

A: Sales: Return as soon as customer brings items back - this keeps customer's payable accurate. Purchase: Return as soon as you identify damage/errors - this keeps supplier relationship clean and avoids using defective stock.

Q: How do I track return rates by supplier or medicine?

A: Use Reports: "Purchase Summary" shows returns by supplier, "Profit & Margin" shows returns by medicine. This helps identify quality problems with specific suppliers or medicines.

Q: Can multiple people process returns for the same sale/purchase?

A: Yes! Multiple returns can be created for the same original sale/purchase. For example, customer returns 3 items today and 2 items next week - create two separate return records.

Reports & Analytics FAQ

Q: Why does my Profit & Margin report show lower profit than expected?

A: The report correctly deducts sales returns and their associated costs from your profit calculation. If a customer returns items, those transactions reduce your reported profit. Check the "Quantity Returned" column to see return impact per medicine.

Q: What's the difference between "Total Spent" and "Net Spent" in Purchase Summary?

A: Total Spent = gross amount paid to supplier. Net Spent = total spent minus credit for returned items. Net spent is the actual cost impact on your business.

Q: Why is my Stock Valuation report showing different values than before?

A: We fixed the report to use correct pricing sources: Cost value now uses the actual purchase cost per unit, Retail value uses the selling price from packings table. This ensures accuracy for inventory management and financial statements.

Q: How are returns handled in all reports?

A: All reports automatically deduct returns from their calculations. Sales returns reduce revenue and profit metrics. Purchase returns reduce supplier costs. The system maintains separate "Total Returns" or "Quantity Returned" columns so you can see the impact clearly.

Q: Can I compare salesman performance using Sales by Salesman report?

A: Yes! The report shows each salesman's metrics including transactions created, revenue, discounts applied, and importantly, payment collection (Paid/Partial/Unpaid counts). Use the same date range when comparing salesmen for fair assessment.

Q: What should I do if Payables Aging shows many overdue payments?

A: Review the report regularly (weekly recommended). Identify which suppliers have consistent delays. Contact them to clarify payment terms, negotiate extended terms if needed, or consider alternative suppliers. Record payment dates accurately to prevent future issues.

Q: How can I use Expiry Report to reduce losses?

A: Check weekly with default 90-day threshold. Items with <30 days can be promoted at discounted prices to move faster. Items nearing expiry can be used for donations or training purposes. Track expiry losses for supplier claims and insurance documentation.

Q: Can I export reports for further analysis?

A: Yes! Every report has an "Export CSV" button. Downloaded files can be opened in Excel, Google Sheets, or other tools for custom analysis, creating charts, or combining data from multiple reports.

Q: Why should I track base units in Stock Movement report?

A: Base units ensure consistent inventory tracking. A medicine might be sold in boxes (10 units per box) but purchased in cases (100 units per case). Base units standardize everything to single units, making all inventory calculations accurate.