Invoice Generator System in Python

Invoice Generator System in Python

This completely free application is an Invoice Generator System in Python, its implementation is quite simple and practical, it could be used to implement it in a more complex system, with Django.

This software developed in Python includes a database in SQLITE3, from where the data of the products and the data of who makes the sale are provided.

In this software you make the choice of the product, the system takes you to a simple form where you enter the customer information and the amount with which you are going to make the payment. After this you give send and a table appears with the information of the invoice.

In the invoice section there is a button that says generate PDF, in this way the invoice is printed. This software is easy to parameterize from SQLITE3, the following is the structure of the database:

CREATE TABLE IF NOT EXISTS "django_migrations" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "app" varchar(255) NOT NULL, "name" varchar(255) NOT NULL, 
"applied" datetime NOT NULL);
CREATE TABLE sqlite_sequence(name,seq);
CREATE TABLE IF NOT EXISTS "auth_group_permissions" 
("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "group_id" integer NOT NULL REFERENCES "auth_group" ("id") DEFERRABLE INITIALLY DEFERRED, "permission_id" 
integer NOT NULL REFERENCES "auth_permission" ("id") DEFERRABLE INITIALLY DEFERRED);
CREATE TABLE IF NOT EXISTS "auth_user_groups" ("id" 
integer NOT NULL PRIMARY KEY AUTOINCREMENT, "user_id" integer NOT NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED, "group_id" integer NOT NULL REFERENCES "auth_group" ("id") DEFERRABLE INITIALLY DEFERRED);
CREATE TABLE IF NOT EXISTS "auth_user_user_permissions" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "user_id" integer NOT NULL REFERENCES "auth_user" 
("id") DEFERRABLE INITIALLY DEFERRED, "permission_id" integer NOT NULL REFERENCES "auth_permission" ("id") DEFERRABLE INITIALLY DEFERRED);
CREATE UNIQUE INDEX "auth_group_permissions_group_id_permission_id_0cd325b0_uniq" ON "auth_group_permissions" ("group_id", "permission_id");
CREATE INDEX "auth_group_permissions_group_id_b120cbf9" ON "auth_group_permissions" ("group_id");       
CREATE INDEX "auth_group_permissions_permission_id_84c5c92e" ON "auth_group_permissions" ("permission_id");
CREATE UNIQUE INDEX "auth_user_groups_user_id_group_id_94350c0c_uniq" ON "auth_user_groups" ("user_id", 
"group_id");
CREATE INDEX "auth_user_groups_user_id_6a12ed8b" ON 
"auth_user_groups" ("user_id");
CREATE INDEX "auth_user_groups_group_id_97559544" ON "auth_user_groups" ("group_id");
CREATE UNIQUE INDEX "auth_user_user_permissions_user_id_permission_id_14a6b632_uniq" ON "auth_user_user_permissions" ("user_id", "permission_id");
CREATE INDEX "auth_user_user_permissions_user_id_a95ead1b" ON "auth_user_user_permissions" ("user_id"); 
CREATE INDEX "auth_user_user_permissions_permission_id_1fbb5f2c" ON "auth_user_user_permissions" ("permission_id");
CREATE TABLE IF NOT EXISTS "django_admin_log" ("id" 
integer NOT NULL PRIMARY KEY AUTOINCREMENT, "action_time" datetime NOT NULL, "object_id" text NULL, "object_repr" varchar(200) NOT NULL, "change_message" text NOT NULL, "content_type_id" integer NULL REFERENCES "django_content_type" ("id") DEFERRABLE INITIALLY DEFERRED, "user_id" integer NOT NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED, "action_flag" smallint unsigned NOT NULL CHECK ("action_flag" >= 0));
CREATE INDEX "django_admin_log_content_type_id_c4bce8eb" ON "django_admin_log" ("content_type_id");     
CREATE INDEX "django_admin_log_user_id_c564eba6" ON 
"django_admin_log" ("user_id");
CREATE TABLE IF NOT EXISTS "django_content_type" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "app_label" varchar(100) NOT NULL, "model" varchar(100) NOT NULL);
CREATE UNIQUE INDEX "django_content_type_app_label_model_76bd3d3b_uniq" ON "django_content_type" ("app_label", "model");
CREATE TABLE IF NOT EXISTS "auth_permission" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "content_type_id" integer NOT NULL REFERENCES "django_content_type" ("id") DEFERRABLE INITIALLY DEFERRED, "codename" varchar(100) NOT NULL, "name" varchar(255) NOT NULL);
CREATE UNIQUE INDEX "auth_permission_content_type_id_codename_01ab375a_uniq" ON "auth_permission" ("content_type_id", "codename");
CREATE INDEX "auth_permission_content_type_id_2f476e4b" ON "auth_permission" ("content_type_id");       
CREATE TABLE IF NOT EXISTS "auth_group" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "name" varchar(150) NOT NULL UNIQUE);
CREATE TABLE IF NOT EXISTS "django_session" ("session_key" varchar(40) NOT NULL PRIMARY KEY, "session_data" text NOT NULL, "expire_date" datetime NOT NULL);
CREATE INDEX "django_session_expire_date_a5c62663" ON "django_session" ("expire_date");
CREATE TABLE IF NOT EXISTS "app_producat" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "name" varchar(100) NOT NULL, "dis" text NOT NULL, "price" varchar(100) NOT NULL, "img" varchar(100) NOT NULL);     
CREATE TABLE IF NOT EXISTS "auth_user" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "password" varchar(128) NOT NULL, "last_login" datetime NULL, "is_superuser" bool NOT NULL, "username" varchar(150) NOT NULL UNIQUE, "last_name" varchar(150) NOT NULL, "email" varchar(254) NOT NULL, "is_staff" bool NOT NULL, "is_active" bool NOT NULL, "date_joined" datetime 
NOT NULL, "first_name" varchar(150) NOT NULL);      
CREATE TABLE IF NOT EXISTS "app_buyer" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "name" varchar(50) NOT NULL, "address" varchar(150) NOT NULL, "phone" integer NOT NULL, "purchase_date" date NOT NULL);
CREATE TABLE IF NOT EXISTS "app_seller" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "name" varchar(50) NOT NULL, "address" varchar(150) NOT NULL, "phone" integer NOT NULL, "date" date NOT NULL); 

Explanatory video (spanish)

Invoice Generator System in Python

Commissioning of the Invoice Generator System in Python on a Local Server

It is very important to install Python on your computer, it is recommended that Python be included in the Windows PATH, so that it can be run from any location.

The following video explains the process if you have any questions, you can support yourself in the following video:

Python installation

Visual Studio Code can be downloaded at the following link:

https://code.visualstudio.com/

Git installation

Git is a repository manager with which we can work in an advanced way with our development process, for this reason we recommend installing Git to advance the process of setting up the application on a local server.

Download Python Invoice Generator System from GitHub

The application is freely distributed and you can download it at the following link:

https://github.com/configuroweb/factura-python
Invoice Generator System in Python

With the installation of the applications listed above, Python, VS Code, and Git, you must first open VS Code and navigate to where you want to download the project. Later in Visual Studio Code, you press, View and then Terminal, confirm that the console that opens is that of Git Bash la nativa de Git, te debe aparecer letras en color.

After clicking on View and Terminal, copy and paste the following code so you can download the project:

git clone https://github.com/configuroweb/factura-python.git

A new folder will be created in the location you have chosen with the name factura-python and inside this folder will already be the project.

Running the application on your local server

After the project is downloaded you will no longer need Git Bash, change the console to Command Prompt and from there run the following command:

pip install -r requirements.txt

With this script all the applications required by the Invoice Generator System in Python with Django will be installed to work correctly and they are the following:

appdirs==1.4.4
arabic-reshaper==2.1.3
asgiref==3.5.2
astroid==2.4.1
autopep8==1.5.7
colorama==0.4.3
distlib==0.3.2
Django==4.1.2
django-crispy-forms==1.13.0
django-easy-pdf==0.1.1
filelock==3.0.12
future==0.18.2
html5lib==1.1
Pillow==9.2.0
pycodestyle==2.7.0
pylint==2.5.2
pytz==2020.4
reportlab==3.6.1
six==1.16.0
sqlparse==0.4.1
toml==0.10.1
virtualenv==20.4.7
virtualenvwrapper-win==1.2.6
wrapt==1.12.1
xhtml2pdf==0.2.5

If this process fails, if it throws an error it could be because of the versions, what you should do is install application by application with pip install and the name, for example, Django, the command would be the following:

pip install Django

The system will install the latest version of Django in the project, most likely without any compatibility issues.

After you have done this process successfully, you need to run the manage.py file and run the runserver option, the command is as follows:

python manage.py runserver

At this point, the application will be working without problems at the following web address:

http://127.0.0.1:8000/

If you need to make any changes to this application, upload it to a host, or need a custom application, you can contact me at the following Whatsapp link:

https://configuroweb.com/WhatsappMessenger

I stay on the lookout for any news!

Leave a Reply

Your email address will not be published.