I use a Google sheet to generate and manage invoices for my clients.
The process is fairly simple.
- One sheet holds the Name, address and contact details of the client.
- I enter the clients ID into a box for whom I want to generate the invoice for.
- This increments a counter which acts as the invoice number.
- I have another sheet (within the same spreadsheet) that is the invoice template.
- The invoice number and client details are pulled in from the first sheet. Current date is used for the date.
- I enter the details related to the job in the invoice.
- I export the invoice as PDF
- I save the spreadsheet version with a name (File > Version History > Name Current Version).
Here is the Google Apps Script code that increments the counter.
// Update invoice number when changing the client ID cell B3.
function onEdit(e) {
if ( e.range.getA1Notation() == "B3" ) {
var sCounter = e.source.getRange("B2"); // B2 is the number that is incremented.
var counter = sCounter.getValue();
counter ++;
sCounter.setValue(counter);
}
}
Add this in Tools > Script Editor of your spreadsheet.
amazing blog. keep writing.