Commit cd6b2e67 by cam

colors query is now fully functional

parent e7324517
......@@ -110,6 +110,9 @@ procedure TFViewOrders.AddRowToTable(temp: string);
// MediaUrl: Link to the recording
var
NewRow, Cell, P, Button, Audio: TJSHTMLElement;
colorObject: TJSObject;
colorList: TJSArray;
colors: integer;
begin
NewRow := TJSHTMLElement(document.createElement('tr'));
......@@ -243,9 +246,14 @@ begin
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Colors');
if XDataWebDataSet1colors.Value = '' then
Cell.innerText := 'None'
Cell.innerText := '0'
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);
......
......@@ -212,6 +212,8 @@ var
limit: string;
SQL: string;
Order: TOrderItem;
colors: string;
ColorType: string;
begin
params := TStringList.Create;
params.StrictDelimiter := true;
......@@ -226,7 +228,7 @@ begin
offset := IntToStr((PageNum - 1) * 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 ' +
' FROM orders_status_schedule oss ' +
' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''PROOF'') AS PROOF_DUE, ' +
......@@ -314,7 +316,22 @@ begin
order.shipDone := '???';
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;
end;
......
[Options]
LogFileNum=82
LogFileNum=92
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