fix: if accepted warehouse not selected during rejection then stock ledger not created

This commit is contained in:
Rohit Waghchaure 2022-04-04 15:10:57 +05:30
parent 12c01e2975
commit 0a71cabab1

View File

@ -463,6 +463,9 @@ class BuyingController(StockController, Subcontracting):
stock_items = self.get_stock_items()
for d in self.get("items"):
if d.item_code not in stock_items:
continue
if d.item_code in stock_items and d.warehouse:
pr_qty = flt(d.qty) * flt(d.conversion_factor)
@ -488,6 +491,7 @@ class BuyingController(StockController, Subcontracting):
sle = self.get_sl_entries(
d, {"actual_qty": flt(pr_qty), "serial_no": cstr(d.serial_no).strip()}
)
if self.is_return:
outgoing_rate = get_rate_for_return(
self.doctype, self.name, d.item_code, self.return_against, item_row=d