How do I replace current JS Print format in POS with a new one?

My receipt printer is only 3 inches wide and the default “Point of Sale” print format is for a 4 inch wide printer. So I made a copy of the original, modified it for my printer width and saved in a new Print Format (Js type) called “POS 3in Ticket”

Now, how do I get the POS module to use this new js format I made instead of the original one? I can’t find anything in the manual to explain how to turn on the new format. The manual indicates that you can change the format, but gives no detail on how to replace the old one with the new modified version. I do not want to delete the old one just in case I made typing errors in the new one I want to be able to go back to the original and try again.

Can anyone explain where to tell POS it to use the new receipt format?

Thanks,

BKM

Try setting up a new POS Profile,

In POS Profile there is a field to select Print Format.

Hmm… That didn’t work. I know the new format was running because I had also changed the line spacing from 200% to 150% and the new receipts print the lines closer together now. but the print width and the “0in.” padding is not coming through to the printer.

The preview of the receipt that pops up before the actual printing looks correct. The text goes all the way to the edges in preview.

Does the js print file go through another processor before it is eventually printed? Somewhere else I could look for these margins being added? I cannot find any other reason for the print out to have such wide left and right margins. I know the printer works out to the edges because the very top of the receipt has the document type and IP address printed across the top and they do in fact go to the edges. So there must be something else in how the js print file is processed that creates these wide margins.

Attached here is a side by side scan of the original receipt as defaulted by ERPNext and the new version of the receipt.

I know the new format is working as you can see the closer line spacing in the new version of the receipt. You can also see that the printer driver is working properly because the header with “POS” and the ip address go almost all the way to the edges of the paper. There must be something elso going on here that I cannot figure out.

Here is the new version of the js print file:

.print-format table, .print-format tr, .print-format td, .print-format div, .print-format p { font-family: Monospace; line-height: 150%; vertical-align: middle; } @media screen { .print-format { width: 3in; padding: 0.0in; min-height: 8in; } }

{{ company }}
{{ __("POS No : ") }} {{ offline_pos_name }}

{{ __("Customer") }}: {{ customer }}

{{ __("Date") }}: {{ dateutil.global_date_format(posting_date) }}


{% for item in items %} {% endfor %}
{{ __("Item") }} {{ __("Qty") }} {{ __("Amount") }}
{{ item.item_name }} {{ format_number(item.qty, null,precision("difference")) }}
@ {{ format_currency(item.rate, currency) }}
{{ format_currency(item.amount, currency) }}
{% for row in taxes %} {% if not row.included_in_print_rate %} {% endif %} {% endfor %} {% if discount_amount %} {% endif %}
{{ __("Net Total") }} {{ format_currency(total, currency) }}
{{ row.description }} {{ format_currency(row.tax_amount, currency) }}
{{ __("Discount") }} {{ format_currency(discount_amount, currency) }}
{{ __("Grand Total") }} {{ format_currency(grand_total, currency) }}
{{ __("Paid Amount") }} {{ format_currency(paid_amount, currency) }}

{{ terms }}

{{ __("Thank you, please visit again.") }}

You can see under the first “style” heading where I changed the line spacing from 200% to 150% and then just below that I changed the print format width from “4in” to “3in” and the padding from “0.25in” to “0.0in” and yet I still get the .25 inch margins.

Anyone have an idea of where I went wrong?

Thanks,

BKM

Well, I had 2 more printers sitting here for testing. All 3 printers were of different brands and different drivers although all compatible with ESC/POS print functions. So, I install both of the other 2 printers, one ethernet, and one USB. Both have the exact same right and left margins that the first printer displayed.

So, now I have been through 3 different printers and driver sets all tested against the original POS settings and the new POS profile settings and all have the same result.

There must be something else going on aside from the js print file processing for them all to wind up with the unwanted white space in the margins.

Has anyone else seen this condition? Any other ideas for what to try?

BKM

@revant_one

Ok I have played around with this for a few days now and I am still stuck. I took your advice and created a new POS profile. In it I used and new Js Print file. However only some of the things I put in it are actually showing up on the receipt printout. (Examples are in posts above)

Is there another file that needs to be altered in order to eliminate the 0.25 inch padding/margins? I changed it to 0 in the Js Print file but it still uses the wide margins. Does the POS Invoice (server) file have anything to do with the receipt? it looks almost identical to the Js Print file but I am just not sure what function it servers so I did not modify it, only modified the Js Print file.

BKM

@bkm Please can you let me know how you solved this problem.I am using google cloud.I cannot print POS Invoice with thermal printer.Initially i used Point of Sale format and when i connect to the printer and click print,it print the firstpage of the invoice and continue printing empty page continuously until you off the printer.But now that i use POS Invoice,it will not print but give this error message:Printer in Error State.It will not print.
Help

Unfortuantely, I was not able to solve the problem. I am paying a developer team to write custom print files to work better on my thermal POS printers. I will not have the actual files for another few weeks since POS module itself is undergoing several changes right now.

I wish I had better news, but the current method for customizing printed reports is really a developer only area of expertise and implementation guys like myself have to hire out that part of our projects.

I wish there was some urgency to change the ERPNext custom report function to something that a novice user could use. It would make the system much easier to get accepted in my clients locations. Some of my clients choose to use competing systems just because of the difficulty of modifying the printing of reports.

BKM

use paper save option in printer driver so that no empty paper comes out

No such option in any of the POS receipt printers that I have used except the Epson and then it only prevented the printer from pushing the receipt out far enough for the cutter to work. Most useless Epson feature ever.

BKM

May I know what pos printers you use?

I use a generic printer from China and Citizen pronters.

Here is the generic one from China:
https://www.amazon.com/Thermal-Receipt-Printer,Symcode-Ethernet-Serial/dp/B01G6E3LFO/ref=sr_1_13?ie=UTF8&qid=1539275142&sr=8-13&keywords=hillpow+receipt+printer

And here is the Citizen printer that I use:

Honestly they both perform very well. If you were to ask the people using them, they prefer the Citizen.

Sorry for the Amazon links, but that is where I buy them because I can get them in 2 days or less.

BKM

Hello,

Were you able to resolve the problem?
I’m using Xprinter from China and when I hit print, the writings are way too small to read.

KwemZ.

Fix the paper size,

Paper size was fine. Issue was with the print style file.

1 Like