mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-19 09:35:03 +00:00
fix: get valuation rate based of previous SLEs for material receipt
(cherry picked from commit fa9ef6708f)
This commit is contained in:
committed by
Mergify
parent
c6c4e31b32
commit
e9f4a34d8d
@@ -539,7 +539,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,
|
||||
@@ -553,6 +553,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