diff --git a/brewman/brewman/routers/voucher.py b/brewman/brewman/routers/voucher.py index c23ffe88..c173d639 100644 --- a/brewman/brewman/routers/voucher.py +++ b/brewman/brewman/routers/voucher.py @@ -180,6 +180,9 @@ def voucher_info(voucher, db): json_voucher["source"] = {"id": item.cost_centre_id, "name": ""} item = [j for j in voucher.journals if j.debit == 1][0] 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: for item in voucher.journals: json_voucher["journals"].append(