Fix: Purchase Return was not showing the vendor on load
This commit is contained in:
parent
5d0852a74d
commit
0cf948b4c8
@ -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(
|
||||||
|
Loading…
Reference in New Issue
Block a user