From 81501ddc6d34d5215c268407554c69d9782e2aaf Mon Sep 17 00:00:00 2001 From: Saurabh Date: Fri, 20 May 2016 12:03:55 +0530 Subject: [PATCH] [fixes] add setting to mark cheque account pay only --- .../cheque_print_template.js | 4 + .../cheque_print_template.json | 112 +++++++++++++++++- .../cheque_print_template.py | 10 +- .../en/accounts/articles/cheque-print.md | 6 + .../manual/en/accounts/articles/index.txt | 3 +- 5 files changed, 129 insertions(+), 6 deletions(-) create mode 100644 erpnext/docs/user/manual/en/accounts/articles/cheque-print.md diff --git a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.js b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.js index cd55c16be3..dea3af6772 100644 --- a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.js +++ b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.js @@ -20,6 +20,10 @@ frappe.ui.form.on('Cheque Print Template', { background-image: url({{ scanned_cheque }});\ background-repeat: no-repeat;\ background-size: cover;">\ + {{ message_to_show || __("Account Pay Only") }} \ {{ frappe.datetime.obj_to_user() }} \ diff --git a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.json b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.json index 19b5a93fd3..9cec920637 100644 --- a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.json +++ b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.json @@ -214,6 +214,31 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "scanned_cheque", + "fieldtype": "Attach", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Scanned Cheque", + "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, @@ -242,14 +267,92 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, - "fieldname": "scanned_cheque", - "fieldtype": "Attach", + "fieldname": "is_account_payable", + "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, - "label": "Scanned Cheque", + "label": "Is Account Payable", + "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, + "depends_on": "eval:doc.is_account_payable", + "fieldname": "acc_pay_dist_from_top_edge", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Distance from top edge", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "2", + "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, + "depends_on": "eval:doc.is_account_payable", + "fieldname": "acc_pay_dist_from_left_edge", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Distance from left edge", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "2", + "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, + "depends_on": "eval:doc.is_account_payable", + "fieldname": "message_to_show", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Message to show", "length": 0, "no_copy": 0, "permlevel": 0, @@ -343,6 +446,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "depends_on": "", "fieldname": "date_dist_from_left_edge", "fieldtype": "Float", "hidden": 0, @@ -898,7 +1002,7 @@ "issingle": 0, "istable": 0, "max_attachments": 1, - "modified": "2016-05-16 12:32:26.649060", + "modified": "2016-05-19 13:30:26.754096", "modified_by": "Administrator", "module": "Accounts", "name": "Cheque Print Template", diff --git a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py index eb3e3d5e4a..14543c40ea 100644 --- a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py +++ b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py @@ -5,6 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document +from frappe import _ class ChequePrintTemplate(Document): pass @@ -28,13 +29,17 @@ def create_or_update_cheque_print_format(template_name): cheque_print.html = """
+ + %(message_to_show)s + {{doc.cheque_date or '' }} - {{ doc.account_no or "Account No" }} + {{ doc.account_no }} @@ -58,6 +63,9 @@ def create_or_update_cheque_print_format(template_name): "starting_position_from_top_edge": doc.starting_position_from_top_edge \ if doc.cheque_size == "A4" else 0.0, "cheque_width": doc.cheque_width, "cheque_height": doc.cheque_height, + "acc_pay_dist_from_top_edge": doc.acc_pay_dist_from_top_edge, + "acc_pay_dist_from_left_edge": doc.acc_pay_dist_from_left_edge, + "message_to_show": doc.message_to_show if doc.message_to_show else _("Account Pay Only"), "date_dist_from_top_edge": doc.date_dist_from_top_edge, "date_dist_from_left_edge": doc.date_dist_from_left_edge, "acc_no_dist_from_top_edge": doc.acc_no_dist_from_top_edge, diff --git a/erpnext/docs/user/manual/en/accounts/articles/cheque-print.md b/erpnext/docs/user/manual/en/accounts/articles/cheque-print.md new file mode 100644 index 0000000000..4920c2e05d --- /dev/null +++ b/erpnext/docs/user/manual/en/accounts/articles/cheque-print.md @@ -0,0 +1,6 @@ +#Cheque Print + +** Whats is Cheque Print? ** + +You can choose to print Cheques at the time of making payments to Creditors/ parties during Voucher Entry i.e., directly from the Payment Vouchers and Inter-bank payment or transfers through Contra Vouchers. + diff --git a/erpnext/docs/user/manual/en/accounts/articles/index.txt b/erpnext/docs/user/manual/en/accounts/articles/index.txt index 76ace0b707..d54f0cda8e 100644 --- a/erpnext/docs/user/manual/en/accounts/articles/index.txt +++ b/erpnext/docs/user/manual/en/accounts/articles/index.txt @@ -12,4 +12,5 @@ fiscal-year-creation post-dated-cheque-entry update-stock-option-in-sales-invoice what-is-the-differences-of-total-and-valuation-in-tax-and-charges -withdrawing-salary-from-owners-equity-account \ No newline at end of file +withdrawing-salary-from-owners-equity-account +cheque-print \ No newline at end of file