This is a Seller Management Systeme that contains many features that allow the seller track his revenue and expenses And register his products with the price and the margin, and register all of this information in a database that Allow to Create Read Update Delete all the information to manage his selling and expense.
- in this project we create a class that deals with all the thing necessary to make a CRUD application (Create, Read, Update and Delete),
we use a few libraries in this project that help facilities and not reinventing the Wheel in a manner of speaking like:
sqlite3
Allows accessing the database using a nonstandard variant of the SQL query language.datetime
That helps get the date and time in any format we want and also make it easy to handle the manipulation in time or date.panda
That helps transform a SQL query to a CSV file in more efficient an easy way.getpass
A library that helps to hide the password when the user want to login or sginup.werkzeug
A library that helps encrypt the password.jinja2
that helpe create html pages andweasyprint
To convert that html page into a pdf file.tabulate
that print tables
This class initially creates a database in a cyclist and have a method to connect to that database and to execute query, We create all the table necessary for this project using SQL query for example:
''' CREATE TABLE IF NOT EXISTS users(
id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE NOT NULL,
username VARCHAR NOT NULL,
password VARCHAR NOT NULL,
type_user VARCHAR) '''
this query creates a table for the users, with that every user has an id, username, password and the type of user
After adding some products you can see them in a form of a table in a terminal window like this.
adding a bill is very easy all you have to to is enter the client name and the product he buys and the amount of that product and after that the class print the bill in the form of 2 tables in the terminal window like this
any selling management system must have a way to enter the income and the expenses and like the bill when you enter the expenses you can see it in a form of table in the terminal window like this
after adding an expense or a bill the program calculates automatically the total expenses and the total income and the total differences and the total number of products and of course print them in a form of a table like this
you can save 3 CSV files of the income and expenses and the total of any day and every day registered in the database
you can also save the last bill to a pdf file like this
to run this project, first you need to install all the requirements using
pip install -r requirements.txt
and then use one of this command
To get help with this project you just type help, that will show you all the command line allowed in this project.
To create a new user with a username and password, a password that is hashed that no one can use your password even if he have access to the database.
To login to your account and register every transaction with your username, it makes you login for 3 hours and automatically logout.
to logout.
this command creates all the necessary table in the database.
this command will add a product name and the price, the margin of this product and if you want, you can add a description for this product
This command will create a new bill for a client all you have to do is to enter the name of the client and the id of the product he buys the number of his products, after that if he buys another product just type yes and continue entering what he buy.
after choosing the bill that you want to update re enter the new products and the bill will be updated
this command will delete the bill from the general bill and detail bill tables
this command will add a new experience to the database you can add the type of the experiences and if it is for some one you can add his name and the amount of this expense
after choosing the expenses that you want to update reenter the data that will be updated
this command will delete the expenses from expenses tables
this command will print a table in the terminal window with the total revenue and total expenses and the difference, if you want to print the hole table add 'all' to like this "python project.py print_total_jr all"
This command will create a pdf file and an html file for the last bill you created.
this command will create a 3 csv file from the tables 'general bill', 'expenses', 'total'
- If you want to create a CSV file for only a specific day add the date in a format " %Y-%m-%d ".
Thanks for all people make CS50โs Introduction to Programming with Python possible. Especially, David J. Malan and his team for making this awesome course