소스 검색

[Printview] Show Landscape view if columns more than 10 (#3336)

- frappe/erpnext#6596
version-14
Faris Ansari 8 년 전
committed by Rushabh Mehta
부모
커밋
70e8e007f1
3개의 변경된 파일20개의 추가작업 그리고 1개의 파일을 삭제
  1. +5
    -1
      frappe/public/html/print_template.html
  2. +10
    -0
      frappe/public/js/lib/microtemplate.js
  3. +5
    -0
      frappe/templates/styles/standard.css

+ 5
- 1
frappe/public/html/print_template.html 파일 보기

@@ -29,7 +29,11 @@
</div>
{% 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 %}
<div {% if print_settings.repeat_header_footer %} id="header-html" class="hidden-pdf" {% endif %}>
<div class="letter-head">{{ print_settings.letter_head.header }}</div>


+ 10
- 0
frappe/public/js/lib/microtemplate.js 파일 보기

@@ -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
if(!opts.content) {
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 w = window.open();

if(!w) {
frappe.msgprint(__("Please enable pop-ups in your browser"))
}

w.document.write(html);
w.document.close();
}

+ 5
- 0
frappe/templates/styles/standard.css 파일 보기

@@ -12,6 +12,11 @@
margin: auto;
}

.print-format.landscape {
max-width: 11.69in;
padding: 0.2in;
}

.page-break {
padding: 30px 0px;
border-bottom: 1px dashed #888;


불러오는 중...
취소
저장