fix: valuation rate for batch in stock reconciliation (#44657)
fix: valuation rate for batch in stock reco
(cherry picked from commit 15c7d26378)
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
@@ -207,6 +207,7 @@ frappe.ui.form.on("Stock Reconciliation", {
|
|||||||
posting_time: frm.doc.posting_time,
|
posting_time: frm.doc.posting_time,
|
||||||
batch_no: d.batch_no,
|
batch_no: d.batch_no,
|
||||||
row: d,
|
row: d,
|
||||||
|
company: frm.doc.company,
|
||||||
},
|
},
|
||||||
callback: function (r) {
|
callback: function (r) {
|
||||||
const row = frappe.model.get_doc(cdt, cdn);
|
const row = frappe.model.get_doc(cdt, cdn);
|
||||||
|
|||||||
@@ -466,6 +466,7 @@ class StockReconciliation(StockController):
|
|||||||
batch_no=item.batch_no,
|
batch_no=item.batch_no,
|
||||||
inventory_dimensions_dict=inventory_dimensions_dict,
|
inventory_dimensions_dict=inventory_dimensions_dict,
|
||||||
row=item,
|
row=item,
|
||||||
|
company=self.company,
|
||||||
)
|
)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@@ -974,6 +975,7 @@ class StockReconciliation(StockController):
|
|||||||
self.posting_date,
|
self.posting_date,
|
||||||
self.posting_time,
|
self.posting_time,
|
||||||
row=row,
|
row=row,
|
||||||
|
company=self.company,
|
||||||
)
|
)
|
||||||
|
|
||||||
current_qty = item_dict.get("qty")
|
current_qty = item_dict.get("qty")
|
||||||
@@ -1308,6 +1310,7 @@ def get_stock_balance_for(
|
|||||||
with_valuation_rate: bool = True,
|
with_valuation_rate: bool = True,
|
||||||
inventory_dimensions_dict=None,
|
inventory_dimensions_dict=None,
|
||||||
row=None,
|
row=None,
|
||||||
|
company=None,
|
||||||
):
|
):
|
||||||
frappe.has_permission("Stock Reconciliation", "write", throw=True)
|
frappe.has_permission("Stock Reconciliation", "write", throw=True)
|
||||||
|
|
||||||
@@ -1367,6 +1370,21 @@ def get_stock_balance_for(
|
|||||||
or 0
|
or 0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if row.use_serial_batch_fields and row.batch_no:
|
||||||
|
rate = get_incoming_rate(
|
||||||
|
frappe._dict(
|
||||||
|
{
|
||||||
|
"item_code": row.item_code,
|
||||||
|
"warehouse": row.warehouse,
|
||||||
|
"qty": row.qty * -1,
|
||||||
|
"batch_no": row.batch_no,
|
||||||
|
"company": company,
|
||||||
|
"posting_date": posting_date,
|
||||||
|
"posting_time": posting_time,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"qty": qty,
|
"qty": qty,
|
||||||
"rate": rate,
|
"rate": rate,
|
||||||
|
|||||||
Reference in New Issue
Block a user