Merge pull request #21389 from marination/stock-entry-qty

fix: Issues on qty trigger in Stock Entry Detail
This commit is contained in:
rohitwaghchaure 2020-04-26 17:59:45 +05:30 committed by GitHub
commit 733b47c5e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -312,10 +312,9 @@ frappe.ui.form.on('Stock Entry', {
callback: function(r) {
if (!r.exe && r.message){
frappe.model.set_value(cdt, cdn, "serial_no", r.message);
if (callback) {
callback();
}
}
if (callback) {
callback();
}
}
});
@ -511,9 +510,10 @@ frappe.ui.form.on('Stock Entry', {
item.amount = flt(item.basic_amount + flt(item.additional_cost),
precision("amount", item));
item.valuation_rate = flt(flt(item.basic_rate)
+ (flt(item.additional_cost) / flt(item.transfer_qty)),
precision("valuation_rate", item));
if (flt(item.transfer_qty)) {
item.valuation_rate = flt(flt(item.basic_rate) + (flt(item.additional_cost) / flt(item.transfer_qty)),
precision("valuation_rate", item));
}
}
refresh_field('items');