From 0cf948b4c8bb97a37bf837acba9ead2e4d0eeac4 Mon Sep 17 00:00:00 2001 From: tanshu Date: Thu, 4 Feb 2021 08:47:21 +0530 Subject: [PATCH] Fix: Purchase Return was not showing the vendor on load --- brewman/brewman/routers/voucher.py | 3 +++ 1 file changed, 3 insertions(+) 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(