Commit e7324517 by cam

Orders display is working properly without the colors

parent 8419ad94
......@@ -5,30 +5,6 @@
<div class="row justify-content-center">
<div class="col-12 col-md-8">
<form class="form-inline">
<div class="col-sm py-2">
<label class='pe-2'style="font-weight: 700;">Location:</label>
<select class="custom-select" id="wcblocation" style="font-size: 1.00rem;"></select>
</div>
<div class="row">
<div class="col-sm-6">
<label class='pe-2'style="font-weight: 700;">Phone Number:</label>
<input class="form-control input-sm" id="edtsearch">
</div>
</div>
</form>
<form class="form-inline">
<div class="row">
<div class="col-sm-6">
<label style="font-weight: 700;">Start Date:</label>
<input class="form-control input-sm" id="dtpstartdate" type="date">
</div>
<div class="col-sm-6">
<label class= 'pe-2'style="font-weight: 700;">End Date:</label>
<input class="form-control input-sm" id="dtpenddate" type="date">
</div>
</div>
</form>
<form class="form-inline">
<div class= "row">
<div class="col-sm-5">
<label class="py-2" style="font-weight: 700;">Show <select class="custom-select" id="wcbpagesize" style="font-size: 1.00rem;"></select> entries</label>
......@@ -42,7 +18,7 @@
</div>
</div>
</form>
</div>
<table class="table table-responsive table-striped table-bordered" id="tblPhoneGrid">
<thead class="thead-dark">
<tr>
......@@ -77,7 +53,6 @@
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="audioModal" tabindex="-1" aria-labelledby="audioModalLabel" aria-hidden="true">
<div class="modal-dialog">
......
......@@ -51,9 +51,9 @@ object FViewMain: TFViewMain
object lblAppTitle: TWebLabel
Left = 57
Top = 31
Width = 60
Width = 74
Height = 15
Caption = 'Envoy Calls'
Caption = 'Kohler Gibson'
ElementID = 'view.main.apptitle'
HeightPercent = 100.000000000000000000
Transparent = False
......
......@@ -62,7 +62,7 @@ uses
View.Items,
View.Users,
View.EditUser,
View.Calls;
View.Orders;
{$R *.dfm}
......@@ -92,7 +92,7 @@ end;
procedure TFViewMain.lblordersClick(Sender: TObject);
begin
ShowForm(TFViewCalls);
ShowForm(TFViewOrders);
end;
procedure TFViewMain.lblUsersClick(Sender: TObject);
......
object FViewCalls: TFViewCalls
object FViewOrders: TFViewOrders
Width = 676
Height = 480
CSSLibrary = cssBootstrap
......@@ -85,7 +85,6 @@ object FViewCalls: TFViewCalls
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
HideSelection = False
TextHint = 'Format: (XXX) XXX-XXXX'
WidthPercent = 100.000000000000000000
end
object XDataWebClient1: TXDataWebClient
......@@ -97,6 +96,9 @@ object FViewCalls: TFViewCalls
Connection = DMConnection.ApiConnection
Left = 440
Top = 300
object XDataWebDataSet1ID: TStringField
FieldName = 'ID'
end
object XDataWebDataSet1companyName: TStringField
FieldName = 'companyName'
end
......@@ -133,15 +135,12 @@ object FViewCalls: TFViewCalls
object XDataWebDataSet1price: TStringField
FieldName = 'price'
end
object XDataWebDataSet1qbRefNum: TIntegerField
object XDataWebDataSet1qbRefNum: TStringField
FieldName = 'qbRefNum'
end
object XDataWebDataSet1colors: TIntegerField
object XDataWebDataSet1colors: TStringField
FieldName = 'colors'
end
object XDataWebDataSet1ID: TIntegerField
FieldName = 'ID'
end
end
object WebDataSource1: TWebDataSource
DataSet = XDataWebDataSet1
......
<div class="row">
<div class="col-12">
<h1 class="page-header pt-3" id="view.calls.title" style="font-size: 24px;">Orders</h1>
<div class="container mt-4">
<div class="row justify-content-center">
<div class="col-12 col-md-8">
<form class="form-inline">
<div class="row">
<div class="col-sm-6">
<label class='pe-2'style="font-weight: 700;">Search:</label>
<input class="form-control input-sm" id="edtsearch">
</div>
</div>
</form>
<form class="form-inline">
<div class= "row">
<div class="col-sm-5">
<label class="py-2" style="font-weight: 700;">Show <select class="custom-select" id="wcbpagesize" style="font-size: 1.00rem;"></select> entries</label>
</div>
<div class="col-sm-5">
<label class="py-2" style="font-weight: 700;">Sorted by:</label>
<select class="custom-select" id="wcbsortby" style="font-size: 1.00rem;"></select>
</div>
<div class="col-sm-2">
<button class= "ps-3" id="btnapply"></button>
</div>
</div>
</form>
</div>
<table class="table table-responsive table-striped table-bordered" id="tblPhoneGrid">
<thead class="thead-dark">
<tr>
<th scope="col">Order ID</th>
<th scope="col">Company Name</th>
<th scope="col">Job Name</th>
<th scope="col">Order Date</th>
<th scope="col">Proof Due</th>
<th scope="col">Proof Date</th>
<th scope="col">Art Due</th>
<th scope="col">Art Done</th>
<th scope="col">Mount Due</th>
<th scope="col">Mount Done</th>
<th scope="col">Ship Due</th>
<th scope="col">Ship Done</th>
<th scope="col">Price</th>
<th scope="col">Quickbooks Reference Number</th>
<th scope="col">Colors</th>
</tr>
</thead>
<tbody>
<!-- Rows will be added dynamically via Delphi code -->
</tbody>
</table>
<label id="lblentries"></label>
<nav aria-label="Page navigation">
<ul class="pagination justify-content-center" id="pagination">
<!-- Pagination items will be added dynamically via Delphi code -->
</ul>
</nav>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="audioModal" tabindex="-1" aria-labelledby="audioModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="audioModalLabel">Audio Player</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" onclick="stopAudio()"></button>
</div>
<div class="modal-body">
<audio controls id="audioPlayer">
<source src="" type="audio/mp3" id="audioSource">
Your browser does not support the audio element.
</audio>
</div>
</div>
</div>
</div>
<script>
// JavaScript function to stop audio
function stopAudio() {
var audioPlayer = document.getElementById('audioPlayer');
audioPlayer.pause(); // Pause the audio
audioPlayer.currentTime = 0; // Reset audio to beginning
}
</script>
......@@ -4,7 +4,7 @@
// Cameron Hayes
// Mac ...
unit View.Calls;
unit View.Orders;
interface
......@@ -15,7 +15,7 @@ uses
XData.Web.Dataset, XData.Web.Connection, Vcl.Forms, DateUtils, WebAudio;
type
TFViewCalls = class(TWebForm)
TFViewOrders = class(TWebForm)
XDataWebClient1: TXDataWebClient;
XDataWebDataSet1: TXDataWebDataSet;
lblEntries: TWebLabel;
......@@ -36,9 +36,9 @@ type
XDataWebDataSet1shipDue: TStringField;
XDataWebDataSet1shipDone: TStringField;
XDataWebDataSet1price: TStringField;
XDataWebDataSet1qbRefNum: TIntegerField;
XDataWebDataSet1colors: TIntegerField;
XDataWebDataSet1ID: TIntegerField;
XDataWebDataSet1ID: TStringField;
XDataWebDataSet1qbRefNum: TStringField;
XDataWebDataSet1colors: TStringField;
procedure WebFormCreate(Sender: TObject);
procedure btnApplyClick(Sender: TObject);
procedure btnSearchClick(Sender: TObject);
......@@ -64,7 +64,7 @@ type
end;
var
FViewCalls: TFViewCalls;
FViewOrders: TFViewOrders;
implementation
......@@ -74,7 +74,7 @@ uses
{$R *.dfm}
procedure TFViewCalls.WebFormCreate(Sender: TObject);
procedure TFViewOrders.WebFormCreate(Sender: TObject);
// Initializes important values:
// PageNumber: What page number the user is on IE 1: 1-10, 2: 11-20 etc
// TotalPages: Total number of pages returned from the search.
......@@ -87,7 +87,7 @@ begin
getCalls(GenerateSearchOptions());
end;
procedure TFViewCalls.getUser();
procedure TFViewOrders.getUser();
var
xdcResponse: TXDataClientResponse;
userList, user: TJSObject;
......@@ -101,7 +101,7 @@ begin
end;
procedure TFViewCalls.AddRowToTable(temp: string);
procedure TFViewOrders.AddRowToTable(temp: string);
// Adds rows to the table
// PhoneNumber: phone number of the location
// Caller: phone number of the caller
......@@ -116,91 +116,136 @@ begin
// Order ID Cell
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Order ID');
Cell.innerText := XDataWebDataSet1ID.AsString;
if XDataWebDataSet1ID.Value = '' then
Cell.innerText := 'None'
else
Cell.innerText := XDataWebDataSet1ID.Value;
NewRow.appendChild(Cell);
// Company Name Cell
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Company Name');
Cell.innerText := XDataWebDataSet1companyName.Value;
if XDataWebDataSet1companyName.Value = '' then
Cell.innerText := 'None'
else
Cell.innerText := XDataWebDataSet1companyName.Value;
NewRow.appendChild(Cell);
// Job Name Cell
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Job Name');
Cell.innerText := XDataWebDataSet1jobName.Value;
if XDataWebDataSet1jobName.Value = '' then
Cell.innerText := 'None'
else
Cell.innerText := XDataWebDataSet1jobName.Value;
NewRow.appendChild(Cell);
// Order Date Cell
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Order Date');
Cell.innerText := XDataWebDataSet1orderDate.Value;
if XDataWebDataSet1orderDate.Value = '' then
Cell.innerText := 'None'
else
Cell.innerText := XDataWebDataSet1orderDate.Value;
NewRow.appendChild(Cell);
// Proof Due Cell
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Proof Due');
Cell.innerText := XDataWebDataSet1proofDue.Value;
if XDataWebDataSet1proofDue.Value = '' then
Cell.innerText := 'None'
else
Cell.innerText := XDataWebDataSet1proofDue.Value;
NewRow.appendChild(Cell);
// Proof Done Cell
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Proof Done');
Cell.innerText := XDataWebDataSet1proofDone.Value;
if XDataWebDataSet1proofDone.Value = '' then
Cell.innerText := 'None'
else
Cell.innerText := XDataWebDataSet1proofDone.Value;
NewRow.appendChild(Cell);
// Art Due Cell
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Art Due');
Cell.innerText := XDataWebDataSet1artDue.Value;
if XDataWebDataSet1artDone.Value = '' then
Cell.innerText := 'None'
else
Cell.innerText := XDataWebDataSet1artDue.Value;
NewRow.appendChild(Cell);
// Art Done Cell
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Art Done');
Cell.innerText := XDataWebDataSet1artDone.Value;
if XDataWebDataSet1artDone.Value = '' then
Cell.innerText := 'None'
else
Cell.innerText := XDataWebDataSet1artDone.Value;
NewRow.appendChild(Cell);
// Mount Due Cell
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Mount Due');
Cell.innerText := XDataWebDataSet1mountDue.Value;
if XDataWebDataSet1mountDue.Value = '' then
Cell.innerText := 'None'
else
Cell.innerText := XDataWebDataSet1mountDue.Value;
NewRow.appendChild(Cell);
// Mount Done Cell
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Mount Done');
Cell.innerText := XDataWebDataSet1mountDone.Value;
if XDataWebDataSet1mountDone.Value = '' then
Cell.innerText := 'None'
else
Cell.innerText := XDataWebDataSet1mountDone.Value;
NewRow.appendChild(Cell);
// Ship Due Cell
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Ship Due');
Cell.innerText := XDataWebDataSet1shipDue.Value;
if XDataWebDataSet1shipDue.Value = '' then
Cell.innerText := 'None'
else
Cell.innerText := XDataWebDataSet1shipDue.Value;
NewRow.appendChild(Cell);
// Ship Done Cell
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Ship Done');
Cell.innerText := XDataWebDataSet1shipDone.Value;
if XDataWebDataSet1shipDone.Value = '' then
Cell.innerText := 'None'
else
Cell.innerText := XDataWebDataSet1shipDone.Value;
NewRow.appendChild(Cell);
// Price Cell
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Price');
Cell.innerText := XDataWebDataSet1jobName.Value;
if XDataWebDataSet1price.Value = '' then
Cell.innerText := 'None'
else
Cell.innerText := XDataWebDataSet1price.Value;
NewRow.appendChild(Cell);
// QuickBooks Reference Number Cell
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Quickbooks Reference Number');
Cell.innerText := XDataWebDataSet1qbRefNum.AsString;
if XDataWebDataSet1qbRefNum.Value = '' then
Cell.innerText := 'None'
else
Cell.innerText := XDataWebDataSet1qbRefNum.Value;
NewRow.appendChild(Cell);
// Colors Cell
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Colors');
Cell.innerText := XDataWebDataSet1colors.AsString;
if XDataWebDataSet1colors.Value = '' then
Cell.innerText := 'None'
else
Cell.innerText := XDataWebDataSet1colors.Value;
NewRow.appendChild(Cell);
......@@ -208,7 +253,7 @@ begin
TJSHTMLElement(document.getElementById('tblPhoneGrid').getElementsByTagName('tbody')[0]).appendChild(NewRow);
end;
procedure TFViewCalls.GeneratePagination(TotalPages: Integer);
procedure TFViewOrders.GeneratePagination(TotalPages: Integer);
// Generates pagination for the table.
// TotalPages: Total amount of pages generated by the search
var
......@@ -377,7 +422,7 @@ begin
end;
procedure TFViewCalls.GetCalls(searchOptions: string);
procedure TFViewOrders.GetCalls(searchOptions: string);
// Retrieves list of calls from the server that meet the criteria searchOptions
// searchOptions: information about how to generate the SQL statement based on
// user input.
......@@ -413,9 +458,6 @@ begin
for i := 0 to data.Length - 1 do
begin
order := TJSObject(data[i]);
{console.log(order);
console.log(XDataWebDataSet1proofDue.Value);
console.log(XDataWebDataSet1ID.Value);}
AddRowToTable(tempString);
XDataWebDataSet1.Next;
end;
......@@ -436,7 +478,7 @@ begin
end;
end;
procedure TFViewCalls.btnApplyClick(Sender: TObject);
procedure TFViewOrders.btnApplyClick(Sender: TObject);
// Button that effectively functions as a GetCalls() button
var
searchOptions: string;
......@@ -450,7 +492,7 @@ begin
GetCalls(searchOptions);
end;
procedure TFViewCalls.Search(searchOptions: string);
procedure TFViewOrders.Search(searchOptions: string);
// Search method that searches the database for a specific phone number
var
xdcResponse: TXDataClientResponse;
......@@ -480,13 +522,13 @@ begin
end;
end;
procedure TFViewCalls.btnSearchClick(Sender: TObject);
procedure TFViewOrders.btnSearchClick(Sender: TObject);
// calls Search method
begin
Search(edtSearch.Text);
end;
procedure TFViewCalls.ClearTable();
procedure TFViewOrders.ClearTable();
// clears the table
var
tbody: TJSHTMLElement;
......@@ -495,7 +537,7 @@ begin
tbody.innerHTML := '';
end;
function TFViewCalls.GenerateSearchOptions(): string;
function TFViewOrders.GenerateSearchOptions(): string;
// Generates searchOptions for get calls.
var
searchOptions: string;
......
......@@ -18,7 +18,7 @@ uses
View.Home in 'View.Home.pas' {FViewHome: TWebForm} {*.html},
View.Users in 'View.Users.pas' {FViewUsers: TWebForm} {*.html},
View.EditUser in 'View.EditUser.pas' {FViewEditUser: TWebForm} {*.html},
View.Calls in 'View.Calls.pas' {FViewCalls: TWebForm} {*.html};
View.Orders in 'View.Orders.pas' {FViewOrders: TWebForm} {*.html};
{$R *.res}
......
......@@ -161,8 +161,8 @@
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
<DCCReference Include="View.Calls.pas">
<Form>FViewCalls</Form>
<DCCReference Include="View.Orders.pas">
<Form>FViewOrders</Form>
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
......
......@@ -26,4 +26,11 @@ object FDatabaseModule: TFDatabaseModule
Left = 220
Top = 134
end
object UniQuery2: TUniQuery
Connection = ucKG
SQL.Strings = (
'')
Left = 433
Top = 144
end
end
......@@ -15,6 +15,7 @@ type
ucKG: TUniConnection;
UniQuery1: TUniQuery;
MySQLUniProvider1: TMySQLUniProvider;
UniQuery2: TUniQuery;
procedure DataModuleCreate(Sender: TObject);
private
{ Private declarations }
......
......@@ -85,7 +85,7 @@ type
TOrderItem = class
public
ID: integer;
ID: string;
companyName: string;
jobName: string;
orderDate: string;
......@@ -98,8 +98,8 @@ type
shipDue: string;
shipDone: string;
price: string;
qbRefNum: integer;
colors: integer;
qbRefNum: string;
colors: string;
end;
TOrderList = class
......
......@@ -226,7 +226,48 @@ begin
offset := IntToStr((PageNum - 1) * PageSize);
limit := IntToStr(PageSize);
SQL := 'select * from web_plate_orders inner join customers on web_plate_orders.COMPANY_ID = customers.CUSTOMER_ID ' + 'limit ' + limit + ' offset ' + offset;
SQL := 'SELECT o.ORDER_ID, o.LOCATION AS Loc, c.NAME AS COMPANY_NAME, o.JOB_NAME, o.ORDER_DATE, ' +
'(SELECT oss.STATUS_DATE ' +
' FROM orders_status_schedule oss ' +
' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''PROOF'') AS PROOF_DUE, ' +
'(SELECT os.STATUS_TIMESTAMP ' +
' FROM orders_status os ' +
' WHERE os.ORDER_ID = o.ORDER_ID AND os.ORDER_STATUS = ''PROOF'' ' +
' ORDER BY os.STATUS_TIMESTAMP DESC LIMIT 1) AS PROOF_DONE, ' +
'(SELECT oss.STATUS_DATE ' +
' FROM orders_status_schedule oss ' +
' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''ART'') AS ART_DUE, ' +
'(SELECT os.STATUS_TIMESTAMP ' +
' FROM orders_status os ' +
' WHERE os.ORDER_ID = o.ORDER_ID AND os.ORDER_STATUS = ''ART'' ' +
' ORDER BY os.STATUS_TIMESTAMP DESC LIMIT 1) AS ART_DONE, ' +
'(SELECT oss.STATUS_DATE ' +
' FROM orders_status_schedule oss ' +
' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''PLATE'') AS PLATE_DUE, ' +
'(SELECT os.STATUS_TIMESTAMP ' +
' FROM orders_status os ' +
' WHERE os.ORDER_ID = o.ORDER_ID AND os.ORDER_STATUS = ''PLATE'' ' +
' ORDER BY os.STATUS_TIMESTAMP DESC LIMIT 1) AS PLATE_DONE, ' +
'(SELECT oss.STATUS_DATE ' +
' FROM orders_status_schedule oss ' +
' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''MOUNT'') AS MOUNT_DUE, ' +
'(SELECT os.STATUS_TIMESTAMP ' +
' FROM orders_status os ' +
' WHERE os.ORDER_ID = o.ORDER_ID AND os.ORDER_STATUS = ''MOUNT'' ' +
' ORDER BY os.STATUS_TIMESTAMP DESC LIMIT 1) AS MOUNT_DONE, ' +
'(SELECT oss.STATUS_DATE ' +
' FROM orders_status_schedule oss ' +
' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''SHIP'') AS SHIP_DUE, ' +
'(SELECT os.STATUS_TIMESTAMP ' +
' FROM orders_status os ' +
' WHERE os.ORDER_ID = o.ORDER_ID AND os.ORDER_STATUS = ''SHIP'' ' +
' ORDER BY os.STATUS_TIMESTAMP DESC LIMIT 1) AS SHIP_DONE, ' +
'o.PRICE, qb.QB_REF_NUM ' +
'FROM orders o ' +
'JOIN customers c ON c.CUSTOMER_ID = o.COMPANY_ID ' +
'LEFT JOIN qb_sales_orders qb ON qb.ORDER_ID = o.ORDER_ID ' +
'ORDER BY o.ORDER_DATE DESC ' +
'LIMIT ' + limit + ' OFFSET ' + offset;
doQuery(callsDB.UniQuery1, SQL);
......@@ -239,11 +280,31 @@ begin
Order := TOrderItem.Create;
TXDataOperationContext.Current.Handler.ManagedObjects.Add( Order );
Result.data.Add( Order );
order.ID := callsDB.UniQuery1.FieldByName('ORDER_ID').AsInteger;
order.companyName := callsDB.UniQuery1.FieldByName('NAME').AsString;
order.jobName := callsDB.UniQuery1.FieldByName('staff_fields_job_name').AsString;
order.ID := callsDB.UniQuery1.FieldByName('ORDER_ID').AsString;
order.companyName := callsDB.UniQuery1.FieldByName('COMPANY_NAME').AsString;
order.jobName := callsDB.UniQuery1.FieldByName('JOB_NAME').AsString;
order.orderDate := callsDB.UniQuery1.FieldByName('ORDER_DATE').AsString;
order.proofDue := callsDB.UniQuery1.FieldByName('staff_fields_proof_date').AsString;
order.proofDue := callsDB.UniQuery1.FieldByName('PROOF_DUE').AsString;
order.proofDone := callsDB.UniQuery1.FieldByName('PROOF_DONE').AsString;
order.artDue := callsDB.UniQuery1.FieldByName('ART_DUE').AsString;
order.artDone := callsDB.UniQuery1.FieldByName('ART_DONE').AsString;
order.mountDue := callsDB.UniQuery1.FieldByName('MOUNT_DUE').AsString;
order.mountDone := callsDB.UniQuery1.FieldByName('MOUNT_DONE').AsString;
order.shipDue := callsDB.UniQuery1.FieldByName('SHIP_DUE').AsString;
order.shipDone := callsDB.UniQuery1.FieldByName('SHIP_DONE').AsString;
order.price := callsDB.UniQuery1.FieldByName('PRICE').AsString;
order.qbRefNum := callsDB.UniQuery1.FieldByName('QB_REF_NUM').AsString;
{SQL := 'SELECT oss.STATUS_DATE ' +
'FROM orders_status_schedule oss ' +
'WHERE oss.ORDER_ID = ' + IntToStr(order.ID) + ' ' +
'AND oss.ORDER_STATUS = ' + QuotedStr('PROOF');
//select oss.STATUS_DATE from orders_status_schedule oss JOIN orders o where oss.ORDER_ID = o.ORDER_ID and oss.ORDER_STATUS = 'PROOF';
SQL := 'select oss.STATUS_DATE from orders_status_schedule oss where oss.ORDER_ID = ' + IntToStr(order.ID) + ' and oss.ORDER_STATUS = ' + quotedStr('PROOF');
doQuery(callsDB.UniQuery2, SQL);
order.proofDue := callsDB.UniQuery2.FieldByName('STATUS_DATE').AsString;
SQL := '(select os.STATUS_TIMESTAMP from orders_status os where os.ORDER_ID = ' + IntToStr(order.ID) + ' and os.ORDER_STATUS = ' + quotedStr('PROOF') + ' order by os.STATUS_TIMESTAMP desc LIMIT 1) AS PROOF_DONE';
doQuery(callsDB.UniQuery2, SQL);
order.proofDone := '???';
order.artDue := callsDB.UniQuery1.FieldByName('staff_fields_art_due').AsString;
order.artDone := '???';
......@@ -251,9 +312,9 @@ begin
order.mountDone := '???';
order.shipDue := callsDB.UniQuery1.FieldByName('staff_fields_ship_date').AsString;
order.shipDone := '???';
order.price := callsDB.UniQuery1.FieldByName('staff_fields_price').AsString;
order.qbRefNum := -1;
order.colors := -1;
order.qbRefNum := -1; }
order.colors := '-1';
callsDB.UniQuery1.Next;
end;
......
[Options]
LogFileNum=51
LogFileNum=82
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