<% '-------------------------------------------------------- ' Configurations for this page '-------------------------------------------------------- myPageName = "editOrder.asp" myPageTable = "orders" '-------------------------------------------------------- displayHeader() if (checkSecurity(30) or checkSecurity(CONST_securityLevelToEditOrdersAll) or checkSecurity(CONST_securityLevelToEditOrdersForCompanyJob)) then select case request("action") case "getById" getOrderById() case "assignset" assignSet() case "edit" editOrder() ' gets company/contact info from super user and gets quantity, discipline, and bid category information case "fulfill" editOrder() case "delete" editOrder() case "deleteExecute" deleteExecute() case "finish" if request("print") <> "" then printOrder() else finishOrder() end if case "list" list() case else list() end select else response.Write("You must be a super user to access this section
") security_getLogonInfo(myPageName & "?job_id=" & request("job_id")) end if displayFooter() '----------------------------------------------------------------------------------------------------------------------------------- ' '----------------------------------------------------------------------------------------------------------------------------------- function list() select case request("action") case "fill" %>
Fill Orders

Retrieve Order By ID <% case else %>
Manage Orders

Retrieve Order By ID <% end select sqlString = "select lkdeliverymethod.deliveryMethod, orders.*, job.job as jobName, company.name as companyName, contacts.name as contactName, pgc.name as pushgroupContactName " sqlString = sqlString & "from orders left outer join job on (orders.job_id = job.id) left outer join company on (orders.company_id=company.id) left outer join contacts on (orders.contact_id=contacts.id) left outer join contacts pgc on (orders.pushgroup_contact_id = pgc.id) left outer join lkdeliverymethod on (lkdeliverymethod.id=orders.shipment_method) " sqlString = sqlString & "where orders.id=orders.id " if not (checkSecurity(CONST_securityLevelToEditOrdersAll)) then sqlString = sqlString & " and job.company_id="&Session("User_Company")&" " end if select case request("action") case "fill" if CONST_statusToDisplayInFillOrder <> "" then fillStatusList = split(CONST_statusToDisplayInFillOrder,",") sqlString = sqlString & " and (orders.status = 'Pending'" For Each statusType in fillStatusList sqlString = sqlString & " or orders.status = '"&trim(statusType)&"'" Next sqlString = sqlString & ")" else sqlString = sqlString & " and (orders.status = 'Pending' or orders.status = 'Waiting on Deposit' or orders.status='Hold' or orders.status = 'Waiting on CC Approv' or orders.status = 'Waiting on Approval' or orders.status = 'Not Approved' or orders.status='Incomplete' )" end if case else sqlString = sqlString & " and orders.date_ordered > DATE_SUB(now(), interval "&CONST_manageOrdersInterval&" day) " end select sqlString = sqlString & " order by id" showList sqlString end function '-------------------------------------------------------------------------- ' This function shows the list of companies. '-------------------------------------------------------------------------- function showList(sqlString) dim headerArray(11) dim jsRowArray(2) dim displayArray(11,4,1) set objRS = objConn.Execute(sqlString) headerArray(0) = " " headerArray(1) = "Job
Order ID" headerArray(2) = "Company
MBE/WBE" headerArray(3) = "Contact" headerArray(4) = "Pushgroup Contact ID" headerArray(5) = "Status" headerArray(6) = "Date Ordered" if checkSecurity(30) and CONST_displayDeliveryMethEditOrder then headerArray(6) = headerArray(6) & "
Delivery Method" end if if CONST_displayFreeSetInEditOrderList then headerArray(7) = "Free Set" end if if CONST_displayTaxInEditOrderList then headerArray(8) = "Tax" end if headerArray(9) = "Comments" if CONST_displayFreightInEditOrderList then headerArray(10) = "Freight" end if if CONST_displayQuantityInEditOrderList then headerArray(11) = "Quantity
Of Full
Sets" end if select case request("action") case "fill" displayArray(0,0,0) = "
Retrieve Order

Enter the order number you wish to pull up.
<% end function '-------------------------------------------------------- ' '-------------------------------------------------------- function editOrder() select case request("action") case "edit" actionName = "Edit" submitName = "Update" actionValue = "finish" case "fulfill" actionName = "Edit" submitName = "Update" actionValue = "finish" case "delete" actionName = "Delete" submitName = "Delete" actionValue = "deleteExecute" end select if request("order_id") = "" then response.Write("There was no order id to retrieve.") end if sqlString = "select * from orders where id = " & request("order_id") set orderRS = objConn.Execute(sqlString) if orderRS.EOF then response.Write("There is no order associated with this order id.") end if sqlString = "select count(*) as total from company" set objRS = objConn.Execute(sqlString) if (Cint("0" & objRS("total")) > 100) then limitResults = true else limitResults = false end if sqlString = "select * from job where id = " & orderRS("job_id") set jobRS = objConn.Execute(sqlString) generic_displayValidator() %> <%=actionName %> Order
"> "> ">
Order ID: <%=db_getData(orderRS, "id")%>     Company: <%=db_qdSelect("select name from company where id=" & orderRS("company_id"), "name") %>
Job ID: <%=db_getData(orderRS, "job_id")%>     Contact: <% generic_displaySelectAdvanced "contact_id", "select id, name from contacts where company_id = " & orderRS("company_id") & " order by name", "id", "name", orderRS("contact_id"), " required='true' " %>
Job: <%=db_getData(jobRS, "job")%>     Free Set: checked<% end if %>>
Order Date: <%=db_getData(orderRS, "date_ordered")%>     Placed By: <% if orderRS("user_who_placed") <> "" then response.Write(db_qdSelect("select name from contacts where id="&orderRS("user_who_placed"), "name")) else response.Write("Unknown (old job)") end if %>
Date Filled: ">     Assigned Set: "> &prevAction=<%=request("action")%>&rd=<%=request("rd")%>">Assign Sets
Date Shipped: ">     Delivery Method: <% sqlString = "select lkdm.id, lkdm.deliverymethod " sqlString = sqlString & "from lkdeliverymethod lkdm " sqlString = sqlString & "left outer join job_delivery_cost jdc on (lkdm.id = jdc.delivery_id and jdc.job_id="&jobRS("id")&") " sqlString = sqlString & "where (jdc.disabled <> -1 or jdc.disabled is null) " sqlString = sqlString & "order by lkdm.id" generic_displaySelectAdvanced "shipment_method", sqlString, "id", "deliverymethod", orderRS("shipment_method"), " required='true' " %> *
Return Due: ">     Tracking Number: ">
Date Returned: ">     FedEx Acct. #: <%=db_qdSelect("select fedex from company where id="&orderRS("company_id"), "fedex")%>
Status: <% generic_displaySelect "status", "select name from lkstatus order by name", "name", "name", orderRS("status") %>     UPS Acct. #: <%=db_qdSelect("select ups from company where id="&orderRS("company_id"), "ups")%>
MBE/WBE Certified: checked <% end if%>>     Trade: <%generic_displaySelectAdvanced "trade_id", "select * from trades order by type", "id", "type", orderRS("trade_id"), " required=true " %>*
<% subTotal = 0 sqlString = "select * from order_lines where order_id = " & orderRS("id") & " and (item_type='job_discipline' or item_type='specs_download') order by line_number" set objRS = objConn.Execute(sqlString) if CONST_disciplinesEnabled and not objRS.EOF then %> <% else sqlString = "select * from order_lines where order_id = " & orderRS("id") & " and name='Full Set' order by line_number" set objRS = objConn.Execute(sqlString) %> <% end if %> <% sqlString = "select * from order_lines where order_id = " & orderRS("id") & " and item_type='images' order by line_number" set objRS = objConn.Execute(sqlString) if CONST_orderIndividualSheets and not objRS.EOF then %> <% end if sqlString = "select * from order_lines where order_id = " & request("order_id") & " order by line_number" set objRS = objConn.Execute(sqlString) ' response.Write(objRS("payment_type")) ' response.Write(db_qdSelect("select paymentOption from lkpaymentoption where id ="&objRS("payment_type"),"paymentOption")) if CONST_minOrder > 0 and CONST_minOrder > subTotal then subTotal = CONST_minOrder end if if (CONST_orderMinCCOrderDisabled <> true) then if generic_isCreditCardOrder(db_qdSelect("select paymentOption from lkpaymentoption where id ="&objRS("payment_type"), "paymentOption")) then if CONST_minCCOrder > 0 and CONST_minCCOrder > totalCost then subTotal = CONST_minCCOrder end if end if end if %> <% bidCategoryValue = db_getData(jobRS,"Bid_Categories") if CONST_bidCategoriesEnabled and bidCategoryValue <> "" then ' response.write "Bid Category 1: " & "Get DAta: " & bidCategoryValue generic_displayBidCategoryList "bid_categories", bidCategoryValue, orderRS("bid_category") end if %>
Order Groups:
<% discCount=0 do while not objRS.EOF %> "> <% subTotal = subTotal + cdbl("0"&db_getData(objRS,"unit_price")) * cdbl("0"&db_getData(objRS,"quantity")) discCount = discCount + 1 objRS.MoveNext loop %>
Qty. Name Description Cost Ext. Amount Payment Method Paid Date Paid Comment
" onChange="updateSheetExtPrice(<%=discCount %>);"> <%=db_getData(objRS,"name") %> <%=db_getData(objRS,"description") %> $" onChange="updateSheetExtPrice(<%=discCount %>);"> $"> <% generic_displaySelectAdvanced "discPayment"&discCount, "select id, paymentoption from lkpaymentoption order by id;", "id", "paymentoption", db_getData(objRS, "payment_type"), "" %> checked <% end if %>> "> ">
Item Description:
<% discCount=0 do while not objRS.EOF %> "> <% subTotal = subTotal + cdbl("0"&db_getData(objRS,"unit_price")) * cdbl("0"&db_getData(objRS,"quantity")) discCount = discCount + 1 objRS.MoveNext loop %>
Qty. Name Description Cost Ext. Amount Payment Method Paid Date Paid Comment
" onChange="updateSheetExtPrice(0);"> <%=db_getData(objRS,"name") %> <%=db_getData(objRS,"description") %> $" onChange="updateSheetExtPrice(0);"> $"> <% generic_displaySelectAdvanced "discPayment0", "select id, paymentoption from lkpaymentoption order by id;", "id", "paymentoption", db_getData(objRS, "payment_type"), "" %> checked <% end if %>> "> ">
Individual Sheets
<% sheetCount = 0 do while not objRS.EOF %> "> <% subTotal = subTotal + cdbl("0"&db_getData(objRS,"unit_price")) * cdbl("0"&db_getData(objRS,"quantity")) sheetCount = sheetCount + 1 objRS.MoveNext loop %>
Qty. Name Description Cost Ext. Amount Payment Method Paid Date Paid Comment
" onChange="updateImgExtPrice('<%=sheetCount %>');"> <%=db_getData(objRS,"name") %> <%=db_getData(objRS,"description") %> $" onChange="updateImgExtPrice('<%=sheetCount %>');"> $"> <% generic_displaySelectAdvanced "sheetPayment"&sheetCount, "select id, paymentoption from lkpaymentoption order by id;", "id", "paymentoption", db_getData(objRS, "payment_type"), "" %> checked <% end if %>> "> ">
Summary: <% if CONST_minOrder > 0 then %>

Minimum Order is $<%=CONST_minOrder%>. Orders below $<%=CONST_minOrder%> will be increased to $<%=CONST_minOrder%>

<% end if %> <% if CONST_minCCOrder > 0 then %>

Minimum Order with a Credit Card is $<%=CONST_minCCOrder%>. Orders below $<%=CONST_minCCOrder%> will be increased to $<%=CONST_minCCOrder%>

<% end if %>
Sub Total: $<%=FormatNumber(subTotal,2)%>
Tax %: <%=orderRS("tax")%>%
Total: $<%=FormatNumber((cdbl("0" & orderRS("tax"))/100 * subTotal + subTotal),2)%>
Freight: $">
Amount Due: $<%=FormatNumber((cdbl("0" & orderRS("tax"))/100 * subTotal + subTotal + cdbl(orderRS("freight"))),2)%>
<% sqlString = "select * from company where id = " & Session("User_Company") set objRS = objConn.Execute(sqlString) %>


Shipping Address:
Care Of: ">
Address Line 1: " required="true"> *
Address Line 2: ">
City / State / Zip<% if CONST_requestCountyForTax then %> / County<% end if %>: " required="true"> * <% generic_displaySelectAdvanced "shipto_state", "select state from lkstates", "state", "state", db_getData(orderRS, "shipto_state"), " required='true' class='selectState'" %> * " required="true"> *   <% if CONST_requestCountyForTax then sqlString = "select lkcounties.county_name from lkcounties where id="&db_getData(orderRS, "shipto_county") %>"><% response.Write(db_qdSelect(sqlString, "county_name")) end if %>


Billing Address:
Address Line 1: " required="true"> *
Address Line 2: ">
City / State / Zip: " required="true"> * <% generic_displaySelectAdvanced "billto_state", "select state from lkstates", "state", "state", db_getData(orderRS, "billto_state"), " required='true' class='selectState'" %> * " required="true"> *

Comments:
<% end function '----------------------------------------------------------------------------------- ' This function increments the value in the job.sets_issued and assigns that number ' to this order '----------------------------------------------------------------------------------- function assignSet() set orderRS = objConn.Execute("select * from orders where id="&request("order_id")) set jobRS = objConn.Execute("select * from job where id="&orderRS("job_id")) if (cint("0"&jobRS("sets_issued")) >= cint("0"&jobRS("sets")) and jobRS("sets") <> "") then response.Write("All sets allowed for this job have been assigned. In order assign more sets you must edit the job and increase the number of sets available.") exit function end if setNumber = cint("0"&jobRS("sets_issued")) + 1 sqlString = "update job set sets_issued="&setNumber&" where id="&orderRS("job_id") objConn.Execute(sqlString) if db_getData(orderRS, "sets_issued") <> "" then setNumber = db_getData(orderRS, "sets_issued") & ", " & setNumber end if sqlString = "update orders set sets_issued='"&setNumber&"' where id="&request("order_id") objConn.Execute(sqlString) generic_redirect(myPageName&"?action="&request("prevAction")&"&order_id="&request("order_id"))&"&rd="&request("rd") end function '----------------------------------------------------------------------------------- ' This function updates the data in the DB for the order and then opens a window ' showing the invoice '----------------------------------------------------------------------------------- function printOrder() processData() %> <% if request("print") = "Print & Return" then select case request("rd") case "bidders.asp" generic_redirect("bidders.asp?job_id="&request("job_id")) case "fill" if (CONST_goToBiddersListAfterFill) then generic_redirect("bidders.asp?job_id="&request("job_id")) else generic_redirect("editOrder.asp?action=fill") end if case else if (CONST_goToBiddersListAfterFill) then generic_redirect("bidders.asp?job_id="&request("job_id")) else generic_redirect("editOrder.asp") end if end select else generic_redirect("editOrder.asp?action=edit&order_id="&request("order_id")) end if end function '----------------------------------------------------------------------------------- ' This function does the final processing of the order. It calls the function to save the data ' to the DB and displays the confirmation page. '----------------------------------------------------------------------------------- function finishOrder() processData() select case request("rd") case "bidders.asp" generic_redirect("bidders.asp?job_id="&request("job_id")) case "fill" if (CONST_goToBiddersListAfterFill) then generic_redirect("bidders.asp?job_id="&request("job_id")) else generic_redirect("editOrder.asp?action=fill") end if case else if (CONST_goToBiddersListAfterFill) then generic_redirect("bidders.asp?job_id="&request("job_id")) else generic_redirect("editOrder.asp") end if end select end function '----------------------------------------------------------------------------------- ' This function saves the data from an order to the DB. It is called from finishOrder ' and skipJackOrder '----------------------------------------------------------------------------------- function processData() set objRS = objConn.Execute("select * from job where id="&request("job_id")) isTaxable = cbool(objRS("taxable")) if isTaxable then ' tax = db_qdSelect("select tax from contacts where id = " & Session("User_Id"), "tax") if tax = "" and request("shipto_county") <> "" then tax = db_qdSelect("select tax from lkcounties where id="&request("shipto_county"), "tax") end if if tax = "" then if CONST_useShippingForTax then tax = db_qdSelect("select tax from lkstates where state = '"&request("shipto_state")&"'", "tax") else tax = db_qdSelect("select tax from lkstates where state = '"&request("billto_state")&"'", "tax") end if end if else tax = 0 end if sqlString = "update orders set " sqlString = sqlString & "tax = '"& tax & "', " sqlString = sqlString & "status = '"& request("status") & "', " sqlString = sqlString & "bid_category='" & db_addSlashes(request("bid_categories")) & "', " sqlString = sqlString & "date_shipped = '" & db_mysqlDate(request("date_shipped")) & "', " sqlString = sqlString & "date_filled = '" & db_mysqlDate(request("date_filled")) & "', " sqlString = sqlString & "return_due = '" & db_mysqlDate(request("return_due")) & "', " sqlString = sqlString & "date_returned = '" & db_mysqlDate(request("date_returned")) & "', " sqlString = sqlString & "minority_owned_company="&db_getCheckBox(request("minority_owned_company"))&", " sqlString = sqlString & "tracking_number = '" & request("tracking_number") & "', " sqlString = sqlString & "shipment_method = '" & request("shipment_method") & "', " sqlString = sqlString & "comment = '" & db_addSlashes(request("comment")) & "', " sqlString = sqlString & "contact_id = " & request("contact_id") & ", " sqlString = sqlString & "care_of = '" & db_addSlashes(request("care_of")) & "', " sqlString = sqlString & "shipto_address1 = '" & db_addSlashes(request("shipto_address1")) & "', " sqlString = sqlString & "shipto_address2 = '" & db_addSlashes(request("shipto_address2")) & "', " sqlString = sqlString & "shipto_city = '" & db_addSlashes(request("shipto_city")) & "', " sqlString = sqlString & "shipto_state = '" & request("shipto_state") & "', " sqlString = sqlString & "shipto_zip = '" & request("shipto_zip") & "', " sqlString = sqlString & "billto_address1 = '" & db_addSlashes(request("billto_address1")) & "', " sqlString = sqlString & "billto_address2 = '" & db_addSlashes(request("billto_address2")) & "', " sqlString = sqlString & "billto_city = '" & db_addSlashes(request("billto_city")) & "', " sqlString = sqlString & "billto_state = '" & request("billto_state") & "', " sqlString = sqlString & "billto_zip = '" & request("billto_zip") & "', " sqlString = sqlString & "freight = " & request("freight") & ", " sqlString = sqlString & "trade_id = " & request("trade_id") & ", " sqlString = sqlString & "free_set = " & db_getCheckBox(request("free_set")) & ", " sqlString = sqlString & "Sets_Issued = '" & request("Sets_Issued") & "' " sqlString = sqlString & "where id=" & request("order_id") response.Write("
" & sqlString & "
") objConn.Execute(sqlString) '---------------------------------------------------------------------------------------------------------------- order_id = request("order_id") '---------------------------------------------------------------------------------------------------------------- ' Disciplines Disciplines Disciplines Disciplines Disciplines Disciplines Disciplines Disciplines Disciplines Disciplines totalQty = 0 totalCost = 0 sqlString = "select * from order_lines where order_id = " & order_id & " and item_type='job_discipline' order by line_number" set objRS = objConn.Execute(sqlString) if CONST_disciplinesEnabled and not objRS.EOF then discCount = 0 do while not objRS.EOF sqlString = "update order_lines set " sqlString = sqlString & "order_id = " & order_id & ", " sqlString = sqlString & "quantity = " & request("discQuant" & discCount) & ", " sqlString = sqlString & "unit_price = " & request("discPrice" & discCount) & ", " ' sqlString = sqlString & "shipping_cost = " & cdbl("0"&request("discSH" & discCount)) & ", " sqlString = sqlString & "extended_price = " & CDbl("0"& request("discQuant" & discCount)) * CDbl("0"& request("discPrice" & discCount)) & ", " sqlString = sqlString & "payment_type='"& request("discPayment" & discCount) & "', " sqlString = sqlString & "paid="& db_getCheckBox(request("discPaid" & discCount)) &", " sqlString = sqlString & "date_paid='"& db_mysqlDate(request("discDatePaid" & discCount)) &"', " sqlString = sqlString & "comment='"& request("discComment" & discCount) &"' " sqlString = sqlString & "where id=" & request("discId" & discCount) objConn.Execute(sqlString) totalCost = totalCost + cdbl(cint(request("discQuant" & discCount))*cdbl(request("discPrice" & discCount))) totalQty = totalQty + cint(request("discQuant" & discCount)) discCount = discCount + 1 objRS.MoveNext loop response.Write("sub Total after disc: " & totalCost & "
"&vbcrlf) else if request("discQuant0") <> "" then discCount = 0 sqlString = "update order_lines set " sqlString = sqlString & "order_id = " & order_id & ", " sqlString = sqlString & "quantity = " & request("discQuant" & discCount) & ", " sqlString = sqlString & "unit_price = " & request("discPrice" & discCount) & ", " ' sqlString = sqlString & "shipping_cost = " & cdbl("0"&request("discSH" & discCount)) & ", " sqlString = sqlString & "extended_price = " & CDbl("0"& request("discQuant" & discCount)) * CDbl("0"& request("discPrice" & discCount)) & ", " sqlString = sqlString & "payment_type='"& request("discPayment" & discCount) & "', " sqlString = sqlString & "paid="& db_getCheckBox(request("discPaid" & discCount)) &", " sqlString = sqlString & "date_paid='"& db_mysqlDate(request("discDatePaid" & discCount)) &"', " sqlString = sqlString & "comment='"& request("discComment" & discCount) &"' " sqlString = sqlString & "where id=" & request("discId" & discCount) objConn.Execute(sqlString) totalCost = totalCost + cdbl(cint(request("discQuant" & discCount))*cdbl(costPerEach)) totalQty = totalQty + cint(request("discQuant" & discCount)) discCount = discCount + 1 end if end if if request("quantity") <> "" then sqlString = "update order_lines set " sqlString = sqlString & "quantity = " & request("quantity") & ", " end if '---------------------------------------------------------------------------------------------------------------- 'IMAGES IMAGES IMAGES IMAGES IMAGES IMAGES IMAGES IMAGES IMAGES IMAGES IMAGES IMAGES IMAGES IMAGES IMAGES IMAGES sqlString = "select * from order_lines where order_id = " & order_id & " and item_type='images' order by line_number" set objRS = objConn.Execute(sqlString) if CONST_orderIndividualSheets and not objRS.EOF then ' similar madness logic as above sheetCount = 0 do while not objRS.EOF sqlString = "update order_lines set " sqlString = sqlString & "order_id = " & order_id & ", " sqlString = sqlString & "quantity = " & request("sheetQuant" & sheetCount) & ", " sqlString = sqlString & "unit_price = " & request("sheetPrice" & sheetCount) & ", " sqlString = sqlString & "extended_price = " & CDbl("0"& request("sheetQuant" & sheetCount)) * CDbl("0"& request("sheetPrice" & sheetCount)) & ", " sqlString = sqlString & "payment_type='"& request("sheetPayment" & sheetCount) & "', " sqlString = sqlString & "paid="& db_getCheckBox(request("sheetPaid" & sheetCount)) &", " sqlString = sqlString & "date_paid='"& db_mysqlDate(request("sheetDatePaid" & sheetCount)) &"', " sqlString = sqlString & "comment='"& request("sheetComment" & sheetCount) &"' " sqlString = sqlString & "where id=" & request("sheetId" & sheetCount) objConn.Execute(sqlString) totalCost = totalCost + cdbl(cint(request("sheetQuant" & sheetCount))*cdbl(request("sheetPrice" & sheetCount))) totalQty = totalQty + cint(request("sheetQuant" & sheetCount)) sheetCount = sheetCount + 1 objRS.MoveNext loop end if '---------------------------------------------------------------------------------------------------------------- sqlString = "select * from order_lines where order_id = " & order_id & " order by line_number" set objRS = objConn.Execute(sqlString) if CONST_minOrder > 0 and CONST_minOrder > totalCost then totalCost = CONST_minOrder end if if (CONST_orderMinCCOrderDisabled <> true) then if generic_isCreditCardOrder(db_qdSelect("select paymentOption from lkpaymentoption where id ="&objRS("payment_type"),"paymentOption")) then if CONST_minCCOrder > 0 and CONST_minCCOrder > totalCost then totalCost = CONST_minCCOrder end if end if end if sqlString = "SELECT freight FROM job WHERE id = " & request("job_id") set objRS = objConn.Execute(sqlString) freight = objRS("freight") sqlString = "select * from lkdeliverymethod where id = '" & request("shipment_method") & "'" set objRS = objConn.Execute(sqlString) response.Write("debug: about to check if we should charge shipping.. If we get an exception error after this it is most likely the delivery method is stored in the old way and a different method needs to be picked
") If objRS("chargeFreight") = "-1" Then select case lcase(CONST_shippingChargeMethod) case "percentage" freight = subTotal * objRS("shippingChargePercentage") case "per method" sqlString = "select * from job_delivery_cost where job_id="&request("job_id")&" and delivery_id="&request("shipment_method") set tempRS = objConn.Execute(sqlString) if (tempRS.EOF) then if (objRS("cost") <> "") then freight = cdbl(objRS("cost")) end if else freight = cdbl(tempRS("cost")) end if If CONST_multiplyFreight Then freight = freight * totalQty End If case "static" If CONST_multiplyFreight Then freight = freight * totalQty End If case else sqlString = "select * from job_delivery_cost where job_id="&request("job_id")&" and delivery_id="&request("shipment_method") set tempRS = objConn.Execute(sqlString) if (tempRS.EOF) then if (objRS("cost") <> "") then freight = cdbl(objRS("cost")) end if else freight = cdbl(tempRS("cost")) end if If CONST_multiplyFreight Then freight = freight * totalQty End If end select Else freight = "0" End If sqlString = "update orders set freight = " & freight & " where id = " & order_id objConn.Execute(sqlString) end function function deleteExecute() sqlString = "delete from order_lines where order_id = " & request("order_id") objConn.Execute(sqlString) sqlString = "delete from orders where id = " & request("order_id") objConn.Execute(sqlString) select case request("rd") case "bidders.asp" generic_redirect("bidders.asp?job_id="&request("job_id")) case "fill" generic_redirect("editOrder.asp?action=fill") case else generic_redirect("editOrder.asp") end select end function %>