<%@ LANGUAGE="VBSCRIPT" %> <% PageStrings = "339, 356, 361, 375, 400, 470, 496, 503, 504, 505, 508, 509, 525, 545, 634, 635, 636, 637, 638, 639, 640, 641, 642, 664, 680, 827, 829, 837, 843, 844, 876, 964, 1045, 1045, 1046, 1139, 1186, 1204, 1205" strThisBackPage = "orders" %> <% '=============================================== ' CactuShop ASP Shopping Cart ' ©1999-2004 Cactusoft Ltd. www.cactusoft.com '=============================================== ' All rights reserved. ' Use of this code is covered by the terms and ' conditions in the license agreement. No ' unauthorized duplication or distribution is ' permitted. Cactusoft's copyright notices must ' remain in the ASP sections of the code. '=============================================== '----------------------------------------------- 'VIEW/MODIFY ORDER STATUS 'The site owner can view orders, mark them as 'sent, add comments on the current status or 'just view them. '----------------------------------------------- '----------------------------------------------- 'FIND WHICH ORDER WAS CLICKED ON '----------------------------------------------- ON_ID = request.querystring("ON_ID") strQuery = "SELECT * FROM (((tblCactuShopInvoiceRows INNER JOIN tblCactuShopOrderNumbers ON tblCactuShopInvoiceRows.IR_OrderNumber = tblCactuShopOrderNumbers.ON_ID) INNER JOIN tblCactuShopCurrencies ON tblCactuShopCurrencies.CUR_ID = tblCactuShopOrderNumbers.ON_CurrencyID) INNER JOIN tblCactuShopCardholderDetails ON tblCactuShopOrderNumbers.ON_CardholderID = tblCactuShopCardholderDetails.CD_ID) INNER JOIN tblCactuShopLanguages ON tblCactuShopOrderNumbers.ON_Language = tblCactuShopLanguages.LANG_ID WHERE ON_ID = " & ON_ID Call ExecuteSQL(strQuery, numCursorType, objRecordSet) numRecordCount = objRecordSet.recordcount If numRecordCount>0 then ON_Details = objRecordSet("ON_Details") ON_TotalPrice = objRecordSet("ON_TotalPrice") ON_Date = objRecordSet("ON_Date") ON_Status = objRecordSet("ON_Status") ON_Details = objRecordSet("ON_Details") ON_LastModified = objRecordSet("ON_LastModified") ON_Sent = objRecordSet("ON_Sent") ON_Invoiced = objRecordSet("ON_Invoiced") ON_Shipped = objRecordSet("ON_Shipped") ON_Paid = objRecordSet("ON_Paid") ON_CouponCode = objRecordSet("ON_CouponCode") ON_CouponDiscountTotal = objRecordSet("ON_CouponDiscountTotal") ON_PricesIncTax = objRecordSet("ON_PricesIncTax") ON_TaxDue = objRecordSet("ON_TaxDue") ON_CurrencyID = objRecordSet("ON_CurrencyID") ON_TotalPriceGateway = objRecordSet("ON_TotalPriceGateway") ON_CurrencyIDGateway = objRecordSet("ON_CurrencyIDGateway") ON_PaymentGateWay = objRecordSet("ON_PaymentGateWay") ON_ReferenceCode = objRecordSet("ON_ReferenceCode") ON_SendOrderUpdateEmail = objRecordSet("ON_SendOrderUpdateEmail") ON_Language = objRecordSet("ON_Language") LANG_BackName = objRecordSet("LANG_BackName") 'Affiliate-related records CD_AffiliateID = objRecordSet("CD_AffiliateID") If IsNull(CD_AffiliateID) then CD_AffiliateID = 0 ON_AffiliatePaymentID = objRecordSet("ON_AffiliatePaymentID") If IsNull(ON_AffiliatePaymentID) then ON_AffiliatePaymentID = 0 ON_AffiliateTotalPrice = objRecordSet("ON_AffiliateTotalPrice") ON_AffiliatePercentage = objRecordSet("ON_AffiliatePercentage") numShippingPriceExTax = objRecordSet("ON_ShippingPrice") numShippingPriceIncTax = numShippingPriceExTax + objRecordSet("ON_ShippingTax") numOrderHandlingPriceExTax = objRecordSet("ON_OrderHandlingCharge") numOrderHandlingPriceIncTax = numOrderHandlingPriceExTax + objRecordSet("ON_OrderHandlingChargeTax") numTotal = objRecordSet("ON_TotalPrice") numDiscountPercentage = objRecordSet("ON_DiscountPercentage") CUR_Symbol = objRecordSet("CUR_Symbol") CUR_HasDecimals = objRecordSet("CUR_HasDecimals") CD_ID = objRecordSet("CD_ID") CD_EmailAddress = objRecordSet("CD_EmailAddress") End if '----------------------------------------------- 'LOOKUP COUPON IF THERE IS ONE '----------------------------------------------- If ON_CouponCode<>"" then strQuery2 = "SELECT * FROM tblCactuShopCoupons WHERE CP_CouponCode='" & ON_CouponCode & "'" Call ExecuteSQL(strQuery2, numCursorType, objRecordSet2) CP_DiscountValue = objRecordSet2("CP_DiscountValue") CP_DiscountType = objRecordSet2("CP_DiscountType") If CP_DiscountType = "f" then CP_DiscountValue = ON_CouponDiscountTotal CP_CouponCode = objRecordSet2("CP_CouponCode") objRecordSet2.close End if %> <% =GetString("Config_headtitle") %>
" name="datValue1"> " name="strCallMode"> " name="CD_EmailAddress2"> " name="CP_CouponCode"> " name="AFP_ID"> <% if CD_AffiliateID <> 0 then %> <% end if %> <% If CP_CouponCode<>"" then %> <% End if %>
<% WriteString("PageTitle_OrderDetails") %>
<% if CD_AffiliateID <> 0 then %> <% end if %>
<% WriteString("ContentText_CustomerDetails") %> <% WriteString("ContentText_AffiliateDetails") %>

<% WriteString("ContentText_OrderID") %> <% =ON_ID %>
<% WriteString("ContentText_PONumber") %> <% =ON_PurchaseOrderNo %>
<% WriteString("ContentText_OrderDate") %> <% =FriendlyDate(ON_Date,"d") %>
<% WriteString("ContentText_OrderValue") %> <% =CUR_Symbol & " " & CurrencyDisplay(ON_TotalPrice, 1, CUR_HasDecimals) %>
<% WriteString("ContentText_LastUpdate") %> <% response.write(FriendlyDate(ON_LastModified,"t")) %>
<% WriteString("ContentText_PaymentGateWay") %> <% response.write(ON_PaymentGateWay) %>
<% WriteString("ContentText_ReferenceCode") %> <% response.write(ON_ReferenceCode) %>
<% WriteString("FormLabel_Language") %> <% response.write(LANG_BackName) %>
Affiliate Commission <%= CUR_Symbol & " " & CurrencyDisplay(ON_AffiliateTotalPrice, 1, CUR_HasDecimals) %> * <%= ON_AffiliatePercentage %>% = <%= CUR_Symbol & " " & CurrencyDisplay((ON_AffiliatePercentage / 100) * ON_AffiliateTotalPrice, 1, CUR_HasDecimals) %>

<% WriteString("ContentText_OrderStatus") %>
> <% WriteString("ContentText_OrderStatusSent") %>
> <% WriteString("ContentText_OrderStatusInvoiced") %>
> <% WriteString("ContentText_OrderStatusPaid") %>
> <% WriteString("ContentText_OrderStatusShipped") %>
<% WriteString("ContentText_OrderProgress") %>
<% if ON_SendOrderUpdateEmail = "y" then %> <% WriteString("ContentText_SendEmailToCustomer") %> <% else %> <% WriteString("ContentText_CustomerRequestedNoEmail") %> <% end if %>
">
<% WriteString("ContentText_OrderText") %> <% WriteString("ContentText_ClickHere") %>
<% WriteString("ContentText_IssueInvoice") %> <% '----------------------------------------------- 'LOOKUP LANGUAGES AND GIVE INVOICE LINKS 'We provide a list of languages - invoices 'can be issued in any of the supported languages 'providing an invoice template is available. '----------------------------------------------- strQuery = "SELECT * FROM tblCactuShopLanguages WHERE LANG_LiveFront = 'y'" Call ExecuteSQL(strQuery, numCursorType, objRecordSet2) Do while not objRecordSet2.EOF If ON_Language = objRecordSet2("LANG_ID") then response.write("" & Ucase(objRecordSet2("LANG_BackName")) & " ") else response.write("" & objRecordSet2("LANG_BackName") & " ") End if objRecordSet2.movenext Loop objRecordSet2.close %>
<% WriteString("ContentText_ViewCouponUsed") %> <% WriteString("ContentText_ClickHere") %>
<% '----------------------------------------- 'PRICES INCLUDING TAX '----------------------------------------- If ON_PricesIncTax = "y" then If Application(LICENSENUMBER & "showtaxdisplay") = "y" then %> <% Else %> <% End if Else '----------------------------------------- 'PRICES EXCLUDING TAX '----------------------------------------- %> <% End if %> <% Do Until objRecordSet.EOF %> <% '----------------------------------------- 'PRICES INCLUDING TAX '----------------------------------------- If ON_PricesIncTax = "y" then If Application(LICENSENUMBER & "showtaxdisplay") = "y" then %> <% Else %> <% End if %> <% Else '----------------------------------------- 'PRICES EXCLUDING TAX '----------------------------------------- %> <% End if %> <% '----------------------------------------------- 'CALCULATE TOTAL 'The total amount without tax is not stored - 'this is calculated from the invoice rows 'records as we cycle through them here. '----------------------------------------------- '----------------------------------------- 'PRICES INCLUDING TAX '----------------------------------------- If ON_PricesIncTax = "y" then numRowPriceExTax = Round((objRecordSet("IR_Quantity") * (objRecordSet("IR_PricePerItem") - objRecordSet("IR_TaxPerItem"))) - 0.0001, 2) numRowPriceIncTax = objRecordSet("IR_PricePerItem") * objRecordSet("IR_Quantity") 'Price of row inc tax (row = items x qty) numTotalPriceExTax = numTotalPriceExTax + numRowPriceExTax numTotalPriceIncTax = numTotalPriceIncTax + numRowPriceIncTax 'Running total of order price ex tax Else '----------------------------------------- 'PRICES EXCLUDING TAX '----------------------------------------- numRowPriceExTax = Round(objRecordSet("IR_PricePerItem") * objRecordSet("IR_Quantity") , 2) numRowPriceIncTax = objRecordSet("IR_PricePerItem") * objRecordSet("IR_Quantity") * (1 + objRecordSet("IR_TaxPerItem")) 'Price of row ex tax (row = items qty) numTotalPriceExTax = numTotalPriceExTax + numRowPriceExTax numTotalPriceIncTax = numTotalPriceIncTax + numRowPriceIncTax 'Running total of order price ex tax End if objRecordSet.movenext loop '----------------------------------------- 'FINAL TOTAL DEPENDS ON COUNTRY '----------------------------------------- If ON_TaxDue = 1 then strOrderValueTotal = GetString("ContentText_TotalOrderValue") & " = " & CUR_Symbol & " " & CurrencyDisplay(numTotalPriceIncTax, 1, CUR_HasDecimals) & "
" strShipping = GetString("ContentText_Shipping") & " = " & CUR_Symbol & " " & CurrencyDisplay(numShippingPriceIncTax, 1, CUR_HasDecimals) If numOrderHandlingPriceIncTax > 0 then strOrderHandlingCharge = "
" & GetString("ContentText_OrderHandlingCharge") & " = " & CUR_Symbol & " " & CurrencyDisplay(numOrderHandlingPriceIncTax, 1, CUR_HasDecimals) Else strOrderValueTotal = GetString("ContentText_TotalOrderValue") & " = " & CUR_Symbol & " " & CurrencyDisplay(numTotalPriceExTax, 1, CUR_HasDecimals) & "
" strShipping = GetString("ContentText_Shipping") & " = " & CUR_Symbol & " " & CurrencyDisplay(numShippingPriceExTax, 1, CUR_HasDecimals) If numOrderHandlingPriceExTax > 0 then strOrderHandlingCharge = "
" & GetString("ContentText_OrderHandlingCharge") & " = " & CUR_Symbol & " " & CurrencyDisplay(numOrderHandlingPriceExTax, 1, CUR_HasDecimals) End if '----------------------------------------- 'LOOKUP GATEWAY CURRENCY USED 'Only needed if different from the one the 'customer used. '----------------------------------------- If ON_CurrencyIDGateway <> ON_CurrencyID then '----------------------------------------- 'LOOKUP DETAILS OF CURRENCY GATEWAY USES '----------------------------------------- strQuery = "SELECT * FROM tblCactuShopCurrencies WHERE CUR_ID = " & ON_CurrencyIDGateway Call ExecuteSQL(strQuery, numCursorType, objRecordSet2) aryCurrenciesGateway(1) = objRecordSet2("CUR_Symbol") If objRecordSet2("CUR_HasDecimals") = "y" then aryCurrenciesGateway(4) = true else aryCurrenciesGateway(4) = false objRecordSet2.close numFinalTotalPriceInTaxGateway = Round(ON_TotalPriceGateway, 2) strOrderValueTotalGateway = "" & GetString("ContentText_AmountProcessGateway") & " " & aryCurrenciesGateway(1) & " " & CurrencyDisplay(numFinalTotalPriceInTaxGateway, 1, aryCurrenciesGateway(4)) & "" else strOrderValueTotalGateway = "" End if %>

<% WriteString("PageTitle_OrderDetails") %>
<% WriteString("ContentText_ExTax") %> (<% =CUR_Symbol %>)  <% WriteString("ContentText_IncTax") %> <% WriteString("ContentText_Price") %> <% WriteString("ContentText_Price") %>  <% WriteString("ContentText_Tax") %> (%) <% WriteString("ContentText_Qty") %> <% WriteString("ContentText_Total") %>
<% response.write(objRecordSet("IR_VersionName")) %>
<% response.write(objRecordSet("IR_VersionCode")) %><% response.write(CUR_Symbol & " " & CurrencyDisplay(objRecordSet("IR_PricePerItem") - objRecordSet("IR_TaxPerItem"), 1, objRecordSet("CUR_HasDecimals"))) %> <% response.write(CUR_Symbol & " " & CurrencyDisplay(objRecordSet("IR_TaxPerItem"), 1, objRecordSet("CUR_HasDecimals"))) %><% response.write(CUR_Symbol & " " & CurrencyDisplay(objRecordSet("IR_PricePerItem"), 1, objRecordSet("CUR_HasDecimals"))) %><% response.write(objRecordSet("IR_Quantity")) %> <% response.write(CUR_Symbol & " " & CurrencyDisplay(objRecordSet("IR_PricePerItem") * objRecordSet("IR_Quantity"), 1, objRecordSet("CUR_HasDecimals"))) %><% response.write(CUR_Symbol & " " & CurrencyDisplay(objRecordSet("IR_PricePerItem"), 1, objRecordSet("CUR_HasDecimals"))) %> <% response.write(objRecordSet("IR_TaxPerItem") * 100) %> <% response.write(objRecordSet("IR_Quantity")) %> <% response.write(CUR_Symbol & " " & CurrencyDisplay((0.0001 + (objRecordSet("IR_PricePerItem") * objRecordSet("IR_Quantity") * (1 + objRecordSet("IR_TaxPerItem")))), 1, objRecordSet("CUR_HasDecimals"))) %>
<% '----------------------------------------------- 'WRITE TOTALS '----------------------------------------------- If ON_CouponCode <> "" then If CP_DiscountType = "p" then strCouponDiscount = GetString("ContentText_CouponDiscount") & " = " & CP_DiscountValue & "%
" Else strCouponDiscount = GetString("ContentText_CouponDiscount") & " = " & CUR_Symbol & " " & CurrencyDisplay(CP_DiscountValue, 1, CUR_HasDecimals) & "
" End if End if If numDiscountPercentage <> 0 then strDiscountPercentage = GetString("ContentText_Discount") & " = " & numDiscountPercentage & "%
" End if strTotal = "
" & GetString("ContentText_Total") & " = " & CUR_Symbol & " " & CurrencyDisplay(numTotal, 1, CUR_HasDecimals) & "
" response.write(strOrderValueTotal & strCouponDiscount & strDiscountPercentage & strShipping & strOrderHandlingCharge & "
" & strTotal & vbcrlf) If strOrderValueTotalGateway <> "" then response.Write "
" & strOrderValueTotalGateway %>
"> <% WriteString("ContentText_DeleteThisOrder") %>
<% objDataConn.Close set objDataConn = nothing %>