From 314c20234066ccbaedd032c05099894689d33306 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 11 May 2012 18:38:11 +0530 Subject: [PATCH] more changes to last purchase rate --- erpnext/buying/doctype/purchase_common/purchase_common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.py b/erpnext/buying/doctype/purchase_common/purchase_common.py index 5a2a9ebc96..8be101abf2 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.py +++ b/erpnext/buying/doctype/purchase_common/purchase_common.py @@ -268,7 +268,7 @@ class DocType(TransactionBase): from `tabPurchase Order` po, `tabPurchase Order Item` po_item where po.docstatus = 1 and po_item.item_code = %s and po.name != %s and po.name = po_item.parent - order by po.transaction_date DESC + order by po.transaction_date desc, po.name desc limit 1""", (item_code, doc_name), as_dict=1) # get last purchase receipt item details @@ -278,7 +278,7 @@ class DocType(TransactionBase): from `tabPurchase Receipt` pr, `tabPurchase Receipt Item` pr_item where pr.docstatus = 1 and pr_item.item_code = %s and pr.name != %s and pr.name = pr_item.parent - order by pr.posting_date DESC, pr.posting_time DESC + order by pr.posting_date desc, pr.posting_time desc, pr.name desc limit 1""", (item_code, doc_name), as_dict=1) # get the latest of the two