Merge pull request #18859 from rohitwaghchaure/incorrect_valuation_rate_calculated_for_serial_no_develop

fix: incorrect valuation rate calculated because of string replacement
This commit is contained in:
rohitwaghchaure 2019-08-29 12:13:02 +05:30 committed by GitHub
commit 445a93e5f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -227,9 +227,9 @@ class update_entries_after(object):
elif actual_qty < 0:
# In case of delivery/stock issue, get average purchase rate
# of serial nos of current entry
stock_value_change = -1 * flt(frappe.db.sql("""select sum(purchase_rate)
from `tabSerial No` where name in (%s)""" % (", ".join(["%s"]*len(serial_no))),
tuple(serial_no))[0][0])
stock_value_change = -1 * flt(frappe.get_all("Serial No",
fields=["sum(purchase_rate)"],
filters = {'name': ('in', serial_no)}, as_list=1)[0][0])
new_stock_qty = self.qty_after_transaction + actual_qty