fix(naming): Use creation instead of name to order SLEs
This commit is contained in:
@@ -179,7 +179,7 @@ class SellingController(StockController):
|
||||
last_valuation_rate = frappe.db.sql("""
|
||||
SELECT valuation_rate FROM `tabStock Ledger Entry` WHERE item_code = %s
|
||||
AND warehouse = %s AND valuation_rate > 0
|
||||
ORDER BY posting_date DESC, posting_time DESC, name DESC LIMIT 1
|
||||
ORDER BY posting_date DESC, posting_time DESC, creation DESC LIMIT 1
|
||||
""", (it.item_code, it.warehouse))
|
||||
if last_valuation_rate:
|
||||
last_valuation_rate_in_sales_uom = last_valuation_rate[0][0] / (it.conversion_factor or 1)
|
||||
|
||||
Reference in New Issue
Block a user