
HPI ERP — Integrated Pharmaceutical ERP, Sales Rep App & Location Tracking
A full-stack integrated ERP system built for HPI — an Egyptian pharmaceutical manufacturing company. Covers the complete business operation end-to-end: sales management, inventory & warehouse with batch/lot/expiry tracking, purchasing, finance & accounting, contract manufacturing (تصنيع لدي الغير — third-party toll manufacturing), HR & payroll, plus a dedicated mobile app for medical sales representatives (المناديب) and a real-time GPS location tracking system for field rep visit verification and route monitoring.
HPI EGYPT · erpnew.hpi-eg.com · PHARMACEUTICAL ERP
🏭 INTEGRATED ERP · PHARMA · MOBILE · GPS · EGYPT
Project Overview
HPI ERP is a fully custom integrated enterprise resource planning system built for HPI — an Egyptian pharmaceutical company engaged in the production and distribution of pharmaceutical products. The system is hosted at erpnew.hpi-eg.com and covers the company's complete operational workflow: from purchasing raw materials and managing multi-warehouse inventory (with pharma-specific batch, lot, and expiry date tracking), through to sales order management, financial reporting, and human resources.
A particularly specialized module is the Contract Manufacturing (تصنيع لدي الغير) component — managing HPI's outsourced pharmaceutical production with third-party manufacturers. This covers the full contract manufacturing workflow: sending raw materials to external manufacturers, tracking production orders and BOMs, monitoring production progress, quality control sign-off, receiving finished goods back into inventory with full batch and lot traceability.
Beyond the web ERP system, the project includes two critical mobile components: (1) a Sales Rep App (تطبيق المناديب) for HPI's field medical representatives to take orders, record customer visits, access the product catalog, and track their daily sales targets — and (2) a real-time GPS Location Tracking system that allows management to monitor rep locations, verify client visits, view route histories, and ensure field team accountability without relying on manual reporting.
ERP System Modules
Manages the full pharma sales cycle — creating and processing customer orders, multi-tier pricing for pharmacies, hospitals, wholesalers and distributors, customer credit limit control (critical for pharmaceutical distribution), order-to-invoice workflow, and full sales history and analytics per product, customer, and sales representative.
Pharmaceutical inventory management is significantly more complex than standard inventory — every product must be tracked by batch number, lot number, and expiry date. The ERP enforces FEFO (First Expired, First Out) stock picking — ensuring oldest-expiring stock is always dispatched first to minimize product write-offs. Manages stock across multiple warehouses, inter-warehouse transfers, stock adjustments, minimum reorder levels, and comprehensive stock movement reports with full batch-level traceability from receipt to dispatch.
Manages the full procurement cycle — supplier database, purchase requisitions, purchase order creation and approval workflow, goods receipt notes with quality inspection, accounts payable tracking, and purchase analytics. Especially important for managing raw material procurement for both direct production and contract manufacturing operations.
Full double-entry accounting integrated directly with all other ERP modules — every purchase order receipt, sales invoice, payment, and manufacturing cost transaction is automatically posted to the general ledger. Covers chart of accounts, accounts receivable, accounts payable, cost center accounting for pharma manufacturing cost allocation, P&L, balance sheet, and all management financial reports needed for HPI's operations and regulatory compliance.
Human resources and payroll management for HPI's full workforce — office staff, warehouse employees, field medical sales representatives, and management. Covers employee records, attendance tracking (integrated with the GPS system for field reps), leave management, monthly payroll calculation (base salary, commissions, allowances, deductions, social insurance), payslip generation, and HR analytics.
The ERP analytics module provides management a comprehensive view of all HPI business operations — executive dashboard with key KPIs (daily sales, outstanding receivables, low-stock alerts, production order status), sales reports, inventory reports (stock levels, batch expiry calendar), financial reports (P&L, balance sheet), and field rep performance reports (visits, orders, targets — integrated with GPS tracking data).
Contract Manufacturing — تصنيع لدي الغير
Outsourced Pharmaceutical Production — Full Workflow Management
HPI operates a contract manufacturing (تصنيع لدي الغير) model — outsourcing some or all of its pharmaceutical production to specialized third-party manufacturers while retaining the brand, regulatory licenses, and distribution rights. This is common in the Egyptian pharmaceutical industry and requires sophisticated tracking to maintain full product traceability and regulatory compliance. The ERP's Contract Manufacturing module manages this complete outsourced production workflow from raw material dispatch to finished goods receipt.
Mobile Components
Sales Rep App — تطبيق المناديب
- Take customer orders from the field — pharmacies, hospitals, distributors — with full product catalog and real-time stock availability
- Record client visit check-ins with timestamp and location — creates a verified visit log synced to the ERP and GPS tracking system
- Daily target tracking — rep can see their daily/monthly sales target vs. achieved, number of visits completed vs. target, and open order status
- Offline-capable — orders and visits recorded offline and synced to the ERP server when connectivity is restored (critical for areas with poor mobile coverage)
- Product photo catalog with pricing tiers — rep can show customers product images, pricing, and promotional offers directly from the app
- Real-time order status — rep can check if previously placed orders have been processed, packed, shipped, or delivered — reducing customer inquiry calls to the office
GPS Location Tracking — تتبع أماكن المناديب
- Real-time GPS tracking of all field medical representatives — management can see a live map view of where every rep is at any point during working hours
- Visit verification — when a rep checks in at a customer location in the mobile app, the GPS coordinates are verified against the expected customer address to confirm the visit is genuine
- Route history — full movement history for each rep for any given day, showing the sequence of client visits, travel routes, stop durations, and time at each location
- Attendance by location — reps can clock-in and clock-out from the field using GPS-verified location, replacing manual attendance systems for field staff
- Alerts for deviations — if a rep is not in an expected area during working hours or visits are not being logged, management receives an alert
- Monthly reports — visit count per rep, time spent per customer, coverage map showing which areas are being serviced and which are under-covered
Key Features
Outcomes
Technical Challenges
The most technically demanding requirement of the HPI ERP is tracking every pharmaceutical product at the individual batch level through every transaction — not just in inventory, but in sales orders, purchase receipts, contract manufacturing orders, returns, and GL cost allocation. The database schema had to be designed to carry batch and lot references through the full transaction chain, and the application logic had to enforce FEFO automatically in all stock picking scenarios while still allowing authorized override when needed for operational reasons.
HPI's medical sales reps visit pharmacies and clinics across Egypt — including areas with poor or intermittent mobile connectivity. The Sales Rep App had to be built with robust offline-first capabilities: orders taken without connectivity are stored locally on the device, and a reliable background sync mechanism uploads them to the ERP server when connectivity is restored — with conflict resolution logic for stock depletion scenarios. The GPS tracking system also had to handle connectivity gaps gracefully, buffering location data locally and flushing to the server when online.
Contract manufacturing (تصنيع لدي الغير) creates a complex inventory accounting scenario: raw materials go OUT of HPI's inventory to the third-party manufacturer, and finished goods come IN — but the raw materials sent out should NOT be treated as a sale, and the finished goods received should NOT be treated as a supplier purchase. The ERP had to implement a dedicated contract manufacturing inventory accounting model that correctly handles this dual movement with proper cost build-up (materials cost + manufacturing service fee = finished goods cost), batch assignment for finished goods, and full GL entries that accurately reflect the economic substance of toll manufacturing operations.
