fix: stock availability not showing (#38382)

fix: stock availability now showing
This commit is contained in:
rohitwaghchaure
2023-11-28 15:16:35 +05:30
committed by GitHub
parent 25f67923ea
commit 3929cc30ca
2 changed files with 7 additions and 1 deletions

View File

@@ -139,6 +139,12 @@ erpnext.ProductList = class {
<br> <br>
<span class="out-of-stock mt-2">${ __("Out of stock") }</span> <span class="out-of-stock mt-2">${ __("Out of stock") }</span>
`; `;
} else if (item.is_stock) {
return `
<br>
<span class="in-stock in-green has-stock mt-2"
style="font-size: 14px;">${ __("In stock") }</span>
`;
} }
} }
return ``; return ``;

View File

@@ -33,7 +33,7 @@ def get_web_item_qty_in_stock(item_code, item_warehouse_field, warehouse=None):
for warehouse in warehouses: for warehouse in warehouses:
stock_qty = frappe.db.sql( stock_qty = frappe.db.sql(
""" """
select GREATEST(S.actual_qty - S.reserved_qty - S.reserved_qty_for_production - S.reserved_qty_for_sub_contract, 0) / IFNULL(C.conversion_factor, 1) select S.actual_qty / IFNULL(C.conversion_factor, 1)
from tabBin S from tabBin S
inner join `tabItem` I on S.item_code = I.Item_code inner join `tabItem` I on S.item_code = I.Item_code
left join `tabUOM Conversion Detail` C on I.sales_uom = C.uom and C.parent = I.Item_code left join `tabUOM Conversion Detail` C on I.sales_uom = C.uom and C.parent = I.Item_code