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
afced290
Commit
afced290
authored
Dec 26, 2024
by
cam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Redisigned the search page
parent
9ddc1084
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
287 additions
and
66 deletions
+287
-66
View.AddOrder.pas
kgOrdersClient/View.AddOrder.pas
+4
-0
View.Orders.dfm
kgOrdersClient/View.Orders.dfm
+14
-0
View.Orders.html
kgOrdersClient/View.Orders.html
+8
-3
View.Orders.pas
kgOrdersClient/View.Orders.pas
+18
-13
View.Search.dfm
kgOrdersClient/View.Search.dfm
+0
-0
View.Search.pas
kgOrdersClient/View.Search.pas
+209
-8
app.css
kgOrdersClient/css/app.css
+10
-0
Lookup.ServiceImpl.pas
kgOrdersServer/Source/Lookup.ServiceImpl.pas
+23
-41
kgOrdersServer.ini
kgOrdersServer/kgOrdersServer.ini
+1
-1
No files found.
kgOrdersClient/View.AddOrder.pas
View file @
afced290
...
@@ -43,6 +43,8 @@ type
...
@@ -43,6 +43,8 @@ type
{ Private declarations }
{ Private declarations }
public
public
{ Public declarations }
{ Public declarations }
var
confirm
:
boolean
;
end
;
end
;
var
var
...
@@ -60,11 +62,13 @@ end;
...
@@ -60,11 +62,13 @@ end;
procedure
TFAddOrder
.
btnConfirmClick
(
Sender
:
TObject
);
procedure
TFAddOrder
.
btnConfirmClick
(
Sender
:
TObject
);
begin
begin
confirm
:=
true
;
Close
;
Close
;
end
;
end
;
procedure
TFAddOrder
.
WebFormShow
(
Sender
:
TObject
);
procedure
TFAddOrder
.
WebFormShow
(
Sender
:
TObject
);
begin
begin
confirm
:=
false
;
getCustomers
();
getCustomers
();
end
;
end
;
...
...
kgOrdersClient/View.Orders.dfm
View file @
afced290
object FViewOrders: TFViewOrders
object FViewOrders: TFViewOrders
Width = 676
Width = 676
Height = 480
Height = 480
Caption = 'edtorderid'
CSSLibrary = cssBootstrap
CSSLibrary = cssBootstrap
ElementFont = efCSS
ElementFont = efCSS
Font.Charset = DEFAULT_CHARSET
Font.Charset = DEFAULT_CHARSET
...
@@ -9,6 +10,7 @@ object FViewOrders: TFViewOrders
...
@@ -9,6 +10,7 @@ object FViewOrders: TFViewOrders
Font.Name = 'Tahoma'
Font.Name = 'Tahoma'
Font.Style = []
Font.Style = []
ParentFont = False
ParentFont = False
Visible = True
OnCreate = WebFormCreate
OnCreate = WebFormCreate
OnShow = WebFormShow
OnShow = WebFormShow
object lblEntries: TWebLabel
object lblEntries: TWebLabel
...
@@ -23,6 +25,18 @@ object FViewOrders: TFViewOrders
...
@@ -23,6 +25,18 @@ object FViewOrders: TFViewOrders
HeightPercent = 100.000000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
end
object lblSearch: TWebLabel
Left = 594
Top = 116
Width = 47
Height = 13
Caption = 'Search = '
ElementID = 'lblsearch'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object btnAddOrder: TWebButton
object btnAddOrder: TWebButton
Left = 59
Left = 59
Top = 79
Top = 79
...
...
kgOrdersClient/View.Orders.html
View file @
afced290
...
@@ -34,9 +34,14 @@
...
@@ -34,9 +34,14 @@
</div>
</div>
</div>
</div>
<!-- Entries Label Section -->
<!-- Entries Label Section d-flex justify-content-between w-100 mt-2-->
<div
class=
"d-flex justify-content-between w-100 mt-2"
>
<div
class=
"row"
>
<label
id=
"lblentries"
></label>
<div
class=
"col text-start"
>
<label
id=
"lblentries"
></label>
</div>
<div
class=
"col text-end"
>
<label
id=
"lblsearch"
></label>
</div>
</div>
</div>
<!-- Table Section -->
<!-- Table Section -->
...
...
kgOrdersClient/View.Orders.pas
View file @
afced290
...
@@ -58,6 +58,7 @@ type
...
@@ -58,6 +58,7 @@ type
wdbtcOrders
:
TWebDBTableControl
;
wdbtcOrders
:
TWebDBTableControl
;
wcbPageSize
:
TWebComboBox
;
wcbPageSize
:
TWebComboBox
;
wlcbOrderBy
:
TWebLookupComboBox
;
wlcbOrderBy
:
TWebLookupComboBox
;
lblSearch
:
TWebLabel
;
procedure
WebFormCreate
(
Sender
:
TObject
);
procedure
WebFormCreate
(
Sender
:
TObject
);
procedure
btnAddOrderClick
(
Sender
:
TObject
);
procedure
btnAddOrderClick
(
Sender
:
TObject
);
procedure
btnSearchClick
(
Sender
:
TObject
);
procedure
btnSearchClick
(
Sender
:
TObject
);
...
@@ -86,6 +87,10 @@ type
...
@@ -86,6 +87,10 @@ type
PageNumber
:
integer
;
PageNumber
:
integer
;
PageSize
:
integer
;
PageSize
:
integer
;
TotalPages
:
integer
;
TotalPages
:
integer
;
OrderID
:
string
;
CompanyID
:
string
;
JobName
:
string
;
orderType
:
string
;
//Status 1
//Status 1
StartDate1
:
string
;
StartDate1
:
string
;
...
@@ -100,10 +105,6 @@ type
...
@@ -100,10 +105,6 @@ type
null2
:
boolean
;
null2
:
boolean
;
OrderBy
:
string
;
OrderBy
:
string
;
fieldType
:
string
;
searchString
:
string
;
orderType
:
string
;
filters
:
boolean
;
filters
:
boolean
;
info
:
string
;
info
:
string
;
public
public
...
@@ -162,8 +163,6 @@ begin
...
@@ -162,8 +163,6 @@ begin
filterType2
:=
''
;
filterType2
:=
''
;
null2
:=
false
;
null2
:=
false
;
fieldType
:=
''
;
searchString
:=
''
;
orderType
:=
''
;
orderType
:=
''
;
//today := TDateTime.Today;
//today := TDateTime.Today;
...
@@ -237,7 +236,7 @@ begin
...
@@ -237,7 +236,7 @@ begin
newform
.
ShowModal
(
newform
.
ShowModal
(
procedure
(
AValue
:
TModalResult
)
procedure
(
AValue
:
TModalResult
)
begin
begin
if
newform
.
edtID
.
Text
<>
''
then
if
newform
.
confirm
then
orderEntry
(
''
,
newForm
.
edtID
.
Text
,
'ADD'
);
orderEntry
(
''
,
newForm
.
edtID
.
Text
,
'ADD'
);
end
end
);
);
...
@@ -252,6 +251,7 @@ begin
...
@@ -252,6 +251,7 @@ begin
newform
.
Caption
:=
'Input Search Options'
;
newform
.
Caption
:=
'Input Search Options'
;
newForm
.
Popup
:=
True
;
newForm
.
Popup
:=
True
;
newForm
.
Border
:=
fbDialog
;
newForm
.
Border
:=
fbDialog
;
newForm
.
searchOptions
:=
generateSearchOptions
();
// used to manage Back button handling to close subform
// used to manage Back button handling to close subform
window
.
location
.
hash
:=
'subform'
;
window
.
location
.
hash
:=
'subform'
;
...
@@ -277,11 +277,14 @@ begin
...
@@ -277,11 +277,14 @@ begin
filterType2
:=
newform
.
wcbFilterType2
.
Text
;
filterType2
:=
newform
.
wcbFilterType2
.
Text
;
null2
:=
newform
.
cbNull2
.
Checked
;
null2
:=
newform
.
cbNull2
.
Checked
;
fieldType
:=
newform
.
wcbFieldType
.
Text
;
jobName
:=
newform
.
edtJobName
.
Text
;
searchString
:=
newform
.
edtSearch
.
Text
;
orderID
:=
newform
.
edtOrderID
.
Text
;
companyID
:=
newform
.
edtCompanyID
.
Text
;
orderType
:=
newform
.
wcbOrderType
.
Text
;
orderType
:=
newform
.
wcbOrderType
.
Text
;
getOrders
(
GenerateSearchOptions
());
searchOptions
:=
generateSearchOptions
();
lblSearch
.
Caption
:=
searchOptions
;
getOrders
(
searchOptions
);
end
;
end
;
end
end
);
);
...
@@ -650,9 +653,11 @@ begin
...
@@ -650,9 +653,11 @@ begin
'&filterType2='
+
filterType2
+
'&filterType2='
+
filterType2
+
'&null2='
+
BoolToStr
(
null2
)
+
'&null2='
+
BoolToStr
(
null2
)
+
'&fieldType='
+
fieldType
+
'&orderType='
+
orderType
+
'&search='
+
searchString
+
'&jobName='
+
jobName
+
'&orderType='
+
orderType
;
'&companyID='
+
companyID
+
'&orderID='
+
orderID
;
Result
:=
searchOptions
;
Result
:=
searchOptions
;
end
;
end
;
...
...
kgOrdersClient/View.Search.dfm
View file @
afced290
This diff is collapsed.
Click to expand it.
kgOrdersClient/View.Search.pas
View file @
afced290
...
@@ -8,7 +8,10 @@ uses
...
@@ -8,7 +8,10 @@ uses
WEBLib
.
JSON
,
Auth
.
Service
,
XData
.
Web
.
Client
,
WebLib
.
Storage
,
WEBLib
.
JSON
,
Auth
.
Service
,
XData
.
Web
.
Client
,
WebLib
.
Storage
,
ConnectionModule
,
App
.
Types
,
Vcl
.
StdCtrls
,
Vcl
.
Controls
,
WEBLib
.
DBCtrls
,
ConnectionModule
,
App
.
Types
,
Vcl
.
StdCtrls
,
Vcl
.
Controls
,
WEBLib
.
DBCtrls
,
Data
.
DB
,
XData
.
Web
.
JsonDataset
,
XData
.
Web
.
Dataset
,
WEBLib
.
DB
,
WEBLib
.
Grids
,
Data
.
DB
,
XData
.
Web
.
JsonDataset
,
XData
.
Web
.
Dataset
,
WEBLib
.
DB
,
WEBLib
.
Grids
,
Vcl
.
Grids
;
Vcl
.
Grids
,
VCL
.
TMSFNCTypes
,
VCL
.
TMSFNCUtils
,
VCL
.
TMSFNCGraphics
,
VCL
.
TMSFNCGraphicsTypes
,
VCL
.
TMSFNCGridCell
,
VCL
.
TMSFNCGridOptions
,
VCL
.
TMSFNCCustomControl
,
VCL
.
TMSFNCCustomScrollControl
,
VCL
.
TMSFNCGridData
,
VCL
.
TMSFNCCustomGrid
,
VCL
.
TMSFNCGrid
;
type
type
TFSearch
=
class
(
TWebForm
)
TFSearch
=
class
(
TWebForm
)
...
@@ -17,13 +20,11 @@ type
...
@@ -17,13 +20,11 @@ type
btnCloseNotification
:
TWebButton
;
btnCloseNotification
:
TWebButton
;
wcbFilterType1
:
TWebComboBox
;
wcbFilterType1
:
TWebComboBox
;
btnConfirm
:
TWebButton
;
btnConfirm
:
TWebButton
;
edt
Search
:
TWebEdit
;
edt
OrderID
:
TWebEdit
;
dtpStartDate1
:
TWebDateTimePicker
;
dtpStartDate1
:
TWebDateTimePicker
;
dtpEndDate1
:
TWebDateTimePicker
;
dtpEndDate1
:
TWebDateTimePicker
;
cbNull1
:
TWebCheckBox
;
cbNull1
:
TWebCheckBox
;
wcbFieldType
:
TWebComboBox
;
wcbOrderType
:
TWebComboBox
;
wcbOrderType
:
TWebComboBox
;
btnCancel
:
TWebButton
;
lblStatus1
:
TWebLabel
;
lblStatus1
:
TWebLabel
;
lblType1
:
TWebLabel
;
lblType1
:
TWebLabel
;
lblStartDate1
:
TWebLabel
;
lblStartDate1
:
TWebLabel
;
...
@@ -36,15 +37,42 @@ type
...
@@ -36,15 +37,42 @@ type
lblType2
:
TWebLabel
;
lblType2
:
TWebLabel
;
lblStartDate2
:
TWebLabel
;
lblStartDate2
:
TWebLabel
;
lblEndDate2
:
TWebLabel
;
lblEndDate2
:
TWebLabel
;
WebLabel1
:
TWebLabel
;
WebLabel2
:
TWebLabel
;
TMSFNCGrid1
:
TTMSFNCGrid
;
edtSearch
:
TWebEdit
;
edtCompanyID
:
TWebEdit
;
lblCompanyID
:
TWebLabel
;
XDataWebClient1
:
TXDataWebClient
;
xdwdsCustomers
:
TXDataWebDataSet
;
xdwdsCustomersID
:
TIntegerField
;
xdwdsCustomersNAME
:
TStringField
;
xdwdsCustomersSHORT_NAME
:
TStringField
;
xdwdsCustomersADDRESS
:
TStringField
;
wdsCustomers
:
TWebDataSource
;
WebLabel3
:
TWebLabel
;
edtJobName
:
TWebEdit
;
WebLabel4
:
TWebLabel
;
btnCancel
:
TWebButton
;
btnClear
:
TWebButton
;
procedure
btnConfirmClick
(
Sender
:
TObject
);
procedure
btnConfirmClick
(
Sender
:
TObject
);
procedure
WebFormShow
(
Sender
:
TObject
);
procedure
WebFormShow
(
Sender
:
TObject
);
procedure
btnCancelClick
(
Sender
:
TObject
);
procedure
btnCancelClick
(
Sender
:
TObject
);
procedure
edtSearchChange
(
Sender
:
TObject
);
procedure
TMSFNCGrid1CellClick
(
Sender
:
TObject
;
ACol
,
ARow
:
Integer
);
procedure
btnClearClick
(
Sender
:
TObject
);
private
private
//FJSONProc: TJSONProc;
//FJSONProc: TJSONProc;
[
async
]
procedure
getCustomers
;
procedure
PopulateGridManually
;
procedure
ApplyFilter
;
var
temp
:
string
;
public
public
class
function
CreateForm
(
AElementID
:
string
):
TWebForm
;
class
function
CreateForm
(
AElementID
:
string
):
TWebForm
;
var
var
confirm
:
boolean
;
confirm
:
boolean
;
searchOptions
:
string
;
end
;
end
;
var
var
...
@@ -67,13 +95,74 @@ begin
...
@@ -67,13 +95,74 @@ begin
);
);
end
;
end
;
procedure
TFSearch
.
edtSearchChange
(
Sender
:
TObject
);
begin
ApplyFilter
;
end
;
procedure
TFSearch
.
WebFormShow
(
Sender
:
TObject
);
procedure
TFSearch
.
WebFormShow
(
Sender
:
TObject
);
var
params
:
TStringList
;
DateFormatSettings
:
TFormatSettings
;
begin
begin
dtpStartDate1
.
Date
:=
0
;
params
:=
TStringList
.
Create
;
dtpEndDate1
.
Date
:=
0
;
params
.
StrictDelimiter
:=
true
;
dtpStartDate1
.
Date
:=
0
;
params
.
Delimiter
:=
'&'
;
dtpEndDate1
.
Date
:=
0
;
params
.
DelimitedText
:=
searchOptions
;
confirm
:=
false
;
confirm
:=
false
;
DateFormatSettings
:=
TFormatSettings
.
Create
;
DateFormatSettings
.
ShortDateFormat
:=
'yyyy/mm/dd'
;
wcbOrderType
.
Text
:=
UpperCase
(
Copy
(
params
.
Values
[
'orderType'
],
1
,
1
))
+
LowerCase
(
Copy
(
params
.
Values
[
'orderType'
],
2
,
MaxInt
));
edtOrderID
.
Text
:=
params
.
Values
[
'orderID'
];
edtCompanyID
.
Text
:=
params
.
Values
[
'companyID'
];
edtJobName
.
Text
:=
params
.
Values
[
'jobName'
];
// Status 1
if
params
.
Values
[
'filterType1'
]
<>
''
then
wcbFilterType1
.
Text
:=
params
.
Values
[
'filterType1'
]
else
wcbFilterType1
.
Text
:=
'NONE'
;
console
.
log
(
params
.
Values
[
'startDate1'
]);
if
params
.
Values
[
'startDate1'
]
=
''
then
dtpStartDate1
.
Date
:=
0
else
begin
dtpStartDate1
.
Date
:=
StrToDateTime
(
params
.
Values
[
'startDate1'
],
DateFormatSettings
);
end
;
if
params
.
Values
[
'endDate1'
]
=
''
then
dtpEndDate1
.
Date
:=
0
else
dtpEndDate1
.
Date
:=
StrToDateTime
(
params
.
Values
[
'endDate1'
],
DateFormatSettings
);
if
params
.
values
[
'null1'
]
<>
''
then
cbNull1
.
Checked
:=
StrToBool
(
params
.
Values
[
'null1'
]);
// Status 2
if
params
.
Values
[
'filterType2'
]
<>
''
then
wcbFilterType2
.
Text
:=
params
.
Values
[
'filterType2'
]
else
wcbFilterType2
.
Text
:=
'NONE'
;
if
params
.
Values
[
'startDate2'
]
=
'1899/12/30'
then
dtpStartDate2
.
Date
:=
0
else
dtpStartDate2
.
Date
:=
StrToDateTime
(
params
.
Values
[
'startDate2'
],
DateFormatSettings
);
if
params
.
Values
[
'endDate2'
]
=
'1899/12/30'
then
dtpEndDate2
.
Date
:=
0
else
dtpEndDate2
.
Date
:=
StrToDateTime
(
params
.
Values
[
'endDate2'
],
DateFormatSettings
);
if
params
.
values
[
'null2'
]
<>
''
then
cbNull1
.
Checked
:=
StrToBool
(
params
.
Values
[
'null2'
]);
params
.
Free
;
getCustomers
();
end
;
end
;
procedure
TFSearch
.
btnCancelClick
(
Sender
:
TObject
);
procedure
TFSearch
.
btnCancelClick
(
Sender
:
TObject
);
...
@@ -81,11 +170,123 @@ begin
...
@@ -81,11 +170,123 @@ begin
Close
;
Close
;
end
;
end
;
procedure
TFSearch
.
btnClearClick
(
Sender
:
TObject
);
begin
edtOrderID
.
Text
:=
''
;
edtCompanyID
.
Text
:=
''
;
edtSearch
.
Text
:=
''
;
edtJobName
.
Text
:=
''
;
wcbOrderType
.
Text
:=
'Any'
;
wcbFilterType1
.
Text
:=
'NONE'
;
dtpStartDate1
.
Date
:=
0
;
dtpEndDate1
.
Date
:=
0
;
cbNull1
.
Checked
:=
False
;
wcbFilterType2
.
Text
:=
'NONE'
;
dtpStartDate2
.
Date
:=
0
;
dtpEndDate2
.
Date
:=
0
;
cbNull2
.
Checked
:=
false
;
end
;
procedure
TFSearch
.
btnConfirmClick
(
Sender
:
TObject
);
procedure
TFSearch
.
btnConfirmClick
(
Sender
:
TObject
);
begin
begin
confirm
:=
true
;
confirm
:=
true
;
Close
;
Close
;
end
;
end
;
[
async
]
procedure
TFSearch
.
getCustomers
();
var
xdcResponse
:
TXDataClientResponse
;
customerList
:
TJSObject
;
begin
// Fetch data from XData service
xdcResponse
:=
await
(
XDataWebClient1
.
RawInvokeAsync
(
'ILookupService.GetCustomers'
,
[]));
customerList
:=
TJSObject
(
xdcResponse
.
Result
);
// Load data into TXDataWebDataset
xdwdsCustomers
.
Close
;
xdwdsCustomers
.
SetJsonData
(
customerList
[
'data'
]);
xdwdsCustomers
.
Open
;
// Manually populate the grid
PopulateGridManually
;
end
;
procedure
TFSearch
.
TMSFNCGrid1CellClick
(
Sender
:
TObject
;
ACol
,
ARow
:
Integer
);
begin
edtCompanyID
.
Text
:=
TMSFNCGrid1
.
Cells
[
0
,
ARow
];
end
;
procedure
TFSearch
.
PopulateGridManually
;
var
RowIndex
:
Integer
;
begin
TMSFNCGrid1
.
BeginUpdate
;
try
TMSFNCGrid1
.
Clear
;
// Clear any existing data
// Set up column headers
TMSFNCGrid1
.
ColumnCount
:=
4
;
TMSFNCGrid1
.
RowCount
:=
1
;
TMSFNCGrid1
.
Cells
[
0
,
0
]
:=
'ID'
;
TMSFNCGrid1
.
Cells
[
1
,
0
]
:=
'Short Name'
;
TMSFNCGrid1
.
Cells
[
2
,
0
]
:=
'Name'
;
TMSFNCGrid1
.
Cells
[
3
,
0
]
:=
'Address'
;
// TMSFNCGrid1.ColumnWidths[0] := 40;
// TMSFNCGrid1.ColumnWidths[1] := 80;
// TMSFNCGrid1.ColumnWidths[2] := 250;
// Populate the grid with data from the dataset
xdwdsCustomers
.
First
;
RowIndex
:=
1
;
while
not
xdwdsCustomers
.
EOF
do
begin
TMSFNCGrid1
.
RowCount
:=
RowIndex
+
1
;
TMSFNCGrid1
.
Cells
[
0
,
RowIndex
]
:=
xdwdsCustomers
.
FieldByName
(
'ID'
).
AsString
;
TMSFNCGrid1
.
Cells
[
1
,
RowIndex
]
:=
xdwdsCustomers
.
FieldByName
(
'SHORT_NAME'
).
AsString
;
TMSFNCGrid1
.
Cells
[
2
,
RowIndex
]
:=
xdwdsCustomers
.
FieldByName
(
'NAME'
).
AsString
;
TMSFNCGrid1
.
Cells
[
3
,
RowIndex
]
:=
xdwdsCustomers
.
FieldByName
(
'ADDRESS'
).
AsString
;
Inc
(
RowIndex
);
xdwdsCustomers
.
Next
;
end
;
finally
TMSFNCGrid1
.
EndUpdate
;
end
;
end
;
procedure
TFSearch
.
ApplyFilter
;
var
fd
:
TTMSFNCGridFilterData
;
i
:
Integer
;
SearchText
:
string
;
begin
SearchText
:=
Trim
(
edtSearch
.
Text
);
TMSFNCGrid1
.
RemoveFilter
;
TMSFNCGrid1
.
Filter
.
Clear
;
// match on first 3 columns
for
i
:=
0
to
2
do
begin
fd
:=
TMSFNCGrid1
.
Filter
.
Add
;
fd
.
Column
:=
i
;
fd
.
Condition
:=
'*'
+
SearchText
+
'*'
;
// Match text anywhere in the cell
fd
.
CaseSensitive
:=
False
;
// Make the filter case-insensitive
// Use foOR for "match any column" logic
if
i
>
0
then
fd
.
Operation
:=
foOR
else
fd
.
Operation
:=
foNONE
;
// First filter has no logical operation
end
;
// Apply the filters to the grid
TMSFNCGrid1
.
ApplyFilter
;
end
;
end
.
end
.
kgOrdersClient/css/app.css
View file @
afced290
...
@@ -14,6 +14,16 @@ input[type="text"] {
...
@@ -14,6 +14,16 @@ input[type="text"] {
padding-left
:
5px
;
padding-left
:
5px
;
}
}
.input-search
input
{
width
:
100px
;
/* Adjust the width of the input */
height
:
35px
;
/* Set the height to match label height */
padding
:
5px
;
/* Padding for input text */
font-size
:
14px
;
/* Font size for input text */
border
:
1px
solid
#ced4da
;
/* Border style */
border-radius
:
5px
;
/* Rounded corners for the input */
box-sizing
:
border-box
;
/* Ensures padding and border are included in the element's total width and height */
}
.card-header
{
.card-header
{
width
:
100%
;
width
:
100%
;
text-align
:
left
;
/* Align text to the left */
text-align
:
left
;
/* Align text to the left */
...
...
kgOrdersServer/Source/Lookup.ServiceImpl.pas
View file @
afced290
...
@@ -46,7 +46,6 @@ type
...
@@ -46,7 +46,6 @@ type
function
EditStatusSchedule
(
StatusType
:
string
;
order
:
TJSONObject
;
ORDER_ID
:
string
):
string
;
function
EditStatusSchedule
(
StatusType
:
string
;
order
:
TJSONObject
;
ORDER_ID
:
string
):
string
;
function
generateOrdersSQL
(
searchOptions
:
string
):
TSQLQuery
;
function
generateOrdersSQL
(
searchOptions
:
string
):
TSQLQuery
;
function
getColorCount
(
colors
:
string
):
string
;
function
getColorCount
(
colors
:
string
):
string
;
function
generateSearchSQL
(
FieldType
,
search
:
string
):
string
;
function
generateStatusSelectSQL
(
statusTableShort
,
statusTableLong
,
startDate
,
endDate
,
statusType
:
string
):
string
;
function
generateStatusSelectSQL
(
statusTableShort
,
statusTableLong
,
startDate
,
endDate
,
statusType
:
string
):
string
;
function
generateStatusWhereSQL
(
status
:
TStatusSearchInfo
):
string
;
function
generateStatusWhereSQL
(
status
:
TStatusSearchInfo
):
string
;
function
createStatusSearchInfo
(
params
:
TStringList
;
statusNum
:
string
):
TStatusSearchInfo
;
function
createStatusSearchInfo
(
params
:
TStringList
;
statusNum
:
string
):
TStatusSearchInfo
;
...
@@ -209,34 +208,6 @@ begin
...
@@ -209,34 +208,6 @@ begin
quotedStr
(
currStatus
)
+
' order by os.STATUS_TIMESTAMP desc LIMIT 1) AS '
+
currStatus
+
'_DONE, '
;
quotedStr
(
currStatus
)
+
' order by os.STATUS_TIMESTAMP desc LIMIT 1) AS '
+
currStatus
+
'_DONE, '
;
end
;
end
;
function
TLookupService
.
generateSearchSQL
(
FieldType
:
string
;
search
:
string
):
string
;
var
shortTable
:
string
;
fieldName
:
string
;
SQL
:
string
;
comparison
:
string
;
begin
if
FieldType
=
'Company Name'
then
begin
SQL
:=
'c.NAME LIKE '
+
quotedStr
(
'%'
+
search
+
'%'
);
end
else
if
FieldType
=
'Company Short Name'
then
begin
SQL
:=
'c.SHORT_NAME LIKE '
+
quotedStr
(
'%'
+
search
+
'%'
);
end
else
if
FieldType
=
'Order ID'
then
begin
SQL
:=
'o.ORDER_ID = '
+
search
;
end
else
if
FieldType
=
'Job Name'
then
begin
SQL
:=
'o.JOB_NAME LIKE '
+
quotedStr
(
'%'
+
search
+
'%'
);
end
;
result
:=
SQL
;
end
;
function
TLookupService
.
generateStatusSelectSQL
(
statusTableShort
:
string
;
statusTableLong
:
string
;
startDate
:
string
;
endDate
:
string
;
statusType
:
string
):
string
;
function
TLookupService
.
generateStatusSelectSQL
(
statusTableShort
:
string
;
statusTableLong
:
string
;
startDate
:
string
;
endDate
:
string
;
statusType
:
string
):
string
;
begin
begin
result
:=
'exists ( select 1 from '
+
statusTableLong
+
' '
+
result
:=
'exists ( select 1 from '
+
statusTableLong
+
' '
+
...
@@ -265,7 +236,7 @@ begin
...
@@ -265,7 +236,7 @@ begin
result
.
statusType
:=
''
;
result
.
statusType
:=
''
;
result
.
filterType
:=
''
;
result
.
filterType
:=
''
;
result
.
statusSuffix
:=
''
;
result
.
statusSuffix
:=
''
;
if
params
.
Values
[
'filterType'
+
statusNum
]
<>
''
then
if
(
(
params
.
Values
[
'filterType'
+
statusNum
]
<>
''
)
and
(
params
.
Values
[
'filterType'
+
statusNum
]
<>
'NONE'
)
)
then
begin
begin
result
.
statusType
:=
params
.
Values
[
'filterType'
+
statusNum
].
Split
([
' '
])[
0
];
result
.
statusType
:=
params
.
Values
[
'filterType'
+
statusNum
].
Split
([
' '
])[
0
];
result
.
statusSuffix
:=
params
.
Values
[
'filterType'
+
statusNum
].
Split
([
' '
])[
1
];
result
.
statusSuffix
:=
params
.
Values
[
'filterType'
+
statusNum
].
Split
([
' '
])[
1
];
...
@@ -318,15 +289,17 @@ var
...
@@ -318,15 +289,17 @@ var
whereSQL
:
string
;
whereSQL
:
string
;
orderBySQL
:
string
;
orderBySQL
:
string
;
OrderID
:
string
;
CompanyID
:
string
;
JobName
:
string
;
orderType
:
string
;
// These variables apply to the first status sent from the client
// These variables apply to the first status sent from the client
status1
:
TStatusSearchInfo
;
status1
:
TStatusSearchInfo
;
// These variables apply to the second status sent from the client
// These variables apply to the second status sent from the client
status2
:
TStatusSearchInfo
;
status2
:
TStatusSearchInfo
;
fieldType
:
string
;
search
:
string
;
orderType
:
string
;
begin
begin
result
:=
TSQLQuery
.
Create
;
result
:=
TSQLQuery
.
Create
;
params
:=
TStringList
.
Create
;
params
:=
TStringList
.
Create
;
...
@@ -339,9 +312,10 @@ begin
...
@@ -339,9 +312,10 @@ begin
PageNum
:=
StrToInt
(
params
.
Values
[
'pagenumber'
]);
PageNum
:=
StrToInt
(
params
.
Values
[
'pagenumber'
]);
PageSize
:=
StrToInt
(
params
.
Values
[
'pagesize'
]);
PageSize
:=
StrToInt
(
params
.
Values
[
'pagesize'
]);
OrderBy
:=
params
.
Values
[
'orderby'
];
OrderBy
:=
params
.
Values
[
'orderby'
];
fieldType
:=
params
.
Values
[
'fieldType'
];
search
:=
params
.
Values
[
'search'
];
orderType
:=
params
.
Values
[
'orderType'
].
ToLower
();
orderType
:=
params
.
Values
[
'orderType'
].
ToLower
();
OrderID
:=
params
.
Values
[
'orderID'
];
companyID
:=
params
.
Values
[
'companyID'
];
jobName
:=
params
.
Values
[
'jobName'
];
// Search infomation for first status type
// Search infomation for first status type
status1
:=
createStatusSearchInfo
(
params
,
'1'
);
status1
:=
createStatusSearchInfo
(
params
,
'1'
);
...
@@ -365,18 +339,26 @@ begin
...
@@ -365,18 +339,26 @@ begin
whereSQL
:=
'from orders o join customers c on '
+
whereSQL
:=
'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 where 0 = 0'
;
'c.CUSTOMER_ID = o.COMPANY_ID left join qb_sales_orders qb on qb.ORDER_ID = o.ORDER_ID where 0 = 0'
;
if
status1
.
filterType
<>
''
then
if
(
(
status1
.
filterType
<>
''
)
and
(
status1
.
filterType
<>
'NONE'
)
)
then
whereSQL
:=
whereSQL
+
generateStatusWhereSQL
(
status1
);
whereSQL
:=
whereSQL
+
generateStatusWhereSQL
(
status1
);
if
status2
.
filterType
<>
''
then
if
(
(
status2
.
filterType
<>
''
)
and
(
status2
.
filterType
<>
'NONE'
)
)
then
whereSQL
:=
whereSQL
+
generateStatusWhereSQL
(
status2
);
whereSQL
:=
whereSQL
+
generateStatusWhereSQL
(
status2
);
if
(
(
fieldType
<>
''
)
and
(
search
<>
''
)
)
then
if
(
(
orderType
<>
''
)
and
(
orderType
<>
'any'
)
)
then
whereSQL
:=
whereSQL
+
' AND '
+
generateSearchSQL
(
fieldType
,
search
);
if
orderType
<>
''
then
whereSQL
:=
whereSQL
+
' AND o.ORDER_TYPE = '
+
quotedStr
(
orderType
+
'_plate'
);
whereSQL
:=
whereSQL
+
' AND o.ORDER_TYPE = '
+
quotedStr
(
orderType
+
'_plate'
);
if
orderID
<>
''
then
whereSQL
:=
whereSQL
+
' AND o.ORDER_ID = '
+
orderID
;
if
companyID
<>
''
then
whereSQL
:=
whereSQL
+
' AND c.CUSTOMER_ID = '
+
companyID
;
if
jobName
<>
''
then
whereSQL
:=
whereSQL
+
' AND o.JOB_NAME = '
+
quotedStr
(
jobName
);
orderBySQL
:=
'ORDER BY '
+
OrderBy
;
orderBySQL
:=
'ORDER BY '
+
OrderBy
;
SQL
:=
SQL
+
'o.PRICE, qb.QB_REF_NUM '
+
whereSQL
+
' '
+
orderBySQL
+
' LIMIT '
+
limit
+
' OFFSET '
+
offset
;
SQL
:=
SQL
+
'o.PRICE, qb.QB_REF_NUM '
+
whereSQL
+
' '
+
orderBySQL
+
' LIMIT '
+
limit
+
' OFFSET '
+
offset
;
...
...
kgOrdersServer/kgOrdersServer.ini
View file @
afced290
[Settings]
[Settings]
MemoLogLevel
=
4
MemoLogLevel
=
4
FileLogLevel
=
5
FileLogLevel
=
5
LogFileNum
=
1
4
5
LogFileNum
=
1
5
5
webClientVersion
=
1.0.0
webClientVersion
=
1.0.0
[Database]
[Database]
...
...
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