company wise letter head feature added

This commit is contained in:
Neil Trini Lasrado 2014-12-15 15:49:40 +05:30 committed by Nabin Hait
parent b0b7e7fdf8
commit 31a92bd9d9
4 changed files with 341 additions and 312 deletions

View File

@ -413,3 +413,8 @@ def get_outstanding_invoices(amount_query, account, party_type, party):
}) })
return all_outstanding_vouchers return all_outstanding_vouchers
@frappe.whitelist()
def get_letter_head(company):
return frappe.db.get_value("Company",company,"default_letter_head")

View File

@ -230,6 +230,8 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
if (this.frm.doc.posting_date) var date = this.frm.doc.posting_date; if (this.frm.doc.posting_date) var date = this.frm.doc.posting_date;
else var date = this.frm.doc.transaction_date; else var date = this.frm.doc.transaction_date;
erpnext.get_fiscal_year(this.frm.doc.company, date, fn); erpnext.get_fiscal_year(this.frm.doc.company, date, fn);
erpnext.get_letter_head(this.frm.doc.company);
}, },
transaction_date: function() { transaction_date: function() {

View File

@ -99,6 +99,20 @@ $.extend(erpnext, {
d.show(); d.show();
}); });
}, },
get_letter_head: function(company) {
frappe.call({
type:"GET",
method: "erpnext.accounts.utils.get_letter_head",
args: {
"company": company
},
callback: function(r) {
if (!r.exe) cur_frm.set_value("letter_head", r.message);
}
});
},
}); });

View File

@ -186,6 +186,14 @@
"read_only": 0, "read_only": 0,
"reqd": 1 "reqd": 1
}, },
{
"fieldname": "default_letter_head",
"fieldtype": "Link",
"label": "Default Letter Head",
"options": "Letter Head",
"permlevel": 0,
"precision": ""
},
{ {
"depends_on": "eval:!doc.__islocal", "depends_on": "eval:!doc.__islocal",
"fieldname": "cost_center", "fieldname": "cost_center",
@ -364,7 +372,7 @@
], ],
"icon": "icon-building", "icon": "icon-building",
"idx": 1, "idx": 1,
"modified": "2014-11-27 18:15:48.909416", "modified": "2014-12-15 11:14:12.090020",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Setup", "module": "Setup",
"name": "Company", "name": "Company",