[fixe] typo-fixes and set base currency symbol to gross-profit and valuation rate
This commit is contained in:
@@ -603,7 +603,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
||||
callback: function(r) {
|
||||
if (!r.exc && r.message) {
|
||||
me._set_values_for_item_list(r.message);
|
||||
if(item) me.gross_profit(item);
|
||||
if(item) me.set_gross_profit(item);
|
||||
if(calculate_taxes_and_totals) me.calculate_taxes_and_totals();
|
||||
}
|
||||
}
|
||||
@@ -879,8 +879,10 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
||||
}
|
||||
},
|
||||
|
||||
gross_profit: function(item) {
|
||||
item.gross_profit = flt((((item.rate - item.valuation_rate) * item.qty) * (this.frm.doc.conversion_rate || 1)), precision("amount", item));
|
||||
set_gross_profit: function(item) {
|
||||
if (this.frm.doc.doctype == "Sales Order") {
|
||||
item.gross_profit = flt((((item.rate - item.valuation_rate) * item.qty) * (this.frm.doc.conversion_rate || 1)), precision("amount", item));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -894,7 +896,7 @@ frappe.ui.form.on(cur_frm.doctype + " Item", "rate", function(frm, cdt, cdn) {
|
||||
item.discount_percentage = 0.0;
|
||||
}
|
||||
|
||||
cur_frm.cscript.gross_profit(item);
|
||||
cur_frm.cscript.set_gross_profit(item);
|
||||
cur_frm.cscript.calculate_taxes_and_totals();
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user