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 @@
...
@@ -5,30 +5,6 @@
<div
class=
"row justify-content-center"
>
<div
class=
"row justify-content-center"
>
<div
class=
"col-12 col-md-8"
>
<div
class=
"col-12 col-md-8"
>
<form
class=
"form-inline"
>
<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=
"row"
>
<div
class=
"col-sm-5"
>
<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>
<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 @@
...
@@ -42,7 +18,7 @@
</div>
</div>
</div>
</div>
</form>
</form>
</div>
<table
class=
"table table-responsive table-striped table-bordered"
id=
"tblPhoneGrid"
>
<table
class=
"table table-responsive table-striped table-bordered"
id=
"tblPhoneGrid"
>
<thead
class=
"thead-dark"
>
<thead
class=
"thead-dark"
>
<tr>
<tr>
...
@@ -77,7 +53,6 @@
...
@@ -77,7 +53,6 @@
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal -->
<!-- Modal -->
<div
class=
"modal fade"
id=
"audioModal"
tabindex=
"-1"
aria-labelledby=
"audioModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal fade"
id=
"audioModal"
tabindex=
"-1"
aria-labelledby=
"audioModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-dialog"
>
...
...
kgOrdersClient/View.Main.dfm
View file @
e7324517
...
@@ -51,9 +51,9 @@ object FViewMain: TFViewMain
...
@@ -51,9 +51,9 @@ object FViewMain: TFViewMain
object lblAppTitle: TWebLabel
object lblAppTitle: TWebLabel
Left = 57
Left = 57
Top = 31
Top = 31
Width =
60
Width =
74
Height = 15
Height = 15
Caption = '
Envoy Calls
'
Caption = '
Kohler Gibson
'
ElementID = 'view.main.apptitle'
ElementID = 'view.main.apptitle'
HeightPercent = 100.000000000000000000
HeightPercent = 100.000000000000000000
Transparent = False
Transparent = False
...
...
kgOrdersClient/View.Main.pas
View file @
e7324517
...
@@ -62,7 +62,7 @@ uses
...
@@ -62,7 +62,7 @@ uses
View
.
Items
,
View
.
Items
,
View
.
Users
,
View
.
Users
,
View
.
EditUser
,
View
.
EditUser
,
View
.
Call
s
;
View
.
Order
s
;
{$R *.dfm}
{$R *.dfm}
...
@@ -92,7 +92,7 @@ end;
...
@@ -92,7 +92,7 @@ end;
procedure
TFViewMain
.
lblordersClick
(
Sender
:
TObject
);
procedure
TFViewMain
.
lblordersClick
(
Sender
:
TObject
);
begin
begin
ShowForm
(
TFView
Call
s
);
ShowForm
(
TFView
Order
s
);
end
;
end
;
procedure
TFViewMain
.
lblUsersClick
(
Sender
:
TObject
);
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
Width = 676
Height = 480
Height = 480
CSSLibrary = cssBootstrap
CSSLibrary = cssBootstrap
...
@@ -85,7 +85,6 @@ object FViewCalls: TFViewCalls
...
@@ -85,7 +85,6 @@ object FViewCalls: TFViewCalls
HeightStyle = ssAuto
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
HeightPercent = 100.000000000000000000
HideSelection = False
HideSelection = False
TextHint = 'Format: (XXX) XXX-XXXX'
WidthPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
end
object XDataWebClient1: TXDataWebClient
object XDataWebClient1: TXDataWebClient
...
@@ -97,6 +96,9 @@ object FViewCalls: TFViewCalls
...
@@ -97,6 +96,9 @@ object FViewCalls: TFViewCalls
Connection = DMConnection.ApiConnection
Connection = DMConnection.ApiConnection
Left = 440
Left = 440
Top = 300
Top = 300
object XDataWebDataSet1ID: TStringField
FieldName = 'ID'
end
object XDataWebDataSet1companyName: TStringField
object XDataWebDataSet1companyName: TStringField
FieldName = 'companyName'
FieldName = 'companyName'
end
end
...
@@ -133,15 +135,12 @@ object FViewCalls: TFViewCalls
...
@@ -133,15 +135,12 @@ object FViewCalls: TFViewCalls
object XDataWebDataSet1price: TStringField
object XDataWebDataSet1price: TStringField
FieldName = 'price'
FieldName = 'price'
end
end
object XDataWebDataSet1qbRefNum: T
Integer
Field
object XDataWebDataSet1qbRefNum: T
String
Field
FieldName = 'qbRefNum'
FieldName = 'qbRefNum'
end
end
object XDataWebDataSet1colors: T
Integer
Field
object XDataWebDataSet1colors: T
String
Field
FieldName = 'colors'
FieldName = 'colors'
end
end
object XDataWebDataSet1ID: TIntegerField
FieldName = 'ID'
end
end
end
object WebDataSource1: TWebDataSource
object WebDataSource1: TWebDataSource
DataSet = XDataWebDataSet1
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 @@
...
@@ -4,7 +4,7 @@
// Cameron Hayes
// Cameron Hayes
// Mac ...
// Mac ...
unit
View
.
Call
s
;
unit
View
.
Order
s
;
interface
interface
...
@@ -15,7 +15,7 @@ uses
...
@@ -15,7 +15,7 @@ uses
XData
.
Web
.
Dataset
,
XData
.
Web
.
Connection
,
Vcl
.
Forms
,
DateUtils
,
WebAudio
;
XData
.
Web
.
Dataset
,
XData
.
Web
.
Connection
,
Vcl
.
Forms
,
DateUtils
,
WebAudio
;
type
type
TFView
Call
s
=
class
(
TWebForm
)
TFView
Order
s
=
class
(
TWebForm
)
XDataWebClient1
:
TXDataWebClient
;
XDataWebClient1
:
TXDataWebClient
;
XDataWebDataSet1
:
TXDataWebDataSet
;
XDataWebDataSet1
:
TXDataWebDataSet
;
lblEntries
:
TWebLabel
;
lblEntries
:
TWebLabel
;
...
@@ -36,9 +36,9 @@ type
...
@@ -36,9 +36,9 @@ type
XDataWebDataSet1shipDue
:
TStringField
;
XDataWebDataSet1shipDue
:
TStringField
;
XDataWebDataSet1shipDone
:
TStringField
;
XDataWebDataSet1shipDone
:
TStringField
;
XDataWebDataSet1price
:
TStringField
;
XDataWebDataSet1price
:
TStringField
;
XDataWebDataSet1
qbRefNum
:
TInteger
Field
;
XDataWebDataSet1
ID
:
TString
Field
;
XDataWebDataSet1
colors
:
TInteger
Field
;
XDataWebDataSet1
qbRefNum
:
TString
Field
;
XDataWebDataSet1
ID
:
TInteger
Field
;
XDataWebDataSet1
colors
:
TString
Field
;
procedure
WebFormCreate
(
Sender
:
TObject
);
procedure
WebFormCreate
(
Sender
:
TObject
);
procedure
btnApplyClick
(
Sender
:
TObject
);
procedure
btnApplyClick
(
Sender
:
TObject
);
procedure
btnSearchClick
(
Sender
:
TObject
);
procedure
btnSearchClick
(
Sender
:
TObject
);
...
@@ -64,7 +64,7 @@ type
...
@@ -64,7 +64,7 @@ type
end
;
end
;
var
var
FView
Calls
:
TFViewCall
s
;
FView
Orders
:
TFViewOrder
s
;
implementation
implementation
...
@@ -74,7 +74,7 @@ uses
...
@@ -74,7 +74,7 @@ uses
{$R *.dfm}
{$R *.dfm}
procedure
TFView
Call
s
.
WebFormCreate
(
Sender
:
TObject
);
procedure
TFView
Order
s
.
WebFormCreate
(
Sender
:
TObject
);
// Initializes important values:
// Initializes important values:
// PageNumber: What page number the user is on IE 1: 1-10, 2: 11-20 etc
// 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.
// TotalPages: Total number of pages returned from the search.
...
@@ -87,7 +87,7 @@ begin
...
@@ -87,7 +87,7 @@ begin
getCalls
(
GenerateSearchOptions
());
getCalls
(
GenerateSearchOptions
());
end
;
end
;
procedure
TFView
Call
s
.
getUser
();
procedure
TFView
Order
s
.
getUser
();
var
var
xdcResponse
:
TXDataClientResponse
;
xdcResponse
:
TXDataClientResponse
;
userList
,
user
:
TJSObject
;
userList
,
user
:
TJSObject
;
...
@@ -101,7 +101,7 @@ begin
...
@@ -101,7 +101,7 @@ begin
end
;
end
;
procedure
TFView
Call
s
.
AddRowToTable
(
temp
:
string
);
procedure
TFView
Order
s
.
AddRowToTable
(
temp
:
string
);
// Adds rows to the table
// Adds rows to the table
// PhoneNumber: phone number of the location
// PhoneNumber: phone number of the location
// Caller: phone number of the caller
// Caller: phone number of the caller
...
@@ -116,91 +116,136 @@ begin
...
@@ -116,91 +116,136 @@ begin
// Order ID Cell
// Order ID Cell
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
.
setAttribute
(
'data-label'
,
'Order ID'
);
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
);
NewRow
.
appendChild
(
Cell
);
// Company Name Cell
// Company Name Cell
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
.
setAttribute
(
'data-label'
,
'Company Name'
);
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
);
NewRow
.
appendChild
(
Cell
);
// Job Name Cell
// Job Name Cell
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
.
setAttribute
(
'data-label'
,
'Job Name'
);
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
);
NewRow
.
appendChild
(
Cell
);
// Order Date Cell
// Order Date Cell
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
.
setAttribute
(
'data-label'
,
'Order Date'
);
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
);
NewRow
.
appendChild
(
Cell
);
// Proof Due Cell
// Proof Due Cell
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
.
setAttribute
(
'data-label'
,
'Proof Due'
);
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
);
NewRow
.
appendChild
(
Cell
);
// Proof Done Cell
// Proof Done Cell
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
.
setAttribute
(
'data-label'
,
'Proof Done'
);
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
);
NewRow
.
appendChild
(
Cell
);
// Art Due Cell
// Art Due Cell
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
.
setAttribute
(
'data-label'
,
'Art Due'
);
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
);
NewRow
.
appendChild
(
Cell
);
// Art Done Cell
// Art Done Cell
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
.
setAttribute
(
'data-label'
,
'Art Done'
);
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
);
NewRow
.
appendChild
(
Cell
);
// Mount Due Cell
// Mount Due Cell
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
.
setAttribute
(
'data-label'
,
'Mount Due'
);
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
);
NewRow
.
appendChild
(
Cell
);
// Mount Done Cell
// Mount Done Cell
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
.
setAttribute
(
'data-label'
,
'Mount Done'
);
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
);
NewRow
.
appendChild
(
Cell
);
// Ship Due Cell
// Ship Due Cell
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
.
setAttribute
(
'data-label'
,
'Ship Due'
);
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
);
NewRow
.
appendChild
(
Cell
);
// Ship Done Cell
// Ship Done Cell
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
.
setAttribute
(
'data-label'
,
'Ship Done'
);
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
);
NewRow
.
appendChild
(
Cell
);
// Price Cell
// Price Cell
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
.
setAttribute
(
'data-label'
,
'Price'
);
Cell
.
setAttribute
(
'data-label'
,
'Price'
);
Cell
.
innerText
:=
XDataWebDataSet1jobName
.
Value
;
if
XDataWebDataSet1price
.
Value
=
''
then
Cell
.
innerText
:=
'None'
else
Cell
.
innerText
:=
XDataWebDataSet1price
.
Value
;
NewRow
.
appendChild
(
Cell
);
NewRow
.
appendChild
(
Cell
);
// QuickBooks Reference Number Cell
// QuickBooks Reference Number Cell
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
.
setAttribute
(
'data-label'
,
'Quickbooks Reference Number'
);
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
);
NewRow
.
appendChild
(
Cell
);
// Colors Cell
// Colors Cell
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
.
setAttribute
(
'data-label'
,
'Colors'
);
Cell
.
setAttribute
(
'data-label'
,
'Colors'
);
Cell
.
innerText
:=
XDataWebDataSet1colors
.
AsString
;
if
XDataWebDataSet1colors
.
Value
=
''
then
Cell
.
innerText
:=
'None'
else
Cell
.
innerText
:=
XDataWebDataSet1colors
.
Value
;
NewRow
.
appendChild
(
Cell
);
NewRow
.
appendChild
(
Cell
);
...
@@ -208,7 +253,7 @@ begin
...
@@ -208,7 +253,7 @@ begin
TJSHTMLElement
(
document
.
getElementById
(
'tblPhoneGrid'
).
getElementsByTagName
(
'tbody'
)[
0
]).
appendChild
(
NewRow
);
TJSHTMLElement
(
document
.
getElementById
(
'tblPhoneGrid'
).
getElementsByTagName
(
'tbody'
)[
0
]).
appendChild
(
NewRow
);
end
;
end
;
procedure
TFView
Call
s
.
GeneratePagination
(
TotalPages
:
Integer
);
procedure
TFView
Order
s
.
GeneratePagination
(
TotalPages
:
Integer
);
// Generates pagination for the table.
// Generates pagination for the table.
// TotalPages: Total amount of pages generated by the search
// TotalPages: Total amount of pages generated by the search
var
var
...
@@ -377,7 +422,7 @@ begin
...
@@ -377,7 +422,7 @@ begin
end
;
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
// Retrieves list of calls from the server that meet the criteria searchOptions
// searchOptions: information about how to generate the SQL statement based on
// searchOptions: information about how to generate the SQL statement based on
// user input.
// user input.
...
@@ -413,9 +458,6 @@ begin
...
@@ -413,9 +458,6 @@ begin
for
i
:=
0
to
data
.
Length
-
1
do
for
i
:=
0
to
data
.
Length
-
1
do
begin
begin
order
:=
TJSObject
(
data
[
i
]);
order
:=
TJSObject
(
data
[
i
]);
{console.log(order);
console.log(XDataWebDataSet1proofDue.Value);
console.log(XDataWebDataSet1ID.Value);}
AddRowToTable
(
tempString
);
AddRowToTable
(
tempString
);
XDataWebDataSet1
.
Next
;
XDataWebDataSet1
.
Next
;
end
;
end
;
...
@@ -436,7 +478,7 @@ begin
...
@@ -436,7 +478,7 @@ begin
end
;
end
;
end
;
end
;
procedure
TFView
Call
s
.
btnApplyClick
(
Sender
:
TObject
);
procedure
TFView
Order
s
.
btnApplyClick
(
Sender
:
TObject
);
// Button that effectively functions as a GetCalls() button
// Button that effectively functions as a GetCalls() button
var
var
searchOptions
:
string
;
searchOptions
:
string
;
...
@@ -450,7 +492,7 @@ begin
...
@@ -450,7 +492,7 @@ begin
GetCalls
(
searchOptions
);
GetCalls
(
searchOptions
);
end
;
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
// Search method that searches the database for a specific phone number
var
var
xdcResponse
:
TXDataClientResponse
;
xdcResponse
:
TXDataClientResponse
;
...
@@ -480,13 +522,13 @@ begin
...
@@ -480,13 +522,13 @@ begin
end
;
end
;
end
;
end
;
procedure
TFView
Call
s
.
btnSearchClick
(
Sender
:
TObject
);
procedure
TFView
Order
s
.
btnSearchClick
(
Sender
:
TObject
);
// calls Search method
// calls Search method
begin
begin
Search
(
edtSearch
.
Text
);
Search
(
edtSearch
.
Text
);
end
;
end
;
procedure
TFView
Call
s
.
ClearTable
();
procedure
TFView
Order
s
.
ClearTable
();
// clears the table
// clears the table
var
var
tbody
:
TJSHTMLElement
;
tbody
:
TJSHTMLElement
;
...
@@ -495,7 +537,7 @@ begin
...
@@ -495,7 +537,7 @@ begin
tbody
.
innerHTML
:=
''
;
tbody
.
innerHTML
:=
''
;
end
;
end
;
function
TFView
Call
s
.
GenerateSearchOptions
():
string
;
function
TFView
Order
s
.
GenerateSearchOptions
():
string
;
// Generates searchOptions for get calls.
// Generates searchOptions for get calls.
var
var
searchOptions
:
string
;
searchOptions
:
string
;
...
...
kgOrdersClient/webKGOrders.dpr
View file @
e7324517
...
@@ -18,7 +18,7 @@ uses
...
@@ -18,7 +18,7 @@ uses
View.Home in 'View.Home.pas' {FViewHome: TWebForm} {*.html},
View.Home in 'View.Home.pas' {FViewHome: TWebForm} {*.html},
View.Users in 'View.Users.pas' {FViewUsers: TWebForm} {*.html},
View.Users in 'View.Users.pas' {FViewUsers: TWebForm} {*.html},
View.EditUser in 'View.EditUser.pas' {FViewEditUser: 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}
{$R *.res}
...
...
kgOrdersClient/webKGOrders.dproj
View file @
e7324517
...
@@ -161,8 +161,8 @@
...
@@ -161,8 +161,8 @@
<FormType>dfm</FormType>
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
</DCCReference>
<DCCReference Include="View.
Call
s.pas">
<DCCReference Include="View.
Order
s.pas">
<Form>FView
Call
s</Form>
<Form>FView
Order
s</Form>
<FormType>dfm</FormType>
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
</DCCReference>
...
...
kgOrdersServer/Source/Database.dfm
View file @
e7324517
...
@@ -26,4 +26,11 @@ object FDatabaseModule: TFDatabaseModule
...
@@ -26,4 +26,11 @@ object FDatabaseModule: TFDatabaseModule
Left = 220
Left = 220
Top = 134
Top = 134
end
end
object UniQuery2: TUniQuery
Connection = ucKG
SQL.Strings = (
'')
Left = 433
Top = 144
end
end
end
kgOrdersServer/Source/Database.pas
View file @
e7324517
...
@@ -15,6 +15,7 @@ type
...
@@ -15,6 +15,7 @@ type
ucKG
:
TUniConnection
;
ucKG
:
TUniConnection
;
UniQuery1
:
TUniQuery
;
UniQuery1
:
TUniQuery
;
MySQLUniProvider1
:
TMySQLUniProvider
;
MySQLUniProvider1
:
TMySQLUniProvider
;
UniQuery2
:
TUniQuery
;
procedure
DataModuleCreate
(
Sender
:
TObject
);
procedure
DataModuleCreate
(
Sender
:
TObject
);
private
private
{ Private declarations }
{ Private declarations }
...
...
kgOrdersServer/Source/Lookup.Service.pas
View file @
e7324517
...
@@ -85,7 +85,7 @@ type
...
@@ -85,7 +85,7 @@ type
TOrderItem
=
class
TOrderItem
=
class
public
public
ID
:
integer
;
ID
:
string
;
companyName
:
string
;
companyName
:
string
;
jobName
:
string
;
jobName
:
string
;
orderDate
:
string
;
orderDate
:
string
;
...
@@ -98,8 +98,8 @@ type
...
@@ -98,8 +98,8 @@ type
shipDue
:
string
;
shipDue
:
string
;
shipDone
:
string
;
shipDone
:
string
;
price
:
string
;
price
:
string
;
qbRefNum
:
integer
;
qbRefNum
:
string
;
colors
:
integer
;
colors
:
string
;
end
;
end
;
TOrderList
=
class
TOrderList
=
class
...
...
kgOrdersServer/Source/Lookup.ServiceImpl.pas
View file @
e7324517
...
@@ -226,7 +226,48 @@ begin
...
@@ -226,7 +226,48 @@ begin
offset
:=
IntToStr
((
PageNum
-
1
)
*
PageSize
);
offset
:=
IntToStr
((
PageNum
-
1
)
*
PageSize
);
limit
:=
IntToStr
(
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
);
doQuery
(
callsDB
.
UniQuery1
,
SQL
);
...
@@ -239,11 +280,31 @@ begin
...
@@ -239,11 +280,31 @@ begin
Order
:=
TOrderItem
.
Create
;
Order
:=
TOrderItem
.
Create
;
TXDataOperationContext
.
Current
.
Handler
.
ManagedObjects
.
Add
(
Order
);
TXDataOperationContext
.
Current
.
Handler
.
ManagedObjects
.
Add
(
Order
);
Result
.
data
.
Add
(
Order
);
Result
.
data
.
Add
(
Order
);
order
.
ID
:=
callsDB
.
UniQuery1
.
FieldByName
(
'ORDER_ID'
).
As
Integer
;
order
.
ID
:=
callsDB
.
UniQuery1
.
FieldByName
(
'ORDER_ID'
).
As
String
;
order
.
companyName
:=
callsDB
.
UniQuery1
.
FieldByName
(
'NAME'
).
AsString
;
order
.
companyName
:=
callsDB
.
UniQuery1
.
FieldByName
(
'
COMPANY_
NAME'
).
AsString
;
order
.
jobName
:=
callsDB
.
UniQuery1
.
FieldByName
(
'
staff_fields_job_name
'
).
AsString
;
order
.
jobName
:=
callsDB
.
UniQuery1
.
FieldByName
(
'
JOB_NAME
'
).
AsString
;
order
.
orderDate
:=
callsDB
.
UniQuery1
.
FieldByName
(
'ORDER_DATE'
).
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.proofDone := '???';
order.artDue := callsDB.UniQuery1.FieldByName('staff_fields_art_due').AsString;
order.artDue := callsDB.UniQuery1.FieldByName('staff_fields_art_due').AsString;
order.artDone := '???';
order.artDone := '???';
...
@@ -251,9 +312,9 @@ begin
...
@@ -251,9 +312,9 @@ begin
order.mountDone := '???';
order.mountDone := '???';
order.shipDue := callsDB.UniQuery1.FieldByName('staff_fields_ship_date').AsString;
order.shipDue := callsDB.UniQuery1.FieldByName('staff_fields_ship_date').AsString;
order.shipDone := '???';
order.shipDone := '???';
order
.
price
:=
callsDB
.
UniQuery1
.
FieldByName
(
'staff_fields_price'
).
AsString
;
order
.
qbRefNum
:=
-
1
;
order.qbRefNum := -1;
}
order
.
colors
:=
-
1
;
order
.
colors
:=
'-1'
;
callsDB
.
UniQuery1
.
Next
;
callsDB
.
UniQuery1
.
Next
;
end
;
end
;
...
...
kgOrdersServer/kgOrdersServer.ini
View file @
e7324517
[Options]
[Options]
LogFileNum
=
51
LogFileNum
=
82
UpdateTimerLength
=
0
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