fix(naming): Use creation instead of name to order SLEs

This commit is contained in:
Aditya Hase
2019-01-07 22:07:13 +05:30
parent 972f659fd5
commit 0c16424d7d
14 changed files with 17 additions and 17 deletions

View File

@@ -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)