I have the following code below. I need to calculate a
backorderqty on a
product if it has partially been invoiced(shipped) on a
The code below identifies if the product in the query results
shipped previously and invoices run in numeric ascending
How do I identify the products that have been shipped
previously in the
query results. I tried putting it in a list like below.
I then need to get same products and add all the QtyInvoiced
invoices and subtract them from the QtyOrdered field.
This will get me a Product BackorderQty on the current
invoice that the
customer has requested.
any help appreciated, I'm still learning
<cfquery name="query" datasource="#client.dsn#"
Select a.accountno, a.line, a.purchaseorder, b.unitofmes,
a.delivery1, a.delivery2, a.delivery3, a.delivery4,
a.price, a.product, a.qtyordered, a.qtyinvoiced,
order_history a INNER JOIN products b ON a.product=b.product
WHERE a.OrderNo='823719' <!-----#form.orderno#---->
AND a.invoice<=172079 <!-----#form.invoice#---->
order by a.invoice,