- frappe/erpnext#6596version-14
@@ -29,7 +29,11 @@ | |||||
</div> | </div> | ||||
{% endif %} | {% endif %} | ||||
<div class="print-format"> | |||||
<div class="print-format {% if landscape %} landscape {% endif %}" | |||||
{% if columns.length > 20 %} | |||||
style="font-size: 4.0pt" | |||||
{% endif %} | |||||
> | |||||
{% if print_settings.letter_head %} | {% if print_settings.letter_head %} | ||||
<div {% if print_settings.repeat_header_footer %} id="header-html" class="hidden-pdf" {% endif %}> | <div {% if print_settings.repeat_header_footer %} id="header-html" class="hidden-pdf" {% endif %}> | ||||
<div class="letter-head">{{ print_settings.letter_head.header }}</div> | <div class="letter-head">{{ print_settings.letter_head.header }}</div> | ||||
@@ -95,6 +95,11 @@ frappe.render_grid = function(opts) { | |||||
} | } | ||||
} | } | ||||
// show landscape view if columns more than 10 | |||||
if(opts.columns.length > 10) { | |||||
opts.landscape = true; | |||||
} | |||||
// render content | // render content | ||||
if(!opts.content) { | if(!opts.content) { | ||||
opts.content = frappe.render_template("print_grid", opts); | opts.content = frappe.render_template("print_grid", opts); | ||||
@@ -106,6 +111,11 @@ frappe.render_grid = function(opts) { | |||||
var html = frappe.render_template("print_template", opts); | var html = frappe.render_template("print_template", opts); | ||||
var w = window.open(); | var w = window.open(); | ||||
if(!w) { | |||||
frappe.msgprint(__("Please enable pop-ups in your browser")) | |||||
} | |||||
w.document.write(html); | w.document.write(html); | ||||
w.document.close(); | w.document.close(); | ||||
} | } |
@@ -12,6 +12,11 @@ | |||||
margin: auto; | margin: auto; | ||||
} | } | ||||
.print-format.landscape { | |||||
max-width: 11.69in; | |||||
padding: 0.2in; | |||||
} | |||||
.page-break { | .page-break { | ||||
padding: 30px 0px; | padding: 30px 0px; | ||||
border-bottom: 1px dashed #888; | border-bottom: 1px dashed #888; | ||||