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