Commit afced290 by cam

Redisigned the search page

parent 9ddc1084
...@@ -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;
......
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
......
...@@ -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 -->
......
...@@ -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;
......
...@@ -7,82 +7,206 @@ object FSearch: TFSearch ...@@ -7,82 +7,206 @@ object FSearch: TFSearch
Font.Name = 'Arial' Font.Name = 'Arial'
Font.Style = [] Font.Style = []
ParentFont = False ParentFont = False
Visible = True
OnShow = WebFormShow OnShow = WebFormShow
object lblStatus1: TWebLabel object lblStatus1: TWebLabel
Left = 18 Left = 8
Top = 44 Top = 422
Width = 43 Width = 47
Height = 14 Height = 14
Caption = 'Status 1:' Caption = 'Status 1:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object lblType1: TWebLabel object lblType1: TWebLabel
Left = 18 Left = 8
Top = 64 Top = 442
Width = 26 Width = 29
Height = 14 Height = 14
Caption = 'Type:' Caption = 'Type:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object lblStartDate1: TWebLabel object lblStartDate1: TWebLabel
Left = 178 Left = 200
Top = 64 Top = 442
Width = 51 Width = 56
Height = 14 Height = 14
Caption = 'Start Date:' Caption = 'Start Date:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object lblEndDate1: TWebLabel object lblEndDate1: TWebLabel
Left = 276 Left = 384
Top = 64 Top = 442
Width = 43 Width = 47
Height = 14 Height = 14
Caption = 'End Date' Caption = 'End Date'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object lblStatus2: TWebLabel object lblStatus2: TWebLabel
Left = 18 Left = 8
Top = 132 Top = 496
Width = 43 Width = 47
Height = 14 Height = 14
Caption = 'Status 2:' Caption = 'Status 2:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object lblType2: TWebLabel object lblType2: TWebLabel
Left = 18 Left = 10
Top = 158 Top = 516
Width = 26 Width = 29
Height = 14 Height = 14
Caption = 'Type:' Caption = 'Type:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object lblStartDate2: TWebLabel object lblStartDate2: TWebLabel
Left = 178 Left = 200
Top = 158 Top = 516
Width = 51 Width = 56
Height = 14 Height = 14
Caption = 'Start Date:' Caption = 'Start Date:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object lblEndDate2: TWebLabel object lblEndDate2: TWebLabel
Left = 276 Left = 384
Top = 158 Top = 516
Width = 43 Width = 47
Height = 14 Height = 14
Caption = 'End Date' Caption = 'End Date'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000
end
object WebLabel1: TWebLabel
Left = 20
Top = 8
Width = 48
Height = 14
Caption = 'Order ID:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000
end
object WebLabel2: TWebLabel
Left = 20
Top = 56
Width = 107
Height = 14
Caption = 'Search Companies:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000
end
object lblCompanyID: TWebLabel
Left = 174
Top = 56
Width = 68
Height = 14
Caption = 'Company ID:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000
end
object WebLabel3: TWebLabel
Left = 8
Top = 368
Width = 57
Height = 14
Caption = 'Job Name:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000
end
object WebLabel4: TWebLabel
Left = 174
Top = 368
Width = 64
Height = 14
Caption = 'Order Type:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object pnlMessage: TWebPanel object pnlMessage: TWebPanel
Left = 102 Left = 92
Top = 515 Top = 637
Width = 121 Width = 121
Height = 33 Height = 33
ElementClassName = 'card' ElementClassName = 'card'
...@@ -94,7 +218,7 @@ object FSearch: TFSearch ...@@ -94,7 +218,7 @@ object FSearch: TFSearch
Role = 'alert' Role = 'alert'
TabOrder = 0 TabOrder = 0
object lblMessage: TWebLabel object lblMessage: TWebLabel
Left = 22 Left = 26
Top = 11 Top = 11
Width = 44 Width = 44
Height = 14 Height = 14
...@@ -124,12 +248,12 @@ object FSearch: TFSearch ...@@ -124,12 +248,12 @@ object FSearch: TFSearch
end end
end end
object wcbFilterType1: TWebComboBox object wcbFilterType1: TWebComboBox
Left = 18 Left = 8
Top = 88 Top = 462
Width = 145 Width = 145
Height = 22 Height = 22
ElementClassName = 'custom-select'
ElementFont = efCSS ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
TabOrder = 4 TabOrder = 4
TabStop = False TabStop = False
...@@ -137,6 +261,7 @@ object FSearch: TFSearch ...@@ -137,6 +261,7 @@ object FSearch: TFSearch
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
ItemIndex = -1 ItemIndex = -1
Items.Strings = ( Items.Strings = (
'NONE'
'PROOF DUE' 'PROOF DUE'
'PROOF DONE' 'PROOF DONE'
'ART DUE' 'ART DUE'
...@@ -149,12 +274,13 @@ object FSearch: TFSearch ...@@ -149,12 +274,13 @@ object FSearch: TFSearch
'SHIP DONE') 'SHIP DONE')
end end
object btnConfirm: TWebButton object btnConfirm: TWebButton
Left = 18 Left = 65
Top = 307 Top = 579
Width = 96 Width = 96
Height = 25 Height = 25
Caption = 'Confirm' Caption = 'Confirm'
ChildOrder = 7 ChildOrder = 7
ElementClassName = 'btn btn-secondary'
ElementFont = efCSS ElementFont = efCSS
HeightStyle = ssAuto HeightStyle = ssAuto
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
...@@ -163,57 +289,76 @@ object FSearch: TFSearch ...@@ -163,57 +289,76 @@ object FSearch: TFSearch
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = btnConfirmClick OnClick = btnConfirmClick
end end
object edtSearch: TWebEdit object edtOrderID: TWebEdit
Left = 180 Left = 20
Top = 264 Top = 28
Width = 121 Width = 145
Height = 22 Height = 22
HelpType = htKeyword HelpType = htKeyword
TabStop = False TabStop = False
ChildOrder = 8 ChildOrder = 8
ElementClassName = 'form-control' ElementClassName = 'form-control'
ElementFont = efCSS ElementFont = efCSS
HeightStyle = ssAuto Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -8
Font.Name = 'Arial'
Font.Style = []
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
HideSelection = False HideSelection = False
ParentFont = False
TabOrder = 1 TabOrder = 1
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object dtpStartDate1: TWebDateTimePicker object dtpStartDate1: TWebDateTimePicker
Left = 178 Left = 200
Top = 88 Top = 462
Width = 85 Width = 127
Height = 22 Height = 22
ElementClassName = 'custom-select'
HeightStyle = ssAuto HeightStyle = ssAuto
BorderStyle = bsSingle BorderStyle = bsSingle
ChildOrder = 7 ChildOrder = 7
Color = clWhite Color = clWhite
Date = 45553.505972858790000000 Date = 45553.505972858790000000
ElementFont = efCSS ElementFont = efCSS
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
Role = '' Role = ''
TabOrder = 2 TabOrder = 2
TabStop = False TabStop = False
Text = '' Text = ''
end end
object dtpEndDate1: TWebDateTimePicker object dtpEndDate1: TWebDateTimePicker
Left = 276 Left = 384
Top = 88 Top = 462
Width = 87 Width = 135
Height = 22 Height = 22
ElementClassName = 'custom-select'
HeightStyle = ssAuto HeightStyle = ssAuto
BorderStyle = bsSingle BorderStyle = bsSingle
ChildOrder = 7 ChildOrder = 7
Color = clWhite Color = clWhite
Date = 45553.505972858790000000 Date = 45553.505972858790000000
ElementFont = efCSS ElementFont = efCSS
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
Role = '' Role = ''
TabOrder = 3 TabOrder = 3
TabStop = False TabStop = False
Text = '' Text = ''
end end
object cbNull1: TWebCheckBox object cbNull1: TWebCheckBox
Left = 384 Left = 566
Top = 88 Top = 462
Width = 185 Width = 185
Height = 22 Height = 22
Caption = 'Only Show Empty' Caption = 'Only Show Empty'
...@@ -221,50 +366,27 @@ object FSearch: TFSearch ...@@ -221,50 +366,27 @@ object FSearch: TFSearch
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object wcbFieldType: TWebComboBox
Left = 18
Top = 264
Width = 145
Height = 22
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
ItemIndex = -1
Items.Strings = (
'Order ID'
'Company Name'
'Company Short Name'
'Job Name')
end
object wcbOrderType: TWebComboBox object wcbOrderType: TWebComboBox
Left = 320 Left = 174
Top = 264 Top = 388
Width = 145 Width = 145
Height = 22 Height = 22
ElementClassName = 'custom-select'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
ItemIndex = -1 ItemIndex = -1
Items.Strings = ( Items.Strings = (
'Corrugated' 'Corrugated'
'Web') 'Web'
end 'Any')
object btnCancel: TWebButton
Left = 144
Top = 307
Width = 96
Height = 25
Caption = 'Cancel'
ChildOrder = 5
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnCancelClick
end end
object wcbFilterType2: TWebComboBox object wcbFilterType2: TWebComboBox
Left = 18 Left = 10
Top = 194 Top = 536
Width = 145 Width = 145
Height = 22 Height = 22
ElementClassName = 'custom-select'
ElementFont = efCSS ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
TabOrder = 4 TabOrder = 4
TabStop = False TabStop = False
...@@ -272,6 +394,7 @@ object FSearch: TFSearch ...@@ -272,6 +394,7 @@ object FSearch: TFSearch
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
ItemIndex = -1 ItemIndex = -1
Items.Strings = ( Items.Strings = (
'NONE'
'PROOF DUE' 'PROOF DUE'
'PROOF DONE' 'PROOF DONE'
'ART DUE' 'ART DUE'
...@@ -284,10 +407,11 @@ object FSearch: TFSearch ...@@ -284,10 +407,11 @@ object FSearch: TFSearch
'SHIP DONE') 'SHIP DONE')
end end
object dtpStartDate2: TWebDateTimePicker object dtpStartDate2: TWebDateTimePicker
Left = 178 Left = 200
Top = 194 Top = 536
Width = 85 Width = 127
Height = 22 Height = 22
ElementClassName = 'custom-select'
HeightStyle = ssAuto HeightStyle = ssAuto
BorderStyle = bsSingle BorderStyle = bsSingle
ChildOrder = 7 ChildOrder = 7
...@@ -300,10 +424,11 @@ object FSearch: TFSearch ...@@ -300,10 +424,11 @@ object FSearch: TFSearch
Text = '' Text = ''
end end
object dtpEndDate2: TWebDateTimePicker object dtpEndDate2: TWebDateTimePicker
Left = 276 Left = 384
Top = 194 Top = 536
Width = 87 Width = 135
Height = 22 Height = 22
ElementClassName = 'custom-select'
HeightStyle = ssAuto HeightStyle = ssAuto
BorderStyle = bsSingle BorderStyle = bsSingle
ChildOrder = 7 ChildOrder = 7
...@@ -316,8 +441,8 @@ object FSearch: TFSearch ...@@ -316,8 +441,8 @@ object FSearch: TFSearch
Text = '' Text = ''
end end
object cbNull2: TWebCheckBox object cbNull2: TWebCheckBox
Left = 384 Left = 566
Top = 194 Top = 536
Width = 185 Width = 185
Height = 22 Height = 22
Caption = 'Only Show Empty' Caption = 'Only Show Empty'
...@@ -325,4 +450,285 @@ object FSearch: TFSearch ...@@ -325,4 +450,285 @@ object FSearch: TFSearch
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object TMSFNCGrid1: TTMSFNCGrid
Left = 20
Top = 112
Width = 865
Height = 233
ParentDoubleBuffered = False
DoubleBuffered = True
TabOrder = 12
DefaultRowHeight = 40.000000000000000000
FixedColumns = 0
ColumnCount = 4
Options.Bands.Enabled = True
Options.ColumnSize.Stretch = True
Options.Editing.CalcFormat = '%g'
Options.Grouping.CalcFormat = '%g'
Options.Grouping.GroupCountFormat = '(%d)'
Options.IO.XMLEncoding = 'ISO-8859-1'
Options.Mouse.ClickMargin = 0
Options.Mouse.ColumnSizeMargin = 6
Options.Mouse.RowSizeMargin = 6
Columns = <
item
BorderWidth = 1
FixedFont.Charset = DEFAULT_CHARSET
FixedFont.Color = 4539717
FixedFont.Height = -11
FixedFont.Name = 'Segoe UI'
FixedFont.Style = [fsBold]
Font.Charset = DEFAULT_CHARSET
Font.Color = 8026746
Font.Height = -11
Font.Name = 'Segoe UI'
Font.Style = []
ID = ''
Width = 70.000000000000000000
end
item
BorderWidth = 1
FixedFont.Charset = DEFAULT_CHARSET
FixedFont.Color = 4539717
FixedFont.Height = -11
FixedFont.Name = 'Segoe UI'
FixedFont.Style = [fsBold]
Font.Charset = DEFAULT_CHARSET
Font.Color = 8026746
Font.Height = -11
Font.Name = 'Segoe UI'
Font.Style = []
ID = ''
Width = 250.000000000000000000
end
item
BorderWidth = 1
FixedFont.Charset = DEFAULT_CHARSET
FixedFont.Color = 4539717
FixedFont.Height = -11
FixedFont.Name = 'Segoe UI'
FixedFont.Style = [fsBold]
Font.Charset = DEFAULT_CHARSET
Font.Color = 8026746
Font.Height = -11
Font.Name = 'Segoe UI'
Font.Style = []
ID = ''
Width = 100.000000000000000000
end
item
BorderWidth = 1
FixedFont.Charset = DEFAULT_CHARSET
FixedFont.Color = 4539717
FixedFont.Height = -11
FixedFont.Name = 'Segoe UI'
FixedFont.Style = [fsBold]
Font.Charset = DEFAULT_CHARSET
Font.Color = 8026746
Font.Height = -11
Font.Name = 'Segoe UI'
Font.Style = []
ID = ''
Width = 426.000000000000000000
end
item
BorderWidth = 1
FixedFont.Charset = DEFAULT_CHARSET
FixedFont.Color = 4539717
FixedFont.Height = -11
FixedFont.Name = 'Segoe UI'
FixedFont.Style = [fsBold]
Font.Charset = DEFAULT_CHARSET
Font.Color = 8026746
Font.Height = -11
Font.Name = 'Segoe UI'
Font.Style = []
ID = ''
Width = 90.000000000000000000
end>
DefaultFont.Charset = DEFAULT_CHARSET
DefaultFont.Color = clWindowText
DefaultFont.Height = -11
DefaultFont.Name = 'Segoe UI'
DefaultFont.Style = []
TopRow = 1
Appearance.FixedLayout.Fill.Color = 16380654
Appearance.FixedLayout.Font.Charset = DEFAULT_CHARSET
Appearance.FixedLayout.Font.Color = 4539717
Appearance.FixedLayout.Font.Height = -13
Appearance.FixedLayout.Font.Name = 'Segoe UI'
Appearance.FixedLayout.Font.Style = [fsBold]
Appearance.NormalLayout.Fill.Color = 16578806
Appearance.NormalLayout.Font.Charset = DEFAULT_CHARSET
Appearance.NormalLayout.Font.Color = 8026746
Appearance.NormalLayout.Font.Height = -11
Appearance.NormalLayout.Font.Name = 'Segoe UI'
Appearance.NormalLayout.Font.Style = []
Appearance.GroupLayout.Fill.Color = 12817262
Appearance.GroupLayout.Font.Charset = DEFAULT_CHARSET
Appearance.GroupLayout.Font.Color = clBlack
Appearance.GroupLayout.Font.Height = -11
Appearance.GroupLayout.Font.Name = 'Segoe UI'
Appearance.GroupLayout.Font.Style = []
Appearance.SummaryLayout.Fill.Color = 14009785
Appearance.SummaryLayout.Font.Charset = DEFAULT_CHARSET
Appearance.SummaryLayout.Font.Color = clBlack
Appearance.SummaryLayout.Font.Height = -11
Appearance.SummaryLayout.Font.Name = 'Segoe UI'
Appearance.SummaryLayout.Font.Style = []
Appearance.SelectedLayout.Fill.Color = 16441019
Appearance.SelectedLayout.Font.Charset = DEFAULT_CHARSET
Appearance.SelectedLayout.Font.Color = 4539717
Appearance.SelectedLayout.Font.Height = -11
Appearance.SelectedLayout.Font.Name = 'Segoe UI'
Appearance.SelectedLayout.Font.Style = []
Appearance.FocusedLayout.Fill.Color = 16039284
Appearance.FocusedLayout.Font.Charset = DEFAULT_CHARSET
Appearance.FocusedLayout.Font.Color = 4539717
Appearance.FocusedLayout.Font.Height = -11
Appearance.FocusedLayout.Font.Name = 'Segoe UI'
Appearance.FocusedLayout.Font.Style = []
Appearance.FixedSelectedLayout.Fill.Color = clLightsteelblue
Appearance.FixedSelectedLayout.Font.Charset = DEFAULT_CHARSET
Appearance.FixedSelectedLayout.Font.Color = clBlack
Appearance.FixedSelectedLayout.Font.Height = -11
Appearance.FixedSelectedLayout.Font.Name = 'Segoe UI'
Appearance.FixedSelectedLayout.Font.Style = []
Appearance.BandLayout.Fill.Color = 16711679
Appearance.BandLayout.Font.Charset = DEFAULT_CHARSET
Appearance.BandLayout.Font.Color = 8026746
Appearance.BandLayout.Font.Height = -11
Appearance.BandLayout.Font.Name = 'Segoe UI'
Appearance.BandLayout.Font.Style = []
Appearance.ProgressLayout.Format = '%.0f%%'
LeftCol = 0
ScrollMode = scmItemScrolling
DesignTimeSampleData = True
OnCellClick = TMSFNCGrid1CellClick
end
object edtSearch: TWebEdit
Left = 20
Top = 76
Width = 145
Height = 22
HelpType = htKeyword
TabStop = False
ChildOrder = 8
ElementClassName = 'form-control'
ElementFont = efCSS
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -8
Font.Name = 'Arial'
Font.Style = []
HeightPercent = 100.000000000000000000
HideSelection = False
ParentFont = False
TabOrder = 1
WidthPercent = 100.000000000000000000
OnChange = edtSearchChange
end
object edtCompanyID: TWebEdit
Left = 174
Top = 76
Width = 145
Height = 22
HelpType = htKeyword
TabStop = False
ChildOrder = 8
ElementClassName = 'form-control'
ElementFont = efCSS
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -8
Font.Name = 'Arial'
Font.Style = []
HeightPercent = 100.000000000000000000
HideSelection = False
ParentFont = False
TabOrder = 1
WidthPercent = 100.000000000000000000
end
object edtJobName: TWebEdit
Left = 8
Top = 388
Width = 145
Height = 22
HelpType = htKeyword
TabStop = False
ChildOrder = 8
ElementClassName = 'form-control'
ElementFont = efCSS
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -8
Font.Name = 'Arial'
Font.Style = []
HeightPercent = 100.000000000000000000
HideSelection = False
ParentFont = False
TabOrder = 1
WidthPercent = 100.000000000000000000
OnChange = edtSearchChange
end
object btnCancel: TWebButton
Left = 171
Top = 579
Width = 96
Height = 25
Caption = 'Cancel'
ChildOrder = 7
ElementClassName = 'btn btn-secondary'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
TabOrder = 5
TabStop = False
WidthPercent = 100.000000000000000000
OnClick = btnCancelClick
end
object btnClear: TWebButton
Left = 279
Top = 579
Width = 96
Height = 25
Caption = 'Clear'
ChildOrder = 7
ElementClassName = 'btn btn-secondary'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
TabOrder = 5
TabStop = False
WidthPercent = 100.000000000000000000
OnClick = btnClearClick
end
object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection
Left = 738
Top = 61
end
object xdwdsCustomers: TXDataWebDataSet
Connection = DMConnection.ApiConnection
Left = 608
Top = 63
object xdwdsCustomersID: TIntegerField
FieldName = 'ID'
end
object xdwdsCustomersNAME: TStringField
FieldName = 'NAME'
end
object xdwdsCustomersSHORT_NAME: TStringField
FieldName = 'SHORT_NAME'
end
object xdwdsCustomersADDRESS: TStringField
FieldName = 'ADDRESS'
Size = 100
end
end
object wdsCustomers: TWebDataSource
DataSet = xdwdsCustomers
Left = 476
Top = 61
end
end end
...@@ -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;
edtSearch: TWebEdit; edtOrderID: 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.
...@@ -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 */
......
...@@ -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;
......
[Settings] [Settings]
MemoLogLevel=4 MemoLogLevel=4
FileLogLevel=5 FileLogLevel=5
LogFileNum=145 LogFileNum=155
webClientVersion=1.0.0 webClientVersion=1.0.0
[Database] [Database]
......
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