[Enhancement] Added letter head for the report (#7250)
This commit is contained in:
parent
17d05b4fd7
commit
34e820d02d
@ -297,6 +297,8 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
|||||||
this.print_template = r.message.print_template;
|
this.print_template = r.message.print_template;
|
||||||
this.pos_profile_data = r.message.pos_profile;
|
this.pos_profile_data = r.message.pos_profile;
|
||||||
this.default_customer = r.message.default_customer || null;
|
this.default_customer = r.message.default_customer || null;
|
||||||
|
this.print_settings = locals[":Print Settings"]["Print Settings"];
|
||||||
|
this.letter_head = frappe.boot.letter_heads[this.pos_profile_data[letter_head]] || {};
|
||||||
},
|
},
|
||||||
|
|
||||||
save_previous_entry : function(){
|
save_previous_entry : function(){
|
||||||
@ -327,9 +329,9 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
|||||||
frappe.meta.sync(data)
|
frappe.meta.sync(data)
|
||||||
})
|
})
|
||||||
|
|
||||||
this.print_template_data = frappe.render_template("print_template",
|
this.print_template_data = frappe.render_template("print_template", {content: this.print_template,
|
||||||
{content: this.print_template, title:"POS",
|
title:"POS", base_url: frappe.urllib.get_base_url(), print_css: frappe.boot.print_css,
|
||||||
base_url: frappe.urllib.get_base_url(), print_css: frappe.boot.print_css})
|
print_settings: this.print_settings, header: this.letter_head.header, footer: this.letter_head.footer})
|
||||||
},
|
},
|
||||||
|
|
||||||
setup: function(){
|
setup: function(){
|
||||||
|
@ -80,13 +80,6 @@ frappe.query_reports["General Ledger"] = {
|
|||||||
"fieldname":"group_by_account",
|
"fieldname":"group_by_account",
|
||||||
"label": __("Group by Account"),
|
"label": __("Group by Account"),
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname":"letter_head",
|
|
||||||
"label": __("Letter Head"),
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"options": "Letter Head",
|
|
||||||
"default": frappe.defaults.get_default("letter_head"),
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,6 @@ def boot_session(bootinfo):
|
|||||||
bootinfo.website_settings = frappe.get_doc('Website Settings')
|
bootinfo.website_settings = frappe.get_doc('Website Settings')
|
||||||
|
|
||||||
if frappe.session['user']!='Guest':
|
if frappe.session['user']!='Guest':
|
||||||
bootinfo.letter_heads = get_letter_heads()
|
|
||||||
|
|
||||||
update_page_info(bootinfo)
|
update_page_info(bootinfo)
|
||||||
|
|
||||||
load_country_and_currency(bootinfo)
|
load_country_and_currency(bootinfo)
|
||||||
@ -42,12 +40,6 @@ def load_country_and_currency(bootinfo):
|
|||||||
number_format, smallest_currency_fraction_value, symbol from tabCurrency
|
number_format, smallest_currency_fraction_value, symbol from tabCurrency
|
||||||
where enabled=1""", as_dict=1, update={"doctype":":Currency"})
|
where enabled=1""", as_dict=1, update={"doctype":":Currency"})
|
||||||
|
|
||||||
def get_letter_heads():
|
|
||||||
import frappe
|
|
||||||
ret = frappe.db.sql("""select name, content from `tabLetter Head`
|
|
||||||
where disabled=0""")
|
|
||||||
return dict(ret)
|
|
||||||
|
|
||||||
def update_page_info(bootinfo):
|
def update_page_info(bootinfo):
|
||||||
bootinfo.page_info.update({
|
bootinfo.page_info.update({
|
||||||
"Chart of Accounts": {
|
"Chart of Accounts": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user