AP Invoices and join condition

Iam doing form personalization through which in invoice screen i need to check whethere the PO is getting overbilled... i have done with my query but...
Iam unable to make a relation with the invoice that hasnt been validated yet... if there exists a invoice which hasnt been validated and when iam creating a new invoice for a particular PO ...it is not considering the already existing invoice ...
iam unable to make a relation with the already existing invoice because in AP_INVOICES_ALL ... po_header_id is null and in AP_DISTRIBUTIONS_ALL AND PO_DISTRIBUTIONS_ALL also there isnt any entry for this invoice ... from where should i make a join condition for this invoice

Copyright 1998-2015 Ziff Davis, LLC (Toolbox.com). All rights reserved. All product names are trademarks of their respective companies. Toolbox.com is not
affiliated with or endorsed by any company listed at this site.