[Fix]Serial No if is_return
This commit is contained in:
parent
ed94aa4798
commit
4f3b0aa249
@ -123,12 +123,13 @@ def apply_pricing_rule(args):
|
|||||||
|
|
||||||
def get_serial_no_for_item(args):
|
def get_serial_no_for_item(args):
|
||||||
from erpnext.stock.get_item_details import get_serial_no
|
from erpnext.stock.get_item_details import get_serial_no
|
||||||
|
|
||||||
item_details = frappe._dict({
|
item_details = frappe._dict({
|
||||||
"doctype": args.doctype,
|
"doctype": args.doctype,
|
||||||
"name": args.name,
|
"name": args.name,
|
||||||
"serial_no": args.serial_no
|
"serial_no": args.serial_no
|
||||||
})
|
})
|
||||||
if args.get("parenttype") in ("Sales Invoice", "Delivery Note"):
|
if args.get("parenttype") in ("Sales Invoice", "Delivery Note") and args.qty > 0:
|
||||||
item_details.serial_no = get_serial_no(args)
|
item_details.serial_no = get_serial_no(args)
|
||||||
return item_details
|
return item_details
|
||||||
|
|
||||||
|
|||||||
@ -73,7 +73,7 @@ def get_item_details(args):
|
|||||||
|
|
||||||
out.update(get_pricing_rule_for_item(args))
|
out.update(get_pricing_rule_for_item(args))
|
||||||
|
|
||||||
if args.get("doctype") in ("Sales Invoice", "Delivery Note"):
|
if args.get("doctype") in ("Sales Invoice", "Delivery Note") and out.qty > 0:
|
||||||
out.serial_no = get_serial_no(out)
|
out.serial_no = get_serial_no(out)
|
||||||
|
|
||||||
if args.transaction_date and item.lead_time_days:
|
if args.transaction_date and item.lead_time_days:
|
||||||
@ -387,7 +387,8 @@ def get_serial_no_details(item_code, warehouse, qty, serial_no):
|
|||||||
def get_bin_details_and_serial_nos(item_code, warehouse, qty=None, serial_no=None):
|
def get_bin_details_and_serial_nos(item_code, warehouse, qty=None, serial_no=None):
|
||||||
bin_details_and_serial_nos = {}
|
bin_details_and_serial_nos = {}
|
||||||
bin_details_and_serial_nos.update(get_bin_details(item_code, warehouse))
|
bin_details_and_serial_nos.update(get_bin_details(item_code, warehouse))
|
||||||
bin_details_and_serial_nos.update(get_serial_no_details(item_code, warehouse, qty, serial_no))
|
if qty > 0:
|
||||||
|
bin_details_and_serial_nos.update(get_serial_no_details(item_code, warehouse, qty, serial_no))
|
||||||
return bin_details_and_serial_nos
|
return bin_details_and_serial_nos
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user