Fix remaining old column names missed by initial batch rename
Second pass fixing 70+ references across 32 files: - Orders: DeliveryMultiplier→BusinessDeliveryMultiplier, OrderTipAmount→TipAmount, OrderPaymentCompletedOn→PaymentCompletedOn, OrderPaymentError→PaymentError - Orders PK: WHERE OrderID=? → WHERE ID=? on Orders table - OrderLineItems PK: OrderLineItemID→ID in INSERT, WHERE, and query results - Items: parent.ItemID→parent.ID in JOIN conditions - Tasks: t.TaskID→t.ID in JOIN conditions - Users PK: WHERE UserID=X → WHERE ID=X on Users table - Addresses PK: A.AddressID→A.ID in JOIN conditions - tt_States: tt_StateID→ID, remove nonexistent tt_StateCountryID/tt_StateSortOrder - tt_OrderTypes: tt_OrderTypeID→ID, tt_OrderTypeName→Name - tt_Days: D.tt_DayID→D.ID - confirm_email.cfm: Add missing SELECT/FROM to queries - setLineItem.cfm: Fix 13 old column references - Stripe webhook/payment: Fix column names and PK references Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
712ec3b635
commit
8dff081407
32 changed files with 259 additions and 264 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
<cfscript>
|
<cfscript>
|
||||||
try {
|
try {
|
||||||
qStates = queryExecute("
|
qStates = queryExecute("
|
||||||
SELECT tt_StateID as StateID, Abbreviation as StateAbbreviation, Name as StateName
|
SELECT ID as StateID, Abbreviation as StateAbbreviation, Name as StateName
|
||||||
FROM tt_States
|
FROM tt_States
|
||||||
ORDER BY Name
|
ORDER BY Name
|
||||||
", {}, { datasource: "payfrit" });
|
", {}, { datasource: "payfrit" });
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@ try {
|
||||||
// Hours: Mon-Thu: 11am-10pm, Fri-Sat: 11am-11pm, Sun: 11am-10pm
|
// Hours: Mon-Thu: 11am-10pm, Fri-Sat: 11am-11pm, Sun: 11am-10pm
|
||||||
|
|
||||||
// Get California StateID
|
// Get California StateID
|
||||||
qState = queryExecute("SELECT tt_StateID FROM tt_States WHERE Abbreviation = 'CA' LIMIT 1");
|
qState = queryExecute("SELECT ID FROM tt_States WHERE Abbreviation = 'CA' LIMIT 1");
|
||||||
stateId = qState.recordCount > 0 ? qState.tt_StateID : 5; // Default to 5 if not found
|
stateId = qState.recordCount > 0 ? qState.ID : 5; // Default to 5 if not found
|
||||||
|
|
||||||
// Check if Big Dean's already has an address
|
// Check if Big Dean's already has an address
|
||||||
existingAddr = queryExecute("
|
existingAddr = queryExecute("
|
||||||
|
|
|
||||||
|
|
@ -2,112 +2,87 @@
|
||||||
<cfsetting enablecfoutputonly="true">
|
<cfsetting enablecfoutputonly="true">
|
||||||
<cfcontent type="application/json; charset=utf-8" reset="true">
|
<cfcontent type="application/json; charset=utf-8" reset="true">
|
||||||
|
|
||||||
<cfscript>
|
<cftry>
|
||||||
/**
|
|
||||||
* Lookup beacons by UUID
|
|
||||||
*
|
|
||||||
* POST: {
|
|
||||||
* UUIDs: array of UUID strings (without dashes, uppercase)
|
|
||||||
* }
|
|
||||||
*
|
|
||||||
* Returns: {
|
|
||||||
* OK: true,
|
|
||||||
* BEACONS: [
|
|
||||||
* {
|
|
||||||
* UUID: "...",
|
|
||||||
* BeaconID: int,
|
|
||||||
* Name: string,
|
|
||||||
* BusinessID: int,
|
|
||||||
* Name: string,
|
|
||||||
* ServicePointID: int,
|
|
||||||
* Name: string,
|
|
||||||
* ParentBusinessID: int (if applicable),
|
|
||||||
* ParentName: string (if applicable),
|
|
||||||
* HasChildren: boolean
|
|
||||||
* }
|
|
||||||
* ]
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
|
|
||||||
response = { "OK": false };
|
<cfset requestData = deserializeJSON(toString(getHttpRequestData().content))>
|
||||||
|
|
||||||
try {
|
<cfif NOT structKeyExists(requestData, "UUIDs") OR NOT isArray(requestData.UUIDs) OR arrayLen(requestData.UUIDs) EQ 0>
|
||||||
requestData = deserializeJSON(toString(getHttpRequestData().content));
|
<cfoutput>#serializeJSON({
|
||||||
|
"OK" = true,
|
||||||
|
"ERROR" = "",
|
||||||
|
"BEACONS" = []
|
||||||
|
})#</cfoutput>
|
||||||
|
<cfabort>
|
||||||
|
</cfif>
|
||||||
|
|
||||||
uuids = requestData.UUIDs ?: [];
|
<!--- Clean and normalize UUIDs (remove dashes, uppercase) --->
|
||||||
|
<cfset cleanUUIDs = []>
|
||||||
|
<cfloop array="#requestData.UUIDs#" index="uuid">
|
||||||
|
<cfset cleanUUID = uCase(reReplace(uuid, "-", "", "all"))>
|
||||||
|
<cfif len(cleanUUID) EQ 32>
|
||||||
|
<cfset arrayAppend(cleanUUIDs, cleanUUID)>
|
||||||
|
</cfif>
|
||||||
|
</cfloop>
|
||||||
|
|
||||||
if (!isArray(uuids) || arrayLen(uuids) == 0) {
|
<cfif arrayLen(cleanUUIDs) EQ 0>
|
||||||
response["OK"] = true;
|
<cfoutput>#serializeJSON({
|
||||||
response["BEACONS"] = [];
|
"OK" = true,
|
||||||
writeOutput(serializeJSON(response));
|
"ERROR" = "",
|
||||||
abort;
|
"BEACONS" = []
|
||||||
}
|
})#</cfoutput>
|
||||||
|
<cfabort>
|
||||||
|
</cfif>
|
||||||
|
|
||||||
// Clean and normalize UUIDs (remove dashes, uppercase)
|
<!--- Query for matching beacons with business info --->
|
||||||
cleanUUIDs = [];
|
<cfquery name="qBeacons" datasource="payfrit">
|
||||||
for (uuid in uuids) {
|
SELECT
|
||||||
cleanUUID = uCase(reReplace(uuid, "-", "", "all"));
|
b.ID AS BeaconID,
|
||||||
if (len(cleanUUID) == 32) {
|
b.Name AS BeaconName,
|
||||||
arrayAppend(cleanUUIDs, cleanUUID);
|
b.UUID,
|
||||||
}
|
COALESCE(sp.ID, 0) AS ServicePointID,
|
||||||
}
|
COALESCE(sp.Name, '') AS ServicePointName,
|
||||||
|
COALESCE(sp.BusinessID, lt.BusinessID, b.BusinessID) AS BusinessID,
|
||||||
|
biz.Name AS BusinessName,
|
||||||
|
biz.ParentBusinessID,
|
||||||
|
COALESCE(parent.Name, '') AS ParentBusinessName,
|
||||||
|
(SELECT COUNT(*) FROM Businesses WHERE ParentBusinessID = biz.ID) AS ChildCount
|
||||||
|
FROM Beacons b
|
||||||
|
LEFT JOIN ServicePoints sp ON sp.BeaconID = b.ID
|
||||||
|
LEFT JOIN lt_BeaconsID_BusinessesID lt ON lt.BeaconID = b.ID
|
||||||
|
INNER JOIN Businesses biz ON COALESCE(sp.BusinessID, lt.BusinessID, b.BusinessID) = biz.ID
|
||||||
|
LEFT JOIN Businesses parent ON biz.ParentBusinessID = parent.ID
|
||||||
|
WHERE b.UUID IN (<cfqueryparam value="#arrayToList(cleanUUIDs)#" cfsqltype="cf_sql_varchar" list="true">)
|
||||||
|
AND b.IsActive = 1
|
||||||
|
AND biz.IsDemo = 0
|
||||||
|
AND biz.IsPrivate = 0
|
||||||
|
</cfquery>
|
||||||
|
|
||||||
if (arrayLen(cleanUUIDs) == 0) {
|
<cfset beacons = []>
|
||||||
response["OK"] = true;
|
<cfloop query="qBeacons">
|
||||||
response["BEACONS"] = [];
|
<cfset arrayAppend(beacons, {
|
||||||
writeOutput(serializeJSON(response));
|
"UUID" = qBeacons.UUID,
|
||||||
abort;
|
"BeaconID" = qBeacons.BeaconID,
|
||||||
}
|
"BeaconName" = qBeacons.BeaconName,
|
||||||
|
"BusinessID" = qBeacons.BusinessID,
|
||||||
|
"BusinessName" = qBeacons.BusinessName,
|
||||||
|
"ServicePointID" = qBeacons.ServicePointID,
|
||||||
|
"ServicePointName" = qBeacons.ServicePointName,
|
||||||
|
"ParentBusinessID" = val(qBeacons.ParentBusinessID),
|
||||||
|
"ParentBusinessName" = qBeacons.ParentBusinessName,
|
||||||
|
"HasChildren" = qBeacons.ChildCount GT 0
|
||||||
|
})>
|
||||||
|
</cfloop>
|
||||||
|
|
||||||
// Query for matching beacons with business info
|
<cfoutput>#serializeJSON({
|
||||||
// Beacons resolve to businesses via: ServicePoints, join table, or owner
|
"OK" = true,
|
||||||
qBeacons = queryExecute("
|
"ERROR" = "",
|
||||||
SELECT
|
"BEACONS" = beacons
|
||||||
b.ID,
|
})#</cfoutput>
|
||||||
b.Name,
|
|
||||||
b.UUID,
|
|
||||||
COALESCE(sp.ID, 0) AS ServicePointID,
|
|
||||||
COALESCE(sp.Name, '') AS Name,
|
|
||||||
COALESCE(sp.BusinessID, lt.BusinessID, b.BusinessID) AS BusinessID,
|
|
||||||
biz.Name,
|
|
||||||
biz.ParentBusinessID,
|
|
||||||
parent.Name AS ParentName,
|
|
||||||
(SELECT COUNT(*) FROM Businesses WHERE ParentBusinessID = biz.ID) AS ChildCount
|
|
||||||
FROM Beacons b
|
|
||||||
LEFT JOIN ServicePoints sp ON sp.BeaconID = b.ID
|
|
||||||
LEFT JOIN lt_BeaconsID_BusinessesID lt ON lt.BeaconID = b.ID
|
|
||||||
INNER JOIN Businesses biz ON COALESCE(sp.BusinessID, lt.BusinessID, b.BusinessID) = biz.ID
|
|
||||||
LEFT JOIN Businesses parent ON biz.ParentBusinessID = parent.ID
|
|
||||||
WHERE b.UUID IN (:uuids)
|
|
||||||
AND b.IsActive = 1
|
|
||||||
AND biz.IsDemo = 0
|
|
||||||
AND biz.IsPrivate = 0
|
|
||||||
", {
|
|
||||||
uuids: { value: arrayToList(cleanUUIDs), cfsqltype: "cf_sql_varchar", list: true }
|
|
||||||
}, { datasource: "payfrit" });
|
|
||||||
|
|
||||||
beacons = [];
|
<cfcatch type="any">
|
||||||
for (row in qBeacons) {
|
<cfoutput>#serializeJSON({
|
||||||
arrayAppend(beacons, {
|
"OK" = false,
|
||||||
"UUID": row.UUID,
|
"ERROR" = cfcatch.message
|
||||||
"BeaconID": row.ID,
|
})#</cfoutput>
|
||||||
"Name": row.Name,
|
</cfcatch>
|
||||||
"BusinessID": row.BusinessID,
|
</cftry>
|
||||||
"Name": row.Name,
|
|
||||||
"ServicePointID": row.ServicePointID,
|
|
||||||
"Name": row.Name,
|
|
||||||
"ParentBusinessID": val(row.ParentBusinessID),
|
|
||||||
"ParentName": row.ParentName ?: "",
|
|
||||||
"HasChildren": row.ChildCount > 0
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
response["OK"] = true;
|
|
||||||
response["BEACONS"] = beacons;
|
|
||||||
|
|
||||||
} catch (any e) {
|
|
||||||
response["ERROR"] = e.message;
|
|
||||||
}
|
|
||||||
|
|
||||||
writeOutput(serializeJSON(response));
|
|
||||||
</cfscript>
|
|
||||||
|
|
|
||||||
|
|
@ -81,10 +81,10 @@ try {
|
||||||
stateID = 0;
|
stateID = 0;
|
||||||
if (len(state)) {
|
if (len(state)) {
|
||||||
qState = queryExecute("
|
qState = queryExecute("
|
||||||
SELECT tt_StateID FROM tt_States WHERE Abbreviation = :abbr
|
SELECT ID FROM tt_States WHERE Abbreviation = :abbr
|
||||||
", { abbr: uCase(state) }, { datasource: "payfrit" });
|
", { abbr: uCase(state) }, { datasource: "payfrit" });
|
||||||
if (qState.recordCount > 0) {
|
if (qState.recordCount > 0) {
|
||||||
stateID = qState.tt_StateID;
|
stateID = qState.ID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ try {
|
||||||
apiAbort({
|
apiAbort({
|
||||||
"OK": true,
|
"OK": true,
|
||||||
"HAS_ACTIVE_CHAT": true,
|
"HAS_ACTIVE_CHAT": true,
|
||||||
"TASK_ID": qChat.TaskID,
|
"TASK_ID": qChat.ID,
|
||||||
"TASK_TITLE": qChat.Title
|
"TASK_TITLE": qChat.Title
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -183,8 +183,8 @@
|
||||||
SELECT
|
SELECT
|
||||||
i.ID,
|
i.ID,
|
||||||
i.CategoryID,
|
i.CategoryID,
|
||||||
c.Name,
|
c.Name AS CategoryName,
|
||||||
i.Name,
|
i.Name AS ItemName,
|
||||||
i.Description,
|
i.Description,
|
||||||
i.ParentItemID,
|
i.ParentItemID,
|
||||||
i.Price,
|
i.Price,
|
||||||
|
|
@ -195,8 +195,9 @@
|
||||||
i.IsCollapsible,
|
i.IsCollapsible,
|
||||||
i.SortOrder,
|
i.SortOrder,
|
||||||
i.StationID,
|
i.StationID,
|
||||||
s.Name,
|
s.Name AS StationName,
|
||||||
s.Color
|
s.Color,
|
||||||
|
c.MenuID
|
||||||
FROM Items i
|
FROM Items i
|
||||||
LEFT JOIN Categories c ON c.ID = i.CategoryID
|
LEFT JOIN Categories c ON c.ID = i.CategoryID
|
||||||
LEFT JOIN Stations s ON s.ID = i.StationID
|
LEFT JOIN Stations s ON s.ID = i.StationID
|
||||||
|
|
@ -317,7 +318,6 @@
|
||||||
"ItemID": qCategories.ID,
|
"ItemID": qCategories.ID,
|
||||||
"CategoryID": qCategories.ID,
|
"CategoryID": qCategories.ID,
|
||||||
"Name": qCategories.Name,
|
"Name": qCategories.Name,
|
||||||
"Name": qCategories.Name,
|
|
||||||
"Description": "",
|
"Description": "",
|
||||||
"ParentItemID": 0,
|
"ParentItemID": 0,
|
||||||
"Price": 0,
|
"Price": 0,
|
||||||
|
|
@ -327,6 +327,7 @@
|
||||||
"MaxNumSelectionReq": 0,
|
"MaxNumSelectionReq": 0,
|
||||||
"IsCollapsible": 0,
|
"IsCollapsible": 0,
|
||||||
"SortOrder": qCategories.SortOrder,
|
"SortOrder": qCategories.SortOrder,
|
||||||
|
"MenuID": isNull(qCategories.MenuID) ? 0 : val(qCategories.MenuID),
|
||||||
"StationID": "",
|
"StationID": "",
|
||||||
"ItemName": "",
|
"ItemName": "",
|
||||||
"ItemColor": ""
|
"ItemColor": ""
|
||||||
|
|
@ -360,11 +361,27 @@
|
||||||
</cfif>
|
</cfif>
|
||||||
</cfif>
|
</cfif>
|
||||||
|
|
||||||
|
<cfset itemMenuID = 0>
|
||||||
|
<cftry>
|
||||||
|
<cfset itemMenuID = isNull(q.MenuID) ? 0 : val(q.MenuID)>
|
||||||
|
<cfcatch><cfset itemMenuID = 0></cfcatch>
|
||||||
|
</cftry>
|
||||||
|
<!--- Use aliased columns if available, fall back to generic Name --->
|
||||||
|
<cfset itemName = "">
|
||||||
|
<cfset catName = "">
|
||||||
|
<cftry>
|
||||||
|
<cfset itemName = q.ItemName>
|
||||||
|
<cfset catName = q.CategoryName>
|
||||||
|
<cfcatch>
|
||||||
|
<!--- Fallback for old schema queries without aliases --->
|
||||||
|
<cfset itemName = q.Name>
|
||||||
|
<cfset catName = q.Name>
|
||||||
|
</cfcatch>
|
||||||
|
</cftry>
|
||||||
<cfset arrayAppend(rows, {
|
<cfset arrayAppend(rows, {
|
||||||
"ItemID": q.ID,
|
"ItemID": q.ID,
|
||||||
"CategoryID": q.CategoryID,
|
"CategoryID": q.CategoryID,
|
||||||
"Name": len(trim(q.Name)) ? q.Name : "",
|
"Name": len(trim(itemName)) ? itemName : catName,
|
||||||
"Name": q.Name,
|
|
||||||
"Description": q.Description,
|
"Description": q.Description,
|
||||||
"ParentItemID": effectiveParentID,
|
"ParentItemID": effectiveParentID,
|
||||||
"Price": q.Price,
|
"Price": q.Price,
|
||||||
|
|
@ -374,8 +391,9 @@
|
||||||
"MaxNumSelectionReq": q.MaxNumSelectionReq,
|
"MaxNumSelectionReq": q.MaxNumSelectionReq,
|
||||||
"IsCollapsible": q.IsCollapsible,
|
"IsCollapsible": q.IsCollapsible,
|
||||||
"SortOrder": q.SortOrder,
|
"SortOrder": q.SortOrder,
|
||||||
|
"MenuID": itemMenuID,
|
||||||
"StationID": len(trim(q.StationID)) ? q.StationID : "",
|
"StationID": len(trim(q.StationID)) ? q.StationID : "",
|
||||||
"ItemName": len(trim(q.Name)) ? q.Name : "",
|
"ItemName": len(trim(catName)) ? catName : "",
|
||||||
"ItemColor": len(trim(q.Color)) ? q.Color : ""
|
"ItemColor": len(trim(q.Color)) ? q.Color : ""
|
||||||
})>
|
})>
|
||||||
</cfloop>
|
</cfloop>
|
||||||
|
|
|
||||||
|
|
@ -52,14 +52,14 @@
|
||||||
|
|
||||||
<!--- Delete line items --->
|
<!--- Delete line items --->
|
||||||
<cfset queryExecute(
|
<cfset queryExecute(
|
||||||
"DELETE FROM OrderLineItems WHERE OrderID = ?",
|
"DELETE FROM OrderLineItems WHERE ID = ?",
|
||||||
[{ value = OrderID, cfsqltype = "cf_sql_integer" }],
|
[{ value = OrderID, cfsqltype = "cf_sql_integer" }],
|
||||||
{ datasource = "payfrit" }
|
{ datasource = "payfrit" }
|
||||||
)>
|
)>
|
||||||
|
|
||||||
<!--- Mark order with status 7 (Deleted and started new cart) --->
|
<!--- Mark order with status 7 (Deleted and started new cart) --->
|
||||||
<cfset queryExecute(
|
<cfset queryExecute(
|
||||||
"UPDATE Orders SET StatusID = 7, LastEditedOn = NOW() WHERE OrderID = ?",
|
"UPDATE Orders SET StatusID = 7, LastEditedOn = NOW() WHERE ID = ?",
|
||||||
[{ value = OrderID, cfsqltype = "cf_sql_integer" }],
|
[{ value = OrderID, cfsqltype = "cf_sql_integer" }],
|
||||||
{ datasource = "payfrit" }
|
{ datasource = "payfrit" }
|
||||||
)>
|
)>
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
<cfset lineItems = []>
|
<cfset lineItems = []>
|
||||||
<cfloop query="qLineItems">
|
<cfloop query="qLineItems">
|
||||||
<cfset arrayAppend(lineItems, {
|
<cfset arrayAppend(lineItems, {
|
||||||
"OrderLineItemID": qLineItems.OrderLineItemID,
|
"OrderLineItemID": qLineItems.ID,
|
||||||
"ParentOrderLineItemID": qLineItems.ParentOrderLineItemID,
|
"ParentOrderLineItemID": qLineItems.ParentOrderLineItemID,
|
||||||
"ItemID": qLineItems.ID,
|
"ItemID": qLineItems.ID,
|
||||||
"Price": qLineItems.Price,
|
"Price": qLineItems.Price,
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
UUID,
|
UUID,
|
||||||
UserID,
|
UserID,
|
||||||
BusinessID,
|
BusinessID,
|
||||||
DeliveryMultiplier,
|
BusinessDeliveryMultiplier,
|
||||||
OrderTypeID,
|
OrderTypeID,
|
||||||
DeliveryFee,
|
DeliveryFee,
|
||||||
StatusID,
|
StatusID,
|
||||||
|
|
@ -94,7 +94,7 @@
|
||||||
parent.Name AS ItemParentName
|
parent.Name AS ItemParentName
|
||||||
FROM OrderLineItems oli
|
FROM OrderLineItems oli
|
||||||
INNER JOIN Items i ON i.ID = oli.ItemID
|
INNER JOIN Items i ON i.ID = oli.ItemID
|
||||||
LEFT JOIN Items parent ON parent.ItemID = i.ParentItemID
|
LEFT JOIN Items parent ON parent.ID = i.ParentItemID
|
||||||
WHERE oli.OrderID = ?
|
WHERE oli.OrderID = ?
|
||||||
ORDER BY oli.ID
|
ORDER BY oli.ID
|
||||||
",
|
",
|
||||||
|
|
@ -105,7 +105,7 @@
|
||||||
<cfset rows = []>
|
<cfset rows = []>
|
||||||
<cfloop query="qLI">
|
<cfloop query="qLI">
|
||||||
<cfset arrayAppend(rows, {
|
<cfset arrayAppend(rows, {
|
||||||
"OrderLineItemID": val(qLI.OrderLineItemID),
|
"OrderLineItemID": val(qLI.ID),
|
||||||
"ParentOrderLineItemID": val(qLI.ParentOrderLineItemID),
|
"ParentOrderLineItemID": val(qLI.ParentOrderLineItemID),
|
||||||
"OrderID": val(qLI.OrderID),
|
"OrderID": val(qLI.OrderID),
|
||||||
"ItemID": val(qLI.ItemID),
|
"ItemID": val(qLI.ItemID),
|
||||||
|
|
@ -130,7 +130,7 @@
|
||||||
"UUID": qOrder.UUID ?: "",
|
"UUID": qOrder.UUID ?: "",
|
||||||
"UserID": val(qOrder.UserID),
|
"UserID": val(qOrder.UserID),
|
||||||
"BusinessID": val(qOrder.BusinessID),
|
"BusinessID": val(qOrder.BusinessID),
|
||||||
"DeliveryMultiplier": val(qOrder.DeliveryMultiplier),
|
"DeliveryMultiplier": val(qOrder.BusinessDeliveryMultiplier),
|
||||||
"OrderTypeID": val(qOrder.OrderTypeID),
|
"OrderTypeID": val(qOrder.OrderTypeID),
|
||||||
"DeliveryFee": val(qOrder.DeliveryFee),
|
"DeliveryFee": val(qOrder.DeliveryFee),
|
||||||
"BusinessDeliveryFee": val(businessDeliveryFee),
|
"BusinessDeliveryFee": val(businessDeliveryFee),
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ try {
|
||||||
o.AddedOn,
|
o.AddedOn,
|
||||||
o.LastEditedOn,
|
o.LastEditedOn,
|
||||||
o.SubmittedOn,
|
o.SubmittedOn,
|
||||||
o.OrderTipAmount,
|
o.TipAmount,
|
||||||
u.FirstName,
|
u.FirstName,
|
||||||
u.LastName,
|
u.LastName,
|
||||||
u.ContactNumber,
|
u.ContactNumber,
|
||||||
|
|
@ -145,7 +145,7 @@ try {
|
||||||
tax = subtotal * taxRate;
|
tax = subtotal * taxRate;
|
||||||
|
|
||||||
// Get tip from order
|
// Get tip from order
|
||||||
tip = isNumeric(qOrder.OrderTipAmount) ? qOrder.OrderTipAmount : 0;
|
tip = isNumeric(qOrder.TipAmount) ? qOrder.TipAmount : 0;
|
||||||
|
|
||||||
// Calculate total
|
// Calculate total
|
||||||
total = subtotal + tax + tip;
|
total = subtotal + tax + tip;
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
UUID,
|
UUID,
|
||||||
UserID,
|
UserID,
|
||||||
BusinessID,
|
BusinessID,
|
||||||
DeliveryMultiplier,
|
BusinessDeliveryMultiplier,
|
||||||
OrderTypeID,
|
OrderTypeID,
|
||||||
DeliveryFee,
|
DeliveryFee,
|
||||||
StatusID,
|
StatusID,
|
||||||
|
|
@ -73,7 +73,7 @@
|
||||||
"UUID": qOrder.UUID ?: "",
|
"UUID": qOrder.UUID ?: "",
|
||||||
"UserID": val(qOrder.UserID),
|
"UserID": val(qOrder.UserID),
|
||||||
"BusinessID": val(qOrder.BusinessID),
|
"BusinessID": val(qOrder.BusinessID),
|
||||||
"DeliveryMultiplier": val(qOrder.DeliveryMultiplier),
|
"DeliveryMultiplier": val(qOrder.BusinessDeliveryMultiplier),
|
||||||
"OrderTypeID": val(qOrder.OrderTypeID),
|
"OrderTypeID": val(qOrder.OrderTypeID),
|
||||||
"DeliveryFee": val(qOrder.DeliveryFee),
|
"DeliveryFee": val(qOrder.DeliveryFee),
|
||||||
"BusinessDeliveryFee": val(businessDeliveryFee),
|
"BusinessDeliveryFee": val(businessDeliveryFee),
|
||||||
|
|
@ -266,7 +266,7 @@
|
||||||
UUID,
|
UUID,
|
||||||
UserID,
|
UserID,
|
||||||
BusinessID,
|
BusinessID,
|
||||||
DeliveryMultiplier,
|
BusinessDeliveryMultiplier,
|
||||||
OrderTypeID,
|
OrderTypeID,
|
||||||
DeliveryFee,
|
DeliveryFee,
|
||||||
StatusID,
|
StatusID,
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@
|
||||||
parent.Name AS ItemParentName
|
parent.Name AS ItemParentName
|
||||||
FROM OrderLineItems oli
|
FROM OrderLineItems oli
|
||||||
INNER JOIN Items i ON i.ID = oli.ItemID
|
INNER JOIN Items i ON i.ID = oli.ItemID
|
||||||
LEFT JOIN Items parent ON parent.ItemID = i.ParentItemID
|
LEFT JOIN Items parent ON parent.ID = i.ParentItemID
|
||||||
WHERE oli.OrderID = ?
|
WHERE oli.OrderID = ?
|
||||||
AND oli.IsDeleted = b'0'
|
AND oli.IsDeleted = b'0'
|
||||||
AND (i.StationID = ? OR i.StationID = 0 OR i.StationID IS NULL OR oli.ParentOrderLineItemID > 0)
|
AND (i.StationID = ? OR i.StationID = 0 OR i.StationID IS NULL OR oli.ParentOrderLineItemID > 0)
|
||||||
|
|
@ -155,7 +155,7 @@
|
||||||
parent.Name AS ItemParentName
|
parent.Name AS ItemParentName
|
||||||
FROM OrderLineItems oli
|
FROM OrderLineItems oli
|
||||||
INNER JOIN Items i ON i.ID = oli.ItemID
|
INNER JOIN Items i ON i.ID = oli.ItemID
|
||||||
LEFT JOIN Items parent ON parent.ItemID = i.ParentItemID
|
LEFT JOIN Items parent ON parent.ID = i.ParentItemID
|
||||||
WHERE oli.OrderID = ?
|
WHERE oli.OrderID = ?
|
||||||
AND oli.IsDeleted = b'0'
|
AND oli.IsDeleted = b'0'
|
||||||
ORDER BY oli.ID
|
ORDER BY oli.ID
|
||||||
|
|
@ -165,7 +165,7 @@
|
||||||
<cfset lineItems = []>
|
<cfset lineItems = []>
|
||||||
<cfloop query="qLineItems">
|
<cfloop query="qLineItems">
|
||||||
<cfset arrayAppend(lineItems, {
|
<cfset arrayAppend(lineItems, {
|
||||||
"OrderLineItemID": qLineItems.OrderLineItemID,
|
"OrderLineItemID": qLineItems.ID,
|
||||||
"ParentOrderLineItemID": qLineItems.ParentOrderLineItemID,
|
"ParentOrderLineItemID": qLineItems.ParentOrderLineItemID,
|
||||||
"ItemID": qLineItems.ID,
|
"ItemID": qLineItems.ID,
|
||||||
"Price": qLineItems.Price,
|
"Price": qLineItems.Price,
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
WHERE ParentItemID = ?
|
WHERE ParentItemID = ?
|
||||||
AND IsCheckedByDefault = 1
|
AND IsCheckedByDefault = 1
|
||||||
AND IsActive = 1
|
AND IsActive = 1
|
||||||
ORDER BY SortOrder, ItemID
|
ORDER BY SortOrder, ID
|
||||||
",
|
",
|
||||||
[ { value = arguments.ParentItemID, cfsqltype = "cf_sql_integer" } ],
|
[ { value = arguments.ParentItemID, cfsqltype = "cf_sql_integer" } ],
|
||||||
{ datasource = "payfrit" }
|
{ datasource = "payfrit" }
|
||||||
|
|
@ -81,13 +81,13 @@
|
||||||
|
|
||||||
<!--- Process direct children --->
|
<!--- Process direct children --->
|
||||||
<cfloop query="qKids">
|
<cfloop query="qKids">
|
||||||
<cfset arrayAppend(request.attachDebug, " -> direct child: ItemID=#qKids.ItemID#")>
|
<cfset arrayAppend(request.attachDebug, " -> direct child: ItemID=#qKids.ID#")>
|
||||||
<cfset processDefaultChild(arguments.OrderID, arguments.ParentLineItemID, qKids.ItemID, qKids.Price)>
|
<cfset processDefaultChild(arguments.OrderID, arguments.ParentLineItemID, qKids.ItemID, qKids.Price)>
|
||||||
</cfloop>
|
</cfloop>
|
||||||
|
|
||||||
<!--- Process template children --->
|
<!--- Process template children --->
|
||||||
<cfloop query="qTemplateKids">
|
<cfloop query="qTemplateKids">
|
||||||
<cfset arrayAppend(request.attachDebug, " -> template child: ItemID=#qTemplateKids.ItemID#")>
|
<cfset arrayAppend(request.attachDebug, " -> template child: ItemID=#qTemplateKids.ID#")>
|
||||||
<cfset processDefaultChild(arguments.OrderID, arguments.ParentLineItemID, qTemplateKids.ItemID, qTemplateKids.Price)>
|
<cfset processDefaultChild(arguments.OrderID, arguments.ParentLineItemID, qTemplateKids.ItemID, qTemplateKids.Price)>
|
||||||
</cfloop>
|
</cfloop>
|
||||||
</cffunction>
|
</cffunction>
|
||||||
|
|
@ -103,7 +103,7 @@
|
||||||
"
|
"
|
||||||
SELECT ID
|
SELECT ID
|
||||||
FROM OrderLineItems
|
FROM OrderLineItems
|
||||||
WHERE OrderID = ?
|
WHERE ID = ?
|
||||||
AND ParentOrderLineItemID = ?
|
AND ParentOrderLineItemID = ?
|
||||||
AND ItemID = ?
|
AND ItemID = ?
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
|
|
@ -121,18 +121,18 @@
|
||||||
"
|
"
|
||||||
UPDATE OrderLineItems
|
UPDATE OrderLineItems
|
||||||
SET IsDeleted = b'0'
|
SET IsDeleted = b'0'
|
||||||
WHERE OrderLineItemID = ?
|
WHERE ID = ?
|
||||||
",
|
",
|
||||||
[ { value = qExisting.OrderLineItemID, cfsqltype = "cf_sql_integer" } ],
|
[ { value = qExisting.ID, cfsqltype = "cf_sql_integer" } ],
|
||||||
{ datasource = "payfrit" }
|
{ datasource = "payfrit" }
|
||||||
)>
|
)>
|
||||||
<cfset attachDefaultChildren(arguments.OrderID, qExisting.OrderLineItemID, arguments.ItemID)>
|
<cfset attachDefaultChildren(arguments.OrderID, qExisting.ID, arguments.ItemID)>
|
||||||
<cfelse>
|
<cfelse>
|
||||||
<cfset var NewLIID = nextId("OrderLineItems","OrderLineItemID")>
|
<cfset var NewLIID = nextId("OrderLineItems","ID")>
|
||||||
<cfset queryExecute(
|
<cfset queryExecute(
|
||||||
"
|
"
|
||||||
INSERT INTO OrderLineItems (
|
INSERT INTO OrderLineItems (
|
||||||
OrderLineItemID,
|
ID,
|
||||||
ParentOrderLineItemID,
|
ParentOrderLineItemID,
|
||||||
OrderID,
|
OrderID,
|
||||||
ItemID,
|
ItemID,
|
||||||
|
|
@ -180,7 +180,7 @@
|
||||||
o.UUID,
|
o.UUID,
|
||||||
o.UserID,
|
o.UserID,
|
||||||
o.BusinessID,
|
o.BusinessID,
|
||||||
o.DeliveryMultiplier,
|
o.BusinessDeliveryMultiplier,
|
||||||
o.OrderTypeID,
|
o.OrderTypeID,
|
||||||
o.DeliveryFee,
|
o.DeliveryFee,
|
||||||
o.StatusID,
|
o.StatusID,
|
||||||
|
|
@ -210,7 +210,7 @@
|
||||||
"UUID": qOrder.UUID ?: "",
|
"UUID": qOrder.UUID ?: "",
|
||||||
"UserID": val(qOrder.UserID),
|
"UserID": val(qOrder.UserID),
|
||||||
"BusinessID": val(qOrder.BusinessID),
|
"BusinessID": val(qOrder.BusinessID),
|
||||||
"DeliveryMultiplier": val(qOrder.DeliveryMultiplier),
|
"DeliveryMultiplier": val(qOrder.BusinessDeliveryMultiplier),
|
||||||
"OrderTypeID": val(qOrder.OrderTypeID),
|
"OrderTypeID": val(qOrder.OrderTypeID),
|
||||||
"DeliveryFee": val(qOrder.DeliveryFee),
|
"DeliveryFee": val(qOrder.DeliveryFee),
|
||||||
"StatusID": val(qOrder.StatusID),
|
"StatusID": val(qOrder.StatusID),
|
||||||
|
|
@ -243,7 +243,7 @@
|
||||||
parent.Name AS ItemParentName
|
parent.Name AS ItemParentName
|
||||||
FROM OrderLineItems oli
|
FROM OrderLineItems oli
|
||||||
INNER JOIN Items i ON i.ID = oli.ItemID
|
INNER JOIN Items i ON i.ID = oli.ItemID
|
||||||
LEFT JOIN Items parent ON parent.ItemID = i.ParentItemID
|
LEFT JOIN Items parent ON parent.ID = i.ParentItemID
|
||||||
WHERE oli.OrderID = ?
|
WHERE oli.OrderID = ?
|
||||||
ORDER BY oli.ID
|
ORDER BY oli.ID
|
||||||
",
|
",
|
||||||
|
|
@ -254,7 +254,7 @@
|
||||||
<cfset var rows = []>
|
<cfset var rows = []>
|
||||||
<cfloop query="qLI">
|
<cfloop query="qLI">
|
||||||
<cfset arrayAppend(rows, {
|
<cfset arrayAppend(rows, {
|
||||||
"OrderLineItemID": val(qLI.OrderLineItemID),
|
"OrderLineItemID": val(qLI.ID),
|
||||||
"ParentOrderLineItemID": val(qLI.ParentOrderLineItemID),
|
"ParentOrderLineItemID": val(qLI.ParentOrderLineItemID),
|
||||||
"OrderID": val(qLI.OrderID),
|
"OrderID": val(qLI.OrderID),
|
||||||
"ItemID": val(qLI.ItemID),
|
"ItemID": val(qLI.ItemID),
|
||||||
|
|
@ -356,7 +356,7 @@
|
||||||
<cfif IsSelected>
|
<cfif IsSelected>
|
||||||
<!--- Get the parent line item's ItemID to check maxSel --->
|
<!--- Get the parent line item's ItemID to check maxSel --->
|
||||||
<cfset qParentLI = queryExecute(
|
<cfset qParentLI = queryExecute(
|
||||||
"SELECT ItemID FROM OrderLineItems WHERE OrderLineItemID = ? LIMIT 1",
|
"SELECT ItemID FROM OrderLineItems WHERE ID = ? LIMIT 1",
|
||||||
[ { value = ParentLineItemID, cfsqltype = "cf_sql_integer" } ],
|
[ { value = ParentLineItemID, cfsqltype = "cf_sql_integer" } ],
|
||||||
{ datasource = "payfrit" }
|
{ datasource = "payfrit" }
|
||||||
)>
|
)>
|
||||||
|
|
@ -375,7 +375,7 @@
|
||||||
"
|
"
|
||||||
UPDATE OrderLineItems
|
UPDATE OrderLineItems
|
||||||
SET IsDeleted = b'1'
|
SET IsDeleted = b'1'
|
||||||
WHERE OrderID = ?
|
WHERE ID = ?
|
||||||
AND ParentOrderLineItemID = ?
|
AND ParentOrderLineItemID = ?
|
||||||
AND ItemID != ?
|
AND ItemID != ?
|
||||||
AND IsDeleted = b'0'
|
AND IsDeleted = b'0'
|
||||||
|
|
@ -395,13 +395,13 @@
|
||||||
<!--- Find existing line item (by order, parent LI, item) - unless ForceNew is set --->
|
<!--- Find existing line item (by order, parent LI, item) - unless ForceNew is set --->
|
||||||
<cfif ForceNew>
|
<cfif ForceNew>
|
||||||
<!--- ForceNew: Skip existing lookup, will always create new line item --->
|
<!--- ForceNew: Skip existing lookup, will always create new line item --->
|
||||||
<cfset qExisting = queryNew("OrderLineItemID", "integer")>
|
<cfset qExisting = queryNew("ID", "integer")>
|
||||||
<cfelse>
|
<cfelse>
|
||||||
<cfset qExisting = queryExecute(
|
<cfset qExisting = queryExecute(
|
||||||
"
|
"
|
||||||
SELECT ID
|
SELECT ID
|
||||||
FROM OrderLineItems
|
FROM OrderLineItems
|
||||||
WHERE OrderID = ?
|
WHERE ID = ?
|
||||||
AND ParentOrderLineItemID = ?
|
AND ParentOrderLineItemID = ?
|
||||||
AND ItemID = ?
|
AND ItemID = ?
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
|
|
@ -431,13 +431,13 @@
|
||||||
Price = ?,
|
Price = ?,
|
||||||
Remark = ?,
|
Remark = ?,
|
||||||
StatusID = 0
|
StatusID = 0
|
||||||
WHERE OrderLineItemID = ?
|
WHERE ID = ?
|
||||||
",
|
",
|
||||||
[
|
[
|
||||||
{ value = Quantity, cfsqltype = "cf_sql_integer" },
|
{ value = Quantity, cfsqltype = "cf_sql_integer" },
|
||||||
{ value = qItem.Price, cfsqltype = "cf_sql_decimal" },
|
{ value = qItem.Price, cfsqltype = "cf_sql_decimal" },
|
||||||
{ value = Remark, cfsqltype = "cf_sql_varchar", null = (len(trim(Remark)) EQ 0) },
|
{ value = Remark, cfsqltype = "cf_sql_varchar", null = (len(trim(Remark)) EQ 0) },
|
||||||
{ value = qExisting.OrderLineItemID, cfsqltype = "cf_sql_integer" }
|
{ value = qExisting.ID, cfsqltype = "cf_sql_integer" }
|
||||||
],
|
],
|
||||||
{ datasource = "payfrit" }
|
{ datasource = "payfrit" }
|
||||||
)>
|
)>
|
||||||
|
|
@ -446,29 +446,29 @@
|
||||||
<cfif NOT structKeyExists(request, "attachDebug")>
|
<cfif NOT structKeyExists(request, "attachDebug")>
|
||||||
<cfset request.attachDebug = []>
|
<cfset request.attachDebug = []>
|
||||||
</cfif>
|
</cfif>
|
||||||
<cfset arrayAppend(request.attachDebug, "BEFORE attachDefaultChildren call: OrderID=#OrderID#, LIID=#qExisting.OrderLineItemID#, ItemID=#ItemID#")>
|
<cfset arrayAppend(request.attachDebug, "BEFORE attachDefaultChildren call: OrderID=#OrderID#, LIID=#qExisting.ID#, ItemID=#ItemID#")>
|
||||||
<cfset attachDefaultChildren(OrderID, qExisting.OrderLineItemID, ItemID)>
|
<cfset attachDefaultChildren(OrderID, qExisting.ID, ItemID)>
|
||||||
<cfset arrayAppend(request.attachDebug, "AFTER attachDefaultChildren call")>
|
<cfset arrayAppend(request.attachDebug, "AFTER attachDefaultChildren call")>
|
||||||
<cfelse>
|
<cfelse>
|
||||||
<cfset queryExecute(
|
<cfset queryExecute(
|
||||||
"
|
"
|
||||||
UPDATE OrderLineItems
|
UPDATE OrderLineItems
|
||||||
SET IsDeleted = b'1'
|
SET IsDeleted = b'1'
|
||||||
WHERE OrderLineItemID = ?
|
WHERE ID = ?
|
||||||
",
|
",
|
||||||
[ { value = qExisting.OrderLineItemID, cfsqltype = "cf_sql_integer" } ],
|
[ { value = qExisting.ID, cfsqltype = "cf_sql_integer" } ],
|
||||||
{ datasource = "payfrit" }
|
{ datasource = "payfrit" }
|
||||||
)>
|
)>
|
||||||
</cfif>
|
</cfif>
|
||||||
<cfelse>
|
<cfelse>
|
||||||
<!--- Insert new if selecting, otherwise no-op --->
|
<!--- Insert new if selecting, otherwise no-op --->
|
||||||
<cfif IsSelected>
|
<cfif IsSelected>
|
||||||
<cfset NewLIID = nextId("OrderLineItems","OrderLineItemID")>
|
<cfset NewLIID = nextId("OrderLineItems","ID")>
|
||||||
|
|
||||||
<cfset queryExecute(
|
<cfset queryExecute(
|
||||||
"
|
"
|
||||||
INSERT INTO OrderLineItems (
|
INSERT INTO OrderLineItems (
|
||||||
OrderLineItemID,
|
ID,
|
||||||
ParentOrderLineItemID,
|
ParentOrderLineItemID,
|
||||||
OrderID,
|
OrderID,
|
||||||
ItemID,
|
ItemID,
|
||||||
|
|
@ -511,7 +511,7 @@
|
||||||
<!--- Touch order last edited --->
|
<!--- Touch order last edited --->
|
||||||
<cftry>
|
<cftry>
|
||||||
<cfset queryExecute(
|
<cfset queryExecute(
|
||||||
"UPDATE Orders SET LastEditedOn = ? WHERE OrderID = ?",
|
"UPDATE Orders SET LastEditedOn = ? WHERE ID = ?",
|
||||||
[
|
[
|
||||||
{ value = now(), cfsqltype = "cf_sql_timestamp" },
|
{ value = now(), cfsqltype = "cf_sql_timestamp" },
|
||||||
{ value = OrderID, cfsqltype = "cf_sql_integer" }
|
{ value = OrderID, cfsqltype = "cf_sql_integer" }
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
UUID,
|
UUID,
|
||||||
UserID,
|
UserID,
|
||||||
BusinessID,
|
BusinessID,
|
||||||
DeliveryMultiplier,
|
BusinessDeliveryMultiplier,
|
||||||
OrderTypeID,
|
OrderTypeID,
|
||||||
DeliveryFee,
|
DeliveryFee,
|
||||||
StatusID,
|
StatusID,
|
||||||
|
|
@ -73,7 +73,7 @@
|
||||||
"UUID": qOrder.UUID ?: "",
|
"UUID": qOrder.UUID ?: "",
|
||||||
"UserID": val(qOrder.UserID),
|
"UserID": val(qOrder.UserID),
|
||||||
"BusinessID": val(qOrder.BusinessID),
|
"BusinessID": val(qOrder.BusinessID),
|
||||||
"DeliveryMultiplier": val(qOrder.DeliveryMultiplier),
|
"DeliveryMultiplier": val(qOrder.BusinessDeliveryMultiplier),
|
||||||
"OrderTypeID": val(qOrder.OrderTypeID),
|
"OrderTypeID": val(qOrder.OrderTypeID),
|
||||||
"DeliveryFee": val(qOrder.DeliveryFee),
|
"DeliveryFee": val(qOrder.DeliveryFee),
|
||||||
"BusinessDeliveryFee": val(businessDeliveryFee),
|
"BusinessDeliveryFee": val(businessDeliveryFee),
|
||||||
|
|
@ -106,7 +106,7 @@
|
||||||
parent.Name AS ItemParentName
|
parent.Name AS ItemParentName
|
||||||
FROM OrderLineItems oli
|
FROM OrderLineItems oli
|
||||||
INNER JOIN Items i ON i.ID = oli.ItemID
|
INNER JOIN Items i ON i.ID = oli.ItemID
|
||||||
LEFT JOIN Items parent ON parent.ItemID = i.ParentItemID
|
LEFT JOIN Items parent ON parent.ID = i.ParentItemID
|
||||||
WHERE oli.OrderID = ?
|
WHERE oli.OrderID = ?
|
||||||
ORDER BY oli.ID
|
ORDER BY oli.ID
|
||||||
",
|
",
|
||||||
|
|
@ -117,7 +117,7 @@
|
||||||
<cfset var rows = []>
|
<cfset var rows = []>
|
||||||
<cfloop query="qLI">
|
<cfloop query="qLI">
|
||||||
<cfset arrayAppend(rows, {
|
<cfset arrayAppend(rows, {
|
||||||
"OrderLineItemID": val(qLI.OrderLineItemID),
|
"OrderLineItemID": val(qLI.ID),
|
||||||
"ParentOrderLineItemID": val(qLI.ParentOrderLineItemID),
|
"ParentOrderLineItemID": val(qLI.ParentOrderLineItemID),
|
||||||
"OrderID": val(qLI.OrderID),
|
"OrderID": val(qLI.OrderID),
|
||||||
"ItemID": val(qLI.ItemID),
|
"ItemID": val(qLI.ItemID),
|
||||||
|
|
@ -221,7 +221,7 @@
|
||||||
AddressID = ?,
|
AddressID = ?,
|
||||||
DeliveryFee = ?,
|
DeliveryFee = ?,
|
||||||
LastEditedOn = ?
|
LastEditedOn = ?
|
||||||
WHERE OrderID = ?
|
WHERE ID = ?
|
||||||
",
|
",
|
||||||
[
|
[
|
||||||
{ value = OrderTypeID, cfsqltype = "cf_sql_integer" },
|
{ value = OrderTypeID, cfsqltype = "cf_sql_integer" },
|
||||||
|
|
@ -241,7 +241,7 @@
|
||||||
AddressID = NULL,
|
AddressID = NULL,
|
||||||
DeliveryFee = 0,
|
DeliveryFee = 0,
|
||||||
LastEditedOn = ?
|
LastEditedOn = ?
|
||||||
WHERE OrderID = ?
|
WHERE ID = ?
|
||||||
",
|
",
|
||||||
[
|
[
|
||||||
{ value = OrderTypeID, cfsqltype = "cf_sql_integer" },
|
{ value = OrderTypeID, cfsqltype = "cf_sql_integer" },
|
||||||
|
|
|
||||||
|
|
@ -42,8 +42,8 @@
|
||||||
ItemID,
|
ItemID,
|
||||||
IsDeleted
|
IsDeleted
|
||||||
FROM OrderLineItems
|
FROM OrderLineItems
|
||||||
WHERE OrderID = ?
|
WHERE ID = ?
|
||||||
ORDER BY OrderLineItemID
|
ORDER BY ID
|
||||||
",
|
",
|
||||||
[ { value = arguments.OrderID, cfsqltype = "cf_sql_integer" } ],
|
[ { value = arguments.OrderID, cfsqltype = "cf_sql_integer" } ],
|
||||||
{ datasource = "payfrit" }
|
{ datasource = "payfrit" }
|
||||||
|
|
@ -55,8 +55,8 @@
|
||||||
|
|
||||||
<cfset var itemIds = []>
|
<cfset var itemIds = []>
|
||||||
<cfloop query="qLI">
|
<cfloop query="qLI">
|
||||||
<cfset out.items[qLI.OrderLineItemID] = {
|
<cfset out.items[qLI.ID] = {
|
||||||
"id": qLI.OrderLineItemID,
|
"id": qLI.ID,
|
||||||
"parentId": qLI.ParentOrderLineItemID,
|
"parentId": qLI.ParentOrderLineItemID,
|
||||||
"itemId": qLI.ItemID,
|
"itemId": qLI.ItemID,
|
||||||
"isDeleted": (qLI.IsDeleted EQ true)
|
"isDeleted": (qLI.IsDeleted EQ true)
|
||||||
|
|
@ -64,7 +64,7 @@
|
||||||
<cfif NOT structKeyExists(out.children, qLI.ParentOrderLineItemID)>
|
<cfif NOT structKeyExists(out.children, qLI.ParentOrderLineItemID)>
|
||||||
<cfset out.children[qLI.ParentOrderLineItemID] = []>
|
<cfset out.children[qLI.ParentOrderLineItemID] = []>
|
||||||
</cfif>
|
</cfif>
|
||||||
<cfset arrayAppend(out.children[qLI.ParentOrderLineItemID], qLI.OrderLineItemID)>
|
<cfset arrayAppend(out.children[qLI.ParentOrderLineItemID], qLI.ID)>
|
||||||
<cfset arrayAppend(itemIds, qLI.ItemID)>
|
<cfset arrayAppend(itemIds, qLI.ItemID)>
|
||||||
</cfloop>
|
</cfloop>
|
||||||
|
|
||||||
|
|
@ -181,7 +181,7 @@
|
||||||
"
|
"
|
||||||
SELECT COUNT(*) AS Cnt
|
SELECT COUNT(*) AS Cnt
|
||||||
FROM OrderLineItems
|
FROM OrderLineItems
|
||||||
WHERE OrderID = ?
|
WHERE ID = ?
|
||||||
AND ParentOrderLineItemID = 0
|
AND ParentOrderLineItemID = 0
|
||||||
AND IsDeleted = b'0'
|
AND IsDeleted = b'0'
|
||||||
",
|
",
|
||||||
|
|
@ -253,7 +253,7 @@
|
||||||
StatusID = 1,
|
StatusID = 1,
|
||||||
SubmittedOn = ?,
|
SubmittedOn = ?,
|
||||||
LastEditedOn = ?
|
LastEditedOn = ?
|
||||||
WHERE OrderID = ?
|
WHERE ID = ?
|
||||||
",
|
",
|
||||||
[
|
[
|
||||||
{ value = now(), cfsqltype = "cf_sql_timestamp" },
|
{ value = now(), cfsqltype = "cf_sql_timestamp" },
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
UPDATE Orders
|
UPDATE Orders
|
||||||
SET StatusID = ?,
|
SET StatusID = ?,
|
||||||
LastEditedOn = ?
|
LastEditedOn = ?
|
||||||
WHERE OrderID = ?
|
WHERE ID = ?
|
||||||
", [
|
", [
|
||||||
{ value = NewStatusID, cfsqltype = "cf_sql_integer" },
|
{ value = NewStatusID, cfsqltype = "cf_sql_integer" },
|
||||||
{ value = now(), cfsqltype = "cf_sql_timestamp" },
|
{ value = now(), cfsqltype = "cf_sql_timestamp" },
|
||||||
|
|
@ -91,7 +91,7 @@
|
||||||
<cftry>
|
<cftry>
|
||||||
<!--- Check if task already exists for this order to prevent duplicates --->
|
<!--- Check if task already exists for this order to prevent duplicates --->
|
||||||
<cfset qExisting = queryExecute("
|
<cfset qExisting = queryExecute("
|
||||||
SELECT ID FROM Tasks WHERE OrderID = ? LIMIT 1
|
SELECT ID FROM Tasks WHERE ID = ? LIMIT 1
|
||||||
", [ { value = OrderID, cfsqltype = "cf_sql_integer" } ], { datasource = "payfrit" })>
|
", [ { value = OrderID, cfsqltype = "cf_sql_integer" } ], { datasource = "payfrit" })>
|
||||||
|
|
||||||
<cfif qExisting.recordCount EQ 0>
|
<cfif qExisting.recordCount EQ 0>
|
||||||
|
|
|
||||||
|
|
@ -71,12 +71,12 @@ try {
|
||||||
response.steps.append("State value received: '" & state & "' (len: " & len(state) & ")");
|
response.steps.append("State value received: '" & state & "' (len: " & len(state) & ")");
|
||||||
if (len(state)) {
|
if (len(state)) {
|
||||||
qState = queryExecute("
|
qState = queryExecute("
|
||||||
SELECT tt_StateID FROM tt_States WHERE Abbreviation = :abbr
|
SELECT ID FROM tt_States WHERE Abbreviation = :abbr
|
||||||
", { abbr: uCase(state) }, { datasource: "payfrit" });
|
", { abbr: uCase(state) }, { datasource: "payfrit" });
|
||||||
|
|
||||||
response.steps.append("State lookup for '" & uCase(state) & "' found " & qState.recordCount & " records");
|
response.steps.append("State lookup for '" & uCase(state) & "' found " & qState.recordCount & " records");
|
||||||
if (qState.recordCount > 0) {
|
if (qState.recordCount > 0) {
|
||||||
stateID = qState.tt_StateID;
|
stateID = qState.ID;
|
||||||
response.steps.append("Using stateID: " & stateID);
|
response.steps.append("Using stateID: " & stateID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,7 @@ try {
|
||||||
try {
|
try {
|
||||||
queryExecute("
|
queryExecute("
|
||||||
UPDATE WorkPayoutLedgers wpl
|
UPDATE WorkPayoutLedgers wpl
|
||||||
INNER JOIN Tasks t ON t.TaskID = wpl.TaskID AND t.OrderID = :orderID
|
INNER JOIN Tasks t ON t.ID = wpl.TaskID AND t.OrderID = :orderID
|
||||||
SET wpl.StripePaymentIntentID = :piID
|
SET wpl.StripePaymentIntentID = :piID
|
||||||
WHERE wpl.Status = 'pending_charge'
|
WHERE wpl.Status = 'pending_charge'
|
||||||
AND wpl.StripePaymentIntentID IS NULL
|
AND wpl.StripePaymentIntentID IS NULL
|
||||||
|
|
|
||||||
|
|
@ -53,9 +53,9 @@ try {
|
||||||
queryExecute("
|
queryExecute("
|
||||||
UPDATE Orders
|
UPDATE Orders
|
||||||
SET PaymentStatus = 'paid',
|
SET PaymentStatus = 'paid',
|
||||||
OrderPaymentCompletedOn = NOW(),
|
PaymentCompletedOn = NOW(),
|
||||||
StatusID = CASE WHEN StatusID = 0 THEN 1 ELSE StatusID END
|
StatusID = CASE WHEN StatusID = 0 THEN 1 ELSE StatusID END
|
||||||
WHERE OrderID = :orderID
|
WHERE ID = :orderID
|
||||||
", { orderID: orderID });
|
", { orderID: orderID });
|
||||||
|
|
||||||
writeLog(file="stripe_webhooks", text="Order #orderID# marked as paid");
|
writeLog(file="stripe_webhooks", text="Order #orderID# marked as paid");
|
||||||
|
|
@ -141,8 +141,8 @@ try {
|
||||||
queryExecute("
|
queryExecute("
|
||||||
UPDATE Orders
|
UPDATE Orders
|
||||||
SET PaymentStatus = 'failed',
|
SET PaymentStatus = 'failed',
|
||||||
OrderPaymentError = :failureMessage
|
PaymentError = :failureMessage
|
||||||
WHERE OrderID = :orderID
|
WHERE ID = :orderID
|
||||||
", {
|
", {
|
||||||
orderID: orderID,
|
orderID: orderID,
|
||||||
failureMessage: failureMessage
|
failureMessage: failureMessage
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@
|
||||||
UPDATE Orders
|
UPDATE Orders
|
||||||
SET StatusID = 5,
|
SET StatusID = 5,
|
||||||
LastEditedOn = NOW()
|
LastEditedOn = NOW()
|
||||||
WHERE OrderID = ?
|
WHERE ID = ?
|
||||||
", [ { value = qTask.OrderID, cfsqltype = "cf_sql_integer" } ], { datasource = "payfrit" })>
|
", [ { value = qTask.OrderID, cfsqltype = "cf_sql_integer" } ], { datasource = "payfrit" })>
|
||||||
<cfset orderUpdated = true>
|
<cfset orderUpdated = true>
|
||||||
</cfif>
|
</cfif>
|
||||||
|
|
|
||||||
|
|
@ -37,26 +37,26 @@
|
||||||
<!--- Get the task and linked order details --->
|
<!--- Get the task and linked order details --->
|
||||||
<cfset qTask = queryExecute("
|
<cfset qTask = queryExecute("
|
||||||
SELECT
|
SELECT
|
||||||
t.ID,
|
t.ID AS TaskID,
|
||||||
t.BusinessID,
|
t.BusinessID,
|
||||||
t.CategoryID,
|
t.CategoryID,
|
||||||
t.OrderID,
|
t.OrderID,
|
||||||
t.TaskTypeID,
|
t.TaskTypeID,
|
||||||
t.CreatedOn,
|
t.CreatedOn,
|
||||||
t.ClaimedByUserID,
|
t.ClaimedByUserID,
|
||||||
tc.Name,
|
tc.Name AS CategoryName,
|
||||||
tc.Color,
|
tc.Color AS CategoryColor,
|
||||||
o.ID,
|
o.ID AS OID,
|
||||||
o.UUID,
|
o.UUID AS OrderUUID,
|
||||||
o.UserID,
|
o.UserID,
|
||||||
o.OrderTypeID,
|
o.OrderTypeID,
|
||||||
o.StatusID,
|
o.StatusID AS OrderStatusID,
|
||||||
o.ServicePointID,
|
o.ServicePointID,
|
||||||
o.Remarks,
|
o.Remarks,
|
||||||
o.SubmittedOn,
|
o.SubmittedOn,
|
||||||
sp.Name,
|
sp.Name AS ServicePointName,
|
||||||
sp.TypeID,
|
sp.TypeID AS ServicePointTypeID,
|
||||||
u.ID as CustomerUserID,
|
u.ID AS CustomerUserID,
|
||||||
u.FirstName,
|
u.FirstName,
|
||||||
u.LastName,
|
u.LastName,
|
||||||
u.ContactNumber
|
u.ContactNumber
|
||||||
|
|
@ -73,7 +73,7 @@
|
||||||
</cfif>
|
</cfif>
|
||||||
|
|
||||||
<!--- Build basic task info --->
|
<!--- Build basic task info --->
|
||||||
<cfset taskTitle = "Task ##" & qTask.ID>
|
<cfset taskTitle = "Task ##" & qTask.TaskID>
|
||||||
<cfif qTask.OrderID GT 0>
|
<cfif qTask.OrderID GT 0>
|
||||||
<cfset taskTitle = "Order ##" & qTask.OrderID>
|
<cfset taskTitle = "Order ##" & qTask.OrderID>
|
||||||
</cfif>
|
</cfif>
|
||||||
|
|
@ -95,20 +95,21 @@
|
||||||
</cfif>
|
</cfif>
|
||||||
|
|
||||||
<cfset result = {
|
<cfset result = {
|
||||||
"TaskID": qTask.ID,
|
"TaskID": qTask.TaskID,
|
||||||
"BusinessID": qTask.BusinessID,
|
"TaskBusinessID": qTask.BusinessID,
|
||||||
"TaskCategoryID": qTask.CategoryID,
|
"TaskCategoryID": qTask.CategoryID,
|
||||||
"Title": taskTitle,
|
"TaskTypeID": qTask.TaskTypeID ?: 1,
|
||||||
"CreatedOn": dateFormat(qTask.CreatedOn, "yyyy-mm-dd") & "T" & timeFormat(qTask.CreatedOn, "HH:mm:ss"),
|
"TaskTitle": taskTitle,
|
||||||
"StatusID": qTask.ClaimedByUserID GT 0 ? 1 : 0,
|
"TaskCreatedOn": dateFormat(qTask.CreatedOn, "yyyy-mm-dd") & "T" & timeFormat(qTask.CreatedOn, "HH:mm:ss"),
|
||||||
"Name": len(trim(qTask.Name)) ? qTask.Name : "General",
|
"TaskStatusID": qTask.ClaimedByUserID GT 0 ? 1 : 0,
|
||||||
"Color": len(trim(qTask.Color)) ? qTask.Color : "##888888",
|
"TaskCategoryName": len(trim(qTask.CategoryName)) ? qTask.CategoryName : "General",
|
||||||
|
"TaskCategoryColor": len(trim(qTask.CategoryColor)) ? qTask.CategoryColor : "##888888",
|
||||||
"OrderID": qTask.OrderID ?: 0,
|
"OrderID": qTask.OrderID ?: 0,
|
||||||
"Remarks": qTask.Remarks ?: "",
|
"OrderRemarks": qTask.Remarks ?: "",
|
||||||
"SubmittedOn": isDate(qTask.SubmittedOn) ? (dateFormat(qTask.SubmittedOn, "yyyy-mm-dd") & "T" & timeFormat(qTask.SubmittedOn, "HH:mm:ss")) : "",
|
"OrderSubmittedOn": isDate(qTask.SubmittedOn) ? (dateFormat(qTask.SubmittedOn, "yyyy-mm-dd") & "T" & timeFormat(qTask.SubmittedOn, "HH:mm:ss")) : "",
|
||||||
"ServicePointID": qTask.ServicePointID ?: 0,
|
"ServicePointID": qTask.ServicePointID ?: 0,
|
||||||
"Name": qTask.Name ?: "",
|
"ServicePointName": qTask.ServicePointName ?: "",
|
||||||
"TypeID": qTask.TypeID ?: 0,
|
"ServicePointTypeID": qTask.ServicePointTypeID ?: 0,
|
||||||
"DeliveryAddress": "",
|
"DeliveryAddress": "",
|
||||||
"DeliveryLat": 0,
|
"DeliveryLat": 0,
|
||||||
"DeliveryLng": 0,
|
"DeliveryLng": 0,
|
||||||
|
|
@ -117,8 +118,9 @@
|
||||||
"CustomerLastName": qTask.LastName ?: "",
|
"CustomerLastName": qTask.LastName ?: "",
|
||||||
"CustomerPhone": qTask.ContactNumber ?: "",
|
"CustomerPhone": qTask.ContactNumber ?: "",
|
||||||
"CustomerPhotoUrl": customerPhotoUrl,
|
"CustomerPhotoUrl": customerPhotoUrl,
|
||||||
"UUID": "",
|
"BeaconUUID": "",
|
||||||
"LineItems": []
|
"LineItems": [],
|
||||||
|
"TableMembers": []
|
||||||
}>
|
}>
|
||||||
|
|
||||||
<!--- Get beacon UUID for the service point (for auto-completion on Works app) --->
|
<!--- Get beacon UUID for the service point (for auto-completion on Works app) --->
|
||||||
|
|
@ -132,7 +134,7 @@
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
", [ { value = qTask.ServicePointID, cfsqltype = "cf_sql_integer" } ], { datasource = "payfrit" })>
|
", [ { value = qTask.ServicePointID, cfsqltype = "cf_sql_integer" } ], { datasource = "payfrit" })>
|
||||||
<cfif qBeacon.recordCount GT 0>
|
<cfif qBeacon.recordCount GT 0>
|
||||||
<cfset result.UUID = qBeacon.UUID>
|
<cfset result.BeaconUUID = qBeacon.UUID>
|
||||||
</cfif>
|
</cfif>
|
||||||
</cfif>
|
</cfif>
|
||||||
|
|
||||||
|
|
@ -140,16 +142,16 @@
|
||||||
<cfif qTask.OrderID GT 0>
|
<cfif qTask.OrderID GT 0>
|
||||||
<cfset qLineItems = queryExecute("
|
<cfset qLineItems = queryExecute("
|
||||||
SELECT
|
SELECT
|
||||||
oli.ID,
|
oli.ID AS OrderLineItemID,
|
||||||
oli.ParentOrderLineItemID,
|
oli.ParentOrderLineItemID,
|
||||||
oli.ItemID,
|
oli.ItemID,
|
||||||
oli.Price,
|
oli.Price AS LineItemPrice,
|
||||||
oli.Quantity,
|
oli.Quantity,
|
||||||
oli.Remark,
|
oli.Remark,
|
||||||
i.ID,
|
i.ID AS IID,
|
||||||
i.Name,
|
i.Name AS ItemName,
|
||||||
i.ParentItemID,
|
i.ParentItemID,
|
||||||
i.Price,
|
i.Price AS ItemPrice,
|
||||||
i.IsCheckedByDefault
|
i.IsCheckedByDefault
|
||||||
FROM OrderLineItems oli
|
FROM OrderLineItems oli
|
||||||
INNER JOIN Items i ON i.ID = oli.ItemID
|
INNER JOIN Items i ON i.ID = oli.ItemID
|
||||||
|
|
@ -162,9 +164,9 @@
|
||||||
<cfset arrayAppend(result.LineItems, {
|
<cfset arrayAppend(result.LineItems, {
|
||||||
"LineItemID": qLineItems.OrderLineItemID,
|
"LineItemID": qLineItems.OrderLineItemID,
|
||||||
"ParentLineItemID": qLineItems.ParentOrderLineItemID,
|
"ParentLineItemID": qLineItems.ParentOrderLineItemID,
|
||||||
"ItemID": qLineItems.ID,
|
"ItemID": qLineItems.ItemID,
|
||||||
"Name": qLineItems.Name,
|
"ItemName": qLineItems.ItemName,
|
||||||
"Price": qLineItems.Price,
|
"ItemPrice": qLineItems.LineItemPrice,
|
||||||
"Quantity": qLineItems.Quantity,
|
"Quantity": qLineItems.Quantity,
|
||||||
"Remark": qLineItems.Remark,
|
"Remark": qLineItems.Remark,
|
||||||
"IsModifier": qLineItems.ParentOrderLineItemID GT 0
|
"IsModifier": qLineItems.ParentOrderLineItemID GT 0
|
||||||
|
|
|
||||||
|
|
@ -77,12 +77,12 @@
|
||||||
t.ClaimedByUserID,
|
t.ClaimedByUserID,
|
||||||
t.ClaimedOn,
|
t.ClaimedOn,
|
||||||
t.CompletedOn,
|
t.CompletedOn,
|
||||||
tc.Name,
|
tc.Name AS CategoryName,
|
||||||
tc.Color,
|
tc.Color AS CategoryColor,
|
||||||
tt.Name AS TaskTypeName,
|
tt.Name AS TaskTypeName,
|
||||||
tt.Icon AS TaskTypeIcon,
|
tt.Icon AS TaskTypeIcon,
|
||||||
tt.Color AS TaskTypeColor,
|
tt.Color AS TaskTypeColor,
|
||||||
b.Name
|
b.Name AS BusinessName
|
||||||
FROM Tasks t
|
FROM Tasks t
|
||||||
LEFT JOIN TaskCategories tc ON tc.ID = t.CategoryID
|
LEFT JOIN TaskCategories tc ON tc.ID = t.CategoryID
|
||||||
LEFT JOIN tt_TaskTypes tt ON tt.ID = t.TaskTypeID
|
LEFT JOIN tt_TaskTypes tt ON tt.ID = t.TaskTypeID
|
||||||
|
|
@ -112,7 +112,7 @@
|
||||||
<cfset arrayAppend(tasks, {
|
<cfset arrayAppend(tasks, {
|
||||||
"TaskID": qTasks.ID,
|
"TaskID": qTasks.ID,
|
||||||
"BusinessID": qTasks.BusinessID,
|
"BusinessID": qTasks.BusinessID,
|
||||||
"Name": qTasks.Name,
|
"BusinessName": qTasks.BusinessName ?: "",
|
||||||
"TaskCategoryID": qTasks.CategoryID,
|
"TaskCategoryID": qTasks.CategoryID,
|
||||||
"TaskTypeID": qTasks.TaskTypeID,
|
"TaskTypeID": qTasks.TaskTypeID,
|
||||||
"Title": taskTitle,
|
"Title": taskTitle,
|
||||||
|
|
@ -123,8 +123,8 @@
|
||||||
"StatusID": (isNull(qTasks.CompletedOn) OR len(trim(qTasks.CompletedOn)) EQ 0) ? 1 : 3,
|
"StatusID": (isNull(qTasks.CompletedOn) OR len(trim(qTasks.CompletedOn)) EQ 0) ? 1 : 3,
|
||||||
"SourceType": "order",
|
"SourceType": "order",
|
||||||
"SourceID": qTasks.OrderID,
|
"SourceID": qTasks.OrderID,
|
||||||
"Name": len(trim(qTasks.Name)) ? qTasks.Name : "General",
|
"CategoryName": len(trim(qTasks.CategoryName)) ? qTasks.CategoryName : "General",
|
||||||
"Color": len(trim(qTasks.Color)) ? qTasks.Color : "##888888",
|
"CategoryColor": len(trim(qTasks.CategoryColor)) ? qTasks.CategoryColor : "##888888",
|
||||||
"TaskTypeName": len(trim(qTasks.TaskTypeName)) ? qTasks.TaskTypeName : "",
|
"TaskTypeName": len(trim(qTasks.TaskTypeName)) ? qTasks.TaskTypeName : "",
|
||||||
"TaskTypeIcon": len(trim(qTasks.TaskTypeIcon)) ? qTasks.TaskTypeIcon : "notifications",
|
"TaskTypeIcon": len(trim(qTasks.TaskTypeIcon)) ? qTasks.TaskTypeIcon : "notifications",
|
||||||
"TaskTypeColor": len(trim(qTasks.TaskTypeColor)) ? qTasks.TaskTypeColor : "##9C27B0"
|
"TaskTypeColor": len(trim(qTasks.TaskTypeColor)) ? qTasks.TaskTypeColor : "##9C27B0"
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,8 @@
|
||||||
t.Details,
|
t.Details,
|
||||||
t.CreatedOn,
|
t.CreatedOn,
|
||||||
t.ClaimedByUserID,
|
t.ClaimedByUserID,
|
||||||
tc.Name,
|
tc.Name AS CategoryName,
|
||||||
tc.Color,
|
tc.Color AS CategoryColor,
|
||||||
tt.Name AS TaskTypeName,
|
tt.Name AS TaskTypeName,
|
||||||
tt.Icon AS TaskTypeIcon,
|
tt.Icon AS TaskTypeIcon,
|
||||||
tt.Color AS TaskTypeColor
|
tt.Color AS TaskTypeColor
|
||||||
|
|
@ -103,8 +103,8 @@
|
||||||
"StatusID": qTasks.ClaimedByUserID GT 0 ? 1 : 0,
|
"StatusID": qTasks.ClaimedByUserID GT 0 ? 1 : 0,
|
||||||
"SourceType": "order",
|
"SourceType": "order",
|
||||||
"SourceID": qTasks.OrderID,
|
"SourceID": qTasks.OrderID,
|
||||||
"Name": len(trim(qTasks.Name)) ? qTasks.Name : "General",
|
"CategoryName": len(trim(qTasks.CategoryName)) ? qTasks.CategoryName : "General",
|
||||||
"Color": len(trim(qTasks.Color)) ? qTasks.Color : "##888888",
|
"CategoryColor": len(trim(qTasks.CategoryColor)) ? qTasks.CategoryColor : "##888888",
|
||||||
"TaskTypeName": len(trim(qTasks.TaskTypeName)) ? qTasks.TaskTypeName : "",
|
"TaskTypeName": len(trim(qTasks.TaskTypeName)) ? qTasks.TaskTypeName : "",
|
||||||
"TaskTypeIcon": len(trim(qTasks.TaskTypeIcon)) ? qTasks.TaskTypeIcon : "notifications",
|
"TaskTypeIcon": len(trim(qTasks.TaskTypeIcon)) ? qTasks.TaskTypeIcon : "notifications",
|
||||||
"TaskTypeColor": len(trim(qTasks.TaskTypeColor)) ? qTasks.TaskTypeColor : "##9C27B0"
|
"TaskTypeColor": len(trim(qTasks.TaskTypeColor)) ? qTasks.TaskTypeColor : "##9C27B0"
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ try {
|
||||||
// Get task types for this business
|
// Get task types for this business
|
||||||
q = queryExecute("
|
q = queryExecute("
|
||||||
SELECT
|
SELECT
|
||||||
tt_TaskTypeID as TaskTypeID,
|
ID as TaskTypeID,
|
||||||
Name as TaskTypeName,
|
Name as TaskTypeName,
|
||||||
Description as TaskTypeDescription,
|
Description as TaskTypeDescription,
|
||||||
Icon as TaskTypeIcon,
|
Icon as TaskTypeIcon,
|
||||||
|
|
@ -54,7 +54,7 @@ try {
|
||||||
SortOrder as SortOrder
|
SortOrder as SortOrder
|
||||||
FROM tt_TaskTypes
|
FROM tt_TaskTypes
|
||||||
WHERE BusinessID = :businessID
|
WHERE BusinessID = :businessID
|
||||||
ORDER BY SortOrder, tt_TaskTypeID
|
ORDER BY SortOrder, ID
|
||||||
", {
|
", {
|
||||||
businessID: { value: businessID, cfsqltype: "cf_sql_integer" }
|
businessID: { value: businessID, cfsqltype: "cf_sql_integer" }
|
||||||
}, { datasource: "payfrit" });
|
}, { datasource: "payfrit" });
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ try {
|
||||||
|
|
||||||
// Get ledger entries (most recent first)
|
// Get ledger entries (most recent first)
|
||||||
qLedger = queryExecute("
|
qLedger = queryExecute("
|
||||||
SELECT TaskID, GrossEarningsCents, ActivationWithheldCents,
|
SELECT ID, TaskID, GrossEarningsCents, ActivationWithheldCents,
|
||||||
NetTransferCents, Status, CreatedAt
|
NetTransferCents, Status, CreatedAt
|
||||||
FROM WorkPayoutLedgers
|
FROM WorkPayoutLedgers
|
||||||
WHERE UserID = :userID
|
WHERE UserID = :userID
|
||||||
|
|
@ -47,6 +47,7 @@ try {
|
||||||
ledgerEntries = [];
|
ledgerEntries = [];
|
||||||
for (row in qLedger) {
|
for (row in qLedger) {
|
||||||
arrayAppend(ledgerEntries, {
|
arrayAppend(ledgerEntries, {
|
||||||
|
"ID": row.ID,
|
||||||
"TaskID": row.TaskID,
|
"TaskID": row.TaskID,
|
||||||
"GrossEarningsCents": row.GrossEarningsCents,
|
"GrossEarningsCents": row.GrossEarningsCents,
|
||||||
"ActivationWithheldCents": row.ActivationWithheldCents,
|
"ActivationWithheldCents": row.ActivationWithheldCents,
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
<cfloop query="qBusinesses">
|
<cfloop query="qBusinesses">
|
||||||
<cfset arrayAppend(businesses, {
|
<cfset arrayAppend(businesses, {
|
||||||
"EmployeeID": qBusinesses.EmployeeID,
|
"EmployeeID": qBusinesses.EmployeeID,
|
||||||
"BusinessID": qBusinesses.ID,
|
"BusinessID": qBusinesses.BusinessID,
|
||||||
"Name": qBusinesses.Name,
|
"Name": qBusinesses.Name,
|
||||||
"Address": "",
|
"Address": "",
|
||||||
"City": "",
|
"City": "",
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
<cfquery name="update_Uer" datasource="#application.datasource#" dbtype="ODBC">
|
<cfquery name="update_Uer" datasource="#application.datasource#" dbtype="ODBC">
|
||||||
UPDATE Users
|
UPDATE Users
|
||||||
SET IsEmailVerified = 1
|
SET IsEmailVerified = 1
|
||||||
WHERE UserID = '#get_user.ID#'
|
WHERE ID = #get_user.ID#
|
||||||
</cfquery>
|
</cfquery>
|
||||||
|
|
||||||
<!--- might as well log them in since they confirmed successfully --->
|
<!--- might as well log them in since they confirmed successfully --->
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,8 @@
|
||||||
<cfset request.Userid = 0>
|
<cfset request.Userid = 0>
|
||||||
|
|
||||||
<cfquery name="get_user" datasource="#application.datasource#">
|
<cfquery name="get_user" datasource="#application.datasource#">
|
||||||
ID AS UserID
|
SELECT ID AS UserID, EmailAddress
|
||||||
|
FROM Users
|
||||||
WHERE UUID = '#url.UUID#'
|
WHERE UUID = '#url.UUID#'
|
||||||
AND
|
AND
|
||||||
IsEmailVerified = 0
|
IsEmailVerified = 0
|
||||||
|
|
@ -19,7 +20,7 @@
|
||||||
<cfquery name="update_User" datasource="#application.datasource#">
|
<cfquery name="update_User" datasource="#application.datasource#">
|
||||||
UPDATE Users
|
UPDATE Users
|
||||||
SET IsEmailVerified = 1
|
SET IsEmailVerified = 1
|
||||||
WHERE UserID = '#get_user.ID#'
|
WHERE ID = '#get_user.ID#'
|
||||||
</cfquery>
|
</cfquery>
|
||||||
|
|
||||||
<!--- might as well log them in since they confirmed successfully, probably a bad idea but not worried about it for now --->
|
<!--- might as well log them in since they confirmed successfully, probably a bad idea but not worried about it for now --->
|
||||||
|
|
@ -48,7 +49,8 @@
|
||||||
<cfelse>
|
<cfelse>
|
||||||
|
|
||||||
<cfquery name="get_confirmed_customer" datasource="#application.datasource#">
|
<cfquery name="get_confirmed_customer" datasource="#application.datasource#">
|
||||||
ID AS UserID
|
SELECT ID AS UserID, ContactNumber
|
||||||
|
FROM Users
|
||||||
WHERE UUID = '#url.UUID#'
|
WHERE UUID = '#url.UUID#'
|
||||||
AND
|
AND
|
||||||
IsEmailVerified = 0
|
IsEmailVerified = 0
|
||||||
|
|
@ -61,7 +63,7 @@
|
||||||
<cfquery name="update_User" datasource="#application.datasource#">
|
<cfquery name="update_User" datasource="#application.datasource#">
|
||||||
UPDATE Users
|
UPDATE Users
|
||||||
SET IsEmailVerified = 1
|
SET IsEmailVerified = 1
|
||||||
WHERE UserID = '#get_confirmed_customer.UserID#'
|
WHERE ID = '#get_confirmed_customer.UserID#'
|
||||||
</cfquery>
|
</cfquery>
|
||||||
|
|
||||||
your email was confirmed but we still need to verify your mobile number!<br><br>
|
your email was confirmed but we still need to verify your mobile number!<br><br>
|
||||||
|
|
@ -71,7 +73,7 @@
|
||||||
<cfquery name="update_OPT_confirm" datasource="#application.datasource#">
|
<cfquery name="update_OPT_confirm" datasource="#application.datasource#">
|
||||||
UPDATE Users
|
UPDATE Users
|
||||||
SET MobileVerifyCode = '#customer_OPT_confirm#'
|
SET MobileVerifyCode = '#customer_OPT_confirm#'
|
||||||
WHERE UserID = #get_confirmed_customer.UserID#
|
WHERE ID = #get_confirmed_customer.UserID#
|
||||||
</cfquery>
|
</cfquery>
|
||||||
|
|
||||||
we sent a six-digit code to <cfoutput>#get_confirmed_customer.ContactNumber#</cfoutput>, please input that code here:<br><br>
|
we sent a six-digit code to <cfoutput>#get_confirmed_customer.ContactNumber#</cfoutput>, please input that code here:<br><br>
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
<cfquery name="confirm_mobile" datasource="#application.datasource#" dbtype="ODBC">
|
<cfquery name="confirm_mobile" datasource="#application.datasource#" dbtype="ODBC">
|
||||||
UPDATE Users
|
UPDATE Users
|
||||||
SET IsContactVerified = 1
|
SET IsContactVerified = 1
|
||||||
WHERE UserID = #check_valid.UserID#
|
WHERE ID = #check_valid.ID#
|
||||||
</cfquery>
|
</cfquery>
|
||||||
|
|
||||||
<cfif check_valid.IsEmailVerified eq 1>
|
<cfif check_valid.IsEmailVerified eq 1>
|
||||||
|
|
@ -58,14 +58,14 @@
|
||||||
<cfquery name="confirm_mobile" datasource="#application.datasource#" dbtype="ODBC">
|
<cfquery name="confirm_mobile" datasource="#application.datasource#" dbtype="ODBC">
|
||||||
UPDATE Users
|
UPDATE Users
|
||||||
SET IsContactVerified = 1
|
SET IsContactVerified = 1
|
||||||
WHERE UserID = #check_valid_with_email_confirmed.UserID#
|
WHERE ID = #check_valid_with_email_confirmed.ID#
|
||||||
</cfquery>
|
</cfquery>
|
||||||
|
|
||||||
<!--- might as well log them in since they confirmed successfully, probably a bad idea but not worried about it for now --->
|
<!--- might as well log them in since they confirmed successfully, probably a bad idea but not worried about it for now --->
|
||||||
|
|
||||||
<!--- Update the session variables and request variables --->
|
<!--- Update the session variables and request variables --->
|
||||||
<cflock timeout="60" throwontimeout="Yes" type="EXCLUSIVE" scope="SESSION">
|
<cflock timeout="60" throwontimeout="Yes" type="EXCLUSIVE" scope="SESSION">
|
||||||
<cfset session.UserID = #check_valid_with_email_confirmed.UserID#>
|
<cfset session.UserID = #check_valid_with_email_confirmed.ID#>
|
||||||
<!--- Re-duplicate them --->
|
<!--- Re-duplicate them --->
|
||||||
<cfset request.UserID = Duplicate(session.UserID)>
|
<cfset request.UserID = Duplicate(session.UserID)>
|
||||||
</cflock>
|
</cflock>
|
||||||
|
|
@ -73,7 +73,7 @@
|
||||||
<cfmodule template="#application.wwwrootprefix#modules/notifier.cfm"
|
<cfmodule template="#application.wwwrootprefix#modules/notifier.cfm"
|
||||||
domain="box.payfrit.com"
|
domain="box.payfrit.com"
|
||||||
from_email="admin@payfrit.com"
|
from_email="admin@payfrit.com"
|
||||||
to_email="#check_valid_with_email_confirmed.UserEmail#"
|
to_email="#check_valid_with_email_confirmed.EmailAddress#"
|
||||||
subject="Welcome to Payfrit!"
|
subject="Welcome to Payfrit!"
|
||||||
email_body="Thanks for confirming your Payfrit account! Go order food!"
|
email_body="Thanks for confirming your Payfrit account! Go order food!"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
43
index.cfm
43
index.cfm
|
|
@ -21,7 +21,7 @@
|
||||||
<cfquery name="ack_order" datasource="#application.datasource#">
|
<cfquery name="ack_order" datasource="#application.datasource#">
|
||||||
UPDATE Orders
|
UPDATE Orders
|
||||||
SET StatusID = 2
|
SET StatusID = 2
|
||||||
WHERE OrderID = #form.OrderID#
|
WHERE ID = #form.OrderID#
|
||||||
</cfquery>
|
</cfquery>
|
||||||
|
|
||||||
<cfquery name="ack_order_lineitems" datasource="#application.datasource#">
|
<cfquery name="ack_order_lineitems" datasource="#application.datasource#">
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
<cfquery name="ack_order_lineitem" datasource="#application.datasource#">
|
<cfquery name="ack_order_lineitem" datasource="#application.datasource#">
|
||||||
UPDATE OrderLineItems
|
UPDATE OrderLineItems
|
||||||
SET StatusID = 2
|
SET StatusID = 2
|
||||||
WHERE OrderID = #form.OrderLineItemID#
|
WHERE ID = #form.OrderLineItemID#
|
||||||
</cfquery>
|
</cfquery>
|
||||||
|
|
||||||
<cfoutput>
|
<cfoutput>
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
<cfquery name="ready_order" datasource="#application.datasource#">
|
<cfquery name="ready_order" datasource="#application.datasource#">
|
||||||
UPDATE Orders
|
UPDATE Orders
|
||||||
SET StatusID = 3
|
SET StatusID = 3
|
||||||
WHERE OrderID = #form.OrderID#
|
WHERE ID = #form.OrderID#
|
||||||
</cfquery>
|
</cfquery>
|
||||||
|
|
||||||
<cfquery name="ready_order_lineitems" datasource="#application.datasource#">
|
<cfquery name="ready_order_lineitems" datasource="#application.datasource#">
|
||||||
|
|
@ -92,7 +92,7 @@
|
||||||
<cfquery name="ready_order_lineitem" datasource="#application.datasource#">
|
<cfquery name="ready_order_lineitem" datasource="#application.datasource#">
|
||||||
UPDATE OrderLineItems
|
UPDATE OrderLineItems
|
||||||
SET StatusID = 3
|
SET StatusID = 3
|
||||||
WHERE OrderLineItemID = #form.OrderLineItemID#
|
WHERE ID = #form.OrderLineItemID#
|
||||||
</cfquery>
|
</cfquery>
|
||||||
|
|
||||||
<cfoutput>
|
<cfoutput>
|
||||||
|
|
@ -626,10 +626,9 @@
|
||||||
</TD>
|
</TD>
|
||||||
</TR>
|
</TR>
|
||||||
<CFQUERY name="get_States" datasource="#application.datasource#">
|
<CFQUERY name="get_States" datasource="#application.datasource#">
|
||||||
SELECT tt_StateID, Name
|
SELECT ID, Name
|
||||||
FROM tt_States
|
FROM tt_States
|
||||||
WHERE tt_StateCountryID = 1 <!--- only USA --->
|
ORDER BY Name
|
||||||
ORDER BY tt_StateSortOrder
|
|
||||||
</CFQUERY>
|
</CFQUERY>
|
||||||
<TR>
|
<TR>
|
||||||
<TD>
|
<TD>
|
||||||
|
|
@ -639,7 +638,7 @@
|
||||||
<select name="StateID">
|
<select name="StateID">
|
||||||
<option value="0">Please Select</option>
|
<option value="0">Please Select</option>
|
||||||
<cfoutput query=#get_States#>
|
<cfoutput query=#get_States#>
|
||||||
<option value="#tt_StateID#" <cfif #values.StateID# EQ #get_States.tt_StateID#>Selected</cfif>>#Name#</option>
|
<option value="#ID#" <cfif #values.StateID# EQ #get_States.ID#>Selected</cfif>>#Name#</option>
|
||||||
</cfoutput>
|
</cfoutput>
|
||||||
</select>
|
</select>
|
||||||
</TD>
|
</TD>
|
||||||
|
|
@ -661,17 +660,16 @@
|
||||||
</TD>
|
</TD>
|
||||||
</TR>
|
</TR>
|
||||||
<CFQUERY name="get_OrderTypes" datasource="#application.datasource#">
|
<CFQUERY name="get_OrderTypes" datasource="#application.datasource#">
|
||||||
SELECT tt_OrderTypeID, tt_OrderTypeName
|
SELECT ID, Name
|
||||||
FROM tt_OrderTypes
|
FROM tt_OrderTypes
|
||||||
WHERE tt_OrderTypeSortOrder IS NOT NULL
|
ORDER BY ID
|
||||||
ORDER BY tt_OrderTypeSortOrder
|
|
||||||
</CFQUERY>
|
</CFQUERY>
|
||||||
<TR>
|
<TR>
|
||||||
<TD valign="top">
|
<TD valign="top">
|
||||||
Select Order Types:
|
Select Order Types:
|
||||||
</TD>
|
</TD>
|
||||||
<TD>
|
<TD>
|
||||||
<cfoutput query="get_OrderTypes"><input type="CHECKBOX" name="BusinessOrdertypes" value="#get_OrderTypes.tt_OrderTypeID#"<cfif find(get_OrderTypes.tt_OrderTypeID, values.BusinessOrdertypes) GT 0> CHECKED</cfif>>#get_OrderTypes.tt_OrderTypeName#<br></cfoutput>
|
<cfoutput query="get_OrderTypes"><input type="CHECKBOX" name="BusinessOrdertypes" value="#get_OrderTypes.ID#"<cfif find(get_OrderTypes.ID, values.BusinessOrdertypes) GT 0> CHECKED</cfif>>#get_OrderTypes.Name#<br></cfoutput>
|
||||||
</TD>
|
</TD>
|
||||||
</TR>
|
</TR>
|
||||||
<TR>
|
<TR>
|
||||||
|
|
@ -825,7 +823,7 @@
|
||||||
FROM Hours H, tt_Days D
|
FROM Hours H, tt_Days D
|
||||||
WHERE BusinessID = #request.BusinessID#
|
WHERE BusinessID = #request.BusinessID#
|
||||||
AND
|
AND
|
||||||
H.DayID = D.tt_DayID
|
H.DayID = D.ID
|
||||||
ORDER BY DayID
|
ORDER BY DayID
|
||||||
</CFQUERY>
|
</CFQUERY>
|
||||||
|
|
||||||
|
|
@ -1197,7 +1195,7 @@
|
||||||
FROM Hours H, tt_Days D
|
FROM Hours H, tt_Days D
|
||||||
WHERE BusinessID = #request.BusinessID#
|
WHERE BusinessID = #request.BusinessID#
|
||||||
AND
|
AND
|
||||||
H.DayID = D.tt_DayID
|
H.DayID = D.ID
|
||||||
ORDER BY DayID
|
ORDER BY DayID
|
||||||
</CFQUERY>
|
</CFQUERY>
|
||||||
|
|
||||||
|
|
@ -1238,7 +1236,7 @@
|
||||||
FROM Hours H, tt_Days D
|
FROM Hours H, tt_Days D
|
||||||
WHERE BusinessID = #request.BusinessID#
|
WHERE BusinessID = #request.BusinessID#
|
||||||
AND
|
AND
|
||||||
H.DayID = D.tt_DayID
|
H.DayID = D.ID
|
||||||
ORDER BY DayID
|
ORDER BY DayID
|
||||||
</CFQUERY>
|
</CFQUERY>
|
||||||
|
|
||||||
|
|
@ -3436,10 +3434,9 @@
|
||||||
</TD>
|
</TD>
|
||||||
</TR>
|
</TR>
|
||||||
<CFQUERY name="get_States" datasource="#application.datasource#">
|
<CFQUERY name="get_States" datasource="#application.datasource#">
|
||||||
SELECT tt_StateID, Name
|
SELECT ID, Name
|
||||||
FROM tt_States
|
FROM tt_States
|
||||||
WHERE tt_StateCountryID = 1 <!--- only USA --->
|
ORDER BY Name
|
||||||
ORDER BY tt_StateSortOrder
|
|
||||||
</CFQUERY>
|
</CFQUERY>
|
||||||
<TR>
|
<TR>
|
||||||
<TD>
|
<TD>
|
||||||
|
|
@ -3449,7 +3446,7 @@
|
||||||
<select name="StateID">
|
<select name="StateID">
|
||||||
<option value="0">Please Select</option>
|
<option value="0">Please Select</option>
|
||||||
<cfoutput query=#get_States#>
|
<cfoutput query=#get_States#>
|
||||||
<option value="#tt_StateID#" <cfif #values.StateID# EQ #get_States.tt_StateID#>Selected</cfif>>#Name#</option>
|
<option value="#ID#" <cfif #values.StateID# EQ #get_States.ID#>Selected</cfif>>#Name#</option>
|
||||||
</cfoutput>
|
</cfoutput>
|
||||||
</select>
|
</select>
|
||||||
</TD>
|
</TD>
|
||||||
|
|
@ -3564,7 +3561,7 @@
|
||||||
<CFQUERY name="update_item" datasource="#application.datasource#">
|
<CFQUERY name="update_item" datasource="#application.datasource#">
|
||||||
UPDATE Users
|
UPDATE Users
|
||||||
SET ImageExtension = '#cffile.ClientFileExt#'
|
SET ImageExtension = '#cffile.ClientFileExt#'
|
||||||
WHERE UserID = #request.UserID#
|
WHERE ID = #request.UserID#
|
||||||
</CFQUERY>
|
</CFQUERY>
|
||||||
|
|
||||||
</cfif>
|
</cfif>
|
||||||
|
|
@ -3618,7 +3615,7 @@
|
||||||
<CFQUERY name="update_item" datasource="#application.datasource#">
|
<CFQUERY name="update_item" datasource="#application.datasource#">
|
||||||
UPDATE Users
|
UPDATE Users
|
||||||
SET ImageExtension = null
|
SET ImageExtension = null
|
||||||
WHERE UserID = #request.UserID#
|
WHERE ID = #request.UserID#
|
||||||
</CFQUERY>
|
</CFQUERY>
|
||||||
|
|
||||||
<cfoutput>
|
<cfoutput>
|
||||||
|
|
@ -3638,7 +3635,7 @@
|
||||||
UPDATE Users
|
UPDATE Users
|
||||||
SET FirstName = '#values.FirstName#',
|
SET FirstName = '#values.FirstName#',
|
||||||
LastName = '#values.LastName#'
|
LastName = '#values.LastName#'
|
||||||
WHERE UserID = #request.UserID#
|
WHERE ID = #request.UserID#
|
||||||
</CFQUERY>
|
</CFQUERY>
|
||||||
|
|
||||||
<CFQUERY name="update_user_address" datasource="#application.datasource#">
|
<CFQUERY name="update_user_address" datasource="#application.datasource#">
|
||||||
|
|
@ -3648,7 +3645,7 @@
|
||||||
City = '#values.City#',
|
City = '#values.City#',
|
||||||
StateID = #values.StateID#,
|
StateID = #values.StateID#,
|
||||||
ZIPCode = '#values.ZIPCode#'
|
ZIPCode = '#values.ZIPCode#'
|
||||||
WHERE UserID = #request.UserID#
|
WHERE ID = #request.UserID#
|
||||||
AND
|
AND
|
||||||
AddressTypeID = 1
|
AddressTypeID = 1
|
||||||
</CFQUERY>
|
</CFQUERY>
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,9 @@
|
||||||
</cfquery>
|
</cfquery>
|
||||||
|
|
||||||
<cfquery name="get_order_type">
|
<cfquery name="get_order_type">
|
||||||
SELECT tt_OrderTypeName
|
SELECT Name AS tt_OrderTypeName
|
||||||
FROM tt_OrderTypes
|
FROM tt_OrderTypes
|
||||||
WHERE tt_OrderTypeID = <cfqueryparam value="#get_order_info.OrderTypeID#" cfsqltype="cf_sql_integer">
|
WHERE ID =<cfqueryparam value="#get_order_info.OrderTypeID#" cfsqltype="cf_sql_integer">
|
||||||
</cfquery>
|
</cfquery>
|
||||||
|
|
||||||
<cfif get_order_info.OrderTypeID EQ 3>
|
<cfif get_order_info.OrderTypeID EQ 3>
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
SELECT A.Line1
|
SELECT A.Line1
|
||||||
FROM Addresses A, Orders O
|
FROM Addresses A, Orders O
|
||||||
WHERE O.UUID = <cfqueryparam value="#url.UUID#" cfsqltype="cf_sql_varchar">
|
WHERE O.UUID = <cfqueryparam value="#url.UUID#" cfsqltype="cf_sql_varchar">
|
||||||
AND A.AddressID = O.AddressID
|
AND A.ID = O.AddressID
|
||||||
</cfquery>
|
</cfquery>
|
||||||
</cfif>
|
</cfif>
|
||||||
|
|
||||||
|
|
@ -257,7 +257,7 @@
|
||||||
SELECT I.Name, I.Price, I.ParentItemID
|
SELECT I.Name, I.Price, I.ParentItemID
|
||||||
FROM OrderLineItems OL
|
FROM OrderLineItems OL
|
||||||
JOIN Items I ON I.ID = OL.ItemID
|
JOIN Items I ON I.ID = OL.ItemID
|
||||||
WHERE OL.ParentOrderLineItemID = <cfqueryparam value="#get_parent_items.OrderLineItemID#" cfsqltype="cf_sql_integer">
|
WHERE OL.ParentOrderLineItemID = <cfqueryparam value="#get_parent_items.ID#" cfsqltype="cf_sql_integer">
|
||||||
ORDER BY OL.AddedOn DESC
|
ORDER BY OL.AddedOn DESC
|
||||||
</cfquery>
|
</cfquery>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,9 @@ WHERE O.UUID = '#form.UUID#'
|
||||||
AND
|
AND
|
||||||
<cfif url.is_admin_view EQ 0>O.ID = T.OrderID
|
<cfif url.is_admin_view EQ 0>O.ID = T.OrderID
|
||||||
AND</cfif>
|
AND</cfif>
|
||||||
<cfif get_order_info.OrderTypeID eq 3>A.AddressID = O.AddressID
|
<cfif get_order_info.OrderTypeID eq 3>A.ID = O.AddressID
|
||||||
AND </cfif>
|
AND </cfif>
|
||||||
ttO.tt_OrderTypeID = O.OrderTypeID
|
ttO.ID = O.OrderTypeID
|
||||||
ORDER BY AddedOn DESC
|
ORDER BY AddedOn DESC
|
||||||
</cfquery>
|
</cfquery>
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue