Skip to content

hasnaavvathottil/invoice

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Environment variables

  • INVOICE_DB - Location of database file

This is a command line tool to manage invoices for a small company. We can manage the different parts of software using subcommands. They are listed below.

  1. init : Init Commands
  2. db : DB commands
  3. Summary : Summary commands
  4. Timesheet : Timesheet commands
  5. Account : Account commands
  6. Client : Client commands
  7. Template : Template commands
  8. Invoice : Invoice commands
  9. Tag : Tag commands

To generate a simple invoice in pdf we have to add at least one account for our use. Use add command in the account.

invoice -f INVOICE_DB account add -n name -s sign -a addr -p 76543 -e email --bank-details 'HDFC Bank,calicut'

Then we need to add a client entry in this tool. Use add command in client.

invoice -f INVOICE_DB client add  -n NAME -a ACCOUNT -b INR --address ADDRESS -p period

Then we need a letterhead template in pdf and add this to the template with the name. Use add command in the template.

invoice -f INVOICE_DB template add -n samplename -l letterhead.pdf

Then import the timesheet of all employees, they worked for some client. Add client name, employee name, template and date with this command.

invoice -f INVOICE_DB timesheet import -e Hasna -c IRF -s Imported -t template -d 02/Oct/2018 timesheet.org

We can generate a pdf file for this added timesheet by choosing the id. Use generate command in the timesheet

invoice -f INVOICE_DB timesheet generate -d 3 --format pdf

Finally add the invoice with the template, client and some particular

invoice -f INVOICE_DB invoice add -c IRF -t sample -p PARTICULARS

And Generate the invoice with the format and other filter options.

invoice -f INVOICE_DB invoice generate -i 1 --format pdf

Init

After creating the database for this tool, this command is used to initialise the database.

invoice -f INVOICE_DB init

Here INVOICE_DB is a just filename with DB extension.

DB commands

This command is used to manage invoice database. DB commands have some subcommands to manage. They are listed below:

  1. Info : Summarise database status
  2. Update : Update the database to the latest version
  3. Migrate : Create database migrations (not needed for end users)
invoice -f INVOICE_DB db info

Summary Commands

This command is used to show a summary of the database contents. It'll print on the screen.

  1. -c/--chronological : Order by date rather than id
  2. -v/--verbose : Print detailed summary
  3. -d/--dump : Dump the entire database in a format that can be imported
invoice -f INVOICE_DB summary -v

Account

In the account section, we can add multiple accounts, like multiple companies. To manage account section we can use some subcommands like:

  • Add: This operation is used to create a new account. We can use command line arguments like :
    1. -n/--name : Name of Account
    2. -s/--signatory : Name of Signatory
    3. -a/--address : Billing address account
    4. -p/--phone : Phone Number
    5. -e/--email : Email Address
    6. --pan : PAN number
    7. --serve : Service Tax number
    8. --bank-details : Bank details. Must include bank name, address, account number, account holders name, IFSC code and any other details.
    9. --prefix : Invoice number prefix
invoice -f INVOICE_DB account add -n name -s sign -a addr -p 76543 -e email --bank-details 'HDFC Bank,calicut'
  • Edit: This operation used to edit an existing account. We can select one account by its name. We can use command line arguments like:
    1. -s/--signatory : Name of Signatory
    2. -a/--address : Billing address account
    3. -p/--phone : Phone Number
    4. -e/--email : Email Address
    5. --pan : PAN number
    6. --serve : Service Tax number
    7. --bank-details : Bank details. Must include bank name, address, account number, account holders name, IFSC code and any other details.
    8. --prefix : Invoice number prefix
invoice -f INVOICE_DB account edit name --pan 7654egh
  • Show: This operation used to show the account with the name.
invoice -f INVOICE_DB account show name
  • List: This operation used to list accounts.
invoice -f INVOICE_DB account ls

Client

In the client section, we can add clients are under the corresponding accounts. To manage client section we can use some subcommands like.

  • Add: This operation used to add a new client. We use some command line arguments like:
    1. -n/--name : Name of client
    2. -a/--account : Name of account under which this client is to be registered
    3. -b/--bunit : Units to bill in (e.g. INR)
    4. --address : Client billing address
    5. -p/--period: Day of month on which this customer should be billed.
 invoice -f INVOICE_DB client add  -n NAME -a ACCOUNT -b INR --address ADDRESS -p period
  • List: This operation is used to list all clients
invoice -f INVOICE_DB client ls
  • Edit: This operation used to edit an existing client. We can select one client by its name. We can use command line arguments like:
    1. -a/--account : Name of account under which this client is to be registered
    2. -b/--bunit : Units to bill in (e.g. INR)
    3. --address : Client billing address
    4. -p/--period: Day of month on which this customer should be billed.
invoice -f INVOICE_DB client edit  NAME -a name -b BChange --address 'first floor, B building' --period period
  • Show: This operation used to show details of a client with the name.
invoice -f INVOICE_DB client show  NAME

Template

The template is used to generate invoice and timesheet with proper letterhead template. Here listed some subcommands to manipulate templates.

  • Add: This command is used to add a new template. We can use some command line arguments like.
    1. -n/--name : Name of Template
    2. -d/--desc : Description of template
    3. -l/--letterhead : Add a letterhead to use as a base PDF
invoice -f INVOICE_DB template add -n samplename

Here the letterhead file should be pdf and we can style the pdf beforehand. Styling like add header, footer, outline etc. And this pdf we can add as letterhead in templates.

  • Edit: This command is used to edit the existing template with the name. We can use some arguments like::
    1. -d/--desc : change description of template
    2. -l/--letterhead : Change template letterhead to this file
invoice -f INVOICE_DB template edit templatename -l etterhead.pdf

Here the letterhead file should be a pdf as explained above

  • Remove: This command is used to delete template with the name.
invoice -f INVOICE_DB template rm samplename
  • List: This command is used list all templates.
invoice -f INVOICE_DB template ls

TimeSheet

In this section, the system is managing the timesheet of the employee, the time they worked for the client. Here listed some subcommands to manipulate timesheet.

  • Show: This command is used to display timesheet details with id
invoice -f INVOICE_DB timesheet show 3
  • Remove: This command is used to delete an existing timesheet with id
invoice -f INVOICE_DB timesheet rm 1
  • Edit: This command is used to edit an existing timesheet with id. We can use some arguments like:
    1. -d/--date : Change timesheet date (e.g. 10/Aug/2010)
    2. -e/--employee : Change employee name
    3. -c/--client : Change timesheet client
    4. -s/--description : Change timesheet description
invoice -f INVOICE_DB timesheet edit 2 -e Ligin -c NAME -s DESCRIPTION  -d 04/Oct/2018
  • Add: This command is used to manually add a timesheet. i.e. write it out fully in a text buffer. This is not something that's commonly used. It makes more sense to use timesheet import. Some command line arguments are listed below.
    1. -d/--date : Timesheet date (e.g. 10/Aug/2010)
    2. -e/--employee : Employee name
    3. -c/--client : Client name
    4. -s/--description : Description of timesheet
    5. -t/--template : Template to use
  • List: This command is used to list timesheets
invoice -f INVOICE_DB timesheet ls
  • Import: This command is used to import new timesheet. In most cases, we have to use this command for creating timesheets. We can use some command line arguments like.
    1. -d/--date : timesheet date (10/Aug/2010)
    2. -e/--employee : employee name
    3. -c/--client : client name
    4. -t/--template : Template to use timesheet : timesheet file instead of timesheet
invoice -f INVOICE_DB timesheet import -e Hasna -c IRF -s Imported -t sample -d 02/Oct/2018 timesheet.org 

Here we can use the org file as the timesheet. It should be in one format. Use Org’s time-clocking support for entering clock time. And use the plain list for outline tree to list the months and days. The format is given below.

* jan
** [2018-01-01 Mon]
   :LOGBOOK:
   CLOCK: [2018-01-01 Mon 14:39]--[2018-01-01 Mon 17:51] =>  3:12
   CLOCK: [2018-01-01 Mon 10:14]--[2018-01-01 Mon 13:59] =>  3:45
   :END:
  • Parse: This command is used to parse and print a timesheet. And the given timesheet to see if there are any errors and it looks good.
invoice -f INVOICE_DB timesheet parse timesheet 

Here the timesheet should be the org file as explained above.

  • Generate : This operation will take a timesheet that's already imported and then create a PDF or text version of it which can be sent to the client. Here we can use some command line arguments like:
    1. -d/--id : generate timesheet with this id (override other options)
    2. f/--from : generate all invoices since this date (10/Aug/2010).
    3. -t/--to : generate all invoices till this date (10/Aug/2010).
    4. --format : Format to output timesheet.
    5. -e/--employee : generate timesheets only for this employee
    6. -c/--client : which client to generate invoices for.
    7. -w /--overwrite : overwrite existing generated files.
invoice -f INVOICE_DB timesheet generate -d 3 --format pdf

Invoice

In this section, the system is managing the Invoices. Here listed some subcommands to manage invoice.

  • Show: This command is used to display invoice details with id.
invoice -f INVOICE_DB invoice show 5
  • List: This command is used to list the invoices and we can use different types of filtering by adding command line arguments. They are listed below:
    1. --from : show only invoices since this date (10/Aug/2010). Use 'a’ to list from the beginning.
    2. --to : show only invoices till this date (10/Aug/2010).
    3. -c /--client : show only invoices for this client
    4. -g/--tag : show only invoices with this tags. Can be given multiple times.
    5. -a/--all : show all invoices (including cancelled)
invoice -f INVOICE_DB invoice ls
  • Add: Invoice add will open an editor with a buffer where you can add an invoice. You can type the fields into the table that gets displayed and create a new invoice. e.g. if you use a template that has 3 fields (S.no, description, and amount), you will get something like | | | |

You can then edit it to be like this

| 1 | Senior engineer| 1000|
|2  | Junior engineer| 500|

and save it to create an invoice.

invoice -f INVOICE_DB invoice add -c IRF -t sample -p PARTICULARS
  • Remove: This command used to delete an invoice with id
invoice -f INVOICE_DB invoice rm 1
  • Edit: This command used to edit an existing invoice with id
invoice -f INVOICE_DB invoice edit 2 -c NAME
  • Generate: this command is used to generate an invoice. Here we can use some command line arguments.
    1. -i/--id : generate invoice with this if
    2. -f/--from : generate all invoices since this date (10/Aug/2010).
    3. -t/--to : generate all invoices till this date (10/Aug/2010).
    4. --format : Format to output invoice
    5. -c/--client : which client to generate invoices for.
    6. -w /--overwrite : overwrite existing generated files.
invoice -f INVOICE_DB invoice generate -i 1 --format pdf

Tag

It's to give labels to invoices like (paid, unpaid, cancelled etc.).when we list invoices. We can filter by tags. Here listed some subcommands to manage tag.

  • Add : This command is used to create a new tag. And the command line argument is given below:
    1. Name : Name of new tag to add
invoice -f INVOICE_DB tag add tag_name
  • Remove : This command is used to delete an existing tag with the name.
invoice -f INVOICE_DB tag rm tag_name
  • List: This command is used to list all the tags.
invoice -f INVOICE_DB tag ls

About

Command line invoicing tool

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.5%
  • Mako 0.5%