fix: stock ledger variance report filter options (#44137)
(cherry picked from commit e8bbf6492f)
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
@@ -47,7 +47,23 @@ frappe.query_reports["Stock Ledger Variance"] = {
|
|||||||
fieldname: "difference_in",
|
fieldname: "difference_in",
|
||||||
fieldtype: "Select",
|
fieldtype: "Select",
|
||||||
label: __("Difference In"),
|
label: __("Difference In"),
|
||||||
options: ["", "Qty", "Value", "Valuation"],
|
options: [
|
||||||
|
{
|
||||||
|
// Check "Stock Ledger Invariant Check" report with A - B column
|
||||||
|
label: __("Quantity (A - B)"),
|
||||||
|
value: "Qty",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Check "Stock Ledger Invariant Check" report with G - D column
|
||||||
|
label: __("Value (G - D)"),
|
||||||
|
value: "Value",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Check "Stock Ledger Invariant Check" report with I - K column
|
||||||
|
label: __("Valuation (I - K)"),
|
||||||
|
value: "Valuation",
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldname: "include_disabled",
|
fieldname: "include_disabled",
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
|
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
# For license information, please see license.txt
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
import json
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _
|
||||||
from frappe.utils import cint, flt
|
from frappe.utils import cint, flt
|
||||||
@@ -270,12 +272,16 @@ def has_difference(row, precision, difference_in, valuation_method):
|
|||||||
value_diff = flt(row.diff_value_diff, precision)
|
value_diff = flt(row.diff_value_diff, precision)
|
||||||
valuation_diff = flt(row.valuation_diff, precision)
|
valuation_diff = flt(row.valuation_diff, precision)
|
||||||
else:
|
else:
|
||||||
qty_diff = flt(row.difference_in_qty, precision) or flt(row.fifo_qty_diff, precision)
|
qty_diff = flt(row.difference_in_qty, precision)
|
||||||
value_diff = (
|
value_diff = flt(row.diff_value_diff, precision)
|
||||||
flt(row.diff_value_diff, precision)
|
|
||||||
or flt(row.fifo_value_diff, precision)
|
if row.stock_queue and json.loads(row.stock_queue):
|
||||||
or flt(row.fifo_difference_diff, precision)
|
value_diff = value_diff or (
|
||||||
)
|
flt(row.fifo_value_diff, precision) or flt(row.fifo_difference_diff, precision)
|
||||||
|
)
|
||||||
|
|
||||||
|
qty_diff = qty_diff or flt(row.fifo_qty_diff, precision)
|
||||||
|
|
||||||
valuation_diff = flt(row.valuation_diff, precision) or flt(row.fifo_valuation_diff, precision)
|
valuation_diff = flt(row.valuation_diff, precision) or flt(row.fifo_valuation_diff, precision)
|
||||||
|
|
||||||
if difference_in == "Qty" and qty_diff:
|
if difference_in == "Qty" and qty_diff:
|
||||||
|
|||||||
Reference in New Issue
Block a user