Merge pull request #5008 from rohitwaghchaure/support_week_14_03_5
[fix]Letterhead not being changed with change in company
This commit is contained in:
commit
dcedac7f25
@ -308,7 +308,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.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, function() { set_party_account(set_pricing); });
|
set_party_account(set_pricing);
|
||||||
|
|
||||||
if(this.frm.doc.company) {
|
if(this.frm.doc.company) {
|
||||||
erpnext.last_selected_company = this.frm.doc.company;
|
erpnext.last_selected_company = this.frm.doc.company;
|
||||||
@ -319,8 +319,6 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
if (this.frm.doc.transaction_date) {
|
if (this.frm.doc.transaction_date) {
|
||||||
this.frm.transaction_date = this.frm.doc.transaction_date;
|
this.frm.transaction_date = this.frm.doc.transaction_date;
|
||||||
}
|
}
|
||||||
|
|
||||||
erpnext.get_fiscal_year(this.frm.doc.company, this.frm.doc.transaction_date);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
posting_date: function() {
|
posting_date: function() {
|
||||||
@ -342,11 +340,8 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
if(r.message) {
|
if(r.message) {
|
||||||
me.frm.set_value("due_date", r.message);
|
me.frm.set_value("due_date", r.message);
|
||||||
}
|
}
|
||||||
erpnext.get_fiscal_year(me.frm.doc.company, me.frm.doc.posting_date);
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
|
||||||
erpnext.get_fiscal_year(me.frm.doc.company, me.frm.doc.posting_date);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -13,24 +13,6 @@ $.extend(erpnext, {
|
|||||||
return frappe.boot.sysdefaults.currency;
|
return frappe.boot.sysdefaults.currency;
|
||||||
},
|
},
|
||||||
|
|
||||||
get_fiscal_year: function(company, date, fn) {
|
|
||||||
if(frappe.meta.get_docfield(cur_frm.doctype, "fiscal_year")) {
|
|
||||||
frappe.call({
|
|
||||||
type:"GET",
|
|
||||||
method: "erpnext.accounts.utils.get_fiscal_year",
|
|
||||||
args: {
|
|
||||||
"company": company,
|
|
||||||
"date": date,
|
|
||||||
"verbose": 0
|
|
||||||
},
|
|
||||||
callback: function(r) {
|
|
||||||
if (r.message) cur_frm.set_value("fiscal_year", r.message[0]);
|
|
||||||
if (fn) fn();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
toggle_naming_series: function() {
|
toggle_naming_series: function() {
|
||||||
if(cur_frm.fields_dict.naming_series) {
|
if(cur_frm.fields_dict.naming_series) {
|
||||||
cur_frm.toggle_display("naming_series", cur_frm.doc.__islocal?true:false);
|
cur_frm.toggle_display("naming_series", cur_frm.doc.__islocal?true:false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user