Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: get batch_no. for item automatically #34473

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions erpnext/selling/page/point_of_sale/point_of_sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,17 @@ def search_by_term(search_term, warehouse, price_list):
)

item_stock_qty, is_stock_item = get_stock_availability(item_code, warehouse)
item_stock_qty = item_stock_qty // item.get("conversion_factor")
item_stock_qty = item_stock_qty // item.get("conversion_factor", 1)
item.update({"actual_qty": item_stock_qty})

price = frappe.get_list(
doctype="Item Price",
filters={
"price_list": price_list,
"item_code": item_code,
"batch_no": batch_no,
},
fields=["uom", "stock_uom", "currency", "price_list_rate"],
fields=["uom", "stock_uom", "currency", "price_list_rate", "batch_no"],
)

def __sort(p):
Expand Down Expand Up @@ -167,7 +168,7 @@ def get_items(start, page_length, price_list, item_group, pos_profile, search_te

item_price = frappe.get_all(
"Item Price",
fields=["price_list_rate", "currency", "uom"],
fields=["price_list_rate", "currency", "uom", "batch_no"],
filters={
"price_list": price_list,
"item_code": item.item_code,
Expand All @@ -190,9 +191,9 @@ def get_items(start, page_length, price_list, item_group, pos_profile, search_te
"price_list_rate": price.get("price_list_rate"),
"currency": price.get("currency"),
"uom": price.uom or item.uom,
"batch_no": price.batch_no,
}
)

return {"items": result}


Expand Down