[minor] [fix] call company trigger in onload for a new selling/buying transaction
This commit is contained in:
parent
82e006917a
commit
535d833523
@ -103,7 +103,7 @@
|
||||
<tr>
|
||||
<td>Net Total</td>
|
||||
<td width=40% style="text-align: right;">{{
|
||||
utils.fmt_money(doc.net_total/doc.conversion_rate, currency=doc.currency)
|
||||
utils.fmt_money(doc.net_total_export, currency=doc.currency)
|
||||
}}</td>
|
||||
</tr>
|
||||
{%- for charge in doclist.get({"doctype":"Sales Taxes and Charges"}) -%}
|
||||
|
@ -39,6 +39,8 @@ erpnext.TransactionController = wn.ui.form.Controller.extend({
|
||||
if(me.frm.fields_dict[fieldname] && !me.frm.doc[fieldname])
|
||||
me.frm.set_value(fieldname, value);
|
||||
});
|
||||
|
||||
me.frm.script_manager.trigger("company");
|
||||
}
|
||||
},
|
||||
|
||||
@ -75,9 +77,9 @@ erpnext.TransactionController = wn.ui.form.Controller.extend({
|
||||
var me = this;
|
||||
var company_currency = this.get_company_currency();
|
||||
$.each(["currency", "price_list_currency"], function(i, fieldname) {
|
||||
if(!me.doc[fieldname]) {
|
||||
if(!me.frm.doc[fieldname]) {
|
||||
me.frm.set_value(fieldname, company_currency);
|
||||
me[fieldname]();
|
||||
me.script_manager.trigger(fieldname);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -106,8 +108,7 @@ erpnext.TransactionController = wn.ui.form.Controller.extend({
|
||||
},
|
||||
|
||||
conversion_rate: function() {
|
||||
if(this.frm.doc.currency === this.get_company_currency() &&
|
||||
this.frm.doc.conversion_rate !== 1.0) {
|
||||
if(this.frm.doc.currency === this.get_company_currency()) {
|
||||
this.frm.set_value("conversion_rate", 1.0);
|
||||
} else if(this.frm.doc.currency === this.frm.doc.price_list_currency &&
|
||||
this.frm.doc.plc_conversion_rate !== this.frm.doc.conversion_rate) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user