[fixe] typo-fixes and set base currency symbol to gross-profit and valuation rate

This commit is contained in:
Saurabh 2016-02-26 11:09:20 +05:30
parent d313553ae3
commit 2d7af63351
4 changed files with 15 additions and 9 deletions

View File

@ -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();
})

View File

@ -1232,6 +1232,7 @@
"label": "Valuation Rate",
"length": 0,
"no_copy": 1,
"options": "Company:company:default_currency",
"permlevel": 0,
"precision": "",
"print_hide": 1,
@ -1257,6 +1258,7 @@
"label": "Gross Profit",
"length": 0,
"no_copy": 1,
"options": "Company:company:default_currency",
"permlevel": 0,
"precision": "",
"print_hide": 1,
@ -1390,7 +1392,7 @@
"istable": 1,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-02-25 17:52:22.402065",
"modified": "2016-02-26 11:08:24.708912",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Order Item",

View File

@ -125,7 +125,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
item.rate = flt(item.price_list_rate * (1 - item.discount_percentage / 100.0),
precision("rate", item));
this.gross_profit(item);
this.set_gross_profit(item);
this.calculate_taxes_and_totals();
},

View File

@ -68,7 +68,7 @@ def get_item_details(args):
if args.get("is_subcontracted") == "Yes":
out.bom = get_default_bom(args.item_code)
get_goss_profit(out)
get_gross_profit(out)
return out
@ -470,8 +470,10 @@ def get_default_bom(item_code=None):
frappe.throw(_("No default BOM exists for Item {0}").format(item_code))
def get_goss_profit(out):
def get_gross_profit(out):
if isinstance(out.valuation_rate, dict): return out
out.update({
"gross_profit": ((out.price_list_rate - out.valuation_rate) * out.qty) * (out.conversio_rate or 1)
"gross_profit": ((out.base_rate - out.valuation_rate) * out.qty)
})
return out