Design and Implement Web Based Pharmacy Management System: Adama, Ethiopi
Design and Implement Web Based Pharmacy Management System: Adama, Ethiopi
SYSTEM
By:
1. Girum Zena
2. Yohannis Dinku
3. Bizuneh Tassew
4. Tesfaye Deribe
5. Micael Addis
April, 2022
ADAMA, ETHIOPI
Declaration
We the undersigned, hereby declare that this project work is the result of our own research and no
part of it has been presented for any other degree in this university or elsewhere. We are solely
responsible for any errors in the work.
Name Signature
2
Date of Submission
This project has been submitted for examination with our approval as a university advisor.
Project advisor Signature Date
Mr. Sudi Mustefa (M.SC). …………...... ……………….
3
Approval Sheet
Internal Examiner
___________________________________________________
Advisor
___________________________________________________
Department Head
___________________________________________________
4
Acknowledgment
First of all, thanks to God for the finalization of this documentation. Second we would also like to
thank our Advisor Mr. Sudi Mustefa (M.SC) for his impressive guidance and support for the
accomplishment of this work. Next, we would like to thank all employees and pharmacist of Geda
Pharmacy for their response while we were gathering information. At the last but not the least
special thanks for our classmates for their great help and keeping us to reach today’s day.
5
List of Tables
Table 1:1 Project Cost Estimate Management
Table 1:2 Project Time Schedule Management
Table 2.1 Players of Existing System
Table 2.4 Made Payment for Supplier Use case Documentation
Table 3.1 Functional Requirements
Table 3.2 Non-Functional Requirements
Table 3.3 Hardware Requirements
Table 3.4 Software Requirement
Table 3.5 Actors of the Proposed System
Table 3.6 Use cases of the proposed System
Table 3.7 LogIn Use Case Documentation
Table 3.8 Sale Medicine Use Case Documentation for Admin actor
Table 3.9 Receive Medicine Use Case Documentation
Table 3.10 Medicine Type Use case Documentation
Table 4.1 Medicine Category List table
Table4.2 Customer List table
Table 4.5 Medicine Inventory table
Table 4.7 Medicine Receiving List table
Table 4.8 Medicine Sales List table
Table 4.9 Medicine Supplier List table
Table 4.11 Users table
6
List of Figures
Fig 2.1 Essential Use Case Diagram for Pharmacy Management System
Fig 3.1 System Use Case Diagram
Fig 3.2 Conceptual Class Diagram
Fig 3.3 Sequence Diagram for LogIn Use Case
Fig 3.4 Sequence Diagram for Sale Medicine Use Case
Fig 3.5 Sequence Diagram for ReceiveMedicine Use Case
Fig 3.6 Activity Diagram for LogIn use case
Fig 3.7 Activity Diagram for Pharmacy Management System
Fig 3.8 State chart diagram
Fig 4.1 Subsystem Decomposition
Fig 4.2 Hardware-Software Mapping for Pharmacy Management System
Fig 4.3 Persistent Data Modeling for Pharmacy Management
Fig 4.4 Component Diagram of Pharmacy Management System
Fig 4.5 Deployment Diagram of Pharmacy Management System
Fig 4.6 Entity Relation Diagram
Fig 4.7 Login Screen UI
Fig 4.8 Home Page Screen
Fig 4.9 Inventory List UI
Fig 4.10 Sale New Medicine UI
Fig 4.11 Manage Receiving Medicine UI
Fig 4.12 Medicine Expired List UI
Fig 4.13 Medicine Supplier List UI
Fig 4.14 Medicine List UI
Fig 4.15 Customer List UI
Fi 4.16 Pharmacy Management Receipt Payment UI
7
Table of Contents
Declaration ...................................................................................................................................... 2
Date of Submission ......................................................................................................................... 3
Approval Sheet................................................................................................................................ 4
Acknowledgment ............................................................................................................................ 5
List of Tables .................................................................................................................................. 6
List of Figures ................................................................................................................................. 7
Acronyms ...................................................................................................................................... 11
Abstract ......................................................................................................................................... 12
CHAPTER ONE: INTRODUCTION ........................................................................................... 13
1.1. Background of the Project .............................................................................................. 13
1.2. Problem of Statement ..................................................................................................... 14
1.3. Purpose of the Project .................................................................................................... 14
1.4. Objectives of the Project ................................................................................................ 15
1.4.1. General Objectives .................................................................................................. 15
1.4.2. Specific Objectives ................................................................................................. 15
1.5. Scope of the Project........................................................................................................ 16
1.6. Limitation of the Project ................................................................................................ 16
1.7. Significance of the Project ............................................................................................. 17
1.8. Methodology .................................................................................................................. 17
1.8.1. Fact Finding Methodology ...................................................................................... 17
1.8.2. System Development Methodology or Models ...................................................... 18
1.8.3. System Development Tools .................................................................................... 18
1.9. Testing Plan .................................................................................................................... 18
1.9.1. Unit Testing ............................................................................................................ 18
1.9.2. Integration Testing .................................................................................................. 18
1.10. Project Management ................................................................................................... 19
1.10.1. Cost Management ................................................................................................... 19
1.10.2. Project Schedule...................................................................................................... 20
CHAPTER TWO: ANALYSIS OF EXISTING SYSTEM .......................................................... 21
8
2.1 Overview of Existing System......................................................................................... 21
2.2. Functions of Existing System......................................................................................... 21
2.3. Problems of Existing System ......................................................................................... 21
2.4. Players of Existing System ............................................................................................. 22
2.5. Supplementary Specification ......................................................................................... 23
2.5.1. Business Rule .......................................................................................................... 23
2.6. Modeling the Existing System ....................................................................................... 23
2.6.1. Use Cases ................................................................................................................ 23
2..1. Essential Use Case Modeling ..................................................................................... 24
2..2. Essential Use Case Documentation ............................................................................ 25
CHAPTER THREE: ANALYSIS OF PROPOSED SYSTEM .................................................... 28
3.1. Overview of Proposed System ....................................................................................... 28
4.1. Requirement Determination ........................................................................................... 28
3..1. Functional Requirement ............................................................................................. 28
3..2. Non-Functional Requirements .................................................................................... 30
3..3. System Requirements ................................................................................................. 30
4.1. Supplementary Specification ......................................................................................... 31
3..1. Business Rule ............................................................................................................. 31
3..2. Constraints .................................................................................................................. 32
4.1. System Model ................................................................................................................. 32
3..1. System Use case Model .............................................................................................. 32
3..2. Conceptual Class Diagram ......................................................................................... 37
3..3. Sequence Diagram ...................................................................................................... 38
3..4. Activity Diagram ........................................................................................................ 39
3..5. State Chart Diagram ................................................................................................... 40
CHAPTER FOUR: SYSTEM DESIGN ....................................................................................... 41
4.1. Overview of System Design ........................................................................................... 41
4.1.1. Purpose of System Design ...................................................................................... 41
4.1.2. Design Goal ............................................................................................................ 41
4.2. System Architecture ....................................................................................................... 41
4.2.1. Architectural Style .................................................................................................. 41
9
4.2.2. System Process........................................................................................................ 42
4.2.3. Subsystem Decomposition ...................................................................................... 42
4.2.4. Hardware/Software Mapping .................................................................................. 42
4.2.5. Persistent Data Management Modeling .................................................................. 43
4.2.6. Component Diagram ............................................................................................... 44
4.2.7. Deployment Diagram .............................................................................................. 45
4.2.8. Database Design...................................................................................................... 46
4.2.8.3. Access Control .................................................................................................... 49
4.2.8.4. User Interface Design .......................................................................................... 50
CHAPTER FIVE: CONCLUSION AND RECOMMENDATIONS ........................................... 55
5.1. Conclusions .................................................................................................................... 55
5.2. Recommendations .......................................................................................................... 56
Reference ...................................................................................................................................... 57
Appendix ....................................................................................................................................... 58
10
Acronyms
COE Central of Excellence.
CSS Cascading Style Sheets.
DB Data Base
DBMS Data Base Management System.
ERD Entity Relationship Diagram.
GB Gigabit.
GHz Gigahertz.
GUI Graphic user interface
HD Hard disk.
HTML Hyper Text Markup Language.
IDE Integrated Development Environment.
MB Megabyte.
MySQL Structured Query Language.
OOD Object-Oriented Design.
PHP Hypertext Pre-processor.
RAM Random access memory.
SER South East Region.
UML Unified Modeling Language.
COE Central of Excellence.
CPU Central processing unit.
WAMP Windows, Apache, MySQL and PHP
CSS Cascading Style Sheets.
DB Data Base.
DBMS Data Base Management System.
ERD Entity Relationship Diagram.
GB Gigabit.
GHz Gigahertz.
GUI Graphic user interface
11
Abstract
Currently in Geda pharmacy, data management has kept paper record in filing cabinets to
manage sales medicine, medicine inventory, category of medicine types, and expiry date of the
pharmacy. Any items that are sold are not restocked, ordering of drugs is being
carried out manually or through telephone call. The current syst em does not al l ow f or
ef f i ci ent busi ness p ract i ces , w hi ch esse nt i al l y can be cost l y t o t he pharmac y
a n d generat i ng a report f or sal es and medi ci ne order, rec ei vi ng medi ci ne f r om
s uppl i er and st ock i nf ormat i on can be t edi ous and t i me con sumi ng. T he mai n
pur pos e of t hi s proj ect i s t o d ev el op a syst em t hat al l ow s t he ph armaci s t t o
keep t r ac k of st ocks , sal es, pharmaci st , t he manager or t he cashi er shoul d be
abl e t o s ee t h e st oc k avai l abl e at any g i ven t i me , t he expi r y t i me of t he dr ug,
preventing those drugs from being sold a n d pr i nt out report s of speci f i c queri es, and
updat e pri ces w hen t hey change and t o improve accuracy and enhance safety and
efficiency in the pharmaceutical store. The methodology used to model and develop this software
is Iterative and Incremental Mode, which allows room for scalability as time goes on and this
model helps to start development with a simple implementation of a small set of the software
requirements and iteratively enhances the evolving versions until the complete system is
implemented and ready to be deployed. The project benefits owners, admins, cashier and
pharmacist to manage and monitor the day to day operational activities of the pharmacy with
better performance to provide reliable, efficient, and accurate and on time services to the
customer.
12
CHAPTER ONE: INTRODUCTION
1.1. Background of the Project
The current Geda pharmacy system is done manually i.e. almost all works on the pharmacy
organization is done by papers. Thus, for medicine data search in order to buy, audit, and other
related works are made manually. Here the data can be accessed anyone who entered to the
pharmacy like friends or other people having no relationship to pharmacist. The pharmacist work
is in tedious situation because of the upper reasons. By this method arrangement of medicine on
the shelf is not efficient, medicine sales and inventory management system is tedious and time
consuming and it is highly subjected to theft. In this system almost, all pharmacies do not use
computerized system but have a computer for giving bills when medicine is sold to the user. Also,
by using this system there is a difficulty to store the data so that recovery of necessary data is
difficult which wastes resources as well as time. So generally, the current system does not arrange
medicine in systematic way, does not store the medicine appropriate data, inventory management
is difficult, identifying the expiry date of the medicine is difficult, restocking of the medicine is
not properly made, searching of the pharmacy on the shelf is time consuming and tedious, security
for the data is low, does not indicate how much medicine is needed and sold quickly and efficiently.
Pharmacy Management System is a pharmacy software designed and developed for any pharmacy.
This software is used for pharmacy data management. They are defined as computer systems
designed specifically for pharmacy departmental use, with functionality for the management of
pharmacy and dispensing processes, such as medicine labeling, medicine data records, decision
support for drug interactions and other warnings, stock control, ward inventory management, order
processing and functions to support pharmacy, sales medicine, recording expiry date and
discarding the expired medicine.
The major purpose of this project is to develop a pharmacy management system for Geda
Pharmacy i.e., is a management system that is developed to improve accuracy and to enhance
safety and efficiency in the pharmaceutical store. It is a computer based system which helps the
pharmacist to improve inventory management, cost, and medical safety, easily manage medicine
category, types and lists, informs warning to order the medicine when it is not sufficient in the
stock and etc.
The system allows the user to enter a manufacturing and expiry date for a particular product or
drug during opening stock and sales transaction. The system will also give report showing the list
13
of products expiry after a specified date before the product eventually expires. It also involves
manual entry upon arrival of new batches of drugs and upon drug movement out of the pharmacy
for a certain period, e.g. every month, the pharmacist may want to generate report for the
movement of drugs in and out of the pharmacy, getting information about the drugs e.g. expiry
date, date purchased, number of drug type left, location of a drug in the pharmacy easily and
efficiently.
1.2. Problem of Statement
Currently in Geda pharmacy, data management has kept paper record in filing cabinets to
manage the sales and inventory of the pharmacy. Any items that are sold are not restocked.
The pharmacist normally check the shelves in the stock or shop every week to see
what stocks or medicines are needed, write up a list of items, which are purchased
from the wholesalers. Managing a very large pharmacy with records on papers will be
tedious and difficult to keep track of inventories with regards to the drugs in the store,
expiry date, quantity of drugs available based on the categories and their types of function.
The pharmacist has to order drugs to replenish the already diminishing stock. In addition,
ordering of drugs is being carried out manually or through telephone call. Significant
amount of time is required for writing the order as the pharmacist needs to go through
the stock balance and make rough estimate of the amount to order m a n u a l l y . Drugs are
not supposed to be used a f t e r t h e y have expired. The stakeholders who are affected by this
problem include; the owner, pharmacist, and the cashier. The impact of the problem outlined is
that, the current system does not allow for efficient business practices, which essentially can be
costly to the pharmacy and generating a report for sales and stock information can be time
consuming. The proposed system will allow the pharmacist to keep track of medicines types and
categories, inventory of medicine, sales medicine, order the medicine, pharmacist or the cashier
should be able to see the stock available at any given time, the expiry time of the drug, preventing
those drugs from being sold and print out reports of specific queries, and update prices when they
change.
1.3. Purpose of the Project
The purpose of this project is to develop automated pharmacy management system for Geda
pharmacy that supports the owners, admins and pharmacist to manage and monitor the day to day
operational activities of the pharmacy with better performance to manage sales, medicine stock,
14
medicine order, receive ordered medicine and expiry date of the medicine and provide reliable,
efficient, accurate, secured and provides on time services to the customer and generate sales
report easily.
1.4. Objectives of the Project
1.4.1. General Objectives
The general objective of this project is to design and develop web-based Pharmacy Management
System for Geda Pharmacy to manage and control sales and stocks of the pharmacy, medicine
types, medicine category, medicine information and medicine order in secured manner and
provide reliable, efficient, accurate, and on time services to the customer and minimize the cost
of the pharmacy by managing and controlling the activities of the pharmacy efficiently with better
performance.
1.4.2. Specific Objectives
The following are the specific objectives of the project that is identified in line with achieving
the general objective of the project:
Identify the problems of existing system
Determine the major functionalities of the existing system
Identify and describe the functional and non-functional requirements of the system
Analyze and model the proposed system
Decompose the system into subsystems
Design the software and hardware architecture of the system
Design and Implement User Interface Prototype
Design and implement Database
Implement the key functionality of the system and subsystems
Test the system unit and key functionalities of the system
To provide optimal drug inventory management by monitoring the drug movement in the
pharmacy
To Design and implement a system that ensure there exists a level of restricted access based
on functionality and role
To develop a system that generate report within a specified period of time
15
1.5. Scope of the Project
To develop a subsystem to manage pharmacy information management to keep track of
medicine supplies and organize them and aids in the reduction of medication errors, the
reporting of drug usage, and the tracking of expenses.
To develop a subsystem or a module that categorize medicine information to monitor and
check the medicine information to identify its category.
To build a module that monitor medicine orders to keep track of dates and events throughout
the process chain, from placing an order with an external vendor to presenting medicine
products in a store or receiving products in a distribution center.
To build a module to manage sales and stocks that helps the pharmacist with the sales and
stocks management that includes ordering, storing, tracking, and monitoring stock levels as
well as monitoring their revenue.
To build or develop a module to generate processes reports to help the cashier, admin or the
pharmacist to generates the transaction reports to keep track of the pharmacy activities.
To build a module that control and manage the expiry date of the medicine or drug and not be
sold expired drug.
To build a module or a subsystem that manages and controls the medicine type and lists that
helps the pharmacist easily to order or restock when it is needed
To build a system that manages and restrict access control to the system by ensuring that there
exists a level of restricted access based on functionality and role
To build a module that control and manage the expiry date of the medicine or drug and not be
sold expired drug.
To develop or build a module to control and manage drug inventory management that strives
to reduce procurement and carrying expenses while maintaining a sufficient stock of products
to meet the needs of customers and prescribers and monitor the performance of the pharmacy
and to know what the most needed medicines are.
1.6. Limitation of the Project
Using English language only to design user interface because of shortage of time and
problems of language skill to talk and write such as Amharic and Oromifa
The project is implemented using trial version software due to high cost of the software
available for commercialization.
16
The system doesn’t support online transaction and accepting payment through credit cards,
doesn’t support scanner tracking of drugs for their prices and foreign currency
1.7. Significance of the Project
The System helps the pharmacists to keep track of medicine supplies and organize them and
aids in the reduction of medication errors, the reporting of drug usage, and the tracking of
expenses
The system helps and allows the admin or the pharmacist to categorize the drugs available in
the pharmacy will be much easier and monitoring and checking of the medicine information
to identify its category is fast, easy and simple.
The system supports the manager or the admin to keep track of dates and events throughout
the process chain, from placing an order with an external vendor to presenting drugs in a store
or receiving drugs in a distribution center. Helps to monitor medicine ordering.
The system helps and aids the pharmacist or cashier with the sales and stocks management
that includes ordering, storing, tracking, and monitoring stock levels as well as monitoring
their revenue.
The system allows the pharmacist or the admin to control and manage drug inventory and
strives to reduce procurement and carrying expenses while maintaining a sufficient stock of
products to meet the needs of customers and prescribers. This will also monitor the
performance of the pharmacy and to know what the most needed medicines are.
The system helps the pharmacist or the cashier to record the expiry date of the pharmacy and
allows to destruct when the expiry date is reached and control not sold the expired medicines.
The system helps the admin to manages, monitor and restrict access control to the system by
ensuring that there exists a level of restricted access based on functionality and role
The system supports and helps the admin, the cashier, the owner to generate the transaction
reports to keep track of the pharmacy activities, daily, weekly, monthly and yearly.
1.8. Methodology
1.8.1. Fact Finding Methodology
The project team member select direct observation, interview and existing document analysis to
study the problems of existing system, to identify the business requirements, user’s requirement,
to identify the players of existing system and to determine the functional requirements of the
proposed system.
17
1.8.2. System Development Methodology or Models
The system development life cycle model or methodology used for analysis, design, model and
implementation of the proposed system is Iterative and Incremental model which allows room
for scalability as time goes on, as the model is suitable to starts with a simple implementation of
a small set of the software requirements and iteratively enhances the evolving versions until the
complete system is implemented and ready to be deployed.
1.8.3. System Development Tools
Visual Paradigm for modeling all the UML diagram of the system.
Enterprise Architecture to model the structural and the behavioral aspects of the proposed
system
MySQL Workbench- to model or diagram the Entity Relation model of the database
MS-Word- used to create, format, modify and print the documentation of the developed
system
Microsoft Project Management Software to schedule the time frame or schedule required for
the development of the system.
Microsoft PowerPoint to create and present the final project
1.9. Testing Plan
1.9.1. Unit Testing
Unit tests designed in the module design phase are executed on the code during this validation
phase. Unit testing is the testing at code level and helps eliminate bugs at an early stage, though
all defects cannot be uncovered by unit testing. In this project test main functionality of the
system such as categorize drugs, add drugs to the stock, manage inventory of drugs, sales drug,
order drug, manage suppliers of drug and pharmacy information management to identify errors
in code or bugs in program before the complete delivery of the system.
1.9.2. Integration Testing
Integration testing is associated with the architectural design phase. Integration tests are
performed to test the coexistence and communication of the internal modules within the system.
The proposed project test a modules that communicate and interact each other such as sales and
inventory, drug product category and inventory system, drug product inventory and drug order
system before the complete system is deployed.
18
1.10. Project Management
1.10.1. Cost Management
The following table shows the materials, equipment’s, devices, tools and costs required for the
development of the proposed project.
No Types of Specifications Measurement Qty Unit Total
Equipment, Price Cost
Materials and
Tools
1 Laptop Core i5, RAM 4GB, Pcs 2 18,000 36,000
Computer CPU Speed 2.3
GHZ, and 1 TB
Hard Disk
2 Printing Cost and A4 Size Paper, RIM 4 500 2000
Printing Paper Color print for
diagrams
3 Transport Cost 5 400 2000
4 Internet Cost 2MB, payment is 2MB 700 1400
made by month
5 Binding Large Size bind Pcs 3 100 300
6 Software Cost New Version Pcs 5 200 1000
Software
7 Other Cost such Hardware, Software 2000
as Maintenance and computer
Cost devices
Total Cost 44,700
Table 1:1 Project Cost Estimate Management
19
1.10.2. Project Schedule
The following graph shows the time schedule that is required to plan, analysis of a system, system
design and implementation of the system or software.
November December January February-March
Nov-01- Nov-16-30- Dec-01-31-21 Jan-01-31- Feb-01-Mar-31
15-21 21 21
Planning Analysis of Analysis of Implementation Testing
Existing Proposed System
System System Design
20
CHAPTER TWO: ANALYSIS OF EXISTING SYSTEM
2.1 Overview of Existing System
This part of the project describe the major functionality of the current or existing or manual
system of Geda Pharmacy Management, problems of existing system, identification of players of
the existing system, supplementary specification (i.e., Business Rule) and modeling the existing
system through Essential use case diagram, CRC model and Essential user interface prototype
flow diagram.
2.2. Functions of Existing System
The project team member identify the following major functions of the current pharmacy
management system in Geda Pharmacy through direct observation, interview and existing
document analysis of fact finding methodology.
Medicine purchase request and order
Receive ordered medicine from the supplier
Record complete and detail records of medicine information in terms of category
Arrange the medicine in its category
Stock the medicine in the store
Record inventory of medicines on hand
Record supplies and customers information
Sales record of medicines or drugs
Record expire dates of the medicine
Destruct and record expired medicines
Revenue reports daily, weekly, monthly, quarterly and annually
Audit the financial performance of the system
2.3. Problems of Existing System
The project team member identify the following major problems of the current pharmacy
management system in Geda Pharmacy.
Difficult to manage and control pharmacy stock or store because every record system is
paper based.
Searching medicine category, medicine type and medicine list is tedious and time consuming
and difficult to find easily.
It requires more labor to perform the day to day operation of the pharmacy
21
Difficult to get up-to-date data or information when they needed
Arrangement of medicine data and files are not systematic and accessing of the data also
difficult
Low security of data, medicine products, and the pharmacy is highly subjected to theft.
It does not deliver accurate, on time, and efficient services to the customer
High redundancy of data and lacks integration of data in the pharmacy
It is highly subjected to error prone and correcting of that errors is difficult and requires more
time.
Difficult to know in advance either the medicine or drugs needs to order and restock and
difficult to manage inventory
Difficult to know the expiry date of the drug or the medicine and to identify those medicine
that is expired would be sold
The current system did not allow the pharmacist or the managers to generate a report that
shows the day to day operational activities of the pharmacy.
Any items that are sold are not restocked, ordering of drugs is being carried
out manually or through telephone call,
Medication counts are done regularly, but even that can’t help in the situation where drug amounts
are counted incorrectly or not updated in the system on time.
2.4. Players of Existing System
No Players of Existing Descriptions of roles of the players
System
1 Pharmacist A technical person who manages the medicine category,
medicine type, lists, accept prescription from the patient,
record medicine expiry date, discard expired medicine
and sale medicine to the customer
2 Manager A person who manages the pharmacy, order medicine,
receive ordered medicine from the supplier
3 Cashier A person who collect cash from the customer when
medicine is sold, made payment to the supplier and
prepare daily sales and report to the manager
4 Supplier A medicine manufacturer or wholesaler suppliers who
22
supply medicine or drugs based on the purchase request
5 Customer A person who buy a medicine or drugs from the pharmacy
6 Stock Keeper A person who receive medicine from the suppliers, stock
the medicine, distribute the medicine to the pharmacist,
record expiry date of the medicine, discard expired
medicine from the stock and manage the stock or
inventory.
Table 2.1 Players of Existing System
2.5. Supplementary Specification
2.5.1. Business Rule
1. Business Rule One
The medicine is distracted from the stock or the shelf by the pharmacist before 1 month of the
expire date of the medicine.
2. Business Rule Two
The pharmacist did not sold a medicine to the customer if the customer did not bring the
prescription of the medicine approved by a Doctor.
3. Business Rule Three
The pharmacist must fill the issued request to get medicines from the store any time when there
is shortage of medicine on the shelf
4. Business Rule Four
The managers or owners of the pharmacy must approve any request of medicine made by the
pharmacist to get medicine from the store
2.6. Modeling the Existing System
2.6.1. Use Cases
Manage users
Order Medicine
Receive Ordered Medicine
Supply Medicine
Accept Medicine Order
Manage Medicine type
Accept Medicine Prescription
23
Arrange Medicine Category
Record Drug Expiry Date
Discard Expired Medicine
Stock the medicine
Record Medicine List
Medicine Inventory
Sales Medicine
Collect Cash
Made Payment to Supplier
Prepare Sales Report
Buy Medicine
2..1. Essential Use Case Modeling
The following figure shows the Essential Use Case Diagram of Existing Pharmacy Management
System that shows the interaction between the players and the functionalities of the manual
system.
Fig 2.1 Essential Use Case Diagram for Pharmacy Management System
24
2..2. Essential Use Case Documentation
Name Sell Medicine
Identifier None
Description Sell available medicine in the store to the customer
Actor Pharmacist
Pre-Condition None
Post Condition The pharmacist will sell medicine if the it is available on the shelf
Extends None
Includes None
Basic Course of Action
1. The pharmacist accept prescription from the customer
2. The pharmacist find or search the medicine on the shelf
3. The pharmacist collect medicine from the shelf and identify according to its type
4. The pharmacist send the customer to the cashier to pay cash
5. The Pharmacist ensure that the customer is paid for the medicine based on the cash
receipt got from the customer
6. The pharmacist give the medicine to the customer
Alternative Course of Action
4. The medicine is not available on the shelf
5. The pharmacist informs to the customer the medicine type is not available
6. The pharmacist issue request order to get the medicine from the stock or to order
medicine purchased request
Table 2.2 Use Case Documentation for Sales Medicine use case
Name Order Medicine
Identifier None
Description Order Medicine based on purchase request issued from the pharmacist
Actor Manager
Pre-Condition None
Post Condition The Manager will order medicine if there is purchase request from the
customer
25
Extends None
Includes None
Basic Course of Action
1. The manager accept purchase request from the pharmacist
2. The manager needs to identify the suppliers of the requested medicine
3. The manager issue purchase order request and sends to the suppliers
4. The manager will wait few days to get confirmation from the suppliers
5. The manager facilitate and inform to the cashier to made payment to medicine supplier
for purchased medicine
6. The manager count check and receive medicine from the supplier
7. The manager inform to the store keeper to issued medicine receive form and send the
medicine to the store
Alternative Course of Action
7. The medicine ordered is not available in the selected supplier identified by the manager.
8. The manager find another supplier to purchase medicine and issue purchase request to
purchase a medicine and send to supplier
Table 2.3 Order Medicine Use case Documentation
Name Made Payment for Supplier
Identifier None
Description Made Payment to the supplier after based on the order send by the
manager for payment
Actor Cashier
Pre-Condition None
Post Condition The cashier will made to the customer after confirmation for payment
is received from the manager
Extends None
Includes None
Basic Course of Action
1. The cashier receive payment order from the pharmacy manager
2. The cashier ensures that all ordered medicine stocked in the store keeper
26
3. The cashier prepared check and will made appointment for the supplier to accept the
check
4. The cashier insures the right person to accept the check
5. The casher give a payment check to the supplier agent or owner of the supplier
6. Payment Confirmation invoice is sent to the pharmacy manager
Alternative Course of Action
3. The ordered medicine is not stocked in the store
4. The cashier return back the payment order to the manager by telling that the medicine is not
reached to the stock and go to step 2
27
CHAPTER THREE: ANALYSIS OF PROPOSED SYSTEM
3.1. Overview of Proposed System
The proposed project named “Pharmacy Management System”, is a client/server based
application. An interactive application for managing medicine stock, inventory, medicine sales,
medicine category, medicine list, medicine type, order medicine, expiry date of the medicine,
record expired medicine and generate reports. It helps in maintaining the records of medicine, the
users and store details and also reduce the work of searching the records of the medicine.
This part of the project describe requirement determination (functional requirement, non-
functional requirement and system requirement), supplementary specification, identification of
actors and use cases and modeling the proposed system through system use case diagram,
conceptual class diagram, sequence diagram, activity diagram, state chart diagram and system user
interface diagram.
4.1. Requirement Determination
3..1. Functional Requirement
1. Manage User Information
1.1 The system allows the admin to add a new user and provides privileges for the users
1.2 The system allows to delete the user by the admin
2. Medicine Sales Management
2.1 The system enables the admin or the cashier to sale medicine to the customer
2.2 The system will allows the admin or the cashier to print receipt for payment to medicine
by the customer.
2.3 The system allows the admin or the cashier to print sales report
3. Medicine Inventory Management
3.1 The system enables the admin or the cashier to manages the medicine in the stock
3.2 The system allows to request to get medicine if there is shortage of medicine in the shelf
before it becomes to null
3.3 The system allows to print all medicine information in the pharmacy
4. Medicine Receive Management
4.1 The system allows the admin to receive new medicines ordered from the suppliers
4.2 The system allows the admin to view list of new medicine received from the supplier
5. Medicine Category Management
28
5.1 The system enables the admin to add new medicine category
5.2 The system allows the admin to view the medicine category
5.3 The system allows the admin to edit medicine category
5.4 The system allows the admin to delete medicine from the medicine category
6. Medicine Type Management
6.1 The system will allow the admin to add new medicine type received from the supplier
6.2 The system will allow the admin to edit medicine type
6.3 The system allows to view the types of medicines
6.4 The system allows the admin to delete different medicine types
7. Medicine Product List Management
7.1 The System will allow the admin to add product name, product price, product description
by selecting based on product category and product type
7.2 The system will allow the admin to edit the price of the product and other information
7.3 The system allows the admin to view product information
7.4 The system will allow the admin to delete product information
8. Medicine Supplier Management
8.1 The system will allow the admin to add new medicine supplier information
8.2 The system allow the admin to view medicine supplier information
8.3 The system will allow the admin to edit or delete medicine supplier
9. Medicine Expire Management
9.1 The system will allow the admin to add the expiry date of the medicine
9.2 The system enables the admin to view the expire date of the medicine with its
corresponding medicine type
9.3 The System will allow the admin to delete the medicine type that reaches to expired date
from the system
Table 3.1 Functional Requirements
29
3..2. Non-Functional Requirements
1. Operational
1.1 The system should be run on tablet pc used by the admin or the cashier
1.2 The system should use in computers connected in local area network
2. Performance
2.1 The system should respond the request of the admin or the cashier within 15 seconds
2.2 The system should print the sales report with less than 5 seconds
3. Security
3.1 The system protect the cashier from viewing other medicine information except sales and
inventory.
3.2 The system provides access control only for those who has username and password.
4. Platform Compatibility
4.1 The system is compatible with all types operating system installed in any type of
computer
4.2 The system can be run in all types of browsers that are freely available
5. User friendly
5.1 The user can easily use and operate the system even without any further training
30
3..3.2. Software Requirement
No Operating System, application Specifications
software and other utilities
1 Windows Operating System Windows 10 64-bits
2 Wamp Server A local server installed in a computer
3 PHP Scripting language used to develop frontend
application
4 MySQL A database sever that is used to develop backend
database application
Table 3.4 Software Requirement
4.1. Supplementary Specification
3..1. Business Rule
3..1.1. Business Rule 1
ID BR-1
Name Distract Expired Medicine
Description The system enables to provide warning information about the expired date of
the medicine when the user login to the system and allows to the admin to delete
the expired medicine and remove from the shelf immediately.
3..1.2. Business Rule 2
ID BR-2
Name Approve Medicine Request
Description The managers or owners of the pharmacy must approve any request of medicine
made by the admin to get medicine from the store
3..1.3. Business Rule 3
ID BR-3
Name Not Sale Expired Medicine
Description The system allows the admin immediately remove those medicines from the
shelf immediately after it deletes from the system based of the information
provided by the system
31
3..1.4. Business Rule 4
ID BR-4
Name Print Sales report
Description The admin or the cashier must print the sales report daily, weekly, monthly or
annually and send the hard copy to the manager
3..2. Constraints
The system does not works online due to Local Area Network
4.1. System Model
3..1. System Use case Model
3..1.1. Identification of Actors
No Actors Description
1 Admin A person who manages users, sales, medicine stock, medicine
information, medicine category, medicine type, product list,
manage receive product and other actions such as add, view and
delete and generate a report
2 Cashier A person who sales medicine, manages medicines in the stock,
manages expiry date of the medicine and generate a report
Table 3.5 Actors of the Proposed System
3..1.2. Identification of Use Cases
No Use Case Id Use Case Type
1 UC-01 LogIn
2 UC-02 Sales Medicine
3 UC-03 Medicine Inventory
4 UC-04 Receive Medicine
5 UC-05 Medicine Category
6 UC-06 Medicine Type
7 UC-07 Product List
8 UC-08 Manage Supplier
9 UC-09 Medicine expire Date
10 UC-10 Manage Customer
Table 3.6 Use cases of the proposed System
32
3..1.3. System Use Case Diagram
33
3..1.4. System Use Case Documentation
Name LogIn
Identifier UC-01
Description The admin log in to the system
Actor Admin
Pre-Condition None
Post Condition The admin log in to the system to perform admin tasks
Extends None
Includes None
Basic Course of Action
1. The admin wants to log in to the system
2. The admin open the browser and locate the address of the system
3. The system displays the Log In page
4. The user input user name and password and click on Loin button
5. The system displays a Home Page
Alternative Course of Action
1. The system displays a wrong message called user name or password is incorrect
2. The system go to step 4
Table 3.7 LogIn Use Case Documentation
Name Sale Medicine
Identifier UC-02
Description The admin wants to sell medicine or drug
Actor Admin
Pre-Condition The admin must have username and password
Post Condition The admin log in to the system to sale medicine or drug
Extends None
Includes UC-01
Basic Course of Action
1. The admin wants to sale medicine or drug
2. The user login to the system by entering his/her user name and password
3. The system displays a Home Page
34
4. The user click on Sales button
5. The System displays sales list information
6. The user click on New Sales button
7. The system displays Sales Page
8. The user select customer, product type and input the quantity sold and click on
Add to List button
9. The System displays payment information and the user click on Pay button
10. The system displays the total amount that a customer must pay and the user
click on Pay button
11. The System displays receipt information and the user print the receipt and give
to the customer
Alternative Course of Action
12. The system displays product quantity wants to sell is greater than available
stock
13. The system back to step 8
Table 3.8 Sale Medicine Use Case Documentation for Admin actor
Name Receive Medicine
Identifier UC-04
Description The admin receive medicine or drug and add to the system
Actor Admin
Pre-Condition
Post Condition The admin log in to the system to receive medicine or drug and add to
the system
Extends None
Includes UC-01
Basic Course of Action
1. The admin wants to receive medicine or drug
2. The user login to the system by entering his/her user name and password
3. The system displays a Home Page
4. The user click on Receive button and the system displays Receiving list
35
information
5. The user click on New Receiving button
6. The system displays Manage Receiving Page
7. The user select supplier list, product type and input the quantity received and
the price of the product and click on Add to List button
8. The System displays product information, quantity and price of the product and
total amount of the product and the user click on Save button
9. The system displays the information that Data is successfully added
10. The system ends with by displaying receiving list page
Alternative Course of Action
Table 3.9 Receive Medicine Use Case Documentation
Name Medicine Type
Identifier UC-06
Description The user needs to add medicine type to the system
Actor Admin
Pre-Condition The admin log into the system to add medicine type to the system
Post Condition
Extends None
Includes UC-01
Basic Course of Action
1. The user login to the system
2. The system displays the home page
3. The user click on medicine type button
4. The system displays the medicine type form and the medicine type list
5. The user input the medicine type he/she needs to add
6. Click on Save button
7. The system add the new medicine type to the medicine list table in the database
Alternative Course of Action
Table 3.10 Medicine Type Use case Documentation
36
3..2. Conceptual Class Diagram
Class diagram shows the class of the system interrelationships and the options’ and attributes of
the class, a class is a representation of n object to describe a class we define its attributes and
methods. Information stored about an object while methods are what the object or the class does.
The following figure shows the conceptual class diagram for pharmacy management system.
37
3..3. Sequence Diagram
Sequence diagrams are used to model the logic of usage scenario; usage scenario is exactly what
its have indicates the description of the potential ways your system is used the project team has
modeled sequence diagram for each use case identified in the use case modeling part. The
following figure shows sequence diagram for different use cases of pharmacy management system.
38
Fig 3.5 Sequence Diagram for ReceiveMedicine Use Case
3..4. Activity Diagram
Activity diagram is used to graphically depict the sequence flow of activities of either a business
process or a use case. They also can be used to model actions that will be performed when an
operation is executing as well as the result of those actions. The following two figure shows login
use case and pharmacy management system activity diagram.
39
Fig 3.7 Activity Diagram for Pharmacy Management System
3..5. State Chart Diagram
State chart diagrams show class states and the events that cause them to transition between states.
It is also called a state transition diagram. It is created when a class has a complex life cycle, an
instance of a class may update its attributes in a number of ways through the life cycle, a class has
an operational life cycle and the object’s current behavior depends on what happened previously.
The following figures shows a sample state chart diagram for purchase class of pharmacy
management system.
40
CHAPTER FOUR: SYSTEM DESIGN
4.1. Overview of System Design
This part of the project is the transformation of analysis model into system design model and
used to describe the purpose of system design, design goals, system architecture, system process,
subsystem decomposition, and model object oriented class diagram, component diagram,
deployment diagram, Database design and user interface diagram.
4.1.1. Purpose of System Design
The purpose of the System Design process is to provide sufficient detailed data and information
about the system and its system elements to enable the implementation consistent with
architectural entities as defined in models and views of the system architecture.
4.1.2. Design Goal
The primary goals of system design are to translate the object oriented system analysis model
into structural design entities. This includes the specification of mechanisms and structures for
managing data, the control of the system as a whole, and performance requirements. The creation
of subsystems is managed by slicing large domains into smaller, manageable portions that can be
worked on by two to four persons. Another approach to the creation of subsystems is the
clustering of related objects into cohesive entities that can form a well-defined interface to other
subsystems
4.2. System Architecture
The System architecture is architecture shows mainly the hardware and software architecture and
shows the interaction between the layers of the architecture. It describes the subsystem
decomposition in terms of subsystem responsibilities, dependencies among subsystems,
subsystem mapping to hardware, and major policy decisions such as control flow, access control,
and data storage.
4.2.1. Architectural Style
It is difficult to modify or correct weak decomposition once development has started, as most
subsystem interfaces would have to change. In recognition of the importance of this problem, the
concept of software architecture has emerged. A software architecture includes system
decomposition, global control flow, handling of boundary conditions, and inter subsystem
communication protocols. Therefore, the project team member selects Client/Server architecture
41
style for the development of supermarket software project management system. This architectural
style is clearly shown in the deployment diagram of this project.
4.2.2. System Process
Software Design is an iterative process through which requirements are translated into a
“blueprint” for constructing the software. It includes architectural design that escribes how
software is decomposed and organized into components (the software architecture) and the
detailed design to describe the specific behavior of these components
4.2.3. Subsystem Decomposition
42
4.2.5. Persistent Data Management Modeling
Persistent modeling is conceptually similar to design class modeling in terms of content. There
are minor things to remove and add in persistent modeling due to the nature of the DBMS to be
used for data management. The model describes the internal schema of a database, depicting the
data tables, the data columns of those tables, the unique nature of some functional columns
(attributes) and the relationships between the tables. The following figure shows the persistent
modeling of the pharmacy management system
43
4.2.6. Component Diagram
The component model illustrates the software components that will be used to build the system.
Component modeling emphasizes the separation of concerns in respect to the wide-ranging
functionality available throughout a given software system. The following figure shows the
component of a software developed for pharmacy management system.
44
4.2.7. Deployment Diagram
Deployment diagrams depict the physical resources in a system including nodes, components,
and connections. This model will be used to show how the hardware in the organization will be
connected and which component of the software will be deployed in hardware. The following
figure shows the Deployment diagram of Pharmacy Management System
45
4.2.8. Database Design
4.2.8.1.Conceptual Database Design
This phase of the database design shows the theoretical design of the data requirement of the
database and it is illustrated by Entity Relationship Diagram. Accordingly, the following the
following figure shows the ER-Diagram of Pharmacy Management System
46
Table 4.1 Medicine Category List table
47
Table 4.6 Medicine Product List Table
48
Table 4.9 Medicine Supplier List table
49
used access control mechanism that restricts access to computer resources based on the role of
individuals or groups with defined business functions. The role-based security model relies on
role assignments, role authorizations and role permissions developed to manage users as admin
and cashier.
Therefore the pharmacy management system ensures that only registered and authorized user’s
access to the system through their own user name and password. The administrator of the system
responsible to create user name and password for the cashier and for the admin also. The admin
manage all pharmacy management system but the system limits the cashier only to sales
medicine, view medicine inventory and expired list of the medicine after login to the system.
4.2.8.4.User Interface Design
50
Fig 4.8 Home Page Screen
51
Fig 4.11 Manage Receiving Medicine UI
52
Fig 4.14 Medicine List UI
53
Fi 4.16 Pharmacy Management Receipt Payment UI
54
CHAPTER FIVE: CONCLUSION AND RECOMMENDATIONS
5.1. Conclusions
While developing the system a conscious effort has been made by the team member to analyses
user requirements, functional requirements and design and develop the pharmacy management
application software or system by using different object oriented methodology, development tools
and a software package. The project team member follows the standard system development life
cycle such as planning, analysis, design, implementation, testing and deployment of the software.
The project team member writes the scripting code for different system and subsystem of this
software application and test each functionality to ensure that the software performs its required
operations.
Accordingly, the project team member ensures that the pharmacy management system provides
the following significant for medicine sellers, pharmacist, users, owners, cashier and customers.
The System helps the pharmacists to keep track of medicine supplies and organize them and
aids in the reduction of medication errors, the reporting of drug usage, and the tracking of
expenses
The system helps and allows the admin or the pharmacist to categorize the drugs available in
the pharmacy will be much easier and monitoring and checking of the medicine information
to identify its category is fast, easy and simple.
The system supports the manager or the admin to keep track of dates and events throughout
the process chain, from placing an order with an external vendor to presenting drugs in a store
or receiving drugs in a distribution center. Helps to monitor medicine ordering.
The system helps and aids the pharmacist or cashier with the sales and stocks management
that includes ordering, storing, tracking, and monitoring stock levels as well as monitoring
their revenue.
The system allows the pharmacist or the admin to control and manage drug inventory and
strives to reduce procurement and carrying expenses while maintaining a sufficient stock of
products to meet the needs of customers and prescribers. This will also monitor the
performance of the pharmacy and to know what the most needed medicines are.
The system helps the pharmacist or the cashier to record the expiry date of the pharmacy and
allows to destruct when the expiry date is reached and control not sold the expired medicines.
55
The system helps the admin to manages, monitor and restrict access control to the system by
ensuring that there exists a level of restricted access based on functionality and role
The system supports and helps the admin, the cashier, the owner to generate the transaction
reports to keep track of the pharmacy activities, daily, weekly, monthly and yearly.
5.2. Recommendations
As such one may hope that the system will be acceptable to any user and will adequately meet
his/her needs and performed all its functionality. As in case of any system development processes
where there are a number of shortcomings, there have been some shortcomings in the development
of this system also. The project is still under modification. For example, the project does not
compute the VAT and withholding for the product sold according to the taxation rules and
regulation of Ethiopia. And also there is shortcomings that the development team member lacks
of skills to use different tools such as time scheduling software and other UML diagrams.
Therefore, the project team member recommends other developers to modify and resolve the
shortcomings of this application software. It also recommended the project team member to
modify after the will fill their skill gabs and will make this software to commercialize.
56
Reference
1. S. Shim, V. Pendyala, M. Sundaram, and Ph. D Jerry Gao, Introduction to E-commerce,
Special issue on E-commerce in IEEE Computer, Vol. 33, No. 10, October, 2000.
2. Dr. Jim Arlow, OO Analysis and Design with UML and USDP, Version 2.0
3. Professor LonnineD.Bentlley “System Analysis and Design Methods” Simon Bennet, Steve
McRobb and Ray Farmer: Object oriented system analysis and design
4. Hoffer, Jeffrey A. and Georg, Joey F and Valacich, Joseph S, Modern Systems and Design,
Person Education (Singapore) ptc.Ltd, India Brench, 482 F.I.E Patperegieng, Delhi 110092,
India, 2000
5. Simon Bennet, SteveMcRobb and Ray Farmer: Object Oriented System Analysis and Design.
Websites
6. http://www.orderonline.sg/cart/
7. http://www.orderonline.sg/product/grapefruit-pink-500-g/
8. http://www.organicsupermarket.ie/shop/products/?category=1
9. http://www.waitrose.com/shop/Browse/Groceries/Fruit_and_Veg
57
Appendix
1. Sample LogIn Script Code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
</head>
<style>
body{
width: 100%;
height: calc(100%);
58
/*background: #007bff;*/
}
main#main{
width:100%;
height: calc(100%);
background:white;
}
#login-right{
position: absolute;
right:0;
width:40%;
height: calc(100%);
background:white;
display: flex;
align-items: center;
}
#login-left {
position: absolute;
left: 0;
width: 60%;
height: calc(100%);
background: #0097ffcf;
display: flex;
align-items: center;
}
#login-right .card{
margin: auto
}
.logo {
margin: auto;
font-size: 8rem;
59
background: white;
padding: .5em 0.9em;
border-radius: 50% 50%;
color: red;
}
</style>
<body>
60
</div>
<center><button class="btn-sm btn-block btn-wave
col-md-4 btn-primary">Login</button></center>
</form>
</div>
</div>
</div>
</main>
</body>
<script>
$('#login-form').submit(function(e){
e.preventDefault()
$('#login-form button[type="button"]').attr('disabled',true).html('Logging in...');
if($(this).find('.alert-danger').length > 0 )
$(this).find('.alert-danger').remove();
$.ajax({
url:'ajax.php?action=login',
method:'POST',
data:$(this).serialize(),
error:err=>{
console.log(err)
$('#login-form button[type="button"]').removeAttr('disabled').html('Login');
},
success:function(resp){
61
if(resp == 1){
location.href ='index.php?page=home';
}else if(resp == 2){
location.href ='voting.php';
}else{
$('#login-form').prepend('<div class="alert alert-
danger">Username or password is incorrect.</div>')
$('#login-form
button[type="button"]').removeAttr('disabled').html('Login');
}
}
})
})
</script>
</html>
2. Sample Database Connect Script Code
<?php
62
<button class="col-md-2 float-right btn btn-primary btn-sm"
id="new_sales"><i class="fa fa-plus"></i> New Sales</button>
</div>
<div class="card-body">
<table class="table table-bordered">
<thead>
<th class="text-center">#</th>
<th class="text-center">Date</th>
<th class="text-center">Reference
#</th>
<th class="text-
center">Customer</th>
<th class="text-center">Action</th>
</thead>
<tbody>
<?php
$customer = $conn-
>query("SELECT * FROM customer_list order by name asc");
while($row=$customer-
>fetch_assoc()):
$cus_arr[$row['id']] =
$row['name'];
endwhile;
$cus_arr[0] = "GUEST";
$i = 1;
$sales = $conn->query("SELECT *
FROM sales_list order by date(date_updated) desc");
while($row=$sales->fetch_assoc()):
?>
<tr>
63
<td class="text-
center"><?php echo $i++ ?></td>
<td class=""><?php echo
date("M d, Y",strtotime($row['date_updated'])) ?></td>
<td class=""><?php echo
$row['ref_no'] ?></td>
<td class=""><?php echo
isset($cus_arr[$row['customer_id']])? $cus_arr[$row['customer_id']] :'N/A' ?></td>
<td class="text-center">
<a class="btn btn-sm
btn-primary" href="index.php?page=pos&id=<?php echo $row['id'] ?>">Edit</a>
<a class="btn btn-sm
btn-danger delete_sales" href="javascript:void(0)" data-id="<?php echo $row['id']
?>">Delete</a>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$('table').dataTable()
$('#new_sales').click(function(){
location.href = "index.php?page=pos"
64
})
$('.delete_sales').click(function(){
_conf("Are you sure to delete this data?","delete_sales",[$(this).attr('data-id')])
})
function delete_sales($id){
start_load()
$.ajax({
url:'ajax.php?action=delete_sales',
method:'POST',
data:{id:$id},
success:function(resp){
if(resp==1){
alert_toast("Data successfully deleted",'success')
setTimeout(function(){
location.reload()
},1500)
}
}
})
}
</script>
4. Sample SQL Script code to create database and table
65
- -----------------------------------------------------
-- Schema mydb
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Schema pharmacy_db
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Schema pharmacy_db
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `pharmacy_db` DEFAULT CHARACTER SET latin1 ;
USE `pharmacy_db` ;
-- -----------------------------------------------------
-- Table `pharmacy_db`.`category_list`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `pharmacy_db`.`category_list` (
`id` INT(30) NOT NULL AUTO_INCREMENT,
`name` TEXT NOT NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB
AUTO_INCREMENT = 9
DEFAULT CHARACTER SET = utf8mb4;
-- -----------------------------------------------------
-- Table `pharmacy_db`.`customer_list`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `pharmacy_db`.`customer_list` (
`id` INT(30) NOT NULL AUTO_INCREMENT,
`name` TEXT NOT NULL,
`contact` VARCHAR(30) NOT NULL,
`address` TEXT NOT NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB
66
AUTO_INCREMENT = 2
DEFAULT CHARACTER SET = utf8mb4;
- -----------------------------------------------------
-- Table `pharmacy_db`.`expired_product`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `pharmacy_db`.`expired_product` (
`id` INT(30) NOT NULL AUTO_INCREMENT,
`product_id` INT(30) NOT NULL,
`qty` INT(30) NOT NULL,
`date_expired` DATE NOT NULL,
`date_created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
CURRENT_TIMESTAMP,
PRIMARY KEY (`id`))
ENGINE = InnoDB
AUTO_INCREMENT = 4
DEFAULT CHARACTER SET = utf8mb4;
-- -----------------------------------------------------
-- Table `pharmacy_db`.`inventory`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `pharmacy_db`.`inventory` (
`id` INT(30) NOT NULL AUTO_INCREMENT,
`product_id` INT(30) NOT NULL,
`qty` INT(30) NOT NULL,
`type` TINYINT(1) NOT NULL COMMENT '1= stockin , 2 = stockout',
`stock_from` VARCHAR(100) NOT NULL COMMENT 'sales/receiving',
`form_id` INT(30) NOT NULL,
`expiry_date` DATE NOT NULL,
`expired_confirmed` TINYINT(1) NOT NULL DEFAULT '0',
`other_details` TEXT NOT NULL,
`remarks` TEXT NOT NULL,
67
`date_updated` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
CURRENT_TIMESTAMP,
PRIMARY KEY (`id`))
ENGINE = InnoDB
AUTO_INCREMENT = 15
DEFAULT CHARACTER SET = utf8mb4;
-- -----------------------------------------------------
-- Table `pharmacy_db`.`product_list`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `pharmacy_db`.`product_list` (
`id` INT(30) NOT NULL AUTO_INCREMENT,
`category_id` TEXT NOT NULL,
`type_id` INT(30) NOT NULL,
`sku` VARCHAR(50) NOT NULL,
`price` DOUBLE NOT NULL,
`name` VARCHAR(150) NOT NULL,
`measurement` TEXT NOT NULL,
`description` TEXT NOT NULL,
`prescription` TINYINT(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`))
ENGINE = InnoDB
AUTO_INCREMENT = 9
DEFAULT CHARACTER SET = utf8mb4;
-- -----------------------------------------------------
-- Table `pharmacy_db`.`receiving_list`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `pharmacy_db`.`receiving_list` (
`id` INT(30) NOT NULL AUTO_INCREMENT,
`ref_no` VARCHAR(100) NOT NULL,
`supplier_id` INT(30) NOT NULL,
`total_amount` DOUBLE NOT NULL,
68
`date_added` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`))
ENGINE = InnoDB
AUTO_INCREMENT = 4
DEFAULT CHARACTER SET = utf8mb4;
-- -----------------------------------------------------
-- Table `pharmacy_db`.`sales_list`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `pharmacy_db`.`sales_list` (
`id` INT(30) NOT NULL AUTO_INCREMENT,
`ref_no` VARCHAR(30) NOT NULL,
`customer_id` INT(30) NOT NULL,
`total_amount` DOUBLE NOT NULL,
`amount_tendered` DOUBLE NOT NULL,
`amount_change` DOUBLE NOT NULL,
`date_updated` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
CURRENT_TIMESTAMP,
PRIMARY KEY (`id`))
ENGINE = InnoDB
AUTO_INCREMENT = 10
DEFAULT CHARACTER SET = utf8mb4;
-- -----------------------------------------------------
-- Table `pharmacy_db`.`supplier_list`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `pharmacy_db`.`supplier_list` (
`id` INT(30) NOT NULL AUTO_INCREMENT,
`supplier_name` TEXT NOT NULL,
`contact` VARCHAR(30) NOT NULL,
`address` TEXT NOT NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB
69
AUTO_INCREMENT = 5
DEFAULT CHARACTER SET = utf8mb4;
-- -----------------------------------------------------
-- Table `pharmacy_db`.`system_settings`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `pharmacy_db`.`system_settings` (
`id` INT(30) NOT NULL AUTO_INCREMENT,
`name` TEXT NOT NULL,
`email` VARCHAR(200) NOT NULL,
`contact` VARCHAR(20) NOT NULL,
`cover_img` TEXT NOT NULL,
`about_content` TEXT NOT NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB
AUTO_INCREMENT = 2
DEFAULT CHARACTER SET = utf8mb4;
-- -----------------------------------------------------
-- Table `pharmacy_db`.`type_list`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `pharmacy_db`.`type_list` (
`id` INT(30) NOT NULL AUTO_INCREMENT,
`name` TEXT NOT NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB
AUTO_INCREMENT = 7
DEFAULT CHARACTER SET = utf8mb4;
-- -----------------------------------------------------
-- Table `pharmacy_db`.`users`
-- -----------------------------------------------------
70
CREATE TABLE IF NOT EXISTS `pharmacy_db`.`users` (
`id` INT(30) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(200) NOT NULL,
`username` VARCHAR(100) NOT NULL,
`password` VARCHAR(200) NOT NULL,
`type` TINYINT(1) NOT NULL DEFAULT '2' COMMENT '1=admin , 2 = cashier',
PRIMARY KEY (`id`))
ENGINE = InnoDB
AUTO_INCREMENT = 8
DEFAULT CHARACTER SET = utf8mb4;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
71