[16.11.1] Added new themes for invoices, quotes, orders, receipts etc

I will let this feature to settle a bit before going into this. There could be an element of novelty where staff is experimenting only initially.

Thank you @lubos for your help on this.

I am trying to show a single custom field element from the array, is this possible?
The custom field from the Invoice doesn’t show for some reason?
Also, how to separate the “notes” section from my custom fields as i think “notes” are included in the array?

You can always loop through the array and skip all fields except for the one with the name you are interested in. For example, this example will loop through all custom fields and skip all where field.label is not Notes.

{% for field in custom_fields %}
  {% if field.label != 'Notes' %}{% continue %}{% endif %}
  <div>{{ field.label }}</div>
  <div>{{ field.text }}</div>
{% endfor %}

When you go to Settings, then Custom Fields, is the custom field on invoice you are referring to set to be displayed on printed documents? If it’s not, then it won’t be available in custom_fields array.

I’m actually going to make Notes as a custom field. The theme is already assuming it is.

PLEASE HELP: I just upgraded to 16.11.41 … all of a sudden the Custom Fields on my Estimates are not showing up when I try to Print or create a PDF. I can see all of the custom fields when viewing my Estimates online. But when I print or create a pdf they are being cut off after page 2. I am using 6 or 7 Custom Fields. Some are lengthy and therefore most of my Estimates end up being 4 or 5 pages total. Why after upgrading is it now cutting off after page 2? Please advise how to fix this???

Why some of your custom fields are so large? This has to do with internal PDF generator, it cannot currently handle custom field which spans more than 1 page.

First allow me to say you guys are great! … We are a Moving company. Florida state law requires us to include our Terms of Service on every Estimate … and we must provide it to the client in writing. We are using 6-7 Custom Fields that include detailed language about Terms, Conditions, Special Handling Fees, Insurance Options, etc. Our Estimates are usually 4-5 pages long because of all the language we are required by law to include. After the recent upgrade to 16.11.43 we can view our estimates online, but when we try to print it is cutting it off after 2 pages. This issue has completely halted us in being able to create new estimates. Is it possible to change your program to allow for lengthy custom fields? What are my options with this latest upgrade? Thank you in advance for your timely reply! :sunglasses:

2 posts were split to a new topic: Combing PDF files

Adopted the new “themes” function instead of “view templates”, but I have a problem - instead of the title for Sales Invoices stating “Invoice”, I need to show it as “Tax Invoice”. How do I customise the template for sales invoice template specifically?

My mistake, hadn’t ticked the box.

Thank you, this had the desired effect. It now only shows the particular custom field on the invoice and i can place it where i wish. :relaxed:

There are a couple more issues i have with the new Themes that i would need support for before i could start using them, similar to @lohjonming issue above.

I need the adjustments in code to only apply to Invoice as i notice that when i go to other forms the changes have been made on them too. (As designed i believe)

When Invoices have been created using different Themes i need that particular Theme to stick to the corresponding invoice so when i go back and view an invoice the correct theme is showing.

Fingers crossed this is achievable?

Your requested feature would have negative consequences. For example, I have two nearly identical themes intended to produce similar-looking output via PDF or direct Print functions (marginal padding is treated differently by the time you get through Manager’s image creation to the operating system’s interpretation). So depending on how I want to use the invoice (or other form) I select the appropriate custom theme.

Similarly, one might want to use a colorful theme for forms being sent to customers or suppliers but stick to simple black and white when the same forms are generated for internal use to save printer ink.

So if the sticky feature were to be implemented, it should be something that is actively chosen, not imposed automatically.

You can’t make theme specifically for invoices. Themes are always universal (this is on purpose). But that shouldn’t be an issue.

In theme, where {{ title }} variable is used, simply replace that with:

{{ title | replace: "Invoice", "Tax Invoice" }}

This will apply replace filter to title variable so if it contains Invoice, it will be replaced with Tax Invoice.

If you want some information to be shown on document only if {{ title }} is Invoice, then you can use simple conditional block.

{% if title == 'Invoice' %}
This text will be shown only if title is "Invoice"
{% endif %}
2 Likes

This is great! Thank you, it works perfectly, and on other forms too :ok_hand:
Maybe worth creating a topic or giude with all these handy tips, others will find these useful.

3 Likes

This is standard (and simple) Liquid coding. There are plenty of readily accessible guides on the web explaining Liquid’s abilities to do much more than has been described so far.

@Tut Is the reason you created two custom themes that when you print from print button the margin is too large? So you have edited it to reduce the margin? And the PDF is fine?

I may not have described what i mean very well when i said stick the theme to the invoice.
If i create one invoice and select theme 1 then create a second invoice and select theme 2 when i go back and view the first invoice the theme has changed from one to two.
Is there a way for the invoice to remember the selected theme? You could still edit the invoice and select theme 2 but it wouldn’t alter other invoices.
I know this isn’t what themes were designed to do, they were meant to change all forms, but view templates supported this but now they are obsolete.

Believe me i have spent much time researching this, there is lots of information out there and in so many programming languages! All the tutorials seem very generic, not showing what i required and not knowing the new variables and certain areas not being supported i.e. custom fields, made applying them impossible, until now.
If yourself or lubos can suggest a good website to gain more knowledge i would be gratetful.

I said it may be worth creating a topic including Lubos’s tips above as i believe many users will find them useful.

@itmoto, try Liquid for Designers ¡ Shopify/liquid Wiki ¡ GitHub or Liquid template language

Thank you! I haven’t been searching liquid, oops, could be reason i struggled finding it!:dizzy_face:

I created the first custom theme because I wanted wider margins all around. I also made some minor changes to font size and got rid of the “Notes” field label with an unless-block. I use this theme for general screen viewing and to create PDFs.

I created the second custom theme for occasions when I want to print forms directly via the operating system’s Print command. Yes, without adaptation, all margins were larger. So this custom theme differs from the first only by having less padding. It ultimately produces the same margin sizes as the first, but only when using the Print command.

I’m not sure what you mean by “…the PDF is fine.” PDF’s generated with the PDF button look very much like the screen presentations. Differences come up when you go to multiple pages, but basically, WYSIWYG.

On the contrary, @itmoto, I understood exactly what you meant. My point was that having it stick automatically and permanently could undermine some users’ desires. If the option were to be introduced, I advocate having it be an option. As long as it was optional, I can see that in situations like yours, it would be much more convenient.

I just wonder where you would stop. @lubos has mentioned two or three things applicable to one situation. The fact is, you can do so much. For example, I’ve already anticipated and provided for incorporation of Notes into custom fields. (While it isn’t obvious yet, that is already how Notes on sales invoices are being handled within the program.) Creative use of themes also resolves the frequent request users have made for multiple business names/looks that are really the same company. Suffice it to say, we can hardly expect this forum to become a resource for programmers. That would defeat its purpose. And there are already so many out there.

I also noticed margins were wider when using print button, so i adjusted theme then changed it back again when found if i right-clicked on invoice clicked print preview selected page setup and reduced margin to the minimum it printed fine as it did when printing from PDF.

I completely agree sticking automatically and permanently is not desirable for everyone. I was hoping there was some code i could apply to my theme which would give the desired affect and not be universal.
My business is in the automotive industry and what i am trying to achieve (by trying to be creative with themes) is what every business in my area would need as a minimum. That’s what got me hooked on Manager, the customisation and ease of use. Tried lots of other software over a few years but they didn’t come close to Managers customisation and the support, so thanks for that.

I see your point, you can do so many things and everyones buisness sectors/requirements are different.
But due to the way it can be customised questions are going to be inevitable.

That ability to set margins from a right-click preview isn’t available in macOS. The Mac’s original emphasis on WYSIWYG made it unnecessary, and that flavor persists 32 years later. Very occasionally, it doesn’t work out, but I can’t remember it ever being an issue before.

Right now, Manager picks up paper size from the email setup. Margins may be tied up with that. I know there are plans to add more obvious control to PDF generation, such as paper size and margins. Maybe that will eliminate the need for separate themes for the two output options.