mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-09 00:01:18 +00:00
* fix: load price list rate for pos search term (cherry picked from commit4b6cae156e) # Conflicts: # erpnext/selling/page/point_of_sale/point_of_sale.py * fix: load search term price with customer default price list (cherry picked from commit2beb485d77) * chore: resolve conflict --------- Co-authored-by: diptanilsaha <diptanil.dev@gmail.com> Co-authored-by: ruthra kumar <ruthra@erpnext.com>
This commit is contained in:
@@ -51,13 +51,18 @@ def search_by_term(search_term, warehouse, price_list):
|
|||||||
item_stock_qty = item_stock_qty // item.get("conversion_factor", 1)
|
item_stock_qty = item_stock_qty // item.get("conversion_factor", 1)
|
||||||
item.update({"actual_qty": item_stock_qty})
|
item.update({"actual_qty": item_stock_qty})
|
||||||
|
|
||||||
|
price_filters = {
|
||||||
|
"price_list": price_list,
|
||||||
|
"item_code": item_code,
|
||||||
|
}
|
||||||
|
|
||||||
|
if batch_no:
|
||||||
|
price_filters["batch_no"] = batch_no
|
||||||
|
|
||||||
price = frappe.get_list(
|
price = frappe.get_list(
|
||||||
doctype="Item Price",
|
doctype="Item Price",
|
||||||
filters={
|
filters=price_filters,
|
||||||
"price_list": price_list,
|
fields=["uom", "currency", "price_list_rate", "batch_no"],
|
||||||
"item_code": item_code,
|
|
||||||
},
|
|
||||||
fields=["uom", "currency", "price_list_rate"],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def __sort(p):
|
def __sort(p):
|
||||||
|
|||||||
@@ -325,13 +325,16 @@ erpnext.PointOfSale.ItemSelector = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
filter_items({ search_term = "" } = {}) {
|
filter_items({ search_term = "" } = {}) {
|
||||||
|
const selling_price_list = this.events.get_frm().doc.selling_price_list;
|
||||||
|
|
||||||
if (search_term) {
|
if (search_term) {
|
||||||
search_term = search_term.toLowerCase();
|
search_term = search_term.toLowerCase();
|
||||||
|
|
||||||
// memoize
|
// memoize
|
||||||
this.search_index = this.search_index || {};
|
this.search_index = this.search_index || {};
|
||||||
if (this.search_index[search_term]) {
|
this.search_index[selling_price_list] = this.search_index[selling_price_list] || {};
|
||||||
const items = this.search_index[search_term];
|
if (this.search_index[selling_price_list][search_term]) {
|
||||||
|
const items = this.search_index[selling_price_list][search_term];
|
||||||
this.items = items;
|
this.items = items;
|
||||||
this.render_item_list(items);
|
this.render_item_list(items);
|
||||||
this.auto_add_item && this.items.length == 1 && this.add_filtered_item_to_cart();
|
this.auto_add_item && this.items.length == 1 && this.add_filtered_item_to_cart();
|
||||||
@@ -343,7 +346,7 @@ erpnext.PointOfSale.ItemSelector = class {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { items, serial_no, batch_no, barcode } = message;
|
const { items, serial_no, batch_no, barcode } = message;
|
||||||
if (search_term && !barcode) {
|
if (search_term && !barcode) {
|
||||||
this.search_index[search_term] = items;
|
this.search_index[selling_price_list][search_term] = items;
|
||||||
}
|
}
|
||||||
this.items = items;
|
this.items = items;
|
||||||
this.render_item_list(items);
|
this.render_item_list(items);
|
||||||
|
|||||||
Reference in New Issue
Block a user