Production-minded medicine inventory software built on the current PHP + MySQL codebase and upgraded without removing the existing working flows for:
- dashboard
- inventory IN
- inventory OUT
- inventory RETURN
- batch history
- alerts
- activity logs
- export center
- regular inventory
- outsourced inventory
This version adds role-based permissions, product master management, correction and reversal workflows, notes, reporting analytics, dashboard filters, chart-based movement analysis, in-app notifications, and barcode-ready label printing while keeping the app compatible with normal shared hosting and cPanel-style deployment.
The flagship version keeps the original transactional structure centered on:
inventoryinventory_outsourcedout_recordsreturn_binded_recordsin_logusers
It extends those tables carefully and introduces supporting tables for product master records, notes, corrections, audits, notifications, and settings.
The result is still a procedural PHP application, but it is now significantly safer for real operational use:
- no silent edits
- no hard-delete transaction reversals
- role-aware UI and server-side guards
- append-only audit trail
- product normalization through product master
- sharable dashboard/report filters
- in-app alert notifications
- barcode label printing for products and batches
- advanced server-side filters for source, stock status, expiry status, manufacturer, distributor, quantity range, and date range
- KPI cards for stock, movements, low stock, expired rows, and health state
- chart widgets for movement trends, stock composition, stock health, and top moved products
- regular and outsourced inventory sections with compact grouped tables
- alerts snapshot and recent activity
- create a batch from an existing product master record
- create a new product master record and first batch in a single workflow
- regular and outsourced source support
- batch threshold override
- importer and distributor support for outsourced batches
- optional batch and IN notes at creation time
- release stock from regular inventory
- customer and document traceability
- transaction note support
- later correction and void workflows for authorized roles
- bind returns directly to the original OUT record
- remaining-return validation
- transaction note support
- later correction and void workflows for authorized roles
- reusable medicine profile list
- create, edit, and archive product profiles
- duplicate prevention
- barcode value storage
- low stock threshold control
- product-level notes
- printable barcode label
- search by batch number
- show IN source details
- show OUT and RETURN history including voided rows
- show batch status and notes
- IN batch voiding when safe
- correction entry point
- printable batch barcode label
- current stock summary
- low stock report
- expiring soon report
- expired stock report
- movement summary by date range
- top outgoing products
- top returned products
- supplier/distributor summary
- regular vs outsourced stock summary
- movement by user
- exportable CSV analytics
- low stock alerts
- out of stock alerts
- expiring soon alerts
- expired and critical expiry alerts
- in-app notifications with read/unread tracking
- correction and reversal notifications for higher-trust roles
- regular inventory export
- outsourced inventory export
- combined inventory export
- batch CSV export
- analytics CSV export
- print-friendly report pages
The system now supports these roles:
AdminManagerStaffViewer
-
AdminFull access across inventory, products, corrections, reversals, exports, reports, notes, notifications, and account provisioning. -
ManagerView, create, export, correct, reverse or void, manage products, manage notes, and review analytics. -
StaffView the system, create IN/OUT/RETURN transactions, review batch history, view reports and exports, and add notes. Staff cannot reverse or void transactions and cannot manage product master corrections. -
ViewerRead-only access to dashboard, history, reports, alerts, activity logs, exports, product browsing, notes, and notifications.
- buttons and navigation are hidden when a role is not allowed
- direct page access is guarded on the server
- note edit/delete respects role and note ownership
- correction and reversal actions always require higher permissions and a reason
Authorized roles can correct:
- inventory IN batch records
- OUT transactions
- RETURN transactions
- product master details
Every correction:
- requires a reason
- writes the actor, time, old values, new values, and reason to
correction_logs - also writes an
audit_logsentry - recalculates live stock safely before saving
edit_record.phpfor batch, OUT, and RETURN correctionsproduct_form.phpfor product master correctionscorrection_logs.phpfor filtered audit review
Authorized roles can void:
- OUT transactions
- RETURN transactions
- IN batches when safe
- no hard deletes
- original records remain in history and are marked
voided - void actions require a reason
- stock totals are adjusted transactionally
- OUT voiding cascades active linked RETURN rows into voided status
- double reversal is prevented by
record_status
Notes are supported on:
- products
- regular batches
- outsourced batches
- IN transactions
- OUT transactions
- RETURN transactions
Notes store:
- target type
- target id
- note text
- author
- timestamps
- active or deleted state
This version implements barcode support using Code39-friendly values.
- barcode value on product master
- printable barcode labels for products
- printable barcode labels for batches
- barcode value included in dashboard and product search inputs
- scanner-friendly workflows because common barcode scanner hardware can type directly into search fields
dashboard.phpform_in.phpform_out.phpform_return.phpbatch_history.phpproducts.phpproduct_form.phpreports.phpalerts.phpactivity_logs.phpcorrection_logs.phpnotifications.phptransaction_detail.phpedit_record.phplabel_print.phpexport_center.php
includes/common.phpincludes/domain.phpassets/app.cssassets/app.js
notes_action.phpnote_edit.phpexport_inventory.phpexport_report.phpexport_batch_excel.phpexport_batch_pdf.php
login.phpsignup.phplogout.php
Run the migration file:
migrations/20260331_flagship_upgrade.sql
- upgrades user roles to
admin,manager,staff,viewer - adds user activity columns
- creates
products - links
inventoryandinventory_outsourcedtoproducts - extends
inventory,inventory_outsourced,out_records,return_binded_records, andin_logwith status and audit fields - backfills product links
- backfills and normalizes
in_log - creates
correction_logs - creates
audit_logs - creates
notes - creates
notifications - creates
app_settings
Examples:
- XAMPP:
htdocs - WAMP:
www - Laragon:
www - cPanel:
public_htmlor a subdirectory
Update db.php:
$host = 'localhost';
$user = 'root';
$pass = '';
$dbname = 'inventory_db';Import:
migrations/20260331_flagship_upgrade.sql
You can use:
- phpMyAdmin
- MySQL command line
- cPanel database tools
Example:
http://localhost/Medicine-Inventory-Software-main/
If there are no users yet:
- open
signup.php - create the first
Adminaccount
If users already exist:
- sign in through
login.php - only an admin can use
signup.phpto create additional users
This project stays compatible with normal shared hosting because it uses:
- procedural PHP
- no Composer dependency requirement
- no queue workers
- no daemon process
- MySQL-compatible schema changes
- browser-side chart rendering with plain JavaScript
- Open
form_in.php - Switch to
New Product - Fill product master details
- Fill batch details
- Save the IN record
- Open
form_in.php - Keep
Existing Product - Select the product master entry
- Enter batch details
- Save the IN record
- Open a batch, OUT, RETURN, or product record
- Click the correction entry point
- Update the values
- Enter a required reason
- Save the correction
- Open the transaction or batch detail page
- Enter a required void or reversal reason
- Submit the action
- The system updates status and stock safely without deleting history
Suggested screenshots for the repository:
- login page
- dashboard with filters and charts
- product master list
- product detail with barcode label
- inventory IN
- inventory OUT
- inventory RETURN
- batch history
- alerts center
- notifications center
- correction log
- reports and analytics
After applying the migration:
- Sign in with an admin or manager account.
- Review the
productstable and verify legacy products were backfilled. - Open the dashboard and confirm inventory rows still load.
- Create a test IN, OUT, and RETURN transaction.
- Correct one OUT or RETURN transaction and verify the correction log updates.
- Void a test RETURN transaction and verify stock recalculates.
- Open
notifications.phpand confirm alert rows generate notifications. - Open
label_print.phpthrough a product or batch page and verify barcode output.
This flagship iteration ships with in-app notifications as the default alert delivery mechanism.
Why:
- shared-hosting friendly
- no hardcoded credentials
- no SMTP dependency
- safer first deployment path
If you later want email delivery, the correct next step is to add a mail transport configuration page and use app_settings for non-hardcoded SMTP or mail() settings.
Shreyansh Jain
GitHub: shreyanshjain1
This project is for portfolio, educational, and internal operational enhancement purposes unless otherwise specified.