Sales Invoice Template Printing Issue

I have modified line 53 in the sales invoice template

                    {% if has_item %}<th style="border: 1px solid #000; background: #f1f1f1; padding: 5px 10px">{{ strings.item }}</th>{% endif %}

I have added background: #f1f1f1; so that the Item, Description and Amount Row displays a light grey background.

The background is displayed correctly within manager, but does not show up when I print an invoice or when I save the invoice as a pdf using my pdf xchange printer program.

I am not sure if the issue is Manager printing only looks for fields that exist in the default template and prints whatever the attributes of those fields are or if this is some wierd printing issue?

Thank you

I duplicated your template modification and did not experience your problem. Several observations:

  1. Manager should print anything using your modified template as per your modifications, not the default template’s attributes.

  2. Unless you also modified other lines of code, your change only adds the grey background to the heading cell containing the word “Item.” Other column headings, such as “Description” and “Amount” are not affected.

  3. If you have an invoice that does not use a sales invoice item, nothing will be colored. This might not be obvious if all your invoices use sales invoice items.

  4. If you didn’t modify any other row, but still see grey background all across the heading row, you were somehow working on a different default template than I have.

I have modified other lines of code. In order to keep the question short, I just focued on Item column, but I did change Description and Amount and I also modifed a few other things.

The invoice that I printed out only has two items and both of them are in the sales invoice items. Are you saying tha inventory items for example would not have a grey column header?

I will go through the template again and see if perhaps I have made an error somewhere else. do you not think it could be some kind of driver printer issue because I definitely see the grey background in manager. If there was an error in the coding, I would imagine that this would prevent manager from seeing the background colour.

I will go through the template now. Thanks

I created a new template and only changed the background colour of the Item, Description and Amount Row. Still same result.

Did you change the row where the words Item, Description and Amount are. I don’t want to change the area where the actual product items are written - I want to change the column headers. I think from point 3 you are saying that you changed the area where the actual item content goes! I am using version 15.1.94

No, I made exactly the change you highlighted in your post, by copying and pasting the line into a new template. That bit of code in line 53 affects only the table cell containing the label “Item.” Lines 54 and 59 format the cells containing “Description” and “Amount.” Those other two cells maintain their original, white background.

I was using v15.1.94 when I first responded. I have now upgraded to v15.1.98, but the template looks the same and the result is the same. If you changed only line 53, I don’t see how you would get the entire heading row to go grey.

My point in #3 of my original response what that you placed the modification in a line containing a conditional test (specifically, {% if has_item %}). So if the invoice doesn’t contain a sales invoice item, but only items entered manually, the format change will not occur, because the column will be left out.

One other thought, @dalacor. Are you sure you selected the revised template on the input/edit screen of the sales invoice? If you only looked at the Preview in the template editor, you would see the change as though the selected invoice had been changed. But if you then printed or saved the invoice without altering the template within the invoice’s record itself, you would revert to whatever template it was originally created under. (That happened to me as I was trying to duplicate your problem.)

I now understand what you mean in point 3. Sorry for confusing you. I changed the other lines to get the entire row to be the grey. Not just line 53. I did 54 and 59.

Yes I saved the template and then went to edit invoice and selected the test template.

I think the problem may be with windows 7 printing background colour options. The fact that it is displaying the correct colour in the program means that its some kind of printing background colour issue. Some programs like word you have to tick a box to enable printing background colours. Maybe this functionality is not working for windows 7?

I will try on another computer with a different OS

Last thought, and then I promise to be silent on this subject. Perhaps the color profile of the printer is such that the grey is too pale to show. In other words, it might show up on the monitor screen, but not on the printer. As a test, change the color code to something darker and give that a try.

Now that I think about it, however, you said it didn’t show on a PDF either. Were you viewing that PDF on screen or paper?

You can chatter as much as you like. Any suggestions welcome :smile:

I tried changing the colours to see if it was an issue with the colour. I also did print preview and it doesn’t show up in the print preview. It doesn’t show up in the pdf on the computer. Bearing in mind that the pdf printer program is a “printer” it is clear to me the problem is Manager is not printing background colours on my computer. Whether its because of my printer drivers or windows 7 or something I cannot say at this point. I will have to test it out on another computer with different printers to see if its computer specific or not.

Thanks

The reason why background in not being printed is simply because when using “Print” button, internal web-browser is making a decision not to print background as to save on ink. One way to overcome this is to use “Email” button to email yourself PDF and print that.

I’m working on new way to print from Manager which will overcome these inconsistency issues when clicking Print button. Check again in one week.

Thank you. I will check back with you in a week or so. I am not sure what @Tut is doing to get the printing background colour to work if you say that manager does not background printing yet. But maybe a different OS produces different results?

Does the “internal browser” have anything to do with what default browser you use on the operating system. I use Firefox and I suspect that Manager uses IE functionality as most progams seem to use IE as the base browser.

Thanks :smile:

@Tut is using Mac OS X, you seem to be using Windows. Different operating systems will produce different results. These inconsistencies are causing a lot of issues and I’m working on Manager being able to consistently print across all platforms the same way.

I had the same problem and here is what I did… (I have Windows 7):
1- Right click on the invoice from the MANAGER
2- Select “Print Preview” from the menu
3- Click on the “page setup” icon … or (ALT+U)
4- Enable “Print Background colors and Images”
5- Click OK and close the Print Preview window

I hope it works for you.

You are responding to a topic over two years old. The entire approach to printing has been completely revamped since the last post. Sales invoice templates are completely obsolete, as is the entire topic. But welcome to the forum.

Manager advances at an extremely rapid pace, so you should consider the age of posts before either taking their advice or responding. There have literally been several hundred updates since this subject was relevant. I am going to close the topic.