Commit e11cfb9f by Mac Stephens

Fixed small issue created by merge. Working now.

parent a72bb77e
...@@ -1216,8 +1216,6 @@ begin ...@@ -1216,8 +1216,6 @@ begin
ordersDB.UniQuery1.Post; ordersDB.UniQuery1.Post;
ordersDB.UniQuery1.Close;
//Retrieve Order ID //Retrieve Order ID
if mode = 'ADD' then if mode = 'ADD' then
begin begin
...@@ -1226,7 +1224,7 @@ begin ...@@ -1226,7 +1224,7 @@ begin
ORDER_ID := ordersDB.UniQuery1.FieldByName('OrderID').AsInteger; ORDER_ID := ordersDB.UniQuery1.FieldByName('OrderID').AsInteger;
end; end;
// Second query
if mode = 'ADD' then if mode = 'ADD' then
SQL := 'select * from corrugated_plate_orders where ORDER_ID = 0 and ORDER_ID <> 0' SQL := 'select * from corrugated_plate_orders where ORDER_ID = 0 and ORDER_ID <> 0'
else else
...@@ -1234,7 +1232,9 @@ begin ...@@ -1234,7 +1232,9 @@ begin
ORDER_ID := JSONData.GetValue<integer>('ORDER_ID'); ORDER_ID := JSONData.GetValue<integer>('ORDER_ID');
SQL := 'select * from corrugated_plate_orders where ORDER_ID = ' + IntToStr(ORDER_ID); SQL := 'select * from corrugated_plate_orders where ORDER_ID = ' + IntToStr(ORDER_ID);
end; end;
doQuery(ordersDB.UniQuery1, SQL); doQuery(ordersDB.UniQuery1, SQL);
try try
if mode = 'ADD' then if mode = 'ADD' then
ordersDB.UniQuery1.Insert ordersDB.UniQuery1.Insert
...@@ -1243,10 +1243,9 @@ begin ...@@ -1243,10 +1243,9 @@ begin
for Pair in JSONData do for Pair in JSONData do
begin begin
Field := ordersDB.UniQuery1.FindField(Pair.JsonString.Value); // Checks if the field exists in the dataset Field := ordersDB.UniQuery1.FindField(Pair.JsonString.Value);
if Assigned(Field) then if Assigned(Field) then
begin begin
// handles any dates or datetimes
if (Field is TDateTimeField) and (Pair.JsonValue.Value <> '') then if (Field is TDateTimeField) and (Pair.JsonValue.Value <> '') then
TDateTimeField(Field).AsDateTime := StrToDate(Pair.JsonValue.Value) TDateTimeField(Field).AsDateTime := StrToDate(Pair.JsonValue.Value)
else if Pair.JsonValue.Value <> '' then else if Pair.JsonValue.Value <> '' then
...@@ -1255,11 +1254,8 @@ begin ...@@ -1255,11 +1254,8 @@ begin
end; end;
ordersDB.UniQuery1.FieldByName('ORDER_ID').AsInteger := ORDER_ID; ordersDB.UniQuery1.FieldByName('ORDER_ID').AsInteger := ORDER_ID;
// Post the record to the database
ordersDB.UniQuery1.Post; ordersDB.UniQuery1.Post;
if JSONData.GetValue<string>('staff_fields_proof_date') <> '' then if JSONData.GetValue<string>('staff_fields_proof_date') <> '' then
AddStatusSchedule('PROOF', JSONData, ORDER_ID); AddStatusSchedule('PROOF', JSONData, ORDER_ID);
if JSONData.GetValue<string>('staff_fields_ship_date') <> '' then if JSONData.GetValue<string>('staff_fields_ship_date') <> '' then
...@@ -1273,6 +1269,11 @@ begin ...@@ -1273,6 +1269,11 @@ begin
// Updated so an object isn't being created in the exception for memory control // Updated so an object isn't being created in the exception for memory control
Result.AddPair('status', 'success'); Result.AddPair('status', 'success');
finally
ordersDB.UniQuery1.Close;
end;
except except
on E: Exception do on E: Exception do
begin begin
...@@ -1282,6 +1283,7 @@ begin ...@@ -1282,6 +1283,7 @@ begin
end; end;
function TLookupService.AddStatusSchedule(StatusType: string; order: TJSONObject; ORDER_ID: integer): string; function TLookupService.AddStatusSchedule(StatusType: string; order: TJSONObject; ORDER_ID: integer): string;
// Adds/edits orders_status_schedule table. // Adds/edits orders_status_schedule table.
// StatusType: name of the status getting added to the schedule. // StatusType: name of the status getting added to the schedule.
......
[Settings] [Settings]
MemoLogLevel=4 MemoLogLevel=4
FileLogLevel=5 FileLogLevel=5
LogFileNum=146 LogFileNum=147
webClientVersion=1.0.0 webClientVersion=1.0.0
[Database] [Database]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment