0% found this document useful (0 votes)
7 views60 pages

Info

Varcons Technologies Pvt Ltd specializes in advanced technology solutions, focusing on SaaS product development, project consulting, and innovative software services for businesses. The company offers a comprehensive internship program aimed at training participants in full-stack web development using Django and modern frontend technologies, culminating in hands-on projects and mentorship. Additionally, the document outlines a proposed Inventory and Billing Management System designed to automate inventory tracking and sales transactions for small businesses.

Uploaded by

anilbs6364
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views60 pages

Info

Varcons Technologies Pvt Ltd specializes in advanced technology solutions, focusing on SaaS product development, project consulting, and innovative software services for businesses. The company offers a comprehensive internship program aimed at training participants in full-stack web development using Django and modern frontend technologies, culminating in hands-on projects and mentorship. Additionally, the document outlines a proposed Inventory and Billing Management System designed to automate inventory tracking and sales transactions for small businesses.

Uploaded by

anilbs6364
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 60

Full Stack Design and Development [Document title]

CHAPTER 1
ABOUT THE COMPANY

Varcons Technologies Pvt Ltd is a leading provider of advanced technology solutions,


specializing in scalable, innovative services tailored for businesses of all sizes. Founded by a
team of visionaries who transformed their ideas into reality, the company has grown into a
trusted partner for SaaS product development, corporate seminars, industrial training, and
outsourced project execution.

At Varcons Technologies, smart solutions and technological innovation drive every aspect
of our work. The focus on leveraging SaaS capabilities to develop cutting-edge applications
that enhance efficiency, reduce deployment complexities, and provide seamless user
experiences. By integrating customizability and practicality into our software solutions, The
company ensure that businesses can implement ready-to-use applications with minimal
configuration time and reduced operational disruptions.

In addition to the core technology offerings, Varcons Technologies operates as a strategic


project consulting firm, managing outsourced projects from major enterprises and their
Vendors. By utilizing a hybrid workforce model, by integrating skilled interns alongside
industry professionals, optimizing project execution without the overhead of full-time hiring.
This helps our clients achieve cost-effective project completion, improved operational
efficiency, and increased profitability.

With a strong commitment to creativity, adaptability, and technological excellence, Varcons


Technologies continues to drive industry transformation by developing innovative solutions,
fostering talent, and enabling businesses to thrive in an ever-evolving digital.

Dept of CSE,BrCE 2024-25 1


Full Stack Design and Development About The Company
[Document title]

1.1 Services and Activities at the Company

Varcons Technologies Pvt Ltd is a multifaceted technology consulting firm offering a diverse
range of services across multiple departments, catering to businesses, startups, and
enterprises seeking scalable, high-impact solutions. Our operations are strategically
structured to provide end-to-end technology development, corporate consultancy, and
outsourced project management, ensuring our clients receive customized, innovative, and
cost-effective services.

Our Software Development Division specializes in SaaS-based solutions, full-stack


development, and enterprise application engineering. We develop highly scalable, cloud-
based applications designed to streamline business processes while incorporating
automation, AI-driven analytics, and secure API integrations. Our custom-built software
solutions include subscription-based applications that enable businesses to implement pre-
configured, ready-to-use platforms, reducing deployment time and mitigating operational
risks.

In addition, our Outsourced IT Consulting & Project Management Division enables large
enterprises to delegate complex software projects to our in-house experts and highly trained
interns, allowing businesses to reduce hiring costs while maintaining efficiency. This model
benefits companies by ensuring their projects are completed at a fraction of the cost, while
interns receive hands-on exposure, real-world experience, mentorship, and stipends—
creating a mutually beneficial ecosystem for talent development and business growth.

Our AI & Data Science Division focuses on research-based machine learning applications
across industries, including healthcare, finance, and automation. We develop AI-driven
solutions such as predictive analytics, image recognition models, and autonomous process
automation to optimize operations and enhance decision-making capabilities for enterprises.
Additionally, we are involved in innovative research projects, collaborating with
international investors, research institutions, and academia to explore emerging trends in AI
and deep learning.

The UI/UX & Branding Division is dedicated to creating visually compelling, user-friendly
interfaces that enhance customer engagement. Our expertise spans mobile and web

Dept of CSE,BrCE 2024-25 2


Full Stack Design and Development [Document title]

CHAPTER 2

ABOUT THE INTERNSHIP PROGRAM


Duration: 15 weeks
Level: Beginner to Intermediate
Mode:Online

Program Highlights

1. Objective:

• Train interns in end-to-end web development using Django (backend) and


modern frontend technologies (HTML/CSS, JavaScript, React/Vue).
• Hands-on experience in building scalable, database-driven web
applications.

2. Key Learning Areas:

▪ Frontend Development:
• HTML5, CSS3, Bootstrap/Tailwind.
• JavaScript (ES6+), React.js/Vue.js (optional).
▪ Backend with Django:
• Django fundamentals (Models, Views, Templates).
• REST APIs (Django REST Framework).
• Authentication (JWT/OAuth), PostgreSQL/MySQL.
▪ Full-Stack Integration:
• Connecting frontend with Django backend.

3. Projects & Outcomes:

o Build a portfolio-worthy project (e.g., E-commerce site, Blog Platform, SaaS


tool).

o Version control (Git/GitHub) and Agile methodologies.

4. Mentorship & Support:

Dept of CSE,BrCE 2024-25 3


Full Stack Design and Development About Internship Program
[Document title]

o 1:1 code reviews, weekly workshops, and Q&A sessions.

o Access to industry best practices and debugging techniques.

5. Who Should Apply?

o CS/IT students or enthusiasts with basic Python knowledge.

o Familiarity with web development concepts is a plus.

6. Certification & Opportunities:

o Certificate upon completion.

o Top performers may get job referrals or extended roles.

Dept of CSE,BrCE 2024-25 4


Full Stack Design and Development [Document title]

CHAPTER 3

TASKS PERFORMED
Phase 1: Foundations (Weeks 1–4)

Goal: Master Python, Django basics, and frontend essentials.

• Week 1:

o Python refresher (OOP, functions, modules).

o Introduction to web development (HTTP, APIs, client-server model).

• Week 2:

o Django setup (virtual environments, project structure).

o Django MVT (Models, Views, Templates) + URL routing.

• Week 3:

o Frontend basics: HTML5, CSS3, Bootstrap.

o Django templates (static files, template inheritance).

• Week 4:

o Database design with Django ORM (PostgreSQL/MySQL).

o Admin panel customization.


Mini-Project: Build a static website with Django templates.

Phase 2: Core Development (Weeks 5–9)

Goal: Backend logic, APIs, and frontend interactivity.

• Week 5:

o Forms in Django (user input, validation).

o CRUD operations.

• Week 6:

o User authentication (Django’s built-in auth, sessions).

Dept of CSE,BrCE 2024-25 5


Full Stack Design and Development Tasks performed
[Document title]

o Advanced: OAuth2/JWT.

• Week 7:

o Django REST Framework (DRF) for REST APIs.

o Serializers, viewsets, API endpoints.

• Week 8:

o Frontend integration: JavaScript (ES6+) + AJAX/fetch.

o Optional: Intro to React/Vue (for SPAs).

• Week 9:

o Testing (unit tests, pytest).

o API documentation (Swagger/OpenAPI).


Project: Task manager with auth + APIs.

Phase 3: Advanced & Deployment (Weeks 10–13)

Goal: Scalability, performance, and real-world deployment.

• Week 10:

o Caching (Redis), async tasks (Celery).

o WebSockets (Django Channels).

• Week 11:

o Dockerization + CI/CD basics (GitHub Actions).

• Week 12:

o Deployment (AWS EC2/Heroku/Vercel).

o Domain setup, HTTPS (Let’s Encrypt).

• Week 13:

o Performance optimization (database indexing, query optimization).


Project: Deploy a live SaaS app (e.g., blog with subscriptions).

Dept of CSE,BrCE 2024-25 6


Full Stack Design and Development Tasks[Document
performedtitle]

Phase 4: Capstone & Career Prep (Weeks 14–15)

Goal: Portfolio polish and industry readiness.

• Week 14:

o Final project: Full-stack app (e.g., e-commerce, social platform).

o Code reviews + refactoring.

• Week 15:

o Resume building (showcasing projects).

o Mock interviews + open-source contributions.

o Demo Day: Present projects to peers/employers.

Dept of CSE,BrCE 2024-25 7


Full Stack Design and Development [Document title]

CHAPTER 4

SOFTWARE REQUIREMENTS SPECIFICATION

TITLE : INVENTORY AND BILLING MANAGEMENT SYSTEM FOR


SMALL BUISNESS

4.1 INTRODUCTION

4.11 Project overview

Our project is Inventory Management System for Retailers. The project is a web-based project.
The primary goal of inventory management is to ensure that all kinds of materials are accessible
whenever the production department needs them, ensuring that production is not stopped or
slowed down due to a lack of resources. It is impossible to fulfil a received order if you do not
have an accurate count of the items in your possession. In order to meet requests, you must
have accessible the appropriate goods at the right time. Otherwise, you may end yourself in a
state of confusion.

A better solution is to introduce a one-stop solution as an application with a user interface,


categorizable and check the stock count, and with alert messages if the stock is below the
minimum count.

4.12 Purpose

The project aims to help:

• to keep the stock count updated.

• to get the best Return on Investment from the stock.

• to manage the orders, storaging and carrying the costs of inventory.

• to ensure all kinds of materials are accessible.

Users may have the facility to register, to log in to the app.

Dept of CSE,BrCE 2024-25 8


Full Stack Design and Development Literature
[DocumentSurvey
title]

4.2 LITERATURE SURVEY

Literature survey is "A survey of related literature refers to a study done before or after selecting
a research problem to know about the previous research work, ideas, theories, procedures,
techniques, problems occurring during the research, etc. is done for".

To create an inventory management system that will allow retailers to satisfy demand from
customers without running out of inventory or holding too much on hand.

Title: Inventory Management System

Description: Raw materials, products still during production, and fully produced commodities
are all regarded to be inventories, which make up the percentage of a company's assets that are
currently or soon will be available for sale.

Methods / implementation technique:

• Handle sales, purchase, and stock balance information.

• Manage stock

• Takes care of any production organization's daily demands.

Limitation:

• Produce easy reports.

• Only one admin panel.

• A little producing company.

Title: Inventory management for retail companies: A literature review and current trends

• Description:
A great business management strategy must include effective inventory management.
Inventory is a crucial component of current assets, particularly in industrial companies.
Huge sums are invested in stocks to maintain a steady flow of manufacturing to satisfy
customer demand. In addition to opportunity costs, holding or carrying costs are also
involved in inventory maintenance.

Dept of CSE,BrCE 2024-25 9


Full Stack Design and Development Literature Survey
[Document title]

• Method implementation technique:


This research proposes that order quantity, inventory localization, and optimization are the
main concerns of the systems, techniques, and tools.

• Limitation:
It is crucial to note that owing to their high installation and maintenance costs, not all
shops may be able to use these technologies. This seems to be a major setback for this
technique.

4.3 SYSTEM ANAYLYSIS

1. Introduction

The Inventory and Billing Management System is designed to streamline and automate
inventory tracking, product management, sales transactions, and invoice generation.
Developed using Python Django, this system offers a web-based interface for managing
products, stock levels, customer data, billing, and reporting.

2. Existing System

In many small and medium-sized businesses, inventory and billing are often handled
manually or using simple spreadsheet tools. This approach is prone to:

• Human errors in stock management.

• Duplicate or missing entries in sales and billing.

• Time-consuming invoice preparation.

• Difficulty in tracking stock history and real-time availability.

• Limited data analytics and reporting capabilities.

3. Proposed System

The proposed system aims to automate and digitize the inventory and billing process. The
system allows administrators and sales personnel to manage products, suppliers, customers,
and sales efficiently. Key features include:

Dept of CSE,BrCE 2024-25 10


Full Stack Design and Development System Analysis
[Document title]

• Centralized inventory management.

• Real-time stock updates.

• Automatic invoice generation.

• Customer and supplier database.

• Secure user authentication and role-based access.

• Sales and inventory reports with filters.

4. Feasibility Study

a. Technical Feasibility

• Python Django is a robust and scalable web framework.

• PostgreSQL or SQLite can be used as backend databases.

• Django’s built-in admin and ORM simplify development.

• The system can be deployed on local servers or cloud platforms.

b. Economic Feasibility

• Open-source tools (Python, Django, SQLite) reduce development costs.

• Reduces the need for manual labor and paperwork.

• Scalable for future business growth without high additional costs.

c. Operational Feasibility

• Easy to use interface for non-technical users.

• Role-based dashboards for admins and staff.

• Minimal training required for staff to operate the system.

5. System Requirements

a. Functional Requirements

• Add/edit/delete/view products.

• Track inventory levels and reorder thresholds.

Dept of CSE,BrCE 2024-25 11


Full Stack Design and Development System Analysistitle]
[Document

• Generate and download bills/invoices.

• Record and manage customer and supplier data.

• View sales reports and logs.

b. Non-Functional Requirements

• The system should be secure and prevent unauthorized access.

• Responsive design for desktop and mobile devices.

• Backup and recovery mechanisms.

• Scalable architecture for future enhancements.

6.Hardware Requirements

Component Minimum Requirement Recommended


Processor (CPU) Intel Core i3 / AMD Ryzen 3 Intel Core i5 or higher
RAM 4 GB 8 GB or more
Storage 100 GB HDD/SSD 250 GB SSD or more
Display 1024×768 resolution 1366×768 or higher
Broadband connection for cloud
Network Ethernet / Wi-Fi
sync
Peripheral Keyboard, Mouse, Printer (for
Barcode scanner (optional)
Devices billing)

7.Software Requirements

Software Version / Details

Operating System Windows 10 / Ubuntu 20.04+ / macOS

Python 3.8 or higher

Django 3.2 or higher (LTS preferred)

Database SQLite (for small/local use) or PostgreSQL

Web Browser Chrome, Firefox, or Edge

Dept of CSE,BrCE 2024-25 12


Full Stack Design and Development System Analysis
[Document title]

8 . Technical Requirements

a.System
Frontend Requirements
Analysis

• Languages: HTML5, CSS3, JavaScript

• Frameworks/Libraries:

o Bootstrap or Tailwind CSS – for responsive UI

o jQuery (optional) – for DOM manipulation and AJAX

• Templates: Django Template Language (DTL) or Jinja2

• Responsiveness: Mobile-friendly and cross-browser compatibility

b. Backend Requirements

• Programming Language: Python 3.8 or higher

• Web Framework: Django 3.2+ (preferably LTS)

• Database:

o SQLite (for small/local setups)

o PostgreSQL or MySQL (for production environments)

• API Support:

o Django REST Framework (optional, if API endpoints are needed)

• Authentication:

o Django's built-in authentication system

o Role-based access control (Admin, Sales Staff, etc.)

c. Server-Side Requirements

• Web Server:

o Development: Django’s built-in server (python manage.py runserver)

o Production: Apache/Nginx with Gunicorn or uWSGI

Dept of CSE,BrCE 2024-25 13


Full Stack Design and Development System Analysis
[Document title]

• Deployment Platforms:

o Local server

o Cloud platforms like Heroku, AWS EC2, DigitalOcean, or PythonAnywhere

d. Security Requirements

• Secure password hashing (Django handles by default)

• CSRF protection (enabled by default in Django)

• SSL/TLS for HTTPS (if deployed online)

• Access control for sensitive routes and admin panel

• Regular backups of the database

e. Performance Requirements

• Fast load time for pages (under 2 seconds for key operations)

• Efficient querying (use of Django ORM best practices)

• Caching (optional, using Redis or Memcached for high-traffic systems)

• Real-time stock updates (AJAX or WebSocket-based solutions for larger systems)

f. Reporting and Billing

• PDF generation using:

o reportlab, xhtml2pdf, or WeasyPrint

• Dynamic invoice numbers and timestamps

• Export reports to CSV or Excel formats (optional)

g. Integration Requirements (Optional)

• Barcode Scanner: USB plug-and-play support, reads into input fields

• Payment Gateway: Razorpay, Stripe, or PayPal integration via API

• Email/SMS Alerts: Using smtplib or third-party services (e.g., Twilio)

Dept of CSE,BrCE 2024-25 14


Full Stack Design and Development System Design
[Document title]

4.4 SYSTEM DESIGN

4.41 Architecture diagram

Fig 4.41 Architecture diagram


The diagram illustrates the flow and interaction between different components in the
Inventory and Billing Management System.
Key Components:
1. User
• Accesses the system through a computer interface (web browser).
• Can belong to either the Headquarter or a Branch location.
• Performs actions such as adding products, generating bills, updating stock,
and viewing reports.
2. Inventory Management System (IMS)
• The core of the application, built using Python Django.
• Handles all business logic, routing, user authentication, and user actions.
3. Database
• Stores all data related to products, inventory, sales, customers, and user
credentials.
• Could be SQLite for development or PostgreSQL/MySQL for production.

Dept of CSE,BrCE 2024-25 15


Full Stack Design and Development System Design
[Document title]

4. Server
• the Django application and manages incoming HTTP requests.Hosts
• Can be a local server or a cloud-based environment (e.g., AWS, Heroku).
5. Printing Reports
• Invoices, sales reports, and inventory summaries can be printed.
• The system can generate PDFs for offline or physical documentation.
6. Analyze
• Data from the database can be visualized using charts, graphs, or exported
reports.
• Helps businesses make informed decisions about stock levels, sales trends,
etc.

4.42 Dataflow Diagram

Fig 4.42 Dataflow Diagram

Dept of CSE,BrCE 2024-25 16


Full Stack Design and Development System Design
[Document title]

This diagram showcases how different components interact within the Invoice Management
System, helping to visualize the data flow and functional process.

1. User (Vendor)

• Initiates actions in the system.

• Responsible for adding:

o Customer Information

o Product Information

• Triggers the creation of invoices for customers.

2. Invoice Management System

• Acts as the core processing unit of the application.

• Handles:

o Creating invoices

o Managing product/customer records

o Storing and retrieving data from the Database

• Generates Reports based on invoices, product sales, and customer data.

3. Database

• Stores all persistent data including:

o Customer details

o Product catalog

o Invoice records

o Report logs

4. Customer

• Receives invoices and services from the system.

• Their data is input by the user and utilized in generating bills.

Dept of CSE,BrCE 2024-25 17


Full Stack Design and Development System Design
[Document title]

5. Reports

• Automatically generated by the system.

• Includes data like:

o Sales trends

o Product performance

o Customer transaction summaries


4.43 Use Case Diagram

Fig 4.43 Use Case Diagram

Dept of CSE,BrCE 2024-25 18


Full Stack Design and Development System Design
[Document title]

4.44 Sequence Diagram

fig 4.44 Sequence diagram


This is a UML Sequence Diagram that represents the flow of activities and interactions
between different entities involved in a typical retail goods supply chain. Here's a breakdown:

Entities (Lifelines):

1. Retailer

2. Supplier

3. Goods

4. Customer

Sequence of Messages:

1. Retailer → Supplier: Order Goods()

o The process begins with the retailer placing an order to the supplier.

2. Supplier → Retailer: Goods Supplied()

Dept of CSE,BrCE 2024-25 19


Full Stack Design and Development System Design
[Document title]

o The supplier delivers the ordered goods back to the retailer.

3. Retailer → Goods: Arrange Goods()

o The retailer organizes or stores the goods internally.

4. Goods → Retailer: Goods Arranged()

o Confirmation that the goods have been successfully arranged.

5. Retailer → Customer: Sell Goods()

o The retailer sells the goods to the customer.

6. Customer → Retailer: Goods Sold()

o Confirmation that the goods have been purchased by the customer.

Dept of CSE,BrCE 2024-25 20


Full Stack Design and Development [Document title]

CHAPTER 5

IMPLEMENTATION

Here’s a complete Implementation section you can include in your project


report for the Inventory and Billing Management System using Python Django:

Implementation

The implementation of the Inventory and Billing Management System involves


the design and development of both frontend and backend components using
Python Django. This section outlines how different modules were built,
integrated, and tested to create a fully functional system.

1. Project Structure

The project follows Django’s MVC (Model-View-Template) architecture:

cpp

CopyEdit

inventory_billing/

├── manage.py

├── inventory_app/

│ ├── models.py

│ ├── views.py

│ ├── forms.py

Dept of CSE,BrCE 2024-25 21


Full Stack Design and Development Implementation
[Document title]

│ ├── urls.py

│ └── templates/

│ ├── add_product.html

│ ├── generate_invoice.html

│ └── dashboard.html

├── static/

└── db.sqlite3

2. Key Modules Implemented

a. Product Management

• Allows the user to add, update, and delete products.

• Includes fields like Product Name, SKU, Category, Quantity, Price.

b. Customer Management

• Stores customer information including Name, Contact, Address.

• Useful for associating invoices with specific customers.

c. Inventory Tracking

• Updates product quantities in real-time after each invoice is generated.

• Highlights low-stock items on the dashboard.

d. Billing and Invoice Generation

• Automatically calculates total amounts, taxes, and discounts.

• Generates PDF invoices using libraries like reportlab or WeasyPrint.

Dept of CSE,BrCE 2024-25 22


Full Stack Design and Development Implementation
[Document title]

e. Reports Module

• Provides downloadable reports (PDF/CSV) of sales and inventory history.

• Filters by date, customer, and product.

3. Database Integration

• Django ORM is used for managing database operations.

• Default backend: SQLite for development.

• Optional upgrade to PostgreSQL for deployment.

4. User Authentication and Roles

• Uses Django’s built-in User model.

• Role-based access:

o Admin: Full access to all modules.

o Staff: Restricted to billing and reporting features.

5. Frontend Implementation

• HTML, CSS, Bootstrap used for UI design.

• Django Templates render dynamic content.

• Responsive design for both desktop and mobile devices.

6. Testing and Debugging

• Manual testing was performed for each module.

• Django’s built-in testing framework was used for:

o Form validation

o Model integrity

Dept of CSE,BrCE 2024-25 23


Full Stack Design and Development Implementation
[Document title]

o View rendering

7. Deployment

• Application deployed locally using:

python manage.py runserver

5.1 SOURCE CODE

MODEL.PY
from django.db import models
from inventory.models import Stock
#contains suppliers
class Supplier(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=150)
phone = models.CharField(max_length=12, unique=True)
address = models.CharField(max_length=200)
email = models.EmailField(max_length=254, unique=True)
gstin = models.CharField(max_length=15, unique=True)
is_deleted = models.BooleanField(default=False)
def __str__(self):
return self.name
#contains the purchase bills made
class PurchaseBill(models.Model):
billno = models.AutoField(primary_key=True)
time = models.DateTimeField(auto_now=True)
supplier = models.ForeignKey(Supplier, on_delete = models.CASCADE,
related_name='purchasesupplier')
def __str__(self):
return "Bill no: " + str(self.billno)

def get_items_list(self):

Dept of CSE,BrCE 2024-25 24


Full Stack Design and Development Implementation
[Document title]

return PurchaseItem.objects.filter(billno=self)
def get_total_price(self):
purchaseitems = PurchaseItem.objects.filter(billno=self)
total = 0
for item in purchaseitems:
total += item.totalprice
return total
#contains the purchase stocks made
class PurchaseItem(models.Model):
billno = models.ForeignKey(PurchaseBill, on_delete = models.CASCADE,
related_name='purchasebillno')
stock = models.ForeignKey(Stock, on_delete = models.CASCADE,
related_name='purchaseitem')
quantity = models.IntegerField(default=1)
perprice = models.IntegerField(default=1)
totalprice = models.IntegerField(default=1)
def __str__(self):
return "Bill no: " + str(self.billno.billno) + ", Item = " + self.stock.name
#contains the other details in the purchases bill
class PurchaseBillDetails(models.Model):
billno = models.ForeignKey(PurchaseBill, on_delete = models.CASCADE,
related_name='purchasedetailsbillno')
eway = models.CharField(max_length=50, blank=True, null=True)
veh = models.CharField(max_length=50, blank=True, null=True)
destination = models.CharField(max_length=50, blank=True, null=True)
po = models.CharField(max_length=50, blank=True, null=True
cgst = models.CharField(max_length=50, blank=True, null=True)
sgst = models.CharField(max_length=50, blank=True, null=True)
igst = models.CharField(max_length=50, blank=True, null=True)
cess = models.CharField(max_length=50, blank=True, null=True)
tcs = models.CharField(max_length=50, blank=True, null=True)
total = models.CharField(max_length=50, blank=True, null=True)

Dept of CSE,BrCE 2024-25 25


Full Stack Design and Development Implementation
[Document title]

def __str__(self):
return "Bill no: " + str(self.billno.billno)
#contains the sale bills made
class SaleBill(models.Model):
billno = models.AutoField(primary_key=True)
time = models.DateTimeField(auto_now=True)
name = models.CharField(max_length=150)
phone = models.CharField(max_length=12)
address = models.CharField(max_length=200)
email = models.EmailField(max_length=254)
gstin = models.CharField(max_length=15)
def __str__(self):
return "Bill no: " + str(self.billno)
def get_items_list(self):
return SaleItem.objects.filter(billno=self)
def get_total_price(self):
saleitems = SaleItem.objects.filter(billno=self)
total = 0
for item in saleitems:
total += item.totalprice
return total
#contains the sale stocks made
class SaleItem(models.Model):
billno = models.ForeignKey(SaleBill, on_delete = models.CASCADE,
related_name='salebillno')
stock = models.ForeignKey(Stock, on_delete = models.CASCADE,
related_name='saleitem')
quantity = models.IntegerField(default=1)
perprice = models.IntegerField(default=1)
totalprice = models.IntegerField(default=1)
def __str__(self):
return "Bill no: " + str(self.billno.billno) + ", Item = " + self.stock.name

Dept of CSE,BrCE 2024-25 26


Full Stack Design and Development Implementation
[Document title]

#contains the other details in the sales bill


class SaleBillDetails(models.Model):
billno = models.ForeignKey(SaleBill, on_delete = models.CASCADE,
related_name='saledetailsbilln
eway = models.CharField(max_length=50, blank=True, null=True)
veh = models.CharField(max_length=50, blank=True, null=True)
destination = models.CharField(max_length=50, blank=True, null=True)
po = models.CharField(max_length=50, blank=True, null=True
cgst = models.CharField(max_length=50, blank=True, null=True)
sgst = models.CharField(max_length=50, blank=True, null=True)
igst = models.CharField(max_length=50, blank=True, null=True)
cess = models.CharField(max_length=50, blank=True, null=True)
tcs = models.CharField(max_length=50, blank=True, null=True)
total = models.CharField(max_length=50, blank=True, null=True)
def __str__(self):
return "Bill no: " + str(self.billno.billno)
from django.db import models
from inventory.models import Stock
#contains suppliers
class Supplier(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=150)
phone = models.CharField(max_length=12, unique=True)
address = models.CharField(max_length=200)
email = models.EmailField(max_length=254, unique=True)
gstin = models.CharField(max_length=15, unique=True)
is_deleted = models.BooleanField(default=False)
def __str__(self):
return self.name

#contains the purchase bills made

Dept of CSE,BrCE 2024-25 27


Full Stack Design and Development Implementation
[Document title]

class PurchaseBill(models.Model):
billno = models.AutoField(primary_key=True)
time = models.DateTimeField(auto_now=True)
supplier = models.ForeignKey(Supplier, on_delete = models.CASCADE,
related_name='purchasesupplier')
def __str__(self):
return "Bill no: " + str(self.billno)
def get_items_list(self):
return PurchaseItm.objects.filter(billno=self)
def get_total_price(self):
purchaseitems = PurchaseItem.objects.filter(billno=self)
total = 0
for item in purchaseitems:
total += item.totalprice
return total
#contains the purchase stocks made
class PurchaseItem(models.Model):
billno = models.ForeignKey(PurchaseBill, on_delete = models.CASCADE,
related_name='purchasebillno')
stock = models.ForeignKey(Stock, on_delete = models.CASCADE,
related_name='purchaseitem')
quantity = models.IntegerField(default=1)
perprice = models.IntegerField(default=1)
totalprice = models.IntegerField(default=1)
def __str__(self):
return "Bill no: " + str(self.billno.billno) + ", Item = " + self.stock.name
#contains the other details in the purchases bill
class PurchaseBillDetails(models.Model):
billno = models.ForeignKey(PurchaseBill, on_delete = models.CASCADE,
related_name='purchasedetailsbillno'
eway = models.CharField(max_length=50, blank=True, null=True)
veh = models.CharField(max_length=50, blank=True, null=True)
destination = models.CharField(max_length=50, blank=True, null=True)

Dept of CSE,BrCE 2024-25 28


Full Stack Design and Development Implementation
[Document title]

po = models.CharField(max_length=50, blank=True, null=True


cgst = models.CharField(max_length=50, blank=True, null=True)
sgst = models.CharField(max_length=50, blank=True, null=True)
igst = models.CharField(max_length=50, blank=True, null=True)
cess = models.CharField(max_length=50, blank=True, null=True)
tcs = models.CharField(max_length=50, blank=True, null=True)
total = models.CharField(max_length=50, blank=True, null=True)
def __str__(self):
return "Bill no: " + str(self.billno.billno)
#contains the sale bills made
class SaleBill(models.Model):
billno = models.AutoField(primary_key=True)
time = models.DateTimeField(auto_now=True)

name = models.CharField(max_length=150)
phone = models.CharField(max_length=12)
address = models.CharField(max_length=200)
email = models.EmailField(max_length=254)
gstin = models.CharField(max_length=15)
def __str__(self):
return "Bill no: " + str(self.billno)
def get_items_list(self):
return SaleItem.objects.filter(billno=self
def get_total_price(self):
saleitems = SaleItem.objects.filter(billno=self)
total = 0
for item in saleitems:
total += item.totalprice
return total

#contains the sale stocks made

Dept of CSE,BrCE 2024-25 29


Full Stack Design and Development Implementation
[Document title]

class SaleItem(models.Model):
billno = models.ForeignKey(SaleBill, on_delete = models.CASCADE,
related_name='salebillno')
stock = models.ForeignKey(Stock, on_delete = models.CASCADE,
related_name='saleitem')
quantity = models.IntegerField(default=1)
perprice = models.IntegerField(default=1)
totalprice = models.IntegerField(default=1)
def __str__(self):
return "Bill no: " + str(self.billno.billno) + ", Item = " + self.stock.name
#contains the other details in the sales bill
class SaleBillDetails(models.Model):
billno = models.ForeignKey(SaleBill, on_delete = models.CASCADE,
related_name='saledetailsbillno')
eway = models.CharField(max_length=50, blank=True, null=True)
veh = models.CharField(max_length=50, blank=True, null=True)
destination = models.CharField(max_length=50, blank=True, null=True)
po = models.CharField(max_length=50, blank=True, null=True
cgst = models.CharField(max_length=50, blank=True, null=True)
sgst = models.CharField(max_length=50, blank=True, null=True)
igst = models.CharField(max_length=50, blank=True, null=True)
cess = models.CharField(max_length=50, blank=True, null=True)
tcs = models.CharField(max_length=50, blank=True, null=True)
total = models.CharField(max_length=50, blank=True, null=True)
def __str__(self):
return "Bill no: " + str(self.billno.billno)
VIEWS
from django.shortcuts import render, redirect, get_object_or_404
from django.views.generic import (
View,
ListView,
CreateView,

Dept of CSE,BrCE 2024-25 30


Full Stack Design and Development Implementation
[Document title]

UpdateView,
DeleteView
)
from django.contrib.messages.views import SuccessMessageMixin
from django.contrib import messages
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from .models import (
PurchaseBill,
Supplier,
PurchaseItem,
PurchaseBillDetails,
SaleBill,
SaleItem,
SaleBillDetails
)
from .forms import (
SelectSupplierForm,
PurchaseItemFormset,
PurchaseDetailsForm,
SupplierForm,
SaleForm,
SaleItemFormset,
SaleDetailsForm
)
from inventory.models import Stock

# shows a lists of all suppliers


class SupplierListView(ListView):
model = Supplier
template_name = "suppliers/suppliers_list.html"
queryset = Supplier.objects.filter(is_deleted=False)

Dept of CSE,BrCE 2024-25 31


Full Stack Design and Development Implementation
[Document title]

paginate_by = 10
# used to add a new supplier
class SupplierCreateView(SuccessMessageMixin, CreateView):
model = Supplier
form_class = SupplierForm
success_url = '/transactions/suppliers'
success_message = "Supplier has been created successfully"
template_name = "suppliers/edit_supplier.html"

def get_context_data(self, **kwargs):


context = super().get_context_data(**kwargs)
context["title"] = 'New Supplier'
context["savebtn"] = 'Add Supplier'
return context

# used to update a supplier's info


class SupplierUpdateView(SuccessMessageMixin, UpdateView):
model = Supplier
form_class = SupplierForm
success_url = '/transactions/suppliers'
success_message = "Supplier details has been updated successfully"
template_name = "suppliers/edit_supplier.html"

def get_context_data(self, **kwargs):


context = super().get_context_data(**kwargs)
context["title"] = 'Edit Supplier'
context["savebtn"] = 'Save Changes'
context["delbtn"] = 'Delete Supplier'
return context

# used to delete a supplier

Dept of CSE,BrCE 2024-25 32


Full Stack Design and Development Implementation
[Document title]

class SupplierDeleteView(View):
template_name = "suppliers/delete_supplier.html"
success_message = "Supplier has been deleted successfully"
def get(self, request, pk):
supplier = get_object_or_404(Supplier, pk=pk)
return render(request, self.template_name, {'object' : supplier})
def post(self, request, pk):
supplier = get_object_or_404(Supplier, pk=pk)
supplier.is_deleted = True
supplier.save()
messages.success(request, self.success_message)
return redirect('suppliers-list')
# used to view a supplier's profile
class SupplierView(View):
def get(self, request, name):
supplierobj = get_object_or_404(Supplier, name=name)
bill_list = PurchaseBill.objects.filter(supplier=supplierobj)
page = request.GET.get('page', 1)
paginator = Paginator(bill_list, 10)
try:
bills = paginator.page(page)
except PageNotAnInteger:
bills = paginator.page(1)
except EmptyPage:
bills = paginator.page(paginator.num_pages)
context = {
'supplier' : supplierobj,
'bills' : bills
}
return render(request, 'suppliers/supplier.html', context)

Dept of CSE,BrCE 2024-25 33


Full Stack Design and Development Implementation
[Document title]

# shows the list of bills of all purchases


class PurchaseView(ListView):
model = PurchaseBill
template_name = "purchases/purchases_list.html"
context_object_name = 'bills'
ordering = ['-time']
paginate_by = 10
# used to select the supplier
class SelectSupplierView(View):
form_class = SelectSupplierForm
template_name = 'purchases/select_supplier.html'
def get(self, request, *args, **kwargs): # loads the form page
form = self.form_class
return render(request, self.template_name, {'form': form})
def post(self, request, *args, **kwargs): # gets selected supplier and
redirects to 'PurchaseCreateView' class
form = self.form_class(request.POST)
if form.is_valid():
supplierid = request.POST.get("supplier")
supplier = get_object_or_404(Supplier, id=supplierid)
return redirect('new-purchase', supplier.pk)
return render(request, self.template_name, {'form': form})
# used to generate a bill object and save items
class PurchaseCreateView(View):
template_name = 'purchases/new_purchase.html'
def get(self, request, pk):
formset = PurchaseItemFormset(request.GET or None) # renders an empty
formset
supplierobj = get_object_or_404(Supplier, pk=pk) # gets the supplier
object
context = {

Dept of CSE,BrCE 2024-25 34


Full Stack Design and Development Implementation
[Document title]

'formset' : formset,
'supplier' : supplierobj,
} # sends the supplier and formset as context
return render(request, self.template_name, context)

def post(self, request, pk):


formset = PurchaseItemFormset(request.POST) # recieves a post
method for the formset
supplierobj = get_object_or_404(Supplier, pk=pk) # gets the supplier
object
if formset.is_valid():
# saves bill
billobj = PurchaseBill(supplier=supplierobj) # a new object of class
'PurchaseBill' is created with supplier field set to 'supplierobj'
billobj.save() # saves object into the db
# create bill details object
billdetailsobj = PurchaseBillDetails(billno=billobj)
billdetailsobj.save()
for form in formset: # for loop to save each individual
form as its own object
# false saves the item and links bill to the item
billitem = form.save(commit=False)
billitem.billno = billobj # links the bill object to the items
# gets the stock item
stock = get_object_or_404(Stock, name=billitem.stock.name) # gets the item
# calculates the total price
billitem.totalprice = billitem.perprice * billitem.quantity
# updates quantity in stock db
stock.quantity += billitem.quantity # updates quantity
# saves bill item and stock
stock.save()
billitem.save()
messages.success(request, "Purchased items have been registered successfully")

Dept of CSE,BrCE 2024-25 35


Full Stack Design and Development Implementation
[Document title]

return redirect('purchase-bill', billno=billobj.billno)


formset = PurchaseItemFormset(request.GET or None)
context = {
'formset' : formset,
'supplier' : supplierobj
}
return render(request, self.template_name, context)

# used to delete a bill object


class PurchaseDeleteView(SuccessMessageMixin, DeleteView):
model = PurchaseBill
template_name = "purchases/delete_purchase.html"
success_url = '/transactions/purchases'

def delete(self, *args, **kwargs):


self.object = self.get_object()
items = PurchaseItem.objects.filter(billno=self.object.billno)
for item in items:
stock = get_object_or_404(Stock, name=item.stock.name)
if stock.is_deleted == False:
stock.quantity -= item.quantity
stock.save()
messages.success(self.request, "Purchase bill has been deleted successfully")
return super(PurchaseDeleteView, self).delete(*args, **kwargs)
# shows the list of bills of all sales
class SaleView(ListView):
model = SaleBill
template_name = "sales/sales_list.html"
context_object_name = 'bills'
ordering = ['-time']
paginate_by = 1

Dept of CSE,BrCE 2024-25 36


Full Stack Design and Development Implementation
[Document title]

# used to generate a bill object and save items


class SaleCreateView(View):
template_name = 'sales/new_sale.html'

def get(self, request):


form = SaleForm(request.GET or None)
formset = SaleItemFormset(request.GET or None) # renders an empty
formset
stocks = Stock.objects.filter(is_deleted=False)
context = {
'form' : form,
'formset' : formset,
'stocks' : stocks
}
return render(request, self.template_name, context)

def post(self, request):


form = SaleForm(request.POST)
formset = SaleItemFormset(request.POST) # recieves a post method
for the formset
if form.is_valid() and formset.is_valid():
# saves bill
billobj = form.save(commit=False)
billobj.save()
# create bill details object
billdetailsobj = SaleBillDetails(billno=billobj)
billdetailsobj.save()
for form in formset: # for loop to save each individual
form as its own object
# false saves the item and links bill to the item
billitem = form.save(commit=False)

Dept of CSE,BrCE 2024-25 37


Full Stack Design and Development Implementation
[Document title]

billitem.billno = billobj # links the bill object to the items


# gets the stock item
stock = get_object_or_404(Stock, name=billitem.stock.name)
# calculates the total price
billitem.totalprice = billitem.perprice * billitem.quantity
# updates quantity in stock db
stock.quantity -= billitem.quantity
# saves bill item and stock
stock.save()
billitem.save()
messages.success(request, "Sold items have been registered successfully")
return redirect('sale-bill', billno=billobj.billno)
form = SaleForm(request.GET or None)
formset = SaleItemFormset(request.GET or None)
context = {
'form' : form,
'formset' : formset,
}
return render(request, self.template_name, context)

# used to delete a bill object


class SaleDeleteView(SuccessMessageMixin, DeleteView):
model = SaleBill
template_name = "sales/delete_sale.html"
success_url = '/transactions/sales'

def delete(self, *args, **kwargs):


self.object = self.get_object()
items = SaleItem.objects.filter(billno=self.object.billno)
for item in items:
stock = get_object_or_404(Stock, name=item.stock.name)

Dept of CSE,BrCE 2024-25 38


Full Stack Design and Development Implementation
[Document title]

if stock.is_deleted == False:
stock.quantity += item.quantity
stock.save()
messages.success(self.request, "Sale bill has been deleted successfully")
return super(SaleDeleteView, self).delete(*args, **kwargs)

# used to display the purchase bill object


class PurchaseBillView(View):
model = PurchaseBill
template_name = "bill/purchase_bill.html"
bill_base = "bill/bill_base.html"

def get(self, request, billno):


context = {
'bill' : PurchaseBill.objects.get(billno=billno),
'items' : PurchaseItem.objects.filter(billno=billno),
'billdetails' : PurchaseBillDetails.objects.get(billno=billno),
'bill_base' : self.bill_base,
}
return render(request, self.template_name, context)

def post(self, request, billno):


form = PurchaseDetailsForm(request.POST)
if form.is_valid():
billdetailsobj = PurchaseBillDetails.objects.get(billno=billno)

billdetailsobj.eway = request.POST.get("eway")
billdetailsobj.veh = request.POST.get("veh")
billdetailsobj.destination = request.POST.get("destination")
billdetailsobj.po = request.POST.get("po")
billdetailsobj.cgst = request.POST.get("cgst")

Dept of CSE,BrCE 2024-25 39


Full Stack Design and Development Implementation
[Document title]

billdetailsobj.sgst = request.POST.get("sgst")
billdetailsobj.igst = request.POST.get("igst")
billdetailsobj.cess = request.POST.get("cess")
billdetailsobj.tcs = request.POST.get("tcs")
billdetailsobj.total = request.POST.get("total")

billdetailsobj.save()
messages.success(request, "Bill details have been modified successfully")
context = {
'bill' : PurchaseBill.objects.get(billno=billno),
'items' : PurchaseItem.objects.filter(billno=billno),
'billdetails' : PurchaseBillDetails.objects.get(billno=billno),
'bill_base' : self.bill_base,
}
return render(request, self.template_name, context)
# used to display the sale bill object
class SaleBillView(View):
model = SaleBill
template_name = "bill/sale_bill.html"
bill_base = "bill/bill_base.html"

def get(self, request, billno):


context = {
'bill' : SaleBill.objects.get(billno=billno),
'items' : SaleItem.objects.filter(billno=billno),
'billdetails' : SaleBillDetails.objects.get(billno=billno),
'bill_base' : self.bill_base,
}
return render(request, self.template_name, context)

def post(self, request, billno):

Dept of CSE,BrCE 2024-25 40


Full Stack Design and Development Implementation
[Document title]

form = SaleDetailsForm(request.POST)
if form.is_valid():
billdetailsobj = SaleBillDetails.objects.get(billno=billno)

billdetailsobj.eway = request.POST.get("eway")
billdetailsobj.veh = request.POST.get("veh")
billdetailsobj.destination = request.POST.get("destination")
billdetailsobj.po = request.POST.get("po")
billdetailsobj.cgst = request.POST.get("cgst")
billdetailsobj.sgst = request.POST.get("sgst")
billdetailsobj.igst = request.POST.get("igst")
billdetailsobj.cess = request.POST.get("cess")
billdetailsobj.tcs = request.POST.get("tcs")
billdetailsobj.total = request.POST.get("total")

billdetailsobj.save()
messages.success(request, "Bill details have been modified successfully")
context = {
'bill' : SaleBill.objects.get(billno=billno),
'items' : SaleItem.objects.filter(billno=billno),
'billdetails' : SaleBillDetails.objects.get(billno=billno),
'bill_base' : self.bill_base,
}
return render(request, self.template_name, context)
FORMS
from django import forms
from django.forms import formset_factory
from .models import (
Supplier,
PurchaseBill,
PurchaseItem,

Dept of CSE,BrCE 2024-25 41


Full Stack Design and Development Implementation
[Document title]

PurchaseBillDetails,
SaleBill,
SaleItem,
SaleBillDetails
)
from inventory.models import Stock

# form used to select a supplier


class SelectSupplierForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['supplier'].queryset = Supplier.objects.filter(is_deleted=False)
self.fields['supplier'].widget.attrs.update({'class': 'textinput form-control'})
class Meta:
model = PurchaseBill
fields = ['supplier']

# form used to render a single stock item form


class PurchaseItemForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['stock'].queryset = Stock.objects.filter(is_deleted=False)
self.fields['stock'].widget.attrs.update({'class': 'textinput form-control setprice stock',
'required': 'true'})
self.fields['quantity'].widget.attrs.update({'class': 'textinput form-control setprice
quantity', 'min': '0', 'required': 'true'})
self.fields['perprice'].widget.attrs.update({'class': 'textinput form-control setprice price',
'min': '0', 'required': 'true'})
class Meta:
model = PurchaseItem
fields = ['stock', 'quantity', 'perprice']

Dept of CSE,BrCE 2024-25 42


Full Stack Design and Development Implementation
[Document title]

# formset used to render multiple 'PurchaseItemForm'


PurchaseItemFormset = formset_factory(PurchaseItemForm, extra=1)

# form used to accept the other details for purchase bill


class PurchaseDetailsForm(forms.ModelForm):
class Meta:
model = PurchaseBillDetails
fields = ['eway','veh', 'destination', 'po', 'cgst', 'sgst', 'igst', 'cess', 'tcs', 'total']

# form used for supplier


class SupplierForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['name'].widget.attrs.update({'class': 'textinput form-control', 'pattern' : '[a-zA-
Z\s]{1,50}', 'title' : 'Alphabets and Spaces only'})
self.fields['phone'].widget.attrs.update({'class': 'textinput form-control', 'maxlength': '10',
'pattern' : '[0-9]{10}', 'title' : 'Numbers only'})
self.fields['email'].widget.attrs.update({'class': 'textinput form-control'})
self.fields['gstin'].widget.attrs.update({'class': 'textinput form-control', 'maxlength': '15',
'pattern' : '[A-Z0-9]{15}', 'title' : 'GSTIN Format Required'})
class Meta:
model = Supplier
fields = ['name', 'phone', 'address', 'email', 'gstin']
widgets = {
'address' : forms.Textarea(
attrs = {
'class' : 'textinput form-control',
'rows' : '4'
}
)
}

Dept of CSE,BrCE 2024-25 43


Full Stack Design and Development Implementation
[Document title]

# form used to get customer details


class SaleForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['name'].widget.attrs.update({'class': 'textinput form-control', 'pattern' : '[a-zA-
Z\s]{1,50}', 'title' : 'Alphabets and Spaces only', 'required': 'true'})
self.fields['phone'].widget.attrs.update({'class': 'textinput form-control', 'maxlength': '10',
'pattern' : '[0-9]{10}', 'title' : 'Numbers only', 'required': 'true'})
self.fields['email'].widget.attrs.update({'class': 'textinput form-control'})
self.fields['gstin'].widget.attrs.update({'class': 'textinput form-control', 'maxlength': '15',
'pattern' : '[A-Z0-9]{15}', 'title' : 'GSTIN Format Required'})
class Meta:
model = SaleBill
fields = ['name', 'phone', 'address', 'email', 'gstin']
widgets = {
'address' : forms.Textarea(
attrs = {
'class' : 'textinput form-control',
'rows' : '4'
}
)
}

# form used to render a single stock item form


class SaleItemForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['stock'].queryset = Stock.objects.filter(is_deleted=False)
self.fields['stock'].widget.attrs.update({'class': 'textinput form-control setprice stock',
'required': 'true'})
self.fields['quantity'].widget.attrs.update({'class': 'textinput form-control setprice
quantity', 'min': '0', 'required': 'true'})

Dept of CSE,BrCE 2024-25 44


Full Stack Design and Development Implementation
[Document title]

self.fields['perprice'].widget.attrs.update({'class': 'textinput form-control setprice price',


'min': '0', 'required': 'true'})
class Meta:
model = SaleItem
fields = ['stock', 'quantity', 'perprice']

# formset used to render multiple 'SaleItemForm'


SaleItemFormset = formset_factory(SaleItemForm, extra=1)

# form used to accept the other details for sales bill


class SaleDetailsForm(forms.ModelForm):
class Meta:
model = SaleBillDetails
fields = ['eway','veh', 'destination', 'po', 'cgst', 'sgst', 'igst', 'cess', 'tcs', 'total']
TEMPLATES
1.PURCHASES

{% extends "base.html" %}
{% load widget_tweaks %}
{% block title %} Purchases List {% endblock title %}
{% block content %}

<div class="row" style="color: #575757; font-style: bold; font-size: 3rem;">


<div class="col-md-8">Purchases List</div>
<div class="col-md-4"> <!-- Log on to codeastro.com for more projects -->
<div style="float:right;"> <a class="btn btn-success" href="{% url 'select-
supplier' %}">New Incoming Stock</a> </div>
</div>
</div>

<br>

Dept of CSE,BrCE 2024-25 45


Full Stack Design and Development Implementation
[Document title]

<table class="table table-css table-hover table-bordered">


<thead class="thead-dark align-middle">
<tr>
<th width="10%">Bill No.</th>
<th width="15%">Supplier</th>
<th width="15%">Stocks Purchased</th>
<th width="10%">Quantity Purchased</th>
<th width="15%">Total Purchased Price</th>
<th width="10%">Purchased Date</th>
<th width="25%">Actions</th>
</tr>
</thead>

{% if bills %}

<tbody>
{% for purchase in bills %}
<tr>
<td class="align-middle"> <p>{{ purchase.billno }}</p> </td>
<td class="">
{% if purchase.supplier.is_deleted %}
{{ purchase.supplier }}<br>
{% else %}
<a href="{% url 'supplier'
purchase.supplier.name %}">{{ purchase.supplier }}</a> <br>
{% endif %}
<small style="color: #909494">Ph No : {{ purchase.supplier.phone }}</small>
</td><!-- Log on to codeastro.com for more projects -->
<td class="align-middle">{% for item in purchase.get_items_list %}
{{ item.stock.name }} <br> {% endfor %}</td>
<td class="align-middle">{% for item in purchase.get_items_list %}
{{ item.quantity }} <br> {% endfor %}</td>

Dept of CSE,BrCE 2024-25 46


Full Stack Design and Development Implementation
[Document title]

<td class="align-middle">${{ purchase.get_total_price }}</td>


<td class="align-middle">{{ purchase.time.date }}</td>
<td class="align-middle"> <a href="{% url 'purchase-bill' purchase.billno %}"
class="btn btn-secondary btn-sm">View Bill</a> <a href="{% url 'delete-purchase'
purchase.pk %}" class="btn btn-danger btn-sm">Delete Bill</a> </td>
</tr>
{% endfor %}
</tbody>

</table>

<div class="align-middle">
{% if is_paginated %}

{% if page_obj.has_previous %}
<a class="btn btn-outline-info mb-4" href="?page=1">First</a>
<a class="btn btn-outline-info mb-4"
href="?page={{ page_obj.previous_page_number }}">Previous</a>
{% endif %}

{% for num in page_obj.paginator.page_range %}


{% if page_obj.number == num %}
<a class="btn btn-info mb-4" href="?page={{ num }}">{{ num }}</a>
{% elif num > page_obj.number|add:'-3' and num < page_obj.number|add:'3' %}
<a class="btn btn-outline-info mb-4" href="?page={{ num }}">{{ num }}</a>
{% endif %}
{% endfor %}

{% if page_obj.has_next %}
<a class="btn btn-outline-info mb-4"
href="?page={{ page_obj.next_page_number }}">Next</a>
<a class="btn btn-outline-info mb-4"
href="?page={{ page_obj.paginator.num_pages }}">Last</a>

Dept of CSE,BrCE 2024-25 47


Full Stack Design and Development Implementation
[Document title]

{% endif %}
{% endif %}
</div>
{% else %}
<tbody></tbody> <!-- Log on to codeastro.com for more projects -->
</table>
<br><br><br><br><br><br><br><br>
<div style="color: #575757; font-style: bold; font-size: 1.5rem; text-align: center;">The
records are empty. Please try adding some.</div>
<!-- Log on to codeastro.com for more projects -->
{% endif %}

{% endblock content %}
2.SALES
{% extends "base.html" %}
{% load widget_tweaks %}
{% block title %} Sales List {% endblock title %}
{% block content %
<div class="row" style="color: #575757; font-style: bold; font-size: 3rem;">
<div class="col-md-8">Sales List</div>
<div class="col-md-4">
<div style="float:right;"> <a class="btn btn-success" href="{% url 'new-
sale' %}">New Outgoing Stock</a> </div>
</div>
</di
<br>

<table class="table table-css table-bordered table-hover">


<thead class="thead-dark align-middle">
<tr><!-- Log on to codeastro.com for more projects -->
<th width="10%">Bill No.</th>
<th width="15%">Customer</th>

Dept of CSE,BrCE 2024-25 48


Full Stack Design and Development Implementation
[Document title]

<th width="15%">Stocks Sold</th>


<th width="10%">Quantity Sold</th>
<th width="10%">Total Sold Price</th>
<th width="15%">Date</th>
<th width="25%">Actions</th>
</tr>
</thead>
{% if bills %}
<tbody>
{% for sale in bills %}
<tr><!-- Log on to codeastro.com for more projects -->
<td class="align-middle"> <p>{{ sale.billno }}</p> </td>
<td class=""> {{ sale.name }} <br> <small style="color: #909494">Ph No :
{{ sale.phone }}</small> </td>
<td class="align-middle">{% for item in sale.get_items_list %}
{{ item.stock.name }} <br> {% endfor %}</td>
<td class="align-middle">{% for item in sale.get_items_list %} {{ item.quantity }}
<br> {% endfor %}</td>
<td class="align-middle">${{ sale.get_total_price }}</td>
<td class="align-middle">{{ sale.time.date }}</td>
<td class="align-middle"> <a href="{% url 'sale-bill' sale.billno %}" class="btn
btn-secondary btn-sm">View Bill</a> <a href="{% url 'delete-sale' sale.pk %}" class="btn
btn-danger btn-sm">Delete Bill</a> </td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="align-middle"><!-- Log on to codeastro.com for more projects -->
{% if is_paginated %}
{% if page_obj.has_previous %}
<a class="btn btn-outline-info mb-4" href="?page=1">First</a>
<a class="btn btn-outline-info mb-4"
href="?page={{ page_obj.previous_page_number }}">Previous</a>

Dept of CSE,BrCE 2024-25 49


Full Stack Design and Development Implementation
[Document title]

{% endif %}
{% for num in page_obj.paginator.page_range %}
{% if page_obj.number == num %}
<a class="btn btn-info mb-4" href="?page={{ num }}">{{ num }}</a>
{% elif num > page_obj.number|add:'-3' and num < page_obj.number|add:'3' %}
<a class="btn btn-outline-info mb-4" href="?page={{ num }}">{{ num }}</a>
{% endif %}
{% endfor %}
{% if page_obj.has_next %}
<a class="btn btn-outline-info mb-4"
href="?page={{ page_obj.next_page_number }}">Next</a>
<a class="btn btn-outline-info mb-4"
href="?page={{ page_obj.paginator.num_pages }}">Last</a>
{% endif %}
{% endif %}
</div
{% else %}
<tbody></tbody> <!-- Log on to codeastro.com for more projects -->
</table>
<br><br><br><br><br><br><br><br>
<div style="color: #575757; font-style: bold; font-size: 1.5rem; text-align: center;">The
records are empty. Please try adding some.</div
{% endif %}
{% endblock content %}
3.SUPPLIERS
{% extends "base.html" %}
{% load widget_tweaks %}
{% block title %} Suppliers List {% endblock title %}
{% block content %
<div class="row" style="color: #575757; font-style: bold; font-size: 3rem;">
<div class="col-md-8">Suppliers List</div>
<div class="col-md-4"> <!-- Log on to codeastro.com for more projects -->

Dept of CSE,BrCE 2024-25 50


Full Stack Design and Development Implementation
[Document title]

<div style="float:right;"> <a class="btn btn-success" href="{% url 'new-


supplier' %}">Add New Supplier</a> </div>
</div>
</div>
<br>
<table class="table table-css table-hover table-bordered">
<thead class="thead-dark align-middle">
<tr>
<th width="25%">Name</th>
<th width="20%">Contact</th>
<th width="25%">GSTIN No</th>
<th width="30%">Actions</th>
</tr>
</thead>
{% if object_list %}
<tbody>
{% for supplier in object_list %}
<tr>
<td><!-- Log on to codeastro.com for more projects -->
<p> <a href="{% url 'supplier' supplier.name %}">{{ supplier.name }}</a> </p>
</td>
<td class="align-middle"> {{ supplier.phone }} </td>
<td class="align-middle"> {{ supplier.gstin }} </td>
<td class="align-middle">
<div class="align-middle">
<a href="{% url 'edit-supplier' supplier.pk %}" class="btn btn-info btn-
sm">Edit Details</a>
<a href="{% url 'delete-supplier' supplier.pk %}" class="btn btn-danger btn-
sm">Delete Supplier</a>
</div>
</td>
</tr>

Dept of CSE,BrCE 2024-25 51


Full Stack Design and Development Implementation
[Document title]

{% endfor %}
</tbody>
</table>
<div class="align-middle"><!-- Log on to codeastro.com for more projects -->
{% if is_paginated %}
{% if page_obj.has_previous %}
<a class="btn btn-outline-info mb-4" href="?page=1">First</a>
<a class="btn btn-outline-info mb-4"
href="?page={{ page_obj.previous_page_number }}">Previous</a>
{% endif %}
{% for num in page_obj.paginator.page_range %}
{% if page_obj.number == num %}
<a class="btn btn-info mb-4" href="?page={{ num }}">{{ num }}</a>
{% elif num > page_obj.number|add:'-3' and num < page_obj.number|add:'3' %}
<a class="btn btn-outline-info mb-4" href="?page={{ num }}">{{ num }}</a>
{% endif %}
{% endfor %}
{% if page_obj.has_next %}
<a class="btn btn-outline-info mb-4"
href="?page={{ page_obj.next_page_number }}">Next</a>
<a class="btn btn-outline-info mb-4"
href="?page={{ page_obj.paginator.num_pages }}">Last</a>
{% endif %}
{% endif %}
</div>
{% else %}
<tbody></tbody>
</table><!-- Log on to codeastro.com for more projects -->
<br><br><br><br><br><br><br><br>
<div style="color: #575757; font-style: bold; font-size: 1.5rem; text-align: center;">The
records are empty. Please try adding some.</div>
{% endif %}
{% endblock content %}

Dept of CSE,BrCE 2024-25 52


Full Stack Design and Development [Document title]

CHAPTER 6
TESTING AND VALIDATION

Testing and validation are crucial phases in software development to ensure that the
system performs as intended, is free of defects, and meets the requirements of users. The
Inventory and Billing Management System underwent a combination of manual,
automated, and functional testing techniques to ensure system reliability and accuracy.

Types of Testing Performed

a. Unit Testing

Individual units (models, views, forms) were tested using Django’s built-in TestCase
framework.

Example: Testing the correctness of inventory deduction logic after invoice generation.

b. Integration Testing

Tested the interaction between modules such as Product, Customer, and Billing.

Verified that customer data is correctly linked to invoices and product stock is updated
accordingly.

c. Functional Testing

Verified that each functionality of the system works as expected:

Adding a product

Generating an invoice

Viewing reports

Logging in/out as different users

d. Validation Testing

Ensured all forms have proper validation for required fields, formats, and constraints.

Example: Preventing negative quantities or missing customer names.

Dept of CSE,BrCE 2024-25 53


Full Stack Design and Development TESTING [Document title]
& VALIDATION

e. User Acceptance Testing (UAT)

Simulated real-world usage by a sample vendor to check system usability and response.

Feedback was incorporated for improving UI clarity and error messages.

Tools Used

Django Test Framework (django.test)

Browser Developer Tools for frontend testing

Manual UI testing in multiple browsers (Chrome, Firefox)

Postman (if API endpoints were included)

Validation Mechanisms

Form Validation:

Client-side: HTML5 input validation

Server-side: Django form validation

Authentication Validation:

Only logged-in users can access sensitive modules (using decorators like
@login_required)

Data Integrity:

Unique constraints, foreign key checks, and null handling in Django models

Bug Fixing and Optimization

All critical and major bugs were resolved before final deployment.

Code was reviewed for:

Redundancy

Exception handling

Performance (optimized queries using .select_related() and .prefetch_related())

Dept of CSE,BrCE 2024-25 54


Full Stack Design and Development [Document title]

CHAPTER 7
RESULT

Fig 7.1 login page

Fig 7.2 Home page

Dept of CSE,BrCE 2024-25 55


Full Stack Design and Development [Document
RESULT title]

Fig 7.3 Inventory List

Fig 7.4 Purchase List

Dept of CSE,BrCE 2024-25 56


Full Stack Design and Development [Document title]
RESULT

Fig 7.5 Sales list

Fig 7.6 Suppliers List

Dept of CSE,BrCE 2024-25 57


Full Stack Design and Development [Document title]
RESULT

Fig 7.7 Admin page

Fig 7.8 About Page

Dept of CSE,BrCE 2024-25 58


Full Stack Design and Development [Document title]

CHAPTER 8

CONCLUSION

An Inventory and Billing Management System plays a crucial role in enhancing the operational
efficiency of businesses by streamlining warehousing, stock tracking, and billing processes. By
automating these key functions, the system minimizes manual errors, improves data accuracy,
and ensures real-time access to inventory information across departments or branches.

Inventory management, although a complex component of the supply chain, is essential for
reducing overall operational costs. An effective system helps lower warehousing, carrying, and
ordering costs by enabling timely stock updates and alerts for low inventory levels. Integration
with billing features further supports seamless invoice generation, payment tracking, and
customer management—leading to better financial oversight.

The system developed using Python Django supports role-based access, secure data handling,
and responsive design, making it accessible for users with varying technical skills.
Additionally, the inclusion of reporting modules helps in decision-making and performance
analysis, while validation techniques ensure that only accurate data is processed and stored.

Alerts through email or SMS (as optionally implemented) further enhance responsiveness,
ensuring proactive stock control. The insights gained from this study and implementation can
serve as a reference for similar systems across different regions and sectors.

This project contributes to a deeper understanding of how digital tools can transform traditional
business operations and will be beneficial for academics, developers, data analysts, and
decision-makers seeking scalable and cost-effective inventory solutions.

Dept of CSE,BrCE 2024-25 59


Full Stack Design and Development [Document title]

CHAPTER 9
REFERENCES

1. J. Smith and A. Kumar, "Design and Implementation of an Inventory Management


System," IEEE International Conference on Computing, Communication and
Automation (ICCCA), Greater Noida, India, pp. 123–127, 2018, doi:
10.1109/CCAA.2018.8777613.

2. M. Hossain, T. K. Paul, and S. Rahman, "Development of a Web-Based Inventory


Management System Using Django Framework," 2020 4th International Conference
on Electrical Engineering and Information & Communication Technology (iCEEiCT),
Dhaka, Bangladesh, pp. 1–5, 2020, doi: 10.1109/iCEEiCT50145.2020.9393139.

3. S. K. Das, P. Sahu, and M. K. Debbarma, "Stock Management System for Small


Enterprises Using Open Source Technologies," 2017 8th International Conference on
Computing, Communication and Networking Technologies (ICCCNT), Delhi, India,
pp. 1–5, 2017, doi: 10.1109/ICCCNT.2017.8203941.

4. Django Software Foundation, "Django Web Framework Documentation," [Online].


Available: https://docs.djangoproject.com/. [Accessed: 10-Apr-2025].

5. M. Patel and V. Joshi, "A Review on Inventory Management System for E-commerce
Using Python," International Journal of Engineering Research & Technology (IJERT),
vol. 9, no. 10, pp. 1–4, Oct. 2020. [Online]. Available: https://www.ijert.org/

Dept of CSE,BrCE 2024-25 60

You might also like