project.lock(); if(request.ItemNumber != "ALL"){ ItemQuery = database.cursor("select order_line.item_no, order_line.order_no, order_line.qty_ordered, order_line.qty_shipped, order_line.location, order_line.price, order_line.line_no, order_header.customer_no, order_header.customer_po, MONTH(order_header.order_date) AS ord_mon, DAY(order_header.order_date) AS ord_day, YEAR(order_header.order_date) AS ord_year, customer.customer_name, item_master.description from order_line, order_header, customer, item_master where order_line.order_no = order_header.order_no and order_header.customer_no = customer.customer_no and order_line.item_no = item_master.part_no and order_line.item_no = '" + request.ItemNumber + "' and order_line.location = '" + request.WhseLocation + "' and order_header.order_date >= '" + request.StartDate + "' and order_header.order_date <= '" + request.EndDate + "' order by item_no, customer_no") } else{ ItemQuery = database.cursor("select order_line.item_no, order_line.order_no, order_line.qty_ordered, order_line.qty_shipped, order_line.location, order_line.price, order_line.line_no, order_header.customer_no, order_header.customer_po, MONTH(order_header.order_date) AS ord_mon, DAY(order_header.order_date) AS ord_day, YEAR(order_header.order_date) AS ord_year, customer.customer_name, item_master.description from order_line, order_header, customer, item_master where order_line.order_no = order_header.order_no and order_header.customer_no = customer.customer_no and order_line.item_no = item_master.part_no and order_line.location = '" + request.WhseLocation + "' and order_header.order_date >= '" + request.StartDate + "' and order_header.order_date <= '" + request.EndDate + "' order by item_no, customer_no") } SelectionQuery = database.cursor("select item_master.description from item_master where item_master.part_no = '" + request.ItemNumber + "'") write(""); //write(""); SelectionQuery.next(); write("" + "" + ""); write(""); write("" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + ""); write("" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + ""); write("
Query Selections
Query Selections
Item Number:" + request.ItemNumber + "Start Date:" + request.StartDate + "Location:" + request.WhseLocation + "
Description:" + SelectionQuery.description + "End Date:" + request.EndDate + "Print:" + request.OrdType + "
"); write(""); write(""); write("" + ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ "" + ""+ ""+ ""); var no_data = "Y"; var bo_qty = 0; var bo_amt = 0; while(ItemQuery.next()){ //this code calls the truncation function. //the following two write statements need to be commented out //when compiling for netscape 2.XX write('' ) //the following two write statements need to be commented out //when compiling for netscape 2.XX. Also replace rndPrc and //rndCst with cursor.price and cursor.cost if((request.OrdType == "Open Order" && ItemQuery.qty_shipped == '0') || (request.OrdType == "Backordered" && ItemQuery.qty_shipped < ItemQuery.qty_ordered && ItemQuery.qty_shipped != '0') || (request.OrdType == "Complete" && ItemQuery.qty_shipped == ItemQuery.qty_ordered)){ no_data = "N"; bo_qty = ItemQuery.qty_ordered - ItemQuery.qty_shipped; bo_amt = bo_qty * ItemQuery.price; write(""); write(""); write(""); write(""); write(""); write(""); write(""); write(""); write(""); write(""); write(""); if (ItemQuery.qty_shipped == 0){ bo_qty = 0; bo_amt = 0; } write(""); write(""); write(""); } } write("
Order Status By Item Number
Item NoDescriptionCustomer NoCustomer NameCust P.O.Order NoOrder DateLine NoQty OrderedQty ShippedPriceQty B.O.$ B.O.
" + ItemQuery.item_no + "
" + ItemQuery.description + "
" + ItemQuery.customer_no + "
" + ItemQuery.customer_name + "
" + ItemQuery.customer_po + "
" + ItemQuery.order_no + "
" + ItemQuery.ord_mon + "/" + ItemQuery.ord_day + "/" + ItemQuery.ord_year + "
" + ItemQuery.line_no + "
" + ItemQuery.qty_ordered + "
" + ItemQuery.qty_shipped + "
" + bo_qty + "
" + bo_amt + "
"); if(no_data == "Y") write("No Data Matches Your Selections"); project.unlock();