Merge pull request #5034 from rmehta/letter-head-in-salary

[fix] default letter in salary slip comes from customized default or company and optimized boot for curreny
This commit is contained in:
Nabin Hait 2016-03-23 11:38:20 +05:30
commit 76db1d702f
2 changed files with 16 additions and 6 deletions

View File

@ -2,7 +2,16 @@
// License: GNU General Public License v3. See license.txt // License: GNU General Public License v3. See license.txt
cur_frm.add_fetch('employee', 'company', 'company'); cur_frm.add_fetch('employee', 'company', 'company');
cur_frm.add_fetch('company', 'default_letter_head', 'letter_head');
frappe.ui.form.on("Salary Slip", {
company: function(frm) {
var company = locals[':Company'][frm.doc.company];
if(!frm.doc.letter_head && company.default_letter_head) {
frm.set_value('letter_head', company.default_letter_head);
}
}
})
// On load // On load
// ------------------------------------------------------------------- // -------------------------------------------------------------------

View File

@ -38,7 +38,8 @@ def load_country_and_currency(bootinfo):
if country and frappe.db.exists("Country", country): if country and frappe.db.exists("Country", country):
bootinfo.docs += [frappe.get_doc("Country", country)] bootinfo.docs += [frappe.get_doc("Country", country)]
bootinfo.docs += frappe.db.sql("""select * from tabCurrency bootinfo.docs += frappe.db.sql("""select name, fraction, fraction_units,
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(): def get_letter_heads():