Uses a script + GH actions to take a google sheet of hours worked and automatically generate an invoice and send it to appropriate parties on the first of every month. As long as your timesheet is up-to-date by the first of the month, this code does everything else for you.
- Fork this repo.
- Save your timesheet in the format shown in google sheets (keep column names as they are) and make it publicly viewable. Edit
make-invoice.pyand set the constantTIMESHEETto the url of your timesheet, making sure it is formatted exactly likehttps://docs.google.com/spreadsheets/d/1ookllAe7kdUx_05QGLUvvp1ZsJM0oVS5P6dyA1awAaE/and doesn't haveedit?usp=sharingat the end. - Change the
HOURLY_RATEconstant inmake_invoice.py. [optional] Make any other changes you like to the invoice content by modifyinggenerate_invoice.py. - Create an app password for your gmail.
- In your github repo settings (under "secrets and variables: actions") add two repository secrets:
EMAIL_USERNAME(your email address), andEMAIL_PASSWORD(the app password you created in step 4).
Click "Actions" at the top. In the "Actions" column on the left of the resulting screen there will be a "Send Monthly Invoice" workflow. Click on that and then on the right you will see a button that says "run workflow". If you don't want to send your invoice to everyone during the testing you should first edit the relevant recipients variable in make-invoice.py.