Commit cd6b2e67 by cam

colors query is now fully functional

parent e7324517
...@@ -110,6 +110,9 @@ procedure TFViewOrders.AddRowToTable(temp: string); ...@@ -110,6 +110,9 @@ procedure TFViewOrders.AddRowToTable(temp: string);
// MediaUrl: Link to the recording // MediaUrl: Link to the recording
var var
NewRow, Cell, P, Button, Audio: TJSHTMLElement; NewRow, Cell, P, Button, Audio: TJSHTMLElement;
colorObject: TJSObject;
colorList: TJSArray;
colors: integer;
begin begin
NewRow := TJSHTMLElement(document.createElement('tr')); NewRow := TJSHTMLElement(document.createElement('tr'));
...@@ -243,9 +246,14 @@ begin ...@@ -243,9 +246,14 @@ begin
Cell := TJSHTMLElement(document.createElement('td')); Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Colors'); Cell.setAttribute('data-label', 'Colors');
if XDataWebDataSet1colors.Value = '' then if XDataWebDataSet1colors.Value = '' then
Cell.innerText := 'None' Cell.innerText := '0'
else else
Cell.innerText := XDataWebDataSet1colors.Value; begin
colorObject := TJSObject(TJSJSON.parse(XDataWebDataSet1colors.Value));
colorList := TJSArray(colorObject['items']);
colors := colorList.flength;
Cell.innerText := IntToStr(colors);
end;
NewRow.appendChild(Cell); NewRow.appendChild(Cell);
......
...@@ -212,6 +212,8 @@ var ...@@ -212,6 +212,8 @@ var
limit: string; limit: string;
SQL: string; SQL: string;
Order: TOrderItem; Order: TOrderItem;
colors: string;
ColorType: string;
begin begin
params := TStringList.Create; params := TStringList.Create;
params.StrictDelimiter := true; params.StrictDelimiter := true;
...@@ -226,7 +228,7 @@ begin ...@@ -226,7 +228,7 @@ begin
offset := IntToStr((PageNum - 1) * PageSize); offset := IntToStr((PageNum - 1) * PageSize);
limit := IntToStr(PageSize); limit := IntToStr(PageSize);
SQL := 'SELECT o.ORDER_ID, o.LOCATION AS Loc, c.NAME AS COMPANY_NAME, o.JOB_NAME, o.ORDER_DATE, ' + SQL := 'SELECT o.ORDER_ID, o.LOCATION AS Loc, c.NAME AS COMPANY_NAME, o.JOB_NAME, o.ORDER_DATE, o.ORDER_TYPE, ' +
'(SELECT oss.STATUS_DATE ' + '(SELECT oss.STATUS_DATE ' +
' FROM orders_status_schedule oss ' + ' FROM orders_status_schedule oss ' +
' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''PROOF'') AS PROOF_DUE, ' + ' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''PROOF'') AS PROOF_DUE, ' +
...@@ -314,7 +316,22 @@ begin ...@@ -314,7 +316,22 @@ begin
order.shipDone := '???'; order.shipDone := '???';
order.qbRefNum := -1; } order.qbRefNum := -1; }
order.colors := '-1'; if callsDB.UniQuery1.FieldByName('ORDER_TYPE').AsString = 'web_plate' then
begin
colorType := 'quantity_and_colors_qty_colors';
SQL := 'Select quantity_and_colors_qty_colors from web_plate_orders where order_id = ' + order.ID;
end
else
begin
colorType := 'colors_colors';
SQL := 'Select colors_colors from corrugated_plate_orders where order_id = ' + order.ID;
end;
doQuery(callsDB.UniQuery2, SQL);
colors := callsDB.UniQuery2.FieldByName(ColorType).AsString;
order.colors := colors;
callsDB.UniQuery1.Next; callsDB.UniQuery1.Next;
end; end;
......
[Options] [Options]
LogFileNum=82 LogFileNum=92
UpdateTimerLength=0 UpdateTimerLength=0
......
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