feat: `Company` filter in `Stock Ledger Variance` report (cherry picked from commit fb3421fccee518799a36a27d79bf4f6632736f81) Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
This commit is contained in:
parent
39e04b119a
commit
02d7dd8b15
@ -13,10 +13,18 @@ const DIFFERENCE_FIELD_NAMES = [
|
|||||||
|
|
||||||
frappe.query_reports["Stock Ledger Variance"] = {
|
frappe.query_reports["Stock Ledger Variance"] = {
|
||||||
"filters": [
|
"filters": [
|
||||||
|
{
|
||||||
|
"fieldname": "company",
|
||||||
|
"label": __("Company"),
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"options": "Company",
|
||||||
|
"reqd": 1,
|
||||||
|
"default": frappe.defaults.get_user_default("Company")
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "item_code",
|
"fieldname": "item_code",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Item",
|
"label": __("Item"),
|
||||||
"options": "Item",
|
"options": "Item",
|
||||||
get_query: function() {
|
get_query: function() {
|
||||||
return {
|
return {
|
||||||
@ -27,7 +35,7 @@ frappe.query_reports["Stock Ledger Variance"] = {
|
|||||||
{
|
{
|
||||||
"fieldname": "warehouse",
|
"fieldname": "warehouse",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Warehouse",
|
"label": __("Warehouse"),
|
||||||
"options": "Warehouse",
|
"options": "Warehouse",
|
||||||
get_query: function() {
|
get_query: function() {
|
||||||
return {
|
return {
|
||||||
@ -38,7 +46,7 @@ frappe.query_reports["Stock Ledger Variance"] = {
|
|||||||
{
|
{
|
||||||
"fieldname": "difference_in",
|
"fieldname": "difference_in",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"label": "Difference In",
|
"label": __("Difference In"),
|
||||||
"options": [
|
"options": [
|
||||||
"",
|
"",
|
||||||
"Qty",
|
"Qty",
|
||||||
@ -49,7 +57,7 @@ frappe.query_reports["Stock Ledger Variance"] = {
|
|||||||
{
|
{
|
||||||
"fieldname": "include_disabled",
|
"fieldname": "include_disabled",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Include Disabled",
|
"label": __("Include Disabled"),
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
@ -230,7 +230,12 @@ def get_item_warehouse_combinations(filters: dict = None) -> dict:
|
|||||||
bin.item_code,
|
bin.item_code,
|
||||||
bin.warehouse,
|
bin.warehouse,
|
||||||
)
|
)
|
||||||
.where((item.is_stock_item == 1) & (item.has_serial_no == 0) & (warehouse.is_group == 0))
|
.where(
|
||||||
|
(item.is_stock_item == 1)
|
||||||
|
& (item.has_serial_no == 0)
|
||||||
|
& (warehouse.is_group == 0)
|
||||||
|
& (warehouse.company == filters.company)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if filters.item_code:
|
if filters.item_code:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user