Merge pull request #14061 from rohitwaghchaure/budget_validation_enhance_in_mr_po

[Enhance] Budget validation on material request, purchase order
This commit is contained in:
rohitwaghchaure
2018-05-15 22:18:17 +05:30
committed by GitHub
9 changed files with 633 additions and 125 deletions

View File

@@ -741,7 +741,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
},
conversion_factor: function(doc, cdt, cdn, dont_fetch_price_list_rate) {
if(frappe.meta.get_docfield(cdt, "stock_qty", cdn)) {
if(doc.doctype != 'Material Request' && frappe.meta.get_docfield(cdt, "stock_qty", cdn)) {
var item = frappe.get_doc(cdt, cdn);
frappe.model.round_floats_in(item, ["qty", "conversion_factor"]);
item.stock_qty = flt(item.qty * item.conversion_factor, precision("stock_qty", item));