mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 08:24:47 +00:00
fixes in sales purchase return
This commit is contained in:
@@ -789,6 +789,8 @@ def make_return_jv(stock_entry):
|
|||||||
|
|
||||||
from accounts.utils import get_balance_on
|
from accounts.utils import get_balance_on
|
||||||
for r in result:
|
for r in result:
|
||||||
|
if not r.get("account"):
|
||||||
|
print result
|
||||||
jv_list.append({
|
jv_list.append({
|
||||||
"__islocal": 1,
|
"__islocal": 1,
|
||||||
"doctype": "Journal Voucher Detail",
|
"doctype": "Journal Voucher Detail",
|
||||||
@@ -847,14 +849,20 @@ def make_return_jv_from_delivery_note(se, ref):
|
|||||||
if not invoices_against_delivery:
|
if not invoices_against_delivery:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
packing_item_parent_map = dict([[d.item_code, d.parent_item] for d in ref.doclist.get(
|
||||||
|
{"parentfield": ref.parentfields[1]})])
|
||||||
|
|
||||||
parent = {}
|
parent = {}
|
||||||
children = []
|
children = []
|
||||||
|
|
||||||
for se_item in se.doclist.get({"parentfield": "mtn_details"}):
|
for se_item in se.doclist.get({"parentfield": "mtn_details"}):
|
||||||
for sales_invoice in invoices_against_delivery:
|
for sales_invoice in invoices_against_delivery:
|
||||||
si = webnotes.bean("Sales Invoice", sales_invoice)
|
si = webnotes.bean("Sales Invoice", sales_invoice)
|
||||||
si.run_method("make_packing_list")
|
|
||||||
ref_item = si.doclist.get({"item_code": se_item.item_code})
|
if se_item.item_code in packing_item_parent_map:
|
||||||
|
ref_item = si.doclist.get({"item_code": packing_item_parent_map[se_item.item_code]})
|
||||||
|
else:
|
||||||
|
ref_item = si.doclist.get({"item_code": se_item.item_code})
|
||||||
|
|
||||||
if not ref_item:
|
if not ref_item:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user