Multiple Templates
|
|
This is a pretty small request I think, and I’m pretty sure this has been brought up before, but I couldn’t find it in a quick search just now. What I would love to see is being able to have multiple active templates, which you choose from when you are producing an invoice or estimate. My reason? For some projects I charge a flat rate, for others I work by the hour (not generally a mix of the two). I would love to be able to have one template which displays the hours worked and hourly rate but not the flat rate column, and another template that doesnt, just shows the total (as its a flat rate for each item). It makes it a bit cleaner, and less confusing for my clients. I understand I could switch out the default template each time, but it is quite time consuming to do so. If it was possible to assign a template, that would be awesome! |
|
|
This is kind of a hack, but since liquid templates supports logic and cashboard supports custom invoice numbers (i think), you could prefix fixed fee invoices with ‘FF’.
Seth, is something like this possible? Although, this is kinda kludgy… shrug |
|
|
Interesting! I’m not sure if that’s valid Liquid syntax, but a similar approach could be used I suppose. You could make use of the liquid include function with the if / elseif statement. |
|
|
I’ll have to give this a go and I’ll post back with the results, thanks for the advice guys! Seth, any interest in adding assignable templates to the core? |
|
|
Yes, I’m interested in doing that, along with a million other things… Problem is there’s a ton of stuff that will give us more bang for the buck before I’d get a chance to get to this. It’s on my radar. |
|
|
No worries, good to know its on the list at least. I’ll try what you and drak0 suggested for now. |
|
|
I’m back! So I quickly realised that adding a character to the id would then be entered into the invoice the client sees too, which I didnt really want. That character could have been removed from the invoice with some code when it is displayed too, but I thought of another way to do it without having to change anything in the invoice. What I did was create two variables ‘flatfee’ and ‘hourly’ and made them false. Then loop through all the line items in the invoice, and if either didnt equal 0, assigned the appropriate variable as true. Then have an if/else if statement to include the appropriate templates for each situation.
Thanks for all the help guys, its greatly appreciated!
|
|
|
Adam.. nice! I like you being able to determine what invoice to use on the fly vs my orig. idea! A slightly more robust solution (that didn’t depend on the way seth format’s his numbers) would be to sum the hourly vs flatfee hours. And then use logic like ‘if flatfee_hours > 0”, etc… Anyway, nice work! This should be the default template :) I’m digging cashboard’s ability to give powerusers… well, power! |
|
|
Awesome use of the features guys ;) Moved this to the Templates section so others might find it and use the technique. |
|
|
Just in case someone finds this, drak0’s comment came to pass as it looks like the formatting for the flat fee changed from 0.00 to 0.0. I’ve implemented his idea with maths instead of comparing strings, so use this one instead of my previous.
|