mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-27 00:26:03 +00:00
Merge pull request #50215 from rohitwaghchaure/fixed-valuation-rate
fix: get valuation rate based of previous SLEs for material receipt
This commit is contained in:
@@ -563,7 +563,7 @@ frappe.ui.form.on("Stock Entry", {
|
||||
const item = locals[cdt][cdn];
|
||||
item.transfer_qty = flt(item.qty) * flt(item.conversion_factor);
|
||||
|
||||
const args = {
|
||||
let args = {
|
||||
item_code: item.item_code,
|
||||
posting_date: frm.doc.posting_date,
|
||||
posting_time: frm.doc.posting_time,
|
||||
@@ -577,6 +577,10 @@ frappe.ui.form.on("Stock Entry", {
|
||||
allow_zero_valuation: 1,
|
||||
};
|
||||
|
||||
if (item.batch_no && frm.doc.purpose == "Material Receipt") {
|
||||
args.qty = Math.abs(args.qty) * -1;
|
||||
}
|
||||
|
||||
if (item.item_code || item.serial_no) {
|
||||
frappe.call({
|
||||
method: "erpnext.stock.utils.get_incoming_rate",
|
||||
|
||||
Reference in New Issue
Block a user