STOCK MANAGEMENT
C.S. Project
Name : - Krishn Gupta
Class : - XII Science
Section: - A
Roll No.: -
ACADEMIC YEAR 2024-25
BAL BHAVAN PUBLIC SR. SEC. SCHOOL
Certificate
This is to certify that Krishn Gupta of class 12th Science
A has successfully completed the C.S Project on Stock
Management under Mrs. Arti Mehra mam guidance
and supervision.
She is satisfied with their initiative and efforts for the
completion of the project file as a part of curriculum of
CBSE Class XIIth Examination.
Date:
Principal’s signature………………………………
Teacher’s Signature………………………….….
Acknowledgement
I would like to express my special thanks of gratitude to my teacher
Mrs. Arti Mehra mam as well as our Director Saroj Gupta mam who
gave me the golden opportunity to do this wonderful project on the
topic “Stock Management”, which also helped me in doing lot of
research and I came to know about so many new things. I am really
thankful to them.
Secondly, I would also like to thank my parents and friends who helped
me a lot in finalizing this project within the limit time frame.
Last but not least I would also like to show my gratitude towards the
Almighty who game me this wonderful life to complete this.
Yours sincerely
Krishn Gupta
Hardware and Software
requirements
Hardware Requirements
❖ PC:
• Desktop or laptop computer for development and running
the program.
❖ Mobile Phone:
• Optional for viewing results if a mobile-friendly interface is
developed.
Software Requirements
❖ Python:
• Latest version (Python 3.6 or higher recommended).
❖ MySQL Python Connector:
• MySQL-connector-python (Install via pip: pip
install mysql-connector-python).
This concise set of requirements ensures we have the essential tools
needed to run and interact with the Stock Management System
effectively.
Proposed System
Built-in Functions: -
1. input(prompt):
• Purpose: Reads a line from input (usually from the
user) and returns it as a string.
• Usage in our program: Used to get inputs from the
user for various fields such as product name,
description, price, and quantity.
2. print (value, ...):
• Purpose: Prints the specified values to the console.
• Usage in our program: Used to display messages,
results, and prompts to the user.
3. int(value):
• Purpose: Converts a specified value to an integer.
• Usage in our program: Used to convert user inputs
for IDs and quantities to integers.
4. float(value):
• Purpose: Converts a specified value to a floating-
point number.
• Usage in our program: Used to convert user inputs
for prices to floats.
5. if statement:
• Purpose: Used for conditional execution of code. If
the specified condition evaluates to True, the
indented block of code beneath it is executed;
otherwise, it is skipped.
• Usage in our program: Used to check conditions
such as user choices in the menu and validation of
inputs.
6. elif statement:
• Purpose: Stands for "else if" and is used to check
additional conditions if the previous if or elif
conditions are not satisfied.
• Usage in our program: Used to handle alternative
conditions in the menu choices.
7. else statement:
• Purpose: It is a catch-all condition. If none of the
preceding if or elif conditions is true, the code under
else is executed.
• Usage in our program: Used to handle invalid menu
choices or unexpected inputs.
Implicitly Defined Functions: -
1. break:
• Purpose: Terminates the execution of the innermost loop.
• Usage in our program: Used to exit the infinite loop when
the user chooses to exit the program.
2. continue:
• Purpose: Skips the rest of the code inside a loop for the
current iteration and jumps to the next iteration.
• Usage in our program: Could be used in loops to skip
iterations when certain conditions are met, although not
explicitly used in the provided program.
Proposed System
The proposed system for the Stock Management System program is
designed to provide an efficient, reliable, and user-friendly solution
for managing inventory, purchases, sales, and user accounts. The
system will be implemented using Python and MySQL, leveraging a
command-line interface for interaction. Below are the key
components and functionalities of the proposed system:
System Components
1. Database:
• MySQL Database: Used to store and manage data related
to products, purchases, sales, and users. The database
schema includes four tables: Users, Products, Purchases,
and Sales.
• Tables:
▪ Users: Stores user information including user ID,
username, password, and role.
▪ Products: Stores product information including
product ID, name, description, price, and quantity.
▪ Purchases: Records purchases made, including
purchase ID, product ID, quantity, and purchase date.
▪ Sales: Records sales transactions, including sale ID,
product ID, quantity, and sale date.
2. Application:
• Python Script: The main program is a Python script that
connects to the MySQL database and provides a menu-
driven interface for users to interact with the system.
Key Functionalities
1. User Management:
• Add new users with specified roles (e.g., admin, manager).
• View all users to manage and monitor access.
2. Product Management:
• Add new products to the inventory with details such as
name, description, price, and quantity.
• Update existing product information.
• Delete products from the inventory.
• View all products to monitor inventory levels and details.
3. Purchase Management:
• Record new purchases with product ID and quantity.
• View all purchase transactions to monitor procurement
activities.
4. Sales Management:
• Record sales transactions with product ID and quantity.
• View all sales transactions to track sales performance.
Workflow
1. Database Setup:
• Create the StockManagement database and its tables using
the provided SQL script.
2. Connecting to the Database:
• Establish a connection to the MySQL database using the
mysql.connector library in Python.
3. User Interaction:
• Provide a menu-driven interface that allows users to select
from various options such as adding products, viewing
products, managing purchases, and managing sales.
4. Executing Operations:
• Depending on the user's choice, the program will execute
the corresponding function to perform database
operations (e.g., inserting, updating, deleting records).
5. Error Handling and Validation:
• Implement error handling to manage database connection
issues and SQL execution errors.
• Validate user inputs to ensure data integrity and prevent
invalid operations.
6. Exit Mechanism:
• Provide an option for users to exit the program gracefully,
ensuring all operations are properly completed and the
database connection is closed.
Advantages
1. Efficiency:
• Automates inventory management tasks, reducing the
time and effort required to track and manage stock levels.
• Streamlines the process of adding, updating, and deleting
products, purchases, and sales.
2. Accuracy:
• Minimizes human errors associated with manual inventory
tracking.
• Ensures accurate record-keeping of product details,
purchases, and sales transactions.
3. Real-Time Data:
• Provides up-to-date information on stock levels,
purchases, and sales, enabling better decision-making.
• Facilitates quick access to inventory data, allowing for
timely restocking and order fulfilment.
4. User Management:
• Allows for the creation and management of user accounts
with specific roles, enhancing security and control over the
system.
• Ensures that only authorized personnel can perform
certain actions, such as adding or deleting products.
5. Scalability:
• Can easily be scaled to accommodate an increasing
number of products, users, and transactions.
• Suitable for small businesses as well as larger enterprises
with more complex inventory management needs.
6. Cost-Effective:
• Reduces the need for expensive inventory management
software.
• Lowers operational costs by improving inventory accuracy
and reducing stockouts and overstock situations.
7. Data Security:
• Stores data securely in a MySQL database, protecting it
from unauthorized access and loss.
• Implements user authentication and role-based access
control to ensure data integrity and confidentiality.
8. Customization:
• The system can be customized and extended to meet
specific business requirements.
• Additional features can be added as needed, such as
reporting and analytics, integration with other systems,
etc.
9. Improved Decision-Making:
• Provides valuable insights into inventory trends, purchase
patterns, and sales performance.
• Helps businesses make informed decisions regarding
inventory management, purchasing, and sales strategies.
10. Ease of Use:
• Offers a simple and intuitive command-line interface,
making it easy for users to navigate and operate the
system.
• Reduces the learning curve for new users, enabling quick
adoption and effective use of the system.
By leveraging these advantages, businesses can improve their
inventory management processes, enhance operational efficiency,
and ultimately drive better business outcomes.
Future of the Program
1) Web-Based Interface:
• Development of a Web Application: Transition from a
command-line interface to a web-based application for more
user-friendly and accessible interaction.
• Mobile Compatibility: Ensure the web application is mobile-
friendly, allowing users to manage inventory on-the-go using
smartphones or tablets.
2) Integration with E-commerce Platforms:
• Real-Time Syncing: Integrate with popular e-commerce
platforms like Shopify, WooCommerce, or Magento to sync
inventory levels in real-time.
• Automated Order Processing: Automatically process orders
from e-commerce platforms, updating stock levels accordingly.
3) Advanced Reporting and Analytics:
• Dashboards: Implement graphical dashboards to provide visual
insights into inventory levels, sales trends, and purchase
patterns.
• Custom Reports: Enable the generation of custom reports to
meet specific business needs, such as sales performance, stock
turnover rates, and purchase history.
4) AI and Machine Learning Integration:
• Predictive Analytics: Use AI and machine learning algorithms to
forecast demand, optimize stock levels, and predict inventory
shortages or surpluses.
• Automated Decision-Making: Implement automated decision-
making tools to recommend reorders, sales promotions, or
markdowns based on historical data and trends.
5) Integration with Accounting Software:
• Financial Tracking: Seamlessly integrate with accounting
software like QuickBooks or Xero to automate financial tracking
and reporting of inventory-related transactions.
• Expense Management: Track expenses related to purchases and
sales, providing a comprehensive view of financial health.
6)Enhanced Security Features:
• Role-Based Access Control (RBAC): Implement more granular
role-based access controls to ensure only authorized users can
access or modify specific data.
• Audit Trails: Maintain detailed audit logs of all user activities for
better accountability and traceability.
7) Cloud Deployment:
• Cloud Hosting: Deploy the application on cloud platforms such
as AWS, Azure, or Google Cloud for enhanced scalability,
reliability, and accessibility.
• Data Backup and Recovery: Implement automated data backup
and recovery solutions to protect against data loss.
8) Integration with IoT Devices:
• Smart Inventory Management: Integrate with IoT devices such
as RFID tags, barcode scanners, and smart shelves for real-time
inventory tracking and management.
• Automated Stock Counting: Use IoT sensors to automate stock
counting processes, reducing manual effort and errors.
9) Multi-Language and Multi-Currency Support:
• Global Reach: Extend the application’s reach by adding support
for multiple languages and currencies, catering to international
businesses.
• Localization: Customize the application to meet local regulatory
and business requirements.
10) Customer Relationship Management (CRM) Integration:
• Customer Insights: Integrate with CRM systems to gain insights
into customer behaviour and preferences, aiding in targeted
marketing and improved customer service.
• Sales and Promotions: Use CRM data to drive sales and
promotions, enhancing customer engagement and retention.
Code
Step1: - Open MySQL command line chart and write the following
SQL commands.
Step2: - Now open any code editor platform or IDLE python and
connect it with MySQL and make the program.
Output
Bibliography
1. VS Code
2. MySQL
3. Microsoft Word
4. Computer Science with Python Class 12 by Sumita
Arora