Commit 86de47e4 by cam

Made some changes discussed earlier

removed none from database, AddOrder table no longer changes on scroll, and hide filters now removes filters( we may want to add a seperate clear filters button instead )
parent 7b98cc6e
...@@ -9,13 +9,13 @@ uses ...@@ -9,13 +9,13 @@ uses
VCL.TMSFNCGridOptions, Vcl.Controls, VCL.TMSFNCCustomControl, VCL.TMSFNCGridOptions, Vcl.Controls, VCL.TMSFNCCustomControl,
VCL.TMSFNCCustomScrollControl, VCL.TMSFNCGridData, VCL.TMSFNCCustomGrid, VCL.TMSFNCCustomScrollControl, VCL.TMSFNCGridData, VCL.TMSFNCCustomGrid,
VCL.TMSFNCGrid, Vcl.StdCtrls, WEBLib.StdCtrls, XData.Web.Client, Data.DB, VCL.TMSFNCGrid, Vcl.StdCtrls, WEBLib.StdCtrls, XData.Web.Client, Data.DB,
XData.Web.JsonDataset, XData.Web.Dataset, WEBLib.DB, ConnectionModule; XData.Web.JsonDataset, XData.Web.Dataset, WEBLib.DB, ConnectionModule,
WEBLib.ExtCtrls;
type type
TFAddOrder = class(TWebForm) TFAddOrder = class(TWebForm)
edtSearch: TWebEdit; edtSearch: TWebEdit;
edtID: TWebEdit; edtID: TWebEdit;
TMSFNCGrid1: TTMSFNCGrid;
cbCorrugatedPlate: TWebCheckBox; cbCorrugatedPlate: TWebCheckBox;
cbWebPlate: TWebCheckBox; cbWebPlate: TWebCheckBox;
btnCancel: TWebButton; btnCancel: TWebButton;
...@@ -29,13 +29,15 @@ type ...@@ -29,13 +29,15 @@ type
xdwdsCustomersSHORT_NAME: TStringField; xdwdsCustomersSHORT_NAME: TStringField;
wdsCustomers: TWebDataSource; wdsCustomers: TWebDataSource;
xdwdsCustomersADDRESS: TStringField; xdwdsCustomersADDRESS: TStringField;
WebPanel1: TWebPanel;
TMSFNCGrid1: TTMSFNCGrid;
procedure WebFormShow(Sender: TObject); procedure WebFormShow(Sender: TObject);
procedure TMSFNCGrid1SelectedCell(Sender: TObject; ACol, ARow: Integer);
procedure edtSearchChange(Sender: TObject); procedure edtSearchChange(Sender: TObject);
procedure cbCorrugatedPlateClick(Sender: TObject); procedure cbCorrugatedPlateClick(Sender: TObject);
procedure cbWebPlateClick(Sender: TObject); procedure cbWebPlateClick(Sender: TObject);
procedure btnConfirmClick(Sender: TObject); procedure btnConfirmClick(Sender: TObject);
procedure btnCancelClick(Sender: TObject); procedure btnCancelClick(Sender: TObject);
procedure TMSFNCGrid1CellClick(Sender: TObject; ACol, ARow: Integer);
private private
[async] procedure getCustomers; [async] procedure getCustomers;
procedure PopulateGridManually; procedure PopulateGridManually;
...@@ -43,6 +45,8 @@ type ...@@ -43,6 +45,8 @@ type
{ Private declarations } { Private declarations }
public public
{ Public declarations } { Public declarations }
var
confirm: boolean;
end; end;
var var
...@@ -61,10 +65,13 @@ end; ...@@ -61,10 +65,13 @@ end;
procedure TFAddOrder.btnConfirmClick(Sender: TObject); procedure TFAddOrder.btnConfirmClick(Sender: TObject);
begin begin
Close; Close;
confirm := true;
console.log(edtID.Text);
end; end;
procedure TFAddOrder.WebFormShow(Sender: TObject); procedure TFAddOrder.WebFormShow(Sender: TObject);
begin begin
confirm := false;
getCustomers(); getCustomers();
end; end;
...@@ -146,8 +153,7 @@ end; ...@@ -146,8 +153,7 @@ end;
procedure TFAddOrder.TMSFNCGrid1SelectedCell(Sender: TObject; ACol, procedure TFAddOrder.TMSFNCGrid1CellClick(Sender: TObject; ACol, ARow: Integer);
ARow: Integer);
begin begin
edtID.Text := TMSFNCGrid1.Cells[0, ARow]; edtID.Text := TMSFNCGrid1.Cells[0, ARow];
end; end;
......
...@@ -205,9 +205,11 @@ end; ...@@ -205,9 +205,11 @@ end;
procedure TFViewMain.ShowForm(AFormClass: TWebFormClass); procedure TFViewMain.ShowForm(AFormClass: TWebFormClass);
begin begin
console.log('ShowForm' + AFormClass.ClassName);
if Assigned(FChildForm) then if Assigned(FChildForm) then
FChildForm.Free; FChildForm.Free;
Application.CreateForm(AFormClass, WebPanel1.ElementID, FChildForm); Application.CreateForm(AFormClass, WebPanel1.ElementID, FChildForm);
console.log(WebPanel1.ElementID);
end; end;
procedure TFViewMain.EditUser(Mode, Username, Password, Name, Status, Email, procedure TFViewMain.EditUser(Mode, Username, Password, Name, Status, Email,
...@@ -232,6 +234,7 @@ begin ...@@ -232,6 +234,7 @@ begin
lblAppTitle.Caption := 'Koehler-Gibson Order Entry'; lblAppTitle.Caption := 'Koehler-Gibson Order Entry';
if Assigned(FChildForm) then if Assigned(FChildForm) then
FChildForm.Free; FChildForm.Free;
console.log('hit');
FChildForm := TFOrderEntry.CreateForm(WebPanel1.ElementID, orderInfo, customerInfo, mode); FChildForm := TFOrderEntry.CreateForm(WebPanel1.ElementID, orderInfo, customerInfo, mode);
end; end;
......
...@@ -370,11 +370,13 @@ var ...@@ -370,11 +370,13 @@ var
localMode: string; localMode: string;
begin begin
localMode := mode; localMode := mode;
console.log('') ;
Application.CreateForm(TFOrderEntry, AElementID, Result, Application.CreateForm(TFOrderEntry, AElementID, Result,
procedure(AForm: TObject) procedure(AForm: TObject)
begin begin
with TFOrderEntry(AForm) do with TFOrderEntry(AForm) do
begin begin
console.log('');
HideNotification; HideNotification;
TFOrderEntry(AForm).customerID := customerInfo; TFOrderEntry(AForm).customerID := customerInfo;
TFOrderEntry(AForm).orderID := orderInfo; TFOrderEntry(AForm).orderID := orderInfo;
...@@ -382,7 +384,7 @@ begin ...@@ -382,7 +384,7 @@ begin
end; end;
end end
); );
console.log('')
end; end;
procedure TFOrderEntry.addColorRow(num: string; Color: string; LPI: string; Size: string); procedure TFOrderEntry.addColorRow(num: string; Color: string; LPI: string; Size: string);
......
...@@ -148,50 +148,6 @@ object FViewOrders: TFViewOrders ...@@ -148,50 +148,6 @@ object FViewOrders: TFViewOrders
TabStop = False TabStop = False
Text = '' Text = ''
end end
object pnlMessage: TWebPanel
Left = 82
Top = 352
Width = 125
Height = 33
ElementClassName = 'card'
ElementID = 'pnl_message'
ChildOrder = 5
ElementBodyClassName = 'card-body'
ElementFont = efCSS
ElementPosition = epRelative
Role = 'alert'
TabOrder = 7
object lblMessage: TWebLabel
Left = 32
Top = 11
Width = 42
Height = 13
Caption = 'Message'
ElementID = 'pnl_message'
ElementFont = efCSS
ElementPosition = epRelative
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object btnCloseNotification: TWebButton
Left = 96
Top = 3
Width = 22
Height = 25
ChildOrder = 1
ElementClassName = 'btn btn-light'
ElementID = 'view.login.message.button'
ElementFont = efCSS
ElementPosition = epRelative
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
Role = 'button'
WidthStyle = ssAuto
WidthPercent = 100.000000000000000000
OnClick = btnCloseNotificationClick
end
end
object WebButton1: TWebButton object WebButton1: TWebButton
Left = 188 Left = 188
Top = 79 Top = 79
...@@ -222,6 +178,44 @@ object FViewOrders: TFViewOrders ...@@ -222,6 +178,44 @@ object FViewOrders: TFViewOrders
TabStop = False TabStop = False
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object pnlMessage: TWebPanel
Left = 52
Top = 248
Width = 121
Height = 33
ElementClassName = 'card'
ElementID = 'view.login.message'
ChildOrder = 17
ElementBodyClassName = 'card-body'
ElementFont = efCSS
TabOrder = 9
object lblMessage: TWebLabel
Left = 16
Top = 11
Width = 42
Height = 13
Caption = 'Message'
ElementID = 'view.login.message.label'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object btnCloseNotification: TWebButton
Left = 96
Top = 3
Width = 22
Height = 25
ChildOrder = 1
ElementClassName = 'btn btn-light'
ElementID = 'view.login.message.button'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnCloseNotificationClick
end
end
object XDataWebClient1: TXDataWebClient object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection Connection = DMConnection.ApiConnection
Left = 28 Left = 28
...@@ -285,6 +279,9 @@ object FViewOrders: TFViewOrders ...@@ -285,6 +279,9 @@ object FViewOrders: TFViewOrders
object XDataWebDataSet1orderType: TStringField object XDataWebDataSet1orderType: TStringField
FieldName = 'orderType' FieldName = 'orderType'
end end
object XDataWebDataSet1SQL: TStringField
FieldName = 'SQL'
end
end end
object WebDataSource1: TWebDataSource object WebDataSource1: TWebDataSource
DataSet = XDataWebDataSet1 DataSet = XDataWebDataSet1
......
<div class="container vh-100 d-flex flex-column pb-5" style="max-width: 80%;"> <!-- <div class="container vh-100 d-flex flex-column pb-5" style="max-width: 80%;"> -->
<!-- Alert Section --> <!-- Alert Section -->
<div class="row"> <div class="row justify-content-center">
<div class="col-sm"> <div class="col-12 col-md-8">
<div id="pnl_message" class="alert alert-danger"> <div class="row">
<button id="view.login.message.button" type="button" class="btn-close" aria-label="Close"></button> <div class=col-sm>
<span id="view.login.message.label"></span> <div id="view.login.message" class="alert alert-danger">
</div> <button id="view.login.message.button" type="button" class="btn-close" aria-label="Close"></button>
</div> <span id="view.login.message.label"></span>
</div>
</div>
</div>
</div>
</div> </div>
<!-- Filters Section --> <!-- Filters Section -->
...@@ -125,5 +129,4 @@ ...@@ -125,5 +129,4 @@
</div> </div>
</div> </div>
</div> </div>
</div>
...@@ -13,7 +13,7 @@ uses ...@@ -13,7 +13,7 @@ uses
WEBLib.Forms, WEBLib.Dialogs, WEBLib.Menus, WEBLib.ExtCtrls, WEBLib.StdCtrls, WEBLib.Forms, WEBLib.Dialogs, WEBLib.Menus, WEBLib.ExtCtrls, WEBLib.StdCtrls,
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,
XData.Web.JsonDataset, WEBLib.DB, Data.DB, XData.Web.Dataset, View.AddOrder; XData.Web.JsonDataset, WEBLib.DB, Data.DB, XData.Web.Dataset;
type type
TFViewOrders = class(TWebForm) TFViewOrders = class(TWebForm)
...@@ -46,9 +46,6 @@ type ...@@ -46,9 +46,6 @@ type
XDataWebDataSet1plateDue: TStringField; XDataWebDataSet1plateDue: TStringField;
XDataWebDataSet1plateDone: TStringField; XDataWebDataSet1plateDone: TStringField;
XDataWebDataSet1orderType: TStringField; XDataWebDataSet1orderType: TStringField;
pnlMessage: TWebPanel;
lblMessage: TWebLabel;
btnCloseNotification: TWebButton;
WebButton1: TWebButton; WebButton1: TWebButton;
WebButton2: TWebButton; WebButton2: TWebButton;
wdsCustomers: TWebDataSource; wdsCustomers: TWebDataSource;
...@@ -59,6 +56,10 @@ type ...@@ -59,6 +56,10 @@ type
xdwdsSave: TXDataWebDataSet; xdwdsSave: TXDataWebDataSet;
wdsSave: TWebDataSource; wdsSave: TWebDataSource;
xdwdsSaveCURR_ID: TIntegerField; xdwdsSaveCURR_ID: TIntegerField;
pnlMessage: TWebPanel;
lblMessage: TWebLabel;
btnCloseNotification: TWebButton;
XDataWebDataSet1SQL: TStringField;
procedure WebFormCreate(Sender: TObject); procedure WebFormCreate(Sender: TObject);
procedure btnApplyClick(Sender: TObject); procedure btnApplyClick(Sender: TObject);
procedure btnSearchClick(Sender: TObject); procedure btnSearchClick(Sender: TObject);
...@@ -101,7 +102,7 @@ var ...@@ -101,7 +102,7 @@ var
implementation implementation
uses uses
XData.Model.Classes, View.Main; XData.Model.Classes, View.Main, View.AddOrder;
{$R *.dfm} {$R *.dfm}
...@@ -179,8 +180,12 @@ begin ...@@ -179,8 +180,12 @@ begin
newform.ShowModal( newform.ShowModal(
procedure(AValue: TModalResult) procedure(AValue: TModalResult)
begin begin
if newform.edtID.Text <> '' then console.log(newForm.edtID.Text);
orderEntry('', newForm.edtID.Text, 'ADD'); if newform.confirm then
begin
if newform.edtID.Text <> '' then
orderEntry('', newForm.edtID.Text, 'ADD');
end;
end end
); );
end; end;
...@@ -214,7 +219,7 @@ begin ...@@ -214,7 +219,7 @@ begin
Cell := TJSHTMLElement(document.createElement('td')); Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Order ID'); Cell.setAttribute('data-label', 'Order ID');
if XDataWebDataSet1ID.Value = '' then if XDataWebDataSet1ID.Value = '' then
Cell.innerText := 'None' //Cell.innerText := 'None'
else else
Cell.innerText := XDataWebDataSet1ID.Value; Cell.innerText := XDataWebDataSet1ID.Value;
NewRow.appendChild(Cell); NewRow.appendChild(Cell);
...@@ -223,7 +228,7 @@ begin ...@@ -223,7 +228,7 @@ begin
Cell := TJSHTMLElement(document.createElement('td')); Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Company Name'); Cell.setAttribute('data-label', 'Company Name');
if XDataWebDataSet1companyName.Value = '' then if XDataWebDataSet1companyName.Value = '' then
Cell.innerText := 'None' //Cell.innerText := 'None'
else else
Cell.innerText := XDataWebDataSet1companyName.Value; Cell.innerText := XDataWebDataSet1companyName.Value;
NewRow.appendChild(Cell); NewRow.appendChild(Cell);
...@@ -232,7 +237,7 @@ begin ...@@ -232,7 +237,7 @@ begin
Cell := TJSHTMLElement(document.createElement('td')); Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Job Name'); Cell.setAttribute('data-label', 'Job Name');
if XDataWebDataSet1jobName.Value = '' then if XDataWebDataSet1jobName.Value = '' then
Cell.innerText := 'None' //Cell.innerText := 'None'
else else
Cell.innerText := XDataWebDataSet1jobName.Value; Cell.innerText := XDataWebDataSet1jobName.Value;
NewRow.appendChild(Cell); NewRow.appendChild(Cell);
...@@ -241,7 +246,7 @@ begin ...@@ -241,7 +246,7 @@ begin
Cell := TJSHTMLElement(document.createElement('td')); Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Order Date'); Cell.setAttribute('data-label', 'Order Date');
if XDataWebDataSet1orderDate.Value = '' then if XDataWebDataSet1orderDate.Value = '' then
Cell.innerText := 'None' //Cell.innerText := 'None'
else else
Cell.innerText := XDataWebDataSet1orderDate.Value; Cell.innerText := XDataWebDataSet1orderDate.Value;
NewRow.appendChild(Cell); NewRow.appendChild(Cell);
...@@ -250,7 +255,7 @@ begin ...@@ -250,7 +255,7 @@ begin
Cell := TJSHTMLElement(document.createElement('td')); Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Proof Due'); Cell.setAttribute('data-label', 'Proof Due');
if XDataWebDataSet1proofDue.Value = '' then if XDataWebDataSet1proofDue.Value = '' then
Cell.innerText := 'None' //Cell.innerText := 'None'
else else
Cell.innerText := XDataWebDataSet1proofDue.Value; Cell.innerText := XDataWebDataSet1proofDue.Value;
NewRow.appendChild(Cell); NewRow.appendChild(Cell);
...@@ -259,7 +264,7 @@ begin ...@@ -259,7 +264,7 @@ begin
Cell := TJSHTMLElement(document.createElement('td')); Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Proof Done'); Cell.setAttribute('data-label', 'Proof Done');
if XDataWebDataSet1proofDone.Value = '' then if XDataWebDataSet1proofDone.Value = '' then
Cell.innerText := 'None' //Cell.innerText := 'None'
else else
Cell.innerText := XDataWebDataSet1proofDone.Value; Cell.innerText := XDataWebDataSet1proofDone.Value;
NewRow.appendChild(Cell); NewRow.appendChild(Cell);
...@@ -268,7 +273,7 @@ begin ...@@ -268,7 +273,7 @@ begin
Cell := TJSHTMLElement(document.createElement('td')); Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Art Due'); Cell.setAttribute('data-label', 'Art Due');
if XDataWebDataSet1artDue.Value = '' then if XDataWebDataSet1artDue.Value = '' then
Cell.innerText := 'None' //Cell.innerText := 'None'
else else
Cell.innerText := XDataWebDataSet1artDue.Value; Cell.innerText := XDataWebDataSet1artDue.Value;
NewRow.appendChild(Cell); NewRow.appendChild(Cell);
...@@ -277,7 +282,7 @@ begin ...@@ -277,7 +282,7 @@ begin
Cell := TJSHTMLElement(document.createElement('td')); Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Art Done'); Cell.setAttribute('data-label', 'Art Done');
if XDataWebDataSet1artDone.Value = '' then if XDataWebDataSet1artDone.Value = '' then
Cell.innerText := 'None' //Cell.innerText := 'None'
else else
Cell.innerText := XDataWebDataSet1artDone.Value; Cell.innerText := XDataWebDataSet1artDone.Value;
NewRow.appendChild(Cell); NewRow.appendChild(Cell);
...@@ -286,7 +291,7 @@ begin ...@@ -286,7 +291,7 @@ begin
Cell := TJSHTMLElement(document.createElement('td')); Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Plate Due'); Cell.setAttribute('data-label', 'Plate Due');
if XDataWebDataSet1plateDue.Value = '' then if XDataWebDataSet1plateDue.Value = '' then
Cell.innerText := 'None' //Cell.innerText := 'None'
else else
Cell.innerText := XDataWebDataSet1plateDue.Value; Cell.innerText := XDataWebDataSet1plateDue.Value;
NewRow.appendChild(Cell); NewRow.appendChild(Cell);
...@@ -295,7 +300,7 @@ begin ...@@ -295,7 +300,7 @@ begin
Cell := TJSHTMLElement(document.createElement('td')); Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Plate Done'); Cell.setAttribute('data-label', 'Plate Done');
if XDataWebDataSet1plateDone.Value = '' then if XDataWebDataSet1plateDone.Value = '' then
Cell.innerText := 'None' //Cell.innerText := 'None'
else else
Cell.innerText := XDataWebDataSet1plateDone.Value; Cell.innerText := XDataWebDataSet1plateDone.Value;
NewRow.appendChild(Cell); NewRow.appendChild(Cell);
...@@ -304,7 +309,7 @@ begin ...@@ -304,7 +309,7 @@ begin
Cell := TJSHTMLElement(document.createElement('td')); Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Mount Due'); Cell.setAttribute('data-label', 'Mount Due');
if XDataWebDataSet1mountDue.Value = '' then if XDataWebDataSet1mountDue.Value = '' then
Cell.innerText := 'None' //Cell.innerText := 'None'
else else
Cell.innerText := XDataWebDataSet1mountDue.Value; Cell.innerText := XDataWebDataSet1mountDue.Value;
NewRow.appendChild(Cell); NewRow.appendChild(Cell);
...@@ -313,7 +318,7 @@ begin ...@@ -313,7 +318,7 @@ begin
Cell := TJSHTMLElement(document.createElement('td')); Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Mount Done'); Cell.setAttribute('data-label', 'Mount Done');
if XDataWebDataSet1mountDone.Value = '' then if XDataWebDataSet1mountDone.Value = '' then
Cell.innerText := 'None' //Cell.innerText := 'None'
else else
Cell.innerText := XDataWebDataSet1mountDone.Value; Cell.innerText := XDataWebDataSet1mountDone.Value;
NewRow.appendChild(Cell); NewRow.appendChild(Cell);
...@@ -322,7 +327,7 @@ begin ...@@ -322,7 +327,7 @@ begin
Cell := TJSHTMLElement(document.createElement('td')); Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Ship Due'); Cell.setAttribute('data-label', 'Ship Due');
if XDataWebDataSet1shipDue.Value = '' then if XDataWebDataSet1shipDue.Value = '' then
Cell.innerText := 'None' //Cell.innerText := 'None'
else else
Cell.innerText := XDataWebDataSet1shipDue.Value; Cell.innerText := XDataWebDataSet1shipDue.Value;
NewRow.appendChild(Cell); NewRow.appendChild(Cell);
...@@ -340,7 +345,7 @@ begin ...@@ -340,7 +345,7 @@ begin
Cell := TJSHTMLElement(document.createElement('td')); Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Price'); Cell.setAttribute('data-label', 'Price');
if XDataWebDataSet1price.Value = '' then if XDataWebDataSet1price.Value = '' then
Cell.innerText := 'None' //Cell.innerText := 'None'
else else
Cell.innerText := XDataWebDataSet1price.Value; Cell.innerText := XDataWebDataSet1price.Value;
NewRow.appendChild(Cell); NewRow.appendChild(Cell);
...@@ -349,7 +354,7 @@ begin ...@@ -349,7 +354,7 @@ begin
Cell := TJSHTMLElement(document.createElement('td')); Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Quickbooks Reference Number'); Cell.setAttribute('data-label', 'Quickbooks Reference Number');
if XDataWebDataSet1qbRefNum.Value = '' then if XDataWebDataSet1qbRefNum.Value = '' then
Cell.innerText := 'None' //Cell.innerText := 'None'
else else
Cell.innerText := XDataWebDataSet1qbRefNum.Value; Cell.innerText := XDataWebDataSet1qbRefNum.Value;
NewRow.appendChild(Cell); NewRow.appendChild(Cell);
...@@ -599,6 +604,7 @@ begin ...@@ -599,6 +604,7 @@ begin
XDataWebDataSet1.Close; XDataWebDataSet1.Close;
XDataWebDataSet1.SetJsonData(orderList['data']); XDataWebDataSet1.SetJsonData(orderList['data']);
XDataWebDataSet1.Open; XDataWebDataSet1.Open;
console.log(XDataWebDataSet1SQL.AsString);
asm asm
setTimeout(endSpinner, 2000); setTimeout(endSpinner, 2000);
end; end;
...@@ -644,20 +650,26 @@ procedure TFViewOrders.btnApplyClick(Sender: TObject); ...@@ -644,20 +650,26 @@ procedure TFViewOrders.btnApplyClick(Sender: TObject);
var var
searchOptions: string; searchOptions: string;
begin begin
PageNumber := 1; if wcbSortBy.Text <> '' then
PageSize := 50; begin
OrderBy := wcbSortBy.Text; PageNumber := 1;
searchOptions := '&pagenumber=' + IntToStr(PageNumber) + PageSize := 50;
'&pagesize=' + IntToStr(PageSize) + OrderBy := wcbSortBy.Text;
'&orderby=' + OrderBy + searchOptions := '&pagenumber=' + IntToStr(PageNumber) +
'&startDate=' + FormatDateTime('yyyy/mm/dd', dtpStartDate.Date) + '&pagesize=' + IntToStr(PageSize) +
'&endDate=' + FormatDateTime('yyyy/mm/dd', dtpEndDate.Date) + '&orderby=' + OrderBy +
'&filterType=' + wcbSortBy.Text; '&startDate=' + FormatDateTime('yyyy/mm/dd', dtpStartDate.Date) +
GetOrders(searchOptions); '&endDate=' + FormatDateTime('yyyy/mm/dd', dtpEndDate.Date) +
'&filterType=' + wcbSortBy.Text;
GetOrders(searchOptions);
end
else
ShowNotification('Failure: Please Select a Status Type');
end; end;
procedure TFViewOrders.btnCloseNotificationClick(Sender: TObject); procedure TFViewOrders.btnCloseNotificationClick(Sender: TObject);
begin begin
console.log('hit');
HideNotification(); HideNotification();
end; end;
...@@ -681,6 +693,10 @@ begin ...@@ -681,6 +693,10 @@ begin
begin begin
btnFilters.Caption := 'Show Filters'; btnFilters.Caption := 'Show Filters';
filterSection := TJSHTMLElement(document.getElementById('filter_info')); filterSection := TJSHTMLElement(document.getElementById('filter_info'));
{edtSearch.Text := '';
dtpStartDate.Date := 0;
dtpEndDate.Date := 0; }
getOrders(generateSearchOptions());
if Assigned(filterSection) then if Assigned(filterSection) then
filterSection.style.setProperty('display', 'none'); filterSection.style.setProperty('display', 'none');
end; end;
...@@ -754,16 +770,35 @@ end; ...@@ -754,16 +770,35 @@ end;
procedure TFViewOrders.HideNotification; procedure TFViewOrders.HideNotification;
begin begin
console.log('hit');
pnlMessage.ElementHandle.hidden := True; pnlMessage.ElementHandle.hidden := True;
info := ''; info := '';
end; end;
procedure TFViewOrders.ShowNotification(Notification: string); procedure TFViewOrders.ShowNotification(Notification: string);
var
splitNotification: TArray<string>;
begin begin
if Notification <> '' then if Notification <> '' then
begin begin
console.log('hit'); splitNotification := Notification.Split([':']);
lblMessage.Caption := Notification; if(splitNotification[0] = 'Success') then
begin
asm
var messageDiv = document.getElementById('view.login.message');
messageDiv.classList.remove('alert-danger');
messageDiv.classList.add('alert-success');
end;
end
else
begin
asm
var messageDiv = document.getElementById('view.login.message');
messageDiv.classList.remove('alert-success');
messageDiv.classList.add('alert-danger');
end;
end;
lblMessage.Caption := splitNotification[1];
pnlMessage.ElementHandle.hidden := False; pnlMessage.ElementHandle.hidden := False;
end; end;
end; end;
......
...@@ -67,5 +67,5 @@ begin ...@@ -67,5 +67,5 @@ begin
Application.MainFormOnTaskbar := True; Application.MainFormOnTaskbar := True;
Application.CreateForm(TDMConnection, DMConnection); Application.CreateForm(TDMConnection, DMConnection);
DMConnection.InitApp(@StartApplication, @UnauthorizedAccessProc); DMConnection.InitApp(@StartApplication, @UnauthorizedAccessProc);
//Application.Run; Application.Run;
end. end.
...@@ -94,7 +94,6 @@ ...@@ -94,7 +94,6 @@
<AppDPIAwarenessMode>PerMonitor</AppDPIAwarenessMode> <AppDPIAwarenessMode>PerMonitor</AppDPIAwarenessMode>
<TMSUseJSDebugger>2</TMSUseJSDebugger> <TMSUseJSDebugger>2</TMSUseJSDebugger>
<TMSWebSingleInstance>1</TMSWebSingleInstance> <TMSWebSingleInstance>1</TMSWebSingleInstance>
<TMSWebBrowser>5</TMSWebBrowser>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''"> <PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols> <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
......
...@@ -259,11 +259,13 @@ begin ...@@ -259,11 +259,13 @@ begin
begin begin
SQL := 'SELECT o.ORDER_ID, o.LOCATION AS Loc, c.NAME AS COMPANY_NAME, o.JOB_NAME, o.ORDER_DATE, o.ORDER_TYPE, ' SQL := 'SELECT o.ORDER_ID, o.LOCATION AS Loc, c.NAME AS COMPANY_NAME, o.JOB_NAME, o.ORDER_DATE, o.ORDER_TYPE, '
end; end;
SQL := SQL + generateSubquery(filterType, statusType, 'PROOF'); SQL := SQL + generateSubquery(filterType, statusType, 'PROOF');
SQL := SQL + generateSubquery(filterType, statusType, 'ART'); SQL := SQL + generateSubquery(filterType, statusType, 'ART');
SQL := SQL + generateSubquery(filterType, statusType, 'PLATE'); SQL := SQL + generateSubquery(filterType, statusType, 'PLATE');
SQL := SQL + generateSubquery(filterType, statusType, 'MOUNT'); SQL := SQL + generateSubquery(filterType, statusType, 'MOUNT');
SQL := SQL + generateSubquery(filterType, statusType, 'SHIP'); SQL := SQL + generateSubquery(filterType, statusType, 'SHIP');
if filterType <> '' then if filterType <> '' then
begin begin
whereSQL := 'FROM orders o join ' + statusTableLong + ' ' + statusTableShort + whereSQL := 'FROM orders o join ' + statusTableLong + ' ' + statusTableShort +
...@@ -272,8 +274,12 @@ begin ...@@ -272,8 +274,12 @@ begin
'qb_sales_orders qb on qb.ORDER_ID = o.ORDER_ID ' + 'qb_sales_orders qb on qb.ORDER_ID = o.ORDER_ID ' +
'WHERE ' + statusTableShort + '.ORDER_ID = o.ORDER_ID AND + ' + 'WHERE ' + statusTableShort + '.ORDER_ID = o.ORDER_ID AND + ' +
statusTableShort + '.ORDER_STATUS = '+ quotedStr(statusType) + statusTableShort + '.ORDER_STATUS = '+ quotedStr(statusType) +
' AND ' + quotedStr(startDate) + ' <= '+ statusTableShort + '.STATUS_DATE AND ' + ' AND ' + quotedStr(startDate) + ' <= '+ statusTableShort + '.STATUS_DATE ';
quotedStr(endDate) + ' >= ' + statusTableShort + '.STATUS_DATE';
if endDate <> '1899/12/30' then
begin
whereSQL := whereSQL + 'AND ' + quotedStr(endDate) + ' >= ' + statusTableShort + '.STATUS_DATE';
end;
SQL := SQL + 'o.PRICE, qb.QB_REF_NUM ' + whereSQL + ' ORDER BY ' + filterType + ' DESC LIMIT ' + limit + ' OFFSET ' + offset; SQL := SQL + 'o.PRICE, qb.QB_REF_NUM ' + whereSQL + ' ORDER BY ' + filterType + ' DESC LIMIT ' + limit + ' OFFSET ' + offset;
end end
...@@ -312,6 +318,7 @@ begin ...@@ -312,6 +318,7 @@ begin
order.price := ordersDB.UniQuery1.FieldByName('PRICE').AsString; order.price := ordersDB.UniQuery1.FieldByName('PRICE').AsString;
order.qbRefNum := ordersDB.UniQuery1.FieldByName('QB_REF_NUM').AsString; order.qbRefNum := ordersDB.UniQuery1.FieldByName('QB_REF_NUM').AsString;
order.orderType := ordersDB.UniQuery1.FieldByName('ORDER_TYPE').AsString; order.orderType := ordersDB.UniQuery1.FieldByName('ORDER_TYPE').AsString;
if ordersDB.UniQuery1.FieldByName('ORDER_TYPE').AsString = 'web_plate' then if ordersDB.UniQuery1.FieldByName('ORDER_TYPE').AsString = 'web_plate' then
begin begin
......
[Settings] [Settings]
MemoLogLevel=4 MemoLogLevel=4
FileLogLevel=5 FileLogLevel=5
LogFileNum=24 LogFileNum=36
webClientVersion=1.0.0 webClientVersion=1.0.0
[Database] [Database]
--Server=192.168.159.132 Server=192.168.159.132
Server=192.168.198.131 --Server=192.168.198.131
--Server=192.168.75.133 --Server=192.168.75.133
--Database= --Database=
--Username= --Username=
......
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