[fixe] typo-fixes and set base currency symbol to gross-profit and valuation rate
This commit is contained in:
parent
d313553ae3
commit
2d7af63351
@ -603,7 +603,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if (!r.exc && r.message) {
|
if (!r.exc && r.message) {
|
||||||
me._set_values_for_item_list(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();
|
if(calculate_taxes_and_totals) me.calculate_taxes_and_totals();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -879,9 +879,11 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
gross_profit: function(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));
|
item.gross_profit = flt((((item.rate - item.valuation_rate) * item.qty) * (this.frm.doc.conversion_rate || 1)), precision("amount", item));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
frappe.ui.form.on(cur_frm.doctype + " Item", "rate", function(frm, cdt, cdn) {
|
frappe.ui.form.on(cur_frm.doctype + " Item", "rate", function(frm, cdt, cdn) {
|
||||||
@ -894,7 +896,7 @@ frappe.ui.form.on(cur_frm.doctype + " Item", "rate", function(frm, cdt, cdn) {
|
|||||||
item.discount_percentage = 0.0;
|
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();
|
cur_frm.cscript.calculate_taxes_and_totals();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -1232,6 +1232,7 @@
|
|||||||
"label": "Valuation Rate",
|
"label": "Valuation Rate",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
|
"options": "Company:company:default_currency",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "",
|
"precision": "",
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
@ -1257,6 +1258,7 @@
|
|||||||
"label": "Gross Profit",
|
"label": "Gross Profit",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
|
"options": "Company:company:default_currency",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "",
|
"precision": "",
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
@ -1390,7 +1392,7 @@
|
|||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"menu_index": 0,
|
"menu_index": 0,
|
||||||
"modified": "2016-02-25 17:52:22.402065",
|
"modified": "2016-02-26 11:08:24.708912",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Selling",
|
"module": "Selling",
|
||||||
"name": "Sales Order Item",
|
"name": "Sales Order Item",
|
||||||
|
@ -125,7 +125,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
|
|||||||
item.rate = flt(item.price_list_rate * (1 - item.discount_percentage / 100.0),
|
item.rate = flt(item.price_list_rate * (1 - item.discount_percentage / 100.0),
|
||||||
precision("rate", item));
|
precision("rate", item));
|
||||||
|
|
||||||
this.gross_profit(item);
|
this.set_gross_profit(item);
|
||||||
this.calculate_taxes_and_totals();
|
this.calculate_taxes_and_totals();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ def get_item_details(args):
|
|||||||
if args.get("is_subcontracted") == "Yes":
|
if args.get("is_subcontracted") == "Yes":
|
||||||
out.bom = get_default_bom(args.item_code)
|
out.bom = get_default_bom(args.item_code)
|
||||||
|
|
||||||
get_goss_profit(out)
|
get_gross_profit(out)
|
||||||
|
|
||||||
return 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))
|
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({
|
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
|
return out
|
||||||
|
Loading…
x
Reference in New Issue
Block a user