Invoice Design: Titlecase and 'Estimate' as opposed to 'Quote'

Hi,

How can you change the $entityTypeUC to be titlecase? Currently it comes out as uppercase? Not a big issue, but ideal if I can.

I tend to use the word ‘Estimate’ rather than ‘Quote’, is there any way I can add/changes this? I’m already using the two custom invoice fields (for Invoice Title, and Ordered By additional fields).

Many thanks.

You can change it to $entityType, the ‘UC’ makes it uppercase.

Oh dear I should have noticed that. Sorry.

Not at all, it’s easy to miss. I’ve considered changing it to $entityTypeUpperCase.

Its a same there’s a limited subset of styling via PDFMake as I took some time to look for ‘Titlecase’ setting, but there doesn’t appear to be one.

On my invoice design there’s a different footer on the first page (the second/third pages are the terms, with only the page number and invoice ref in the footer).

I was just fiddling with the first page of my custom design, adding a text item with a top margin to push it to the bottom, and I now realise that the position of that ‘fotter’ item will change depending on the variable height of the items table above.

Is there any way to position an item from the bottom, as I presume you have done with the $invoiceFooter text?

Many thanks

I’m not sure, you may want to check the pdfmake docs.

$invoiceFooter is shown at the bottom because it’s part of the page footer.

I guess an invoice setting “Footer only on First Page” would be one way to solve it in the longer term - just in case you’re working on the next version.

I have found this setting:
“absolutePosition”: {“x”: 16, “y”: 18},
Where the numbers are coords of the document in inches. Just playing with this…

see this post

That may have worked.
To anyone else reading this, the absolute position appears to be in mm (not inches) from the top left. You may need yo adjust the global margin settings for the document to get the item to go to the very bottom of the page.

If anyone knows if there is any way to change ‘Quote’ to ‘Estimate’ as the $entityType for quotes, please post here.

Hillel, as we limited to 2 custom fields per invoice (as I guess I could use a custom field as a bit of a hack)?

Maybe create a separate custom design and set one as the default for invoices and the other as the default for quotes.

Thats an idea. But does InvoiceNinja say “Quote…” in the email it sends as the subject?

You can customize the email subject on /settings/templates_and_reminders#quote

Probably a stupid question…but where do you set the default template for Quotes/Invoices?

Yes it was stupid. I found it in Settings => Invoice Design (unsurprisingly)

Another question on this approach:

‘Estimate’ has replaced ‘Quote’ in the email title and template sucessfully using the suggested approach. However, the attached PDF is named “Quote_ABC123” (ABC123 = quote number). Is there any way of specifying the file name convention so I could replace ‘Quote’ with ‘Estimate’?

Not that I’m aware of

I’ve just noticed you’ve suggested editing the ‘getFilename’ function in this post:
Can I change PDf Filename

Would it be ok if I change this:

public function getFileName()
    {
        $entityType = $this->getEntityType();

        return trans("texts.$entityType") . '_' . $this->invoice_number . '.pdf';
    }

to this:

public function getFileName()
{
$entityType = $this->getEntityType();
if (trans(“texts.$entityType”) == “Quote”)
{
return trans(“Estimate”) . ‘’ . $this->invoice_number . ‘.pdf’;
}
else
{
return trans(“texts.$entityType”) . '
’ . $this->invoice_number . ‘.pdf’;
}
}

This worked (see below), in terms of renaming the sent PDF. The download PDF option within the CMS still says ‘Quote’ in the filename. I suspect this is a separate function however, as I can see the ‘_’ is has changed to '-'in that filename.

Edited function looks as follows:

`public function getFileName()
{
    $entityType = $this->getEntityType();
	if (if ($entityType == ENTITY_QUOTE))
	{
		return 'Estimate' . '_' . $this->invoice_number . '.pdf';
	}
	else
	{
    	return trans("texts.$entityType") . '_' . $this->invoice_number . '.pdf';
	}
}`

Thanks for sharing your solution!

My pleasue.

(there’s a typo in it - there should be two 'if’s but I cannot edit the post)

If it’s not too much effort, and rather selfishly, may I suggest fields for:

Entity Name (i.e. Quote/Estimate)
Invoice Title
Requested By (Sometimes a quote/invoice needs to say who in the company asked for it)

…in your next version.