Fix: Purchase Return was not showing the vendor on load

This commit is contained in:
Amritanshu Agrawal 2021-02-04 08:47:21 +05:30
parent 5d0852a74d
commit 0cf948b4c8

View File

@ -180,6 +180,9 @@ def voucher_info(voucher, db):
json_voucher["source"] = {"id": item.cost_centre_id, "name": ""} json_voucher["source"] = {"id": item.cost_centre_id, "name": ""}
item = [j for j in voucher.journals if j.debit == 1][0] item = [j for j in voucher.journals if j.debit == 1][0]
json_voucher["destination"] = {"id": item.cost_centre_id, "name": ""} json_voucher["destination"] = {"id": item.cost_centre_id, "name": ""}
if voucher.type == 6: # "Purchase Return"
item = [j for j in voucher.journals if j.debit == 1][0]
json_voucher["vendor"] = {"id": item.account.id, "name": item.account.name}
else: else:
for item in voucher.journals: for item in voucher.journals:
json_voucher["journals"].append( json_voucher["journals"].append(