SQL to return Invoices on Hold with Receipt Information
Hi,
I am trying to build an extract of the following information for invoices on hold, so that the business can see when receipts have been added, and therefore the hold can be released.
PO Number, Invoice Number, Requisitioner, Email Address, Hold Date, Hold Code, Hold Reason, Amount Ordered, Amount Received, Invoice Net Amount, Invoice Gross Amount.
It's still a work in progress but my main concern at the moment is getting the Amount Received column correct when there are multiple invoices on a Purchase Order.
For example, a PO is raised for £10000. An invoice is added for £6000, a receipt for £6000 added and the invoice is validated and paid. A second invoice is then added for the remaining £4000 but no receipt is added. I need the report to show that the amount receipted is 0, but currently it returns 6000 because it is including the receipt that was previously added on the PO and used on the first invoice. This will not be useful for the business as they need to see that no receipt has yet been