Merge pull request #19583 from rohitwaghchaure/fixed_stock_rec_showing_incorrect_current_qty_and_serial_no

fix: stock reconciliation showing incorrect current serial no and qty
This commit is contained in:
rohitwaghchaure 2019-11-15 10:17:11 +05:30 committed by GitHub
commit c74c5d5644
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -510,7 +510,7 @@ def get_qty_rate_for_serial_nos(item_code, warehouse, posting_date, posting_time
}
serial_nos_list = [serial_no.get("name")
for serial_no in get_available_serial_nos(item_code, warehouse)]
for serial_no in get_available_serial_nos(args)]
qty = len(serial_nos_list)
serial_nos = '\n'.join(serial_nos_list)

View File

@ -293,9 +293,11 @@ def update_included_uom_in_report(columns, result, include_uom, conversion_facto
row, key, value = data
row[key] = value
def get_available_serial_nos(item_code, warehouse):
return frappe.get_all("Serial No", filters = {'item_code': item_code,
'warehouse': warehouse, 'delivery_document_no': ''}) or []
def get_available_serial_nos(args):
return frappe.db.sql(""" SELECT name from `tabSerial No`
WHERE item_code = %(item_code)s and warehouse = %(warehouse)s
and timestamp(purchase_date, purchase_time) <= timestamp(%(posting_date)s, %(posting_time)s)
""", args, as_dict=1)
def add_additional_uom_columns(columns, result, include_uom, conversion_factors):
if not include_uom or not conversion_factors: