Code Monkey home page Code Monkey logo

invoicemanager's Introduction

InvoiceManager

A simple Invoice Database with a GUI client and a Command line Interface program to handle it.

New Invoice

CLI help

Usage

The idea of this manager is to generate / use the data of the invoices and store them in an SQLite Database. The visual representation is generated as an HTML page. For that it uses two concepts :

  • A Template file. This file is the HTML structure of the invoice. The final values are placeholders that are replace by the invoice data when the visualization is generated.
  • A Stylesheet file. This is a CSS stylesheet. It is used to change the appearance and the style of the HTML invoice. Both the template files and the stylesheets are also stored in the database. At the moment, only a reference to the files is stored in the database, so you need to keep the files. One example of each file is available in the data/ folder of the project.

You can use the GUI application to manage the invoices or use the Command line interface for some commands. For the command line interface, there is a --help command that shows you the available commands and some usage instructions.

How to build it

The project is built with Cmake. You can either use CMakeLists.txt directly in your IDE (tested only with QT Creator) or build using the command line. Here are details instructions on how to build it from command line on Linux :

  • Clone the git repository into your local machine
  • Create a new folder where the build will be done (we will take build-InvoiceManager here as an example)
  • Go to this directory, and run "cmake [PATH_TO_INVOICEMANAGER_REPOSITORY] ./
  • run "cmake --build ." You should have 3 folders : InvoiceGui, InvoiceCli and InvoiceLib. You will find corresponding executable files in InvoiceGui and InvoiceCli folders. You can launch them directly to run the Graphical user interface or the command line respectively.

Platforms

InvoiceManager is built around Qt Framework, and as such should run on all platforms that are supported by Qt : Windows, Mac and Linux. Please note however that as of today, it has been tested only on Linux.

This program with all its components are released according to the terms of the GNU GPLv3 license. The details about this license are provided in the LICENSE file.

Creating templates

A template is an HTML file with placeholder fields that will be replaced by the invoice data. Here are the fields that are available :

  • {ID}
  • {DATE}
  • {USER-COMPANY-NAME}
  • {USER-COMPANY-ADDRESS}
  • {USER-COMPANY-EMAIL}
  • {USER-COMPANY-PHONE}
  • {CLIENT-NAME}
  • {CLIENT-ADDRESS}
  • {CLIENT-EMAIL}
  • {CLIENT-PHONE}
  • {INVOICE-DETAILS}
  • {INVOICE-TOTAL}
  • {CURRENCY}
  • {NOTES}

Their names are self explanatory. There are, however, some fields that have a special behaviour :

  • {USER-COMPANY-ADDRESS} and {CLIENT-ADDRESS} : The address is a multiline property. In order to allow it to be also represented in a multiline form in the invoice, they need to be enclosed with <p></p> tags. What will be replaced is <p>{ADRESS}</p>, and each line will be enclosed in <p></p> tags.
  • {INVOICE-DETAILS} : Details are meant to be represented in a table structure, they need to be enclosed with <tr></tr> tags. What will be replaced is <tr>{INVOICE-DETAILS}</tr>, with each detail being enclosed in <tr></tr> tags, and each cell in it being in <td></td> tags.

invoicemanager's People

Contributors

mickaelonthewave avatar

Stargazers

 avatar

Watchers

 avatar

invoicemanager's Issues

Use a centralized VERSION file

There are at least to places where the version is used :

  • In the InvoiceCLI --version command
  • In the InvoiceGUI about window

Today they both have their local data. We want to have a VERSION text file in the project root and have it passed by Cmake to the applications, and be used there.

Create basic CLI

Create Command Line Interface project. It should at least allow :

  • provide version information
  • Provide help command
  • list existing invoices
  • List existing clients
  • Create new invoice from last one

Requires #13

Refactor InvoiceDbController

Separate it into several classes. Suggestion :

  • One for direct interaction with DB and basic data return in C++ structures
  • One for business logic (handling only C++ structures)

Reorganize project files

  1. Create subfolders and organize source files in them
  2. Separate business logic from UI
  3. Create lib module with business logic, and use it from UI project

Add About dialog

Add copyright and version info.
Add both app version and DB version (useful for development)

Add page with charts

What's the use of a beautiful system without some reports on its data? :-)
Create a page for charts on database. Some of the possible reports :

  • Annual income chart (per client?)
  • Income chart per type
  • Average income per month (based on annual one)

Add PDF Creation

Add PDF Creation feature. There is already GUi and CLI commands, but their implementation does not work.
Also, the PDF should have its filename configurable and be the same as the preview.

Bugfixes and improvements

  • Fix several bugs still present in the codebase :
  • Remove of detail in New Invoice page not working (GUI)
  • Totals with styles that don't use unitary values are incorrect
  • Add tests for total invoice value computation (might require refactor of total computation)
  • Isolate warnings from wkhtmltopdf
  • Remove memory leaks (Display dialogs in main Page)
  • Remove all warnings

Removed TODOs completion and added to separate ticket

Add basic styling

  • Find/create nice styling for buttons, controls, etc...
  • Find nice color theme for app
  • Create style app-wide

Implement remove button

Implement Remove button in Data handler widget.
Add check from Preferences to show confirmation dialog.

Add default data

In order to be easily usable and understandable, it would be nice to have an initial data sample. In order to show all the software features, the initial DB should :

  • Have several client companies, some with child relationship
  • Have several templates
  • Have several CSS files
  • Have several invoices

Add support for a Quantity field

At the moment, invoice details are composed only of items and a value.
Now they need to also have a 'quantity' field and a unitary value, the total value is computed from them.

Add Data sorting in UI

All TableViews displaying data should have sortable fields.
This requires :

  • Implementing sort in fields
  • Using proxyModels instead of models in UI
  • Maybe add missing functions in existing models to use proxyModels

Add file contents into DB

At the moment, templates and stylesheets store their file.
They should store the contents instead.
This requires updating the DB versioning.

Implement all TODOs in code

Here are the different categories of TODOs that have been identified :

  • ToolsLib : Create a lib for usable tools (CommandLineManager for example), and make it usable in another project.
  • Database improvements : Remove existing duplications and create necessary abstractions
  • New features : Small quality of life improvements
  • Data optimization : Remove duplicated code/data

Fix Templates features

As of today, the manager has been tested only with the initial template. It must be tested against a template that provides all possible fields.
The software must also be able to cope with templates that have missing fields.
Also it should be added somewhere what are the fields to let the user create its own templates easily.

Add versioning to companies

Add a field in DB to have parent entry.
This works in the following way :

  • A company can be modified
  • When modified, a new entry is created linked to the old one
  • The UI considers the new company as being the newest version of its parent, so don't list same companies
  • Requires updating the DB versioning

Migrate to QT6

Migrate all projects to QT6. This is necessary to use the newest PDF printing facilities, necessary for the application to be used in production environment.

Add Settings dialog

Add reset default button
Add confirm for remove option
Implement preferences persistence.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.