[Enhance] Budget validation on material request, purchase order

This commit is contained in:
Rohit Waghchaure
2018-05-15 22:12:44 +05:30
parent c0b15cf41a
commit 4d4fb6dcbc
9 changed files with 633 additions and 125 deletions

View File

@@ -733,7 +733,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));