Skip to content

wiltonpaulo/cs50-final-project

Repository files navigation

Invoicing System

Table of Contents
  1. Description
  2. Getting Started
  3. Usage
  4. What to expect?
  5. Milestone
  6. References
  7. Acknowledgments

Description

This project was created thinking about solving a repetitive and manual activity that happens to freelancers or companies that need to generate several invoices for services performed for their clients.

The customer information, type of service, date, and other data for generating the invoice are created through a menu on the command line.

With this project, I should acquire knowledge of object orientation, SQLite database with sqlalchemy, creation of tests, and also improve my knowledge in python programming.

Getting Started

Prerequisites

The following items below are necessary to have the application working.

File structure

Repository files

README.md - _This file_
logo.png - CS50 logo image
project.py - Main project code
models.py - Models code
test_project.py - Tests
requirements.txt - Requirement modules
.gitignore - Ignore temp files and the ones created after first-run.

Files created after program execution

config.ini - This file is needed to create Company data and db file.
project.db - Created after first run and finish the initial configuration.
invoice.pdf - Created or updated after generate an invoice.

Installation

  1. Ensure python3.10 and pip are installed.
  2. Clone repository: git clone [email protected]:wiltonpaulo/cs50-final-project
  3. cd into the repository.
  4. pip install -r requirements.txt in your shell.
First-Run

The first script execution will checks if the file config.ini exists, otherwise will ask to fill the initial configuration as below:

python3 project.py
***No config.ini found.***

Provide the initial configuration

Company name: <YOU COMPANY NAME>
Company address: <YOU COMPANY ADDRESS>
Company phone: <YOU COMPANY PHONE NUMBER>
Company owner: <PROVIDE THE OWNER NAME>
Company logo path: <PATH TO THE COMPANY LOGO FILE>

SUCCESS: Configuration finished

You can also write the file directly as below:

config.ini

[company]
name = <YOU COMPANY NAME>
address = <YOU COMPANY ADDRESS>
phone = <YOU COMPANY PHONE NUMBER>
owner = <PROVIDE THE OWNER NAME>
logo = <PATH TO THE COMPANY LOGO FILE>

[database]
db_connection = sqlite:///project.db

Usage

Add and Delete Customer
  1. Run the program and select the Customer option
$ python3 project.py
 Invoicing System

  Invoice
> Customer
  Product
  Exit
  1. The menu is intuitive and you can just select the option you want
 Customer Screen

> List Customers
  Add new Customer
  Delete a Customer
  Return
Add and Delete Product
  1. Run the program and select the Product option
$ python3 project.py
 Invoicing System

  Invoice
  Customer
> Product
  Exit
  1. The menu is intuitive and you can just select the option you want
 Product Screen

> List
  Add
  Delete
  Return
Generate Invoice

*Before you start, make sure that you have created at least one Customer and one Product to generate the invoice

  1. Run the program and select the Generate Invoice option
$ python3 project.py
 Invoice Screen

> Generate Invoice
  List Invoices
  Return
  1. Type the customer ID to create your invoice.

Eg.

+----+------------------+--------------------------+-------------------+
| Id |       Name       |         Address          |       Phone       |
+----+------------------+--------------------------+-------------------+
| 1  | Customer Company | Customer Company Address | +55 11 1234 12345 |
+----+------------------+--------------------------+-------------------+
Type the customer id to add in your invoice: 1
  1. Type the product ID to create your invoice.

Eg.

+----+-------------------------+-----------------------------+-----------+
| Id |           Name          |         Description         |   Price   |
+----+-------------------------+-----------------------------+-----------+
| 1  | Application Development | Development of a python app | $ 1000.00 |
+----+-------------------------+-----------------------------+-----------+
Type the product id to add in your invoice: 1
  1. Type the Product amount and the invoice Due Date Eg.
Product amount:
Due Date(DD/M/YY): 20/06/2022

After that, the file invoice.pdf will be created.

What to expect?

Expectation Description
good outcome As a freelancer or company that provides a service.
I want to run the program, type needed information and generate a pdf invoice
better outcome As a freelancer or company that provides a service.
I want to run the program, type needed information and generate a pdf invoice with data persistence
best outcome As a freelancer or company that provides a service.
I want to run the program type needed information and generate a pdf invoice
with data persistence, list invoice history, add or delete Customers and Products.

Milestone

  • Create the project idea and design
  • Menu
    • Read TerminalMenu documentation
    • Create command line menu
  • Models / Database
    • Read SQLAlchemy documentation
    • Create models (Customer, Product and Invoice)
  • Config
    • Read ConfigParser documentation
    • Add function "create_config" to generate the config.ini file
  • CRUD
    • Read PrettyTable documentation
    • Create functions to list tables for Customer, Product and Invoice
    • Create functions to add Customer, Product and Invoice
    • Create functions to remove Customer, Product
  • Invoice creation
    • Read borb.pdf documentation
    • Create functions header, body and items
  • Write Tests
  • Write README.md
  • Record and upload the youtube video.

Acknowledgments

  • I really thank the CS50 Team for providing the content and the ways to learn this course.
  • Thank you professor David C. Malan for all the lectures. It was amazing!!!

References

logo cs50

About

CS50P Final Project

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages