It’s an old PO and the vendor_id field isn’t populated in the po_detail record. Run this sql statement to fix all the POs in the data:



update D set D.vendor_id = H.vendor_id from "po_detail" as D join "po_headers" as H on D.branch_id = H.branch_id and D.po_no = H.po_no