[fix] make "draft" heading for print format configurable
This commit is contained in:
parent
5b83bb4d27
commit
c966fb3d00
4 changed files with 51 additions and 7 deletions
|
|
@ -135,4 +135,5 @@ execute:frappe.db.sql('''delete from `tabSingles` where doctype="Email Settings"
|
|||
execute:frappe.db.sql("delete from `tabWeb Page` where ifnull(template_path, '')!=''")
|
||||
frappe.patches.v7_0.rename_newsletter_list_to_email_group
|
||||
frappe.patches.v7_0.replace_upgrade_link_limit
|
||||
frappe.patches.v7_0.set_email_group
|
||||
frappe.patches.v7_0.set_email_group
|
||||
execute:frappe.db.set_value("Print Settings", "Print Settings", "add_draft_heading", 1)
|
||||
|
|
@ -8,11 +8,13 @@
|
|||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "System",
|
||||
"editable_grid": 0,
|
||||
"fields": [
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "pdf_settings",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
|
|
@ -37,6 +39,7 @@
|
|||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "1",
|
||||
"description": "Send Email Print Attachments as PDF (Recommended)",
|
||||
"fieldname": "send_print_as_pdf",
|
||||
|
|
@ -63,6 +66,7 @@
|
|||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "1",
|
||||
"fieldname": "repeat_header_footer",
|
||||
"fieldtype": "Check",
|
||||
|
|
@ -89,6 +93,7 @@
|
|||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "column_break_4",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
|
|
@ -113,6 +118,7 @@
|
|||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "A4",
|
||||
"fieldname": "pdf_page_size",
|
||||
"fieldtype": "Select",
|
||||
|
|
@ -139,6 +145,7 @@
|
|||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "view_link_in_email",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
|
|
@ -163,6 +170,7 @@
|
|||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "1",
|
||||
"description": "",
|
||||
"fieldname": "attach_view_link",
|
||||
|
|
@ -190,6 +198,7 @@
|
|||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "print_style_section",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
|
|
@ -214,6 +223,7 @@
|
|||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "Modern",
|
||||
"fieldname": "print_style",
|
||||
"fieldtype": "Select",
|
||||
|
|
@ -240,6 +250,7 @@
|
|||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "Default",
|
||||
"fieldname": "font",
|
||||
"fieldtype": "Select",
|
||||
|
|
@ -267,6 +278,7 @@
|
|||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "In points. Default is 9.",
|
||||
"fieldname": "font_size",
|
||||
"fieldtype": "Float",
|
||||
|
|
@ -292,6 +304,7 @@
|
|||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "column_break_6",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
|
|
@ -315,6 +328,7 @@
|
|||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "1",
|
||||
"description": "",
|
||||
"fieldname": "with_letterhead",
|
||||
|
|
@ -341,6 +355,7 @@
|
|||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "1",
|
||||
"description": "",
|
||||
"fieldname": "allow_print_for_draft",
|
||||
|
|
@ -368,6 +383,34 @@
|
|||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "1",
|
||||
"fieldname": "add_draft_heading",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Always add \"Draft\" Heading for printing draft documents",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "",
|
||||
"fieldname": "allow_print_for_cancelled",
|
||||
"fieldtype": "Check",
|
||||
|
|
@ -394,6 +437,7 @@
|
|||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "section_break_8",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
|
|
@ -417,6 +461,7 @@
|
|||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "print_style_preview",
|
||||
"fieldtype": "HTML",
|
||||
"hidden": 0,
|
||||
|
|
@ -449,7 +494,7 @@
|
|||
"issingle": 1,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-06-22 11:44:01.940693",
|
||||
"modified": "2016-09-12 03:19:17.867459",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Print",
|
||||
"name": "Print Settings",
|
||||
|
|
@ -470,8 +515,6 @@
|
|||
"print": 0,
|
||||
"read": 1,
|
||||
"report": 0,
|
||||
"restrict": 0,
|
||||
"restricted": 0,
|
||||
"role": "System Manager",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
{% for page in layout %}
|
||||
<div class="page-break">
|
||||
<div {% if print_settings.repeat_header_footer %} id="header-html" class="hidden-pdf" {% endif %}>
|
||||
{{ add_header(loop.index, layout|len, doc, letter_head, no_letterhead, footer) }}
|
||||
{{ add_header(loop.index, layout|len, doc, letter_head, no_letterhead, footer, print_settings) }}
|
||||
</div>
|
||||
|
||||
{% if print_settings.repeat_header_footer %}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ data-fieldname="{{ df.fieldname }}" data-fieldtype="{{ df.fieldtype }}"
|
|||
{%- endif -%}
|
||||
{% endmacro %}
|
||||
|
||||
{%- macro add_header(page_num, max_pages, doc, letter_head, no_letterhead, footer) -%}
|
||||
{%- macro add_header(page_num, max_pages, doc, letter_head, no_letterhead, footer, print_settings=None) -%}
|
||||
{% if letter_head and not no_letterhead %}
|
||||
<div class="letter-head">{{ letter_head }}</div>
|
||||
{% endif %}
|
||||
|
|
@ -125,7 +125,7 @@ data-fieldname="{{ df.fieldname }}" data-fieldtype="{{ df.fieldtype }}"
|
|||
</h2>
|
||||
</div>
|
||||
{% endif %}
|
||||
{%- if doc.meta.is_submittable and doc.docstatus==0-%}
|
||||
{%- if doc.meta.is_submittable and doc.docstatus==0 and (print_settings==None or print_settings.add_draft_heading) -%}
|
||||
<div class="text-center" document-status="draft">
|
||||
<h4 style="margin: 0px;">{{ _("DRAFT") }}</h4>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue