Redirect show_order.cfm to receipt page
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
80a3e182c8
commit
866335d456
1 changed files with 3 additions and 153 deletions
156
show_order.cfm
156
show_order.cfm
|
|
@ -1,155 +1,5 @@
|
||||||
<cfparam name="cart_grand_total" default="0">
|
<cfparam name="form.UUID" default="">
|
||||||
|
<cfparam name="url.UUID" default="#form.UUID#">
|
||||||
<cfparam name="url.is_admin_view" default="0">
|
<cfparam name="url.is_admin_view" default="0">
|
||||||
|
|
||||||
<cfquery name="get_order_info" datasource="#application.datasource#">
|
<cflocation url="/receipt/index.cfm?UUID=#urlEncodedFormat(url.UUID)#&is_admin_view=#url.is_admin_view#" addtoken="false">
|
||||||
SELECT O.OrderTypeID, O.BusinessID, O.Remarks
|
|
||||||
FROM Orders O
|
|
||||||
WHERE O.UUID = '#form.UUID#'
|
|
||||||
</cfquery>
|
|
||||||
|
|
||||||
<cfquery name="get_parent_items_in_order" datasource="#application.datasource#">
|
|
||||||
SELECT O.OrderTypeID, O.ID, OL.ID AS OrderLineItemID, OL.Quantity, OL.Remark, I.ID, I.Name, I.Price, B.TaxRate, I.CategoryID, ttO.Name AS tt_OrderTypeName<cfif get_order_info.OrderTypeID eq 3>, A.*</cfif><cfif url.is_admin_view EQ 0>, T.CreatedOn</cfif>
|
|
||||||
FROM Orders O, OrderLineItems OL, Items I, Businesses B, tt_OrderTypes ttO<cfif get_order_info.OrderTypeID eq 3>, Addresses A</cfif><cfif url.is_admin_view EQ 0>, Tasks T</cfif>
|
|
||||||
WHERE O.UUID = '#form.UUID#'
|
|
||||||
AND
|
|
||||||
OL.ParentOrderLineItemID = 0
|
|
||||||
AND
|
|
||||||
OL.ItemID = I.ID
|
|
||||||
<!--- AND
|
|
||||||
OL.IsDeleted = 0 --->
|
|
||||||
AND
|
|
||||||
OL.OrderID = O.ID
|
|
||||||
AND
|
|
||||||
B.ID = O.BusinessID
|
|
||||||
AND
|
|
||||||
<cfif url.is_admin_view EQ 0>O.ID = T.OrderID
|
|
||||||
AND</cfif>
|
|
||||||
<cfif get_order_info.OrderTypeID eq 3>A.ID = O.AddressID
|
|
||||||
AND </cfif>
|
|
||||||
ttO.ID = O.OrderTypeID
|
|
||||||
ORDER BY OL.AddedOn DESC
|
|
||||||
</cfquery>
|
|
||||||
|
|
||||||
<cfoutput><cfif url.is_admin_view EQ 0>Ordered On #dateformat(get_parent_items_in_order.CreatedOn, "mm/dd/yy")# at #timeformat(get_parent_items_in_order.CreatedOn, "hh:mm tt")#<br></cfif>
|
|
||||||
|
|
||||||
#get_parent_items_in_order.tt_OrderTypeName#<cfif get_order_info.OrderTypeID eq 3> to #get_parent_items_in_order.Line1#</cfif></cfoutput></br>
|
|
||||||
|
|
||||||
<cfif get_parent_items_in_order.Remark gt "">
|
|
||||||
<font color="FF0000"><cfoutput>#get_order_info.Remarks#</cfoutput></font>
|
|
||||||
</cfif>
|
|
||||||
|
|
||||||
<table border="0" cellspacing="2" cellpadding="2">
|
|
||||||
<tr><td>Name</td><td>Quant</td><td>Price</td><td>Total</td><td> </td></tr>
|
|
||||||
|
|
||||||
<cfset PaymentPayfritsCut = 0>
|
|
||||||
|
|
||||||
<cfoutput query="get_parent_items_in_order">
|
|
||||||
|
|
||||||
<cfif get_parent_items_in_order.CategoryID neq 31>
|
|
||||||
|
|
||||||
<cfset PaymentPayfritsCut = PaymentPayfritsCut + (get_parent_items_in_order.Price*get_parent_items_in_order.Quantity*.05)>
|
|
||||||
|
|
||||||
</cfif>
|
|
||||||
|
|
||||||
<tr><td>#get_parent_items_in_order.Name#</td><td align="middle">#get_parent_items_in_order.Quantity#</td><td align="right">#dollarformat(get_parent_items_in_order.Price)#</td><td>#dollarformat(get_parent_items_in_order.Price * get_parent_items_in_order.Quantity)#</td>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
|
|
||||||
<!--- <script language="JavaScript">
|
|
||||||
function submitformdelitem#get_parent_items_in_order.OrderLineItemID#()
|
|
||||||
{
|
|
||||||
document.myformdelitem#get_parent_items_in_order.OrderLineItemID#.submit();
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<form action="#request.cgiPath#" method="post" name="myformdelitem#get_parent_items_in_order.OrderLineItemID#" id="myformdelitem#get_parent_items_in_order.OrderLineItemID#" style="display:inline;">
|
|
||||||
|
|
||||||
<a href="javascript: submitformdelitem#get_parent_items_in_order.OrderLineItemID#()">X</a>
|
|
||||||
|
|
||||||
<input type="hidden" name="mode" value="delitem">
|
|
||||||
<input type="hidden" name="OrderTypeID" value="#form.OrderTypeID#">
|
|
||||||
<input type="hidden" name="BusinessID" value="#form.BusinessID#">
|
|
||||||
<input type="hidden" name="OrderID" value="#form.OrderID#">
|
|
||||||
<input type="hidden" name="OrderLineItemID" value="#get_parent_items_in_order.OrderLineItemID#">
|
|
||||||
<input type="hidden" name="AddressID" value="#form.AddressID#">
|
|
||||||
|
|
||||||
</form> --->
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
<cfset cart_grand_total = cart_grand_total + get_parent_items_in_order.Price * get_parent_items_in_order.Quantity>
|
|
||||||
|
|
||||||
<cfquery name="get_child_line_items" datasource="#application.datasource#">
|
|
||||||
SELECT I.Name, I.ID, I.Price, I.ParentItemID, OL.ID, OL.ParentOrderLineItemID
|
|
||||||
FROM OrderLineItems OL, Items I, Orders O
|
|
||||||
WHERE O.UUID = '#form.UUID#'
|
|
||||||
AND
|
|
||||||
OL.OrderID = O.ID
|
|
||||||
AND
|
|
||||||
OL.ItemID = I.ID
|
|
||||||
AND
|
|
||||||
OL.ParentOrderLineItemID = #get_parent_items_in_order.OrderLineItemID#
|
|
||||||
ORDER BY OL.AddedOn DESC
|
|
||||||
</cfquery>
|
|
||||||
|
|
||||||
<cfif get_child_line_items.recordcount GT 0>
|
|
||||||
<cfloop query="get_child_line_items">
|
|
||||||
<cfquery name="get_parent_item_Name" datasource="#application.datasource#">
|
|
||||||
SELECT Name
|
|
||||||
FROM Items
|
|
||||||
WHERE ID = #get_child_line_items.ParentItemID#
|
|
||||||
</cfquery>
|
|
||||||
|
|
||||||
<tr><td colspan="3"> #get_parent_item_Name.Name# : #get_child_line_items.Name# (#dollarformat(get_child_line_items.Price)#)</td><td align="right">#dollarformat(get_child_line_items.Price * get_parent_items_in_order.Quantity)#</td>
|
|
||||||
|
|
||||||
<td> </td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
<cfset cart_grand_total = cart_grand_total + get_child_line_items.Price * get_parent_items_in_order.Quantity>
|
|
||||||
</cfloop>
|
|
||||||
</cfif>
|
|
||||||
|
|
||||||
<cfif get_parent_items_in_order.Remark gt "">
|
|
||||||
<tr><td colspan="4"><font color="FF0000"> ^ ^ ^#get_parent_items_in_order.Remark#^ ^ ^</font></td></tr>
|
|
||||||
</cfif>
|
|
||||||
|
|
||||||
</cfoutput>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
|
|
||||||
Cart total: <cfoutput>#dollarFormat(cart_grand_total)#</cfoutput><br>
|
|
||||||
|
|
||||||
<cfset order_grand_total = cart_grand_total>
|
|
||||||
|
|
||||||
<cfif get_parent_items_in_order.TaxRate GT 0>
|
|
||||||
<cfset tax_amount = round(cart_grand_total * get_parent_items_in_order.TaxRate*100)/10000>
|
|
||||||
<cfset order_grand_total = order_grand_total + tax_amount>
|
|
||||||
<cfelse>
|
|
||||||
<cfset tax_amount = 0>
|
|
||||||
</cfif>
|
|
||||||
Tax Amount = <cfoutput>#dollarformat(tax_amount)#</cfoutput><br>
|
|
||||||
|
|
||||||
Subtotal = <cfoutput>#dollarformat(tax_amount+cart_grand_total)#</cfoutput><br>
|
|
||||||
|
|
||||||
<!--- <cfset PaymentPayfritsCut = cart_grand_total*.05> --->
|
|
||||||
Payfrit's cut = <cfoutput>#dollarformat(PaymentPayfritsCut)#</cfoutput><br>
|
|
||||||
|
|
||||||
<cfset order_grand_total = order_grand_total + PaymentPayfritsCut>
|
|
||||||
|
|
||||||
<cfif get_parent_items_in_order.OrderTypeID eq 3> <!--- delivery --->
|
|
||||||
|
|
||||||
<cfmodule template = "modules/get_delivery_fee.cfm" OrderID = "#get_parent_items_in_order.ID#">
|
|
||||||
|
|
||||||
<cfset PaymentDeliveryFee = #calculated_delivery_fee#>
|
|
||||||
|
|
||||||
Delivery Fee = <cfoutput>#dollarformat(PaymentDeliveryFee)#</cfoutput><br>
|
|
||||||
<cfset order_grand_total = order_grand_total + PaymentDeliveryFee>
|
|
||||||
|
|
||||||
<cfelse>
|
|
||||||
|
|
||||||
<cfset PaymentDeliveryFee = 0>
|
|
||||||
|
|
||||||
</cfif>
|
|
||||||
|
|
||||||
<h3>GRAND TOTAL: <cfoutput>#dollarformat(order_grand_total)#</cfoutput></h3>
|
|
||||||
|
|
|
||||||
Reference in a new issue