Commit f61278c7 by Elias Sarraf

clean up merge brach 'master' into cam2

parent 5af369e8
object FAddOrder: TFAddOrder object FAddOrder: TFAddOrder
Width = 871 Width = 871
Height = 488 Height = 477
OnShow = WebFormShow OnShow = WebFormShow
object WebLabel1: TWebLabel object WebLabel1: TWebLabel
Left = 278 Left = 278
...@@ -239,175 +239,6 @@ object FAddOrder: TFAddOrder ...@@ -239,175 +239,6 @@ object FAddOrder: TFAddOrder
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = btnConfirmClick OnClick = btnConfirmClick
end end
object WebPanel1: TWebPanel
Left = 0
Top = 108
Width = 871
Height = 380
Align = alBottom
ChildOrder = 9
TabOrder = 6
DesignSize = (
871
380)
object TMSFNCGrid1: TTMSFNCGrid
Left = 8
Top = 10
Width = 860
Height = 361
ParentDoubleBuffered = False
Anchors = [akLeft, akTop, akRight, akBottom]
DoubleBuffered = True
TabOrder = 0
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 = 421.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
end
object XDataWebClient1: TXDataWebClient object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection Connection = DMConnection.ApiConnection
Left = 730 Left = 730
......
...@@ -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,15 +29,13 @@ type ...@@ -29,15 +29,13 @@ 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;
...@@ -45,8 +43,6 @@ type ...@@ -45,8 +43,6 @@ type
{ Private declarations } { Private declarations }
public public
{ Public declarations } { Public declarations }
var
confirm: boolean;
end; end;
var var
...@@ -65,13 +61,10 @@ end; ...@@ -65,13 +61,10 @@ 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;
...@@ -153,7 +146,8 @@ end; ...@@ -153,7 +146,8 @@ end;
procedure TFAddOrder.TMSFNCGrid1CellClick(Sender: TObject; ACol, ARow: Integer); procedure TFAddOrder.TMSFNCGrid1SelectedCell(Sender: TObject; ACol,
ARow: Integer);
begin begin
edtID.Text := TMSFNCGrid1.Cells[0, ARow]; edtID.Text := TMSFNCGrid1.Cells[0, ARow];
end; end;
......
...@@ -205,11 +205,9 @@ end; ...@@ -205,11 +205,9 @@ 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,
...@@ -234,7 +232,6 @@ begin ...@@ -234,7 +232,6 @@ 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,13 +370,11 @@ var ...@@ -370,13 +370,11 @@ 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;
...@@ -384,7 +382,7 @@ begin ...@@ -384,7 +382,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,6 +148,50 @@ object FViewOrders: TFViewOrders ...@@ -148,6 +148,50 @@ 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
...@@ -286,44 +330,6 @@ object FViewOrders: TFViewOrders ...@@ -286,44 +330,6 @@ object FViewOrders: TFViewOrders
end> end>
DataSource = wdsOrders DataSource = wdsOrders
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
...@@ -387,9 +393,6 @@ object FViewOrders: TFViewOrders ...@@ -387,9 +393,6 @@ object FViewOrders: TFViewOrders
object xdwdsOrdersorderType: TStringField object xdwdsOrdersorderType: TStringField
FieldName = 'orderType' FieldName = 'orderType'
end end
object XDataWebDataSet1SQL: TStringField
FieldName = 'SQL'
end
end end
object wdsOrders: TWebDataSource object wdsOrders: TWebDataSource
DataSet = xdwdsOrders DataSet = xdwdsOrders
......
<div class="container h-100 d-flex flex-column mt-0" style="max-width: 95%;"> <div class="container h-100 d-flex flex-column mt-0" style="max-width: 95%;">
<!-- Alert Section --> <!-- Alert Section -->
<div class="row justify-content-center"> <div class="row">
<div class="col-12 col-md-8"> <div class="col-sm">
<div class="row"> <div id="pnl_message" class="alert alert-danger">
<div class=col-sm> <button id="view.login.message.button" type="button" class="btn-close" aria-label="Close"></button>
<div id="view.login.message" class="alert alert-danger"> <span id="view.login.message.label"></span>
<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> </div>
<!-- Filters Section --> <!-- Filters Section -->
...@@ -107,4 +103,5 @@ ...@@ -107,4 +103,5 @@
</div> </div>
</div> </div>
</div> </div>
</div>
...@@ -105,7 +105,7 @@ var ...@@ -105,7 +105,7 @@ var
implementation implementation
uses uses
XData.Model.Classes, View.Main, View.AddOrder; XData.Model.Classes, View.Main;
{$R *.dfm} {$R *.dfm}
...@@ -203,12 +203,8 @@ begin ...@@ -203,12 +203,8 @@ begin
newform.ShowModal( newform.ShowModal(
procedure(AValue: TModalResult) procedure(AValue: TModalResult)
begin begin
console.log(newForm.edtID.Text); if newform.edtID.Text <> '' then
if newform.confirm then orderEntry('', newForm.edtID.Text, 'ADD');
begin
if newform.edtID.Text <> '' then
orderEntry('', newForm.edtID.Text, 'ADD');
end;
end end
); );
end; end;
...@@ -459,27 +455,21 @@ procedure TFViewOrders.btnApplyClick(Sender: TObject); ...@@ -459,27 +455,21 @@ procedure TFViewOrders.btnApplyClick(Sender: TObject);
var var
searchOptions: string; searchOptions: string;
begin begin
if wcbSortBy.Text <> '' then PageNumber := 1;
begin PageSize := 50;
PageNumber := 1; OrderBy := wcbSortBy.Text;
PageSize := 50; searchOptions := '&pagenumber=' + IntToStr(PageNumber) +
OrderBy := wcbSortBy.Text; '&pagesize=' + IntToStr(PageSize) +
searchOptions := '&pagenumber=' + IntToStr(PageNumber) + '&orderby=' + OrderBy +
'&pagesize=' + IntToStr(PageSize) + '&startDate=' + FormatDateTime('yyyy/mm/dd', dtpStartDate.Date) +
'&orderby=' + OrderBy + '&endDate=' + FormatDateTime('yyyy/mm/dd', dtpEndDate.Date) +
'&startDate=' + FormatDateTime('yyyy/mm/dd', dtpStartDate.Date) + '&filterType=' + wcbSortBy.Text;
'&endDate=' + FormatDateTime('yyyy/mm/dd', dtpEndDate.Date) + GetOrders(searchOptions);
'&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;
...@@ -505,10 +495,6 @@ begin ...@@ -505,10 +495,6 @@ 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;
...@@ -587,36 +573,17 @@ end; ...@@ -587,36 +573,17 @@ 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
splitNotification := Notification.Split([':']); console.log('hit');
if(splitNotification[0] = 'Success') then lblMessage.Caption := Notification;
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;
......
...@@ -94,6 +94,7 @@ ...@@ -94,6 +94,7 @@
<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>
......
...@@ -373,13 +373,11 @@ begin ...@@ -373,13 +373,11 @@ 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 +
...@@ -388,12 +386,8 @@ begin ...@@ -388,12 +386,8 @@ 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 ' + quotedStr(startDate) + ' <= '+ statusTableShort + '.STATUS_DATE AND ' +
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
...@@ -435,27 +429,14 @@ begin ...@@ -435,27 +429,14 @@ begin
if ordersDB.UniQuery1.FieldByName('ORDER_TYPE').AsString = 'web_plate' then if ordersDB.UniQuery1.FieldByName('ORDER_TYPE').AsString = 'web_plate' then
begin begin
Order := TOrderItem.Create; colorType := 'quantity_and_colors_qty_colors';
TXDataOperationContext.Current.Handler.ManagedObjects.Add( Order ); SQL := 'Select quantity_and_colors_qty_colors from web_plate_orders where order_id = ' + order.ID;
Result.data.Add( Order ); end
order.ID := ordersDB.UniQuery1.FieldByName('ORDER_ID').AsString; else
order.companyName := ordersDB.UniQuery1.FieldByName('COMPANY_NAME').AsString; begin
order.jobName := ordersDB.UniQuery1.FieldByName('JOB_NAME').AsString; colorType := 'colors_colors';
order.orderDate := ordersDB.UniQuery1.FieldByName('ORDER_DATE').AsString; SQL := 'Select colors_colors from corrugated_plate_orders where order_id = ' + order.ID;
order.proofDue := ordersDB.UniQuery1.FieldByName('PROOF_DUE').AsString; end;
order.proofDone := ordersDB.UniQuery1.FieldByName('PROOF_DONE').AsString;
order.artDue := ordersDB.UniQuery1.FieldByName('ART_DUE').AsString;
order.artDone := ordersDB.UniQuery1.FieldByName('ART_DONE').AsString;
order.plateDue := ordersDB.UniQuery1.FieldByName('PLATE_DUE').AsString;
order.plateDone := ordersDB.UniQuery1.FieldByName('PLATE_DONE').AsString;
order.mountDue := ordersDB.UniQuery1.FieldByName('MOUNT_DUE').AsString;
order.mountDone := ordersDB.UniQuery1.FieldByName('MOUNT_DONE').AsString;
order.shipDue := ordersDB.UniQuery1.FieldByName('SHIP_DUE').AsString;
order.shipDone := ordersDB.UniQuery1.FieldByName('SHIP_DONE').AsString;
order.price := ordersDB.UniQuery1.FieldByName('PRICE').AsString;
order.qbRefNum := ordersDB.UniQuery1.FieldByName('QB_REF_NUM').AsString;
order.orderType := ordersDB.UniQuery1.FieldByName('ORDER_TYPE').AsString;
doQuery(ordersDB.UniQuery2, SQL); doQuery(ordersDB.UniQuery2, SQL);
colors := ordersDB.UniQuery2.FieldByName(ColorType).AsString; colors := ordersDB.UniQuery2.FieldByName(ColorType).AsString;
......
[Settings] [Settings]
MemoLogLevel=4 MemoLogLevel=4
FileLogLevel=5 FileLogLevel=5
LogFileNum=30 LogFileNum=31
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