mirror of
https://github.com/frappe/erpnext.git
synced 2026-10-31 23:07:51 +00:00
fix(stock): skip returns when recalculating item last purchase rate
(cherry picked from commit e27989f201)
This commit is contained in:
@@ -1371,6 +1371,7 @@ def get_purchase_voucher_details(doctype, item_code, document_name=None):
|
||||
query = query.where(parent_doc.name != document_name)
|
||||
|
||||
if doctype in ("Purchase Receipt", "Purchase Invoice"):
|
||||
query = query.where(parent_doc.is_return == 0)
|
||||
query = query.select(parent_doc.posting_date, parent_doc.posting_time)
|
||||
query = query.orderby(
|
||||
parent_doc.posting_date, parent_doc.posting_time, parent_doc.name, order=Order.desc
|
||||
|
||||
Reference in New Issue
Block a user