CR 10 against an Informix database. I need a PO commitment report for outstanding po's that have not had a final pay process against it. The tables are lined up like this:
po_line_item table
-------------------
po_nbr
po_line_item
line_item_commitment
ap_invoices
--------------------
po_nbr
invoice_nbr
final_paid
I need the sum of the individual line items for any po where there is no ap_invoice generated with a final_paid = Y. There may be none or many invoices against each po and one or more of those may or may not have the final paid flag set to Y. If any one invoice has the final_paid = Y set, then the complete value of that po should not be included.
The end result is simply:
po number po_commitment
grand total po_commitment
po_line_item table
-------------------
po_nbr
po_line_item
line_item_commitment
ap_invoices
--------------------
po_nbr
invoice_nbr
final_paid
I need the sum of the individual line items for any po where there is no ap_invoice generated with a final_paid = Y. There may be none or many invoices against each po and one or more of those may or may not have the final paid flag set to Y. If any one invoice has the final_paid = Y set, then the complete value of that po should not be included.
The end result is simply:
po number po_commitment
grand total po_commitment