Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
KGOrders
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cam Hayes
KGOrders
Commits
e7324517
Commit
e7324517
authored
Aug 30, 2024
by
cam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Orders display is working properly without the colors
parent
8419ad94
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
260 additions
and
86 deletions
+260
-86
View.Calls.html
kgOrdersClient/View.Calls.html
+1
-26
View.Main.dfm
kgOrdersClient/View.Main.dfm
+2
-2
View.Main.pas
kgOrdersClient/View.Main.pas
+2
-2
View.Orders.dfm
kgOrdersClient/View.Orders.dfm
+6
-7
View.Orders.html
kgOrdersClient/View.Orders.html
+89
-0
View.Orders.pas
kgOrdersClient/View.Orders.pas
+76
-34
webKGOrders.dpr
kgOrdersClient/webKGOrders.dpr
+1
-1
webKGOrders.dproj
kgOrdersClient/webKGOrders.dproj
+2
-2
Database.dfm
kgOrdersServer/Source/Database.dfm
+7
-0
Database.pas
kgOrdersServer/Source/Database.pas
+1
-0
Lookup.Service.pas
kgOrdersServer/Source/Lookup.Service.pas
+3
-3
Lookup.ServiceImpl.pas
kgOrdersServer/Source/Lookup.ServiceImpl.pas
+69
-8
kgOrdersServer.ini
kgOrdersServer/kgOrdersServer.ini
+1
-1
No files found.
kgOrdersClient/View.Calls.html
View file @
e7324517
...
...
@@ -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"
>
...
...
kgOrdersClient/View.Main.dfm
View file @
e7324517
...
...
@@ -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
...
...
kgOrdersClient/View.Main.pas
View file @
e7324517
...
...
@@ -62,7 +62,7 @@ uses
View
.
Items
,
View
.
Users
,
View
.
EditUser
,
View
.
Call
s
;
View
.
Order
s
;
{$R *.dfm}
...
...
@@ -92,7 +92,7 @@ end;
procedure
TFViewMain
.
lblordersClick
(
Sender
:
TObject
);
begin
ShowForm
(
TFView
Call
s
);
ShowForm
(
TFView
Order
s
);
end
;
procedure
TFViewMain
.
lblUsersClick
(
Sender
:
TObject
);
...
...
kgOrdersClient/View.
Call
s.dfm
→
kgOrdersClient/View.
Order
s.dfm
View file @
e7324517
object FView
Calls: TFViewCall
s
object FView
Orders: TFViewOrder
s
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: T
Integer
Field
object XDataWebDataSet1qbRefNum: T
String
Field
FieldName = 'qbRefNum'
end
object XDataWebDataSet1colors: T
Integer
Field
object XDataWebDataSet1colors: T
String
Field
FieldName = 'colors'
end
object XDataWebDataSet1ID: TIntegerField
FieldName = 'ID'
end
end
object WebDataSource1: TWebDataSource
DataSet = XDataWebDataSet1
...
...
kgOrdersClient/View.Orders.html
0 → 100644
View file @
e7324517
<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>
kgOrdersClient/View.
Call
s.pas
→
kgOrdersClient/View.
Order
s.pas
View file @
e7324517
...
...
@@ -4,7 +4,7 @@
// Cameron Hayes
// Mac ...
unit
View
.
Call
s
;
unit
View
.
Order
s
;
interface
...
...
@@ -15,7 +15,7 @@ uses
XData
.
Web
.
Dataset
,
XData
.
Web
.
Connection
,
Vcl
.
Forms
,
DateUtils
,
WebAudio
;
type
TFView
Call
s
=
class
(
TWebForm
)
TFView
Order
s
=
class
(
TWebForm
)
XDataWebClient1
:
TXDataWebClient
;
XDataWebDataSet1
:
TXDataWebDataSet
;
lblEntries
:
TWebLabel
;
...
...
@@ -36,9 +36,9 @@ type
XDataWebDataSet1shipDue
:
TStringField
;
XDataWebDataSet1shipDone
:
TStringField
;
XDataWebDataSet1price
:
TStringField
;
XDataWebDataSet1
qbRefNum
:
TInteger
Field
;
XDataWebDataSet1
colors
:
TInteger
Field
;
XDataWebDataSet1
ID
:
TInteger
Field
;
XDataWebDataSet1
ID
:
TString
Field
;
XDataWebDataSet1
qbRefNum
:
TString
Field
;
XDataWebDataSet1
colors
:
TString
Field
;
procedure
WebFormCreate
(
Sender
:
TObject
);
procedure
btnApplyClick
(
Sender
:
TObject
);
procedure
btnSearchClick
(
Sender
:
TObject
);
...
...
@@ -64,7 +64,7 @@ type
end
;
var
FView
Calls
:
TFViewCall
s
;
FView
Orders
:
TFViewOrder
s
;
implementation
...
...
@@ -74,7 +74,7 @@ uses
{$R *.dfm}
procedure
TFView
Call
s
.
WebFormCreate
(
Sender
:
TObject
);
procedure
TFView
Order
s
.
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
TFView
Call
s
.
getUser
();
procedure
TFView
Order
s
.
getUser
();
var
xdcResponse
:
TXDataClientResponse
;
userList
,
user
:
TJSObject
;
...
...
@@ -101,7 +101,7 @@ begin
end
;
procedure
TFView
Call
s
.
AddRowToTable
(
temp
:
string
);
procedure
TFView
Order
s
.
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
TFView
Call
s
.
GeneratePagination
(
TotalPages
:
Integer
);
procedure
TFView
Order
s
.
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
TFView
Call
s
.
GetCalls
(
searchOptions
:
string
);
procedure
TFView
Order
s
.
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
TFView
Call
s
.
btnApplyClick
(
Sender
:
TObject
);
procedure
TFView
Order
s
.
btnApplyClick
(
Sender
:
TObject
);
// Button that effectively functions as a GetCalls() button
var
searchOptions
:
string
;
...
...
@@ -450,7 +492,7 @@ begin
GetCalls
(
searchOptions
);
end
;
procedure
TFView
Call
s
.
Search
(
searchOptions
:
string
);
procedure
TFView
Order
s
.
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
TFView
Call
s
.
btnSearchClick
(
Sender
:
TObject
);
procedure
TFView
Order
s
.
btnSearchClick
(
Sender
:
TObject
);
// calls Search method
begin
Search
(
edtSearch
.
Text
);
end
;
procedure
TFView
Call
s
.
ClearTable
();
procedure
TFView
Order
s
.
ClearTable
();
// clears the table
var
tbody
:
TJSHTMLElement
;
...
...
@@ -495,7 +537,7 @@ begin
tbody
.
innerHTML
:=
''
;
end
;
function
TFView
Call
s
.
GenerateSearchOptions
():
string
;
function
TFView
Order
s
.
GenerateSearchOptions
():
string
;
// Generates searchOptions for get calls.
var
searchOptions
:
string
;
...
...
kgOrdersClient/webKGOrders.dpr
View file @
e7324517
...
...
@@ -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' {FViewCall
s: TWebForm} {*.html};
View.
Orders in 'View.Orders.pas' {FViewOrder
s: TWebForm} {*.html};
{$R *.res}
...
...
kgOrdersClient/webKGOrders.dproj
View file @
e7324517
...
...
@@ -161,8 +161,8 @@
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
<DCCReference Include="View.
Call
s.pas">
<Form>FView
Call
s</Form>
<DCCReference Include="View.
Order
s.pas">
<Form>FView
Order
s</Form>
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
...
...
kgOrdersServer/Source/Database.dfm
View file @
e7324517
...
...
@@ -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
kgOrdersServer/Source/Database.pas
View file @
e7324517
...
...
@@ -15,6 +15,7 @@ type
ucKG
:
TUniConnection
;
UniQuery1
:
TUniQuery
;
MySQLUniProvider1
:
TMySQLUniProvider
;
UniQuery2
:
TUniQuery
;
procedure
DataModuleCreate
(
Sender
:
TObject
);
private
{ Private declarations }
...
...
kgOrdersServer/Source/Lookup.Service.pas
View file @
e7324517
...
...
@@ -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
...
...
kgOrdersServer/Source/Lookup.ServiceImpl.pas
View file @
e7324517
...
...
@@ -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'
).
As
Integer
;
order
.
companyName
:=
callsDB
.
UniQuery1
.
FieldByName
(
'NAME'
).
AsString
;
order
.
jobName
:=
callsDB
.
UniQuery1
.
FieldByName
(
'
staff_fields_job_name
'
).
AsString
;
order
.
ID
:=
callsDB
.
UniQuery1
.
FieldByName
(
'ORDER_ID'
).
As
String
;
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
;
...
...
kgOrdersServer/kgOrdersServer.ini
View file @
e7324517
[Options]
LogFileNum
=
51
LogFileNum
=
82
UpdateTimerLength
=
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment