Commit 6ad3395e by cam

benchmark for set status, and cutting die order page

need to clean up set status to match the original program and need to fix cutting die edits not being enabled.
parent c3f1ba54
...@@ -3,7 +3,7 @@ object FAddOrder: TFAddOrder ...@@ -3,7 +3,7 @@ object FAddOrder: TFAddOrder
Height = 477 Height = 477
OnShow = WebFormShow OnShow = WebFormShow
object WebLabel1: TWebLabel object WebLabel1: TWebLabel
Left = 278 Left = 310
Top = 44 Top = 44
Width = 35 Width = 35
Height = 15 Height = 15
...@@ -12,7 +12,7 @@ object FAddOrder: TFAddOrder ...@@ -12,7 +12,7 @@ object FAddOrder: TFAddOrder
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object WebLabel2: TWebLabel object WebLabel2: TWebLabel
Left = 414 Left = 452
Top = 44 Top = 44
Width = 58 Width = 58
Height = 15 Height = 15
...@@ -21,7 +21,7 @@ object FAddOrder: TFAddOrder ...@@ -21,7 +21,7 @@ object FAddOrder: TFAddOrder
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object edtSearch: TWebEdit object edtSearch: TWebEdit
Left = 278 Left = 310
Top = 62 Top = 62
Width = 121 Width = 121
Height = 22 Height = 22
...@@ -30,7 +30,7 @@ object FAddOrder: TFAddOrder ...@@ -30,7 +30,7 @@ object FAddOrder: TFAddOrder
OnChange = edtSearchChange OnChange = edtSearchChange
end end
object edtID: TWebEdit object edtID: TWebEdit
Left = 414 Left = 452
Top = 62 Top = 62
Width = 69 Width = 69
Height = 22 Height = 22
...@@ -196,7 +196,7 @@ object FAddOrder: TFAddOrder ...@@ -196,7 +196,7 @@ object FAddOrder: TFAddOrder
DesignTimeSampleData = True DesignTimeSampleData = True
end end
object cbCorrugatedPlate: TWebCheckBox object cbCorrugatedPlate: TWebCheckBox
Left = 26 Left = 0
Top = 63 Top = 63
Width = 113 Width = 113
Height = 22 Height = 22
...@@ -207,8 +207,8 @@ object FAddOrder: TFAddOrder ...@@ -207,8 +207,8 @@ object FAddOrder: TFAddOrder
OnClick = cbCorrugatedPlateClick OnClick = cbCorrugatedPlateClick
end end
object cbWebPlate: TWebCheckBox object cbWebPlate: TWebCheckBox
Left = 152 Left = 124
Top = 64 Top = 63
Width = 83 Width = 83
Height = 22 Height = 22
Caption = 'Web Plate' Caption = 'Web Plate'
...@@ -239,6 +239,17 @@ object FAddOrder: TFAddOrder ...@@ -239,6 +239,17 @@ object FAddOrder: TFAddOrder
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = btnConfirmClick OnClick = btnConfirmClick
end end
object cbCuttingDie: TWebCheckBox
Left = 221
Top = 63
Width = 83
Height = 22
Caption = 'Cutting Die'
ChildOrder = 3
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = cbCuttingDieClick
end
object XDataWebClient1: TXDataWebClient object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection Connection = DMConnection.ApiConnection
Left = 730 Left = 730
......
...@@ -31,6 +31,7 @@ type ...@@ -31,6 +31,7 @@ type
xdwdsCustomersSHORT_NAME: TStringField; xdwdsCustomersSHORT_NAME: TStringField;
wdsCustomers: TWebDataSource; wdsCustomers: TWebDataSource;
xdwdsCustomersADDRESS: TStringField; xdwdsCustomersADDRESS: TStringField;
cbCuttingDie: TWebCheckBox;
procedure WebFormShow(Sender: TObject); procedure WebFormShow(Sender: TObject);
procedure TMSFNCGrid1SelectedCell(Sender: TObject; ACol, ARow: Integer); procedure TMSFNCGrid1SelectedCell(Sender: TObject; ACol, ARow: Integer);
procedure edtSearchChange(Sender: TObject); procedure edtSearchChange(Sender: TObject);
...@@ -38,6 +39,7 @@ type ...@@ -38,6 +39,7 @@ type
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 cbCuttingDieClick(Sender: TObject);
private private
[async] procedure getCustomers; [async] procedure getCustomers;
procedure PopulateGridManually; procedure PopulateGridManually;
...@@ -76,12 +78,20 @@ end; ...@@ -76,12 +78,20 @@ end;
procedure TFAddOrder.cbCorrugatedPlateClick(Sender: TObject); procedure TFAddOrder.cbCorrugatedPlateClick(Sender: TObject);
begin begin
cbWebPlate.Checked := False; cbWebPlate.Checked := False;
cbCuttingDie.Checked := False;
end;
procedure TFAddOrder.cbCuttingDieClick(Sender: TObject);
begin
cbCorrugatedPlate.Checked := False;
cbWebPlate.Checked := False;
end; end;
procedure TFAddOrder.cbWebPlateClick(Sender: TObject); procedure TFAddOrder.cbWebPlateClick(Sender: TObject);
begin begin
cbCorrugatedPlate.Checked := False; cbCorrugatedPlate.Checked := False;
cbCuttingDie.Checked := False;
end; end;
procedure TFAddOrder.edtSearchChange(Sender: TObject); procedure TFAddOrder.edtSearchChange(Sender: TObject);
......
...@@ -51,7 +51,8 @@ type ...@@ -51,7 +51,8 @@ type
procedure ShowForm( AFormClass: TWebFormClass ); procedure ShowForm( AFormClass: TWebFormClass );
procedure EditUser( Mode, Username, Password, Name, Status, Email, procedure EditUser( Mode, Username, Password, Name, Status, Email,
Access, Rights, Perspective, QB: string); Access, Rights, Perspective, QB: string);
procedure ViewOrderEntry(orderInfo, customerInfo, mode: string); procedure ViewOrderEntryCorrugated(orderInfo, customerInfo, mode: string);
procedure ViewOrderEntryCuttingDie(orderInfo, customerInfo, mode: string);
procedure ViewOrders(info: string); procedure ViewOrders(info: string);
procedure ShowUserForm(Info: string); procedure ShowUserForm(Info: string);
end; end;
...@@ -70,7 +71,8 @@ uses ...@@ -70,7 +71,8 @@ uses
View.Users, View.Users,
View.EditUser, View.EditUser,
View.Orders, View.Orders,
View.OrderEntryCorrugated; View.OrderEntryCorrugated,
View.OrderEntryCuttingDie;
{$R *.dfm} {$R *.dfm}
...@@ -227,12 +229,20 @@ begin ...@@ -227,12 +229,20 @@ begin
end; end;
procedure TFViewMain.ViewOrderEntry(orderInfo, customerInfo, mode: string); procedure TFViewMain.ViewOrderEntryCorrugated(orderInfo, customerInfo, mode: string);
begin 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;
FChildForm := TFOrderEntry.CreateForm(WebPanel1.ElementID, orderInfo, customerInfo, mode); FChildForm := TFOrderEntryCorrugated.CreateForm(WebPanel1.ElementID, orderInfo, customerInfo, mode);
end;
procedure TFViewMain.ViewOrderEntryCuttingDie(orderInfo, customerInfo, mode: string);
begin
lblAppTitle.Caption := 'Koehler-Gibson Order Entry';
if Assigned(FChildForm) then
FChildForm.Free;
FChildForm := TFOrderEntryCuttingDie.CreateForm(WebPanel1.ElementID, orderInfo, customerInfo, mode);
end; end;
procedure TFViewMain.ShowUserForm(Info: string); procedure TFViewMain.ShowUserForm(Info: string);
......
object FOrderEntry: TFOrderEntry object FOrderEntryCorrugated: TFOrderEntryCorrugated
Width = 1018 Width = 1018
Height = 764 Height = 764
Font.Charset = ANSI_CHARSET Font.Charset = ANSI_CHARSET
...@@ -990,8 +990,8 @@ object FOrderEntry: TFOrderEntry ...@@ -990,8 +990,8 @@ object FOrderEntry: TFOrderEntry
end end
object XDataWebClient1: TXDataWebClient object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection Connection = DMConnection.ApiConnection
Left = 244 Left = 160
Top = 44 Top = 18
end end
object tmrScrollTop: TWebTimer object tmrScrollTop: TWebTimer
Interval = 100 Interval = 100
...@@ -1001,8 +1001,8 @@ object FOrderEntry: TFOrderEntry ...@@ -1001,8 +1001,8 @@ object FOrderEntry: TFOrderEntry
end end
object XDataWebDataSet1: TXDataWebDataSet object XDataWebDataSet1: TXDataWebDataSet
Connection = DMConnection.ApiConnection Connection = DMConnection.ApiConnection
Left = 324 Left = 90
Top = 104 Top = 20
object XDataWebDataSet1ORDER_ID: TIntegerField object XDataWebDataSet1ORDER_ID: TIntegerField
FieldName = 'ORDER_ID' FieldName = 'ORDER_ID'
end end
...@@ -1279,8 +1279,8 @@ object FOrderEntry: TFOrderEntry ...@@ -1279,8 +1279,8 @@ object FOrderEntry: TFOrderEntry
end end
object WebDataSource1: TWebDataSource object WebDataSource1: TWebDataSource
DataSet = XDataWebDataSet1 DataSet = XDataWebDataSet1
Left = 216 Left = 22
Top = 104 Top = 10
end end
object wdsShipTo: TWebDataSource object wdsShipTo: TWebDataSource
DataSet = xdwdsShipTo DataSet = xdwdsShipTo
......
...@@ -12,7 +12,7 @@ uses ...@@ -12,7 +12,7 @@ uses
Data.DB, XData.Web.JsonDataset, XData.Web.Dataset, WEBLib.DB; Data.DB, XData.Web.JsonDataset, XData.Web.Dataset, WEBLib.DB;
type type
TFOrderEntry = class(TWebForm) TFOrderEntryCorrugated = class(TWebForm)
pnlMessage: TWebPanel; pnlMessage: TWebPanel;
lblMessage: TWebLabel; lblMessage: TWebLabel;
btnCloseNotification: TWebButton; btnCloseNotification: TWebButton;
...@@ -216,7 +216,7 @@ type ...@@ -216,7 +216,7 @@ type
end; end;
var var
FOrderEntry: TFOrderEntry; FOrderEntryCorrugated: TFOrderEntryCorrugated;
implementation implementation
...@@ -225,7 +225,7 @@ implementation ...@@ -225,7 +225,7 @@ implementation
uses uses
View.Home, View.Main; View.Home, View.Main;
procedure TFOrderEntry.btnConfirmClick(Sender: TObject); procedure TFOrderEntryCorrugated.btnConfirmClick(Sender: TObject);
// Converts all the information on the page into a JSON to then send to the server // Converts all the information on the page into a JSON to then send to the server
var var
colorList: TJSONArray; colorList: TJSONArray;
...@@ -269,8 +269,8 @@ begin ...@@ -269,8 +269,8 @@ begin
XDataWebDataSet1staff_fields_art_due.Value := DateTimeToStr(dtpArtDue.Date); XDataWebDataSet1staff_fields_art_due.Value := DateTimeToStr(dtpArtDue.Date);
XDataWebDataSet1staff_fields_mount_due.Value := DateTimeToStr(dtpMountDue.Date); XDataWebDataSet1staff_fields_mount_due.Value := DateTimeToStr(dtpMountDue.Date);
XDataWebDataSet1staff_fields_plate_due.Value := DateTimeToStr(dtpPlateDue.Date); XDataWebDataSet1staff_fields_plate_due.Value := DateTimeToStr(dtpPlateDue.Date);
XDataWebDataSet1supplied_by_customer_order_date.Value := DateTimeToStr(dtpOrderDate.Date); XDataWebDataSet1staff_fields_order_date.Value := DateTimeToStr(dtpOrderDate.Date);
XDataWebDataSet1proofing_approved_date.Value := DateTimeToStr(dtpOrderDate.Date); XDataWebDataSet1proofing_approved_date.Value := DateTimeToStr(dtpApprovedDate.Date);
// Convert all check boxes to strings because the database stores them as strings // Convert all check boxes to strings because the database stores them as strings
if cbFTP.Checked then if cbFTP.Checked then
...@@ -363,7 +363,7 @@ begin ...@@ -363,7 +363,7 @@ begin
FViewMain.ViewOrders('Success'); FViewMain.ViewOrders('Success');
end; end;
procedure TFOrderEntry.AddCorrugatedOrder(orderJSON: TJSONObject); procedure TFOrderEntryCorrugated.AddCorrugatedOrder(orderJSON: TJSONObject);
// sends the order JSON object to the server // sends the order JSON object to the server
var var
Response: TXDataClientResponse; Response: TXDataClientResponse;
...@@ -372,27 +372,27 @@ begin ...@@ -372,27 +372,27 @@ begin
[orderJSON.ToString])); [orderJSON.ToString]));
end; end;
class function TFOrderEntry.CreateForm(AElementID, orderInfo, customerInfo, mode: string): TWebForm; class function TFOrderEntryCorrugated.CreateForm(AElementID, orderInfo, customerInfo, mode: string): TWebForm;
var var
localMode: string; localMode: string;
begin begin
localMode := mode; localMode := mode;
Application.CreateForm(TFOrderEntry, AElementID, Result, Application.CreateForm(TFOrderEntryCorrugated, AElementID, Result,
procedure(AForm: TObject) procedure(AForm: TObject)
begin begin
with TFOrderEntry(AForm) do with TFOrderEntryCorrugated(AForm) do
begin begin
HideNotification; HideNotification;
TFOrderEntry(AForm).customerID := customerInfo; TFOrderEntryCorrugated(AForm).customerID := customerInfo;
TFOrderEntry(AForm).orderID := orderInfo; TFOrderEntryCorrugated(AForm).orderID := orderInfo;
TFOrderEntry(AForm).mode := localMode; TFOrderEntryCorrugated(AForm).mode := localMode;
end; end;
end end
); );
end; end;
procedure TFOrderEntry.addColorRow(num: string; Color: string; LPI: string; Size: string); procedure TFOrderEntryCorrugated.addColorRow(num: string; Color: string; LPI: string; Size: string);
// Java script code to add a row of colors when a button is clicked // Java script code to add a row of colors when a button is clicked
// all variables are information to be placed in the boxes when loading an order. // all variables are information to be placed in the boxes when loading an order.
// TODO: convert to Delphi // TODO: convert to Delphi
...@@ -445,17 +445,17 @@ begin ...@@ -445,17 +445,17 @@ begin
end; end;
end; end;
procedure TFOrderEntry.WebButton1Click(Sender: TObject); procedure TFOrderEntryCorrugated.WebButton1Click(Sender: TObject);
begin begin
addColorRow('','','',''); addColorRow('','','','');
end; end;
procedure TFOrderEntry.btnCancelClick(Sender: TObject); procedure TFOrderEntryCorrugated.btnCancelClick(Sender: TObject);
begin begin
FViewMain.ViewOrders(''); FViewMain.ViewOrders('');
end; end;
procedure TFOrderEntry.WebFormCreate(Sender: TObject); procedure TFOrderEntryCorrugated.WebFormCreate(Sender: TObject);
begin begin
if not DMConnection.ApiConnection.Connected then if not DMConnection.ApiConnection.Connected then
begin begin
...@@ -464,7 +464,7 @@ begin ...@@ -464,7 +464,7 @@ begin
end; end;
end; end;
procedure TFOrderEntry.getOrder(Order_ID: string); procedure TFOrderEntryCorrugated.getOrder(Order_ID: string);
// retrieves an order from the server then loads the info into the page // retrieves an order from the server then loads the info into the page
var var
xdcResponse: TXDataClientResponse; xdcResponse: TXDataClientResponse;
...@@ -550,13 +550,9 @@ begin ...@@ -550,13 +550,9 @@ begin
else else
cbColorCopy.checked := false; cbColorCopy.checked := false;
console.log(XDataWebDataSet1supplied_by_customer_ftp.AsString);
if XDataWebDataSet1supplied_by_customer_ftp.AsString <> '' then if XDataWebDataSet1supplied_by_customer_ftp.AsString <> '' then
begin begin
console.log('hit');
cbFTP.Checked := true; cbFTP.Checked := true;
console.log(cbFTP.Checked);
end end
else else
cbFTP.Checked := false; cbFTP.Checked := false;
...@@ -605,15 +601,12 @@ begin ...@@ -605,15 +601,12 @@ begin
else else
cbStripMount.Checked := false; cbStripMount.Checked := false;
console.log(mode);
console.log(XDataWebDataSet1COMPANY_ID.AsString);
if mode = 'EDIT' then if mode = 'EDIT' then
CustomerID := XDataWebDataSet1COMPANY_ID.AsString; CustomerID := XDataWebDataSet1COMPANY_ID.AsString;
console.log(CustomerID);
end; end;
procedure TFOrderEntry.getCustomer(customerID: string); procedure TFOrderEntryCorrugated.getCustomer(customerID: string);
// gets a customer from the database then loads the appropiate fields // gets a customer from the database then loads the appropiate fields
var var
xdcResponse: TXDataClientResponse; xdcResponse: TXDataClientResponse;
...@@ -635,7 +628,7 @@ begin ...@@ -635,7 +628,7 @@ begin
end; end;
procedure TFOrderEntry.WebFormShow(Sender: TObject); procedure TFOrderEntryCorrugated.WebFormShow(Sender: TObject);
begin begin
if mode <> 'ADD' then if mode <> 'ADD' then
getOrder(orderID) getOrder(orderID)
...@@ -644,12 +637,12 @@ begin ...@@ -644,12 +637,12 @@ begin
HideNotification(); HideNotification();
end; end;
procedure TFOrderEntry.HideNotification; procedure TFOrderEntryCorrugated.HideNotification;
begin begin
pnlMessage.ElementHandle.hidden := True; pnlMessage.ElementHandle.hidden := True;
end; end;
procedure TFOrderEntry.ShowNotification(Notification: string); procedure TFOrderEntryCorrugated.ShowNotification(Notification: string);
begin begin
if Notification <> '' then if Notification <> '' then
begin begin
...@@ -659,14 +652,14 @@ begin ...@@ -659,14 +652,14 @@ begin
end; end;
procedure TFOrderEntry.tmrScrollTopTimer(Sender: TObject); procedure TFOrderEntryCorrugated.tmrScrollTopTimer(Sender: TObject);
begin begin
tmrScrollTop.Enabled := False; tmrScrollTop.Enabled := False;
window.scrollTo(0, 0); window.scrollTo(0, 0);
end; end;
initialization initialization
RegisterClass(TFOrderEntry); RegisterClass(TFOrderEntryCorrugated);
end. end.
object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
Width = 956
Height = 728
OnShow = WebFormShow
object WebLabel2: TWebLabel
Left = 26
Top = 72
Width = 52
Height = 15
Caption = 'Company'
HeightPercent = 100.000000000000000000
Visible = False
WidthPercent = 100.000000000000000000
end
object WebLabel1: TWebLabel
Left = 34
Top = 188
Width = 57
Height = 15
Caption = 'Staff Fields'
HeightPercent = 100.000000000000000000
Visible = False
WidthPercent = 100.000000000000000000
end
object WebLabel9: TWebLabel
Left = 862
Top = 147
Width = 40
Height = 15
Caption = 'General'
HeightPercent = 100.000000000000000000
Visible = False
WidthPercent = 100.000000000000000000
end
object edtCompanyAccountName: TWebDBEdit
Left = 24
Top = 120
Width = 121
Height = 23
AutoSize = True
ChildOrder = 79
ElementID = 'edtaccountcompanyname'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'SHORT_NAME'
DataSource = WebDataSource1
end
object edtInQuickBooks: TWebDBEdit
Left = 26
Top = 148
Width = 121
Height = 23
AutoSize = True
ChildOrder = 79
ElementID = 'edtinquickbooks'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'inQuickBooks'
DataSource = WebDataSource1
end
object dtpOrderDate: TWebDateTimePicker
Left = 22
Top = 218
Width = 170
Height = 22
ElementID = 'dtporderdate'
BorderStyle = bsSingle
ChildOrder = 4
Color = clWhite
Date = 45638.529943136570000000
Role = ''
Text = ''
end
object dtpProofDate: TWebDateTimePicker
Left = 22
Top = 250
Width = 170
Height = 22
ElementID = 'dtpproofdate'
BorderStyle = bsSingle
ChildOrder = 4
Color = clWhite
Date = 45638.529943136570000000
Role = ''
Text = ''
end
object dtpShipDate: TWebDateTimePicker
Left = 22
Top = 282
Width = 170
Height = 22
ElementID = 'dtpshipdate'
BorderStyle = bsSingle
ChildOrder = 4
Color = clWhite
Date = 45638.529943136570000000
Role = ''
Text = ''
end
object edtShipVia: TWebDBEdit
Left = 24
Top = 314
Width = 121
Height = 23
AutoSize = True
ChildOrder = 79
ElementID = 'edtshipvia'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'staff_fields_ship_via'
DataSource = WebDataSource1
end
object edtQuantity: TWebDBEdit
Left = 24
Top = 346
Width = 121
Height = 23
AutoSize = True
ChildOrder = 79
ElementID = 'edtquantity'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'staff_fields_quantity'
DataSource = WebDataSource1
end
object edtPrice: TWebDBEdit
Left = 24
Top = 374
Width = 121
Height = 22
ChildOrder = 79
ElementID = 'edtprice'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'staff_fields_price'
DataSource = WebDataSource1
end
object edtInvoiceTo: TWebDBEdit
Left = 26
Top = 402
Width = 121
Height = 23
AutoSize = True
ChildOrder = 79
ElementID = 'edtinvoiceto'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'staff_fields_invoice_to'
DataSource = WebDataSource1
end
object wdbcbShipTo: TWebDBComboBox
Left = 26
Top = 430
Width = 145
Height = 23
ElementID = 'wcbshipto'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
ItemIndex = -1
DataField = 'staff_fields_ship_to'
DataSource = WebDataSource1
ListField = 'ADDRESS'
ListSource = wdsShipTo
end
object edtPONumber: TWebDBEdit
Left = 26
Top = 458
Width = 121
Height = 23
AutoSize = True
ChildOrder = 79
ElementID = 'edtponumber'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'staff_fields_po_number'
DataSource = WebDataSource1
end
object edtJobName: TWebDBEdit
Left = 26
Top = 486
Width = 121
Height = 23
AutoSize = True
ChildOrder = 79
ElementID = 'edtjobname'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'staff_fields_job_name'
DataSource = WebDataSource1
end
object edtQuickBooksItem: TWebDBEdit
Left = 26
Top = 514
Width = 121
Height = 23
AutoSize = True
ChildOrder = 79
ElementID = 'edtquickbooksitem'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'staff_fields_quickbooks_item'
DataSource = WebDataSource1
end
object edtSpecialInstructions: TWebDBEdit
Left = 835
Top = 185
Width = 121
Height = 23
AutoSize = True
ChildOrder = 78
ElementID = 'edtspecialinstructions'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'general_special_instructions'
DataSource = WebDataSource1
end
object btnConfirm: TWebButton
Left = 652
Top = 560
Width = 96
Height = 25
Caption = 'Confirm'
ChildOrder = 79
ElementID = 'btnconfirm'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnConfirmClick
end
object btnCancel: TWebButton
Left = 764
Top = 560
Width = 96
Height = 25
Caption = 'Cancel'
ChildOrder = 79
ElementID = 'btncancel'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnCancelClick
end
object pnlMessage: TWebPanel
Left = 324
Top = 19
Width = 121
Height = 33
ElementID = 'pnl_message'
ChildOrder = 5
ElementPosition = epRelative
Role = 'alert'
TabOrder = 16
object lblMessage: TWebLabel
Left = 28
Top = 9
Width = 46
Height = 15
Caption = 'Message'
ElementID = 'view.login.message.label'
ElementPosition = epRelative
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object btnCloseNotification: TWebButton
Left = 96
Top = 3
Width = 22
Height = 25
ChildOrder = 1
ElementID = 'view.login.message.button'
ElementFont = efCSS
ElementPosition = epRelative
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
Role = 'button'
WidthStyle = ssAuto
WidthPercent = 100.000000000000000000
end
end
object edtCompanyName: TWebDBEdit
Left = 26
Top = 92
Width = 121
Height = 22
ChildOrder = 20
ElementID = 'edtcompanyname'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'NAME'
DataSource = WebDataSource1
end
object WebDataSource1: TWebDataSource
Left = 22
Top = 10
end
object XDataWebDataSet1: TXDataWebDataSet
Connection = DMConnection.ApiConnection
Left = 90
Top = 20
object XDataWebDataSet1ORDER_ID: TIntegerField
FieldName = 'ORDER_ID'
end
object XDataWebDataSet1COMPANY_ID: TIntegerField
FieldName = 'COMPANY_ID'
end
object XDataWebDataSet1USER_ID: TIntegerField
FieldName = 'USER_ID'
end
object XDataWebDataSet1ORDER_DATE: TDateField
FieldName = 'ORDER_DATE'
end
object XDataWebDataSet1START_DATE: TDateField
FieldName = 'START_DATE'
end
object XDataWebDataSet1END_DATE: TDateField
FieldName = 'END_DATE'
end
object XDataWebDataSet1ORDER_STATUS: TStringField
FieldName = 'ORDER_STATUS'
end
object XDataWebDataSet1SCHED_JSON: TStringField
FieldName = 'SCHED_JSON'
end
object XDataWebDataSet1NAME: TStringField
FieldName = 'NAME'
end
object XDataWebDataSet1SHORT_NAME: TStringField
FieldName = 'SHORT_NAME'
end
object XDataWebDataSet1staff_fields_ship_via: TStringField
FieldName = 'staff_fields_ship_via'
end
object XDataWebDataSet1staff_fields_price: TStringField
FieldName = 'staff_fields_price'
end
object XDataWebDataSet1staff_fields_invoice_to: TStringField
FieldName = 'staff_fields_invoice_to'
end
object XDataWebDataSet1staff_fields_invoice_attention: TStringField
FieldName = 'staff_fields_invoice_attention'
end
object XDataWebDataSet1staff_fields_ship_to: TStringField
FieldName = 'staff_fields_ship_to'
end
object XDataWebDataSet1staff_fields_ship_attention: TStringField
FieldName = 'staff_fields_ship_attention'
end
object XDataWebDataSet1staff_fields_po_number: TStringField
FieldName = 'staff_fields_po_number'
end
object XDataWebDataSet1staff_fields_job_name: TStringField
FieldName = 'staff_fields_job_name'
end
object XDataWebDataSet1plates_job_number: TStringField
FieldName = 'plates_job_number'
end
object XDataWebDataSet1supplied_by_customer_b_w_copy: TBooleanField
FieldName = 'supplied_by_customer_b_w_copy'
end
object XDataWebDataSet1supplied_by_customer_dimension: TStringField
FieldName = 'supplied_by_customer_dimension'
end
object XDataWebDataSet1supplied_by_customer_e_mail: TStringField
FieldName = 'supplied_by_customer_e_mail'
end
object XDataWebDataSet1supplied_by_customer_ftp: TStringField
FieldName = 'supplied_by_customer_ftp'
end
object XDataWebDataSet1supplied_by_customer_other: TStringField
FieldName = 'supplied_by_customer_other'
end
object XDataWebDataSet1supplied_by_customer_existing_: TStringField
FieldName = 'supplied_by_customer_existing_'
end
object XDataWebDataSet1supplied_by_customer_ref_art_p: TStringField
FieldName = 'supplied_by_customer_ref_art_p'
end
object XDataWebDataSet1supplied_by_customer_ref_art_a: TStringField
FieldName = 'supplied_by_customer_ref_art_a'
end
object XDataWebDataSet1cut_die_cutdier: TStringField
FieldName = 'cut_die_cutdier'
end
object XDataWebDataSet1cut_die_cutdieb: TStringField
FieldName = 'cut_die_cutdieb'
end
object XDataWebDataSet1cut_die_cutdief: TStringField
FieldName = 'cut_die_cutdief'
end
object XDataWebDataSet1cut_die_cutdierkr: TStringField
FieldName = 'cut_die_cutdierkr'
end
object XDataWebDataSet1cut_die_cutdiefkr: TStringField
FieldName = 'cut_die_cutdiefkr'
end
object XDataWebDataSet1cut_die_cad_file: TStringField
FieldName = 'cut_die_cad_file'
end
object XDataWebDataSet1cut_die_attached: TStringField
FieldName = 'cut_die_attached'
end
object XDataWebDataSet1cut_die_boxpol250: TStringField
FieldName = 'cut_die_boxpol250'
end
object XDataWebDataSet1cut_die_boxpol155: TStringField
FieldName = 'cut_die_boxpol155'
end
object XDataWebDataSet1cut_die_boxpol125: TStringField
FieldName = 'cut_die_boxpol125'
end
object XDataWebDataSet1cut_die_brub: TStringField
FieldName = 'cut_die_brub'
end
object XDataWebDataSet1proofing_fax: TStringField
FieldName = 'proofing_fax'
end
object XDataWebDataSet1proofing_fax_attn: TStringField
FieldName = 'proofing_fax_attn'
end
object XDataWebDataSet1proofing_e_mail: TStringField
FieldName = 'proofing_e_mail'
end
object XDataWebDataSet1proofing_ship_to: TStringField
FieldName = 'proofing_ship_to'
end
object XDataWebDataSet1proofing_other: TStringField
FieldName = 'proofing_other'
end
object XDataWebDataSet1proofing_changes_required: TStringField
FieldName = 'proofing_changes_required'
end
object XDataWebDataSet1proofing_changes_date: TDateField
FieldName = 'proofing_changes_date'
end
object XDataWebDataSet1layout_rsc_l: TStringField
FieldName = 'layout_rsc_l'
end
object XDataWebDataSet1layout_rcs_w: TStringField
FieldName = 'layout_rcs_w'
end
object XDataWebDataSet1layout_rcs_d: TStringField
FieldName = 'layout_rcs_d'
end
object XDataWebDataSet1layout_die_cut_no: TStringField
FieldName = 'layout_die_cut_no'
end
object XDataWebDataSet1layout_accross_no: TStringField
FieldName = 'layout_accross_no'
end
object XDataWebDataSet1layout_around_no: TStringField
FieldName = 'layout_around_no'
end
object XDataWebDataSet1layout_cad_file: TStringField
FieldName = 'layout_cad_file'
end
object XDataWebDataSet1mounting_standard_setup: TStringField
FieldName = 'mounting_standard_setup'
end
object XDataWebDataSet1mounting_custom_backing: TStringField
FieldName = 'mounting_custom_backing'
end
object XDataWebDataSet1mounting_custom_adhesive: TStringField
FieldName = 'mounting_custom_adhesive'
end
object XDataWebDataSet1colors_cylinder_size: TStringField
FieldName = 'colors_cylinder_size'
end
object XDataWebDataSet1colors_cross_hairs: TStringField
FieldName = 'colors_cross_hairs'
end
object XDataWebDataSet1colors_machine_ident: TStringField
FieldName = 'colors_machine_ident'
end
object XDataWebDataSet1colors_clemson: TStringField
FieldName = 'colors_clemson'
end
object XDataWebDataSet1plates_thickness: TStringField
FieldName = 'plates_thickness'
end
object XDataWebDataSet1plates_plate_material: TStringField
FieldName = 'plates_plate_material'
end
object XDataWebDataSet1general_special_instructions: TStringField
FieldName = 'general_special_instructions'
end
object XDataWebDataSet1colors_colors: TStringField
FieldName = 'colors_colors'
end
object XDataWebDataSet1staff_fields_quickbooks_item: TStringField
FieldName = 'staff_fields_quickbooks_item'
end
object XDataWebDataSet1staff_fields_quantity: TStringField
FieldName = 'staff_fields_quantity'
end
object XDataWebDataSet1layout_rsc_style: TStringField
FieldName = 'layout_rsc_style'
end
object XDataWebDataSet1staff_fields_art_location: TStringField
FieldName = 'staff_fields_art_location'
end
object XDataWebDataSet1supplied_by_customer_color_copy: TBooleanField
FieldName = 'supplied_by_customer_color_copy'
end
object XDataWebDataSet1supplied_by_customer_plates: TBooleanField
FieldName = 'supplied_by_customer_plates'
end
object XDataWebDataSet1supplied_by_customer_sample_ca: TBooleanField
FieldName = 'supplied_by_customer_sample_ca'
end
object XDataWebDataSet1supplied_by_customer_disk_or_cd: TBooleanField
FieldName = 'supplied_by_customer_disk_or_cd'
end
object XDataWebDataSet1mounting_loose: TStringField
FieldName = 'mounting_loose'
end
object XDataWebDataSet1mounting_sticky_bak: TBooleanField
FieldName = 'mounting_sticky_bak'
end
object XDataWebDataSet1mounting_full_mount: TBooleanField
FieldName = 'mounting_full_mount'
end
object XDataWebDataSet1mounting_strip_mount: TStringField
FieldName = 'mounting_strip_mount'
end
object XDataWebDataSet1layout_excalibur_die: TBooleanField
FieldName = 'layout_excalibur_die'
end
object XDataWebDataSet1proofing_full_size_panel: TBooleanField
FieldName = 'proofing_full_size_panel'
end
object XDataWebDataSet1proofing_print_card: TBooleanField
FieldName = 'proofing_print_card'
end
object XDataWebDataSet1proofing_wide_format: TBooleanField
FieldName = 'proofing_wide_format'
end
object XDataWebDataSet1proofing_pdf_file: TBooleanField
FieldName = 'proofing_pdf_file'
end
object XDataWebDataSet1proofing_art_approved_as_is: TBooleanField
FieldName = 'proofing_art_approved_as_is'
end
object XDataWebDataSet1proofing_e_mail_attn: TStringField
FieldName = 'proofing_e_mail_attn'
end
object XDataWebDataSet1proofing_approved_date: TStringField
FieldName = 'proofing_approved_date'
end
object XDataWebDataSet1staff_fields_order_date: TStringField
FieldName = 'staff_fields_order_date'
end
object XDataWebDataSet1staff_fields_proof_date: TStringField
FieldName = 'staff_fields_proof_date'
end
object XDataWebDataSet1staff_fields_ship_date: TStringField
FieldName = 'staff_fields_ship_date'
end
object XDataWebDataSet1staff_fields_art_due: TStringField
FieldName = 'staff_fields_art_due'
end
object XDataWebDataSet1staff_fields_plate_due: TStringField
FieldName = 'staff_fields_plate_due'
end
object XDataWebDataSet1staff_fields_mount_due: TStringField
FieldName = 'staff_fields_mount_due'
end
object XDataWebDataSet1ADDRESS_LIST: TStringField
FieldName = 'ADDRESS_LIST'
end
object XDataWebDataSet1supplied_by_customer_order_date: TStringField
FieldName = 'supplied_by_customer_order_date'
end
end
object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection
Left = 160
Top = 18
end
object tmrScrollTop: TWebTimer
Interval = 100
OnTimer = tmrScrollTopTimer
Left = 240
Top = 8
end
object wdsShipTo: TWebDataSource
Left = 212
Top = 436
end
object xdwdsShipTo: TXDataWebDataSet
Left = 192
Top = 486
object xdwdsShipToADDRESS: TStringField
FieldName = 'ADDRESS'
end
end
end
<div class="col-12 col-md-8">
<div class="row">
<div class=col-sm>
<div id="pnl_message" class="alert alert-danger">
<button id="view.login.message.button" type="button" class="btn-close" aria-label="Close"></button>
<span id="view.login.message.label"></span>
</div>
</div>
</div>
<h4 class="custom-h4 mt-3">Company</h4>
<hr class="custom-hr">
<div class="row">
<div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">Company Name:</label>
<input id="edtcompanyname" type="text" class="form-control" style="width: 300px;"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">Account Company Name:</label>
<input id="edtaccountcompanyname"type="text" class="form-control" style="width: 150px"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">In Quickbooks?:</label>
<input id="edtinquickbooks"type="text" class="form-control" style="width: 150px"/>
</div>
</div>
<h4 class="custom-h4 mt-3">Staff Fields</h4>
<hr class="custom-hr">
<div class="row">
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Order Date:</label>
<input class="form-control input-sm" id="dtporderdate" type="date">
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Proof Date:</label>
<input class="form-control input-sm" id="dtpproofdate" type="date">
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Ship Date:</label>
<input class="form-control input-sm" id="dtpshipdate" type="date">
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Ship Via:</label>
<input id="edtshipvia" type="text" class="form-control"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Quantity:</label>
<input id="edtquantity" class="form-control input-sm" style="width: 100px"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Price:</label>
<input id="edtprice" class="form-control input-sm" style="width: 100px" type="number" min="0"/>
</div>
<div>
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Invoice To:</label>
<input id="edtinvoiceto" class="form-control input-sm"/>
</div>
<div>
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Ship To:</label>
<select id="wcbshipto" class='form-select'></select>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">PO Number:</label>
<input id="edtponumber" class="form-control input-sm" width='50%'/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Job Name:</label>
<input id="edtjobname" class="form-control input-sm" width='50%'/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">QuickBooks Item:</label>
<input id="edtquickbooksitem" class="form-control input-sm" width='50%'/>
</div>
</div>
<h4 class="custom-h4 mt-3">General</h4>
<hr class="custom-hr">
<div class="row">
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label">Special Instructions</label>
<textarea id="edtspecialinstructions" class="form-control" style=" width: 500px; height: 150px;"></textarea>
</div>
</div>
<div class="row">
<div class="col-auto">
<button id="btnconfirm" class="btn btn-primary btn-sm float-end my-2">Confirm</button>
</div>
<div class="col-auto">
<button id="btncancel" class="btn btn-primary btn-sm float-end my-2">Cancel</button>
</div>
</div>
</div>
unit View.OrderEntryCuttingDie;
interface
uses
System.SysUtils, System.Generics.Collections, System.Classes, JS, Web, WEBLib.Graphics, WEBLib.Controls,
WEBLib.Forms, WEBLib.Dialogs, WEBLib.Menus, WEBLib.ExtCtrls, WEBLib.StdCtrls,
WEBLib.JSON, Auth.Service, XData.Web.Client, WebLib.Storage,
ConnectionModule, App.Types, Vcl.StdCtrls, Vcl.Controls, WEBLib.DBCtrls,
Data.DB, XData.Web.JsonDataset, XData.Web.Dataset, WEBLib.DB;
type
TFOrderEntryCuttingDie = class(TWebForm)
WebDataSource1: TWebDataSource;
XDataWebDataSet1: TXDataWebDataSet;
XDataWebDataSet1ORDER_ID: TIntegerField;
XDataWebDataSet1COMPANY_ID: TIntegerField;
XDataWebDataSet1USER_ID: TIntegerField;
XDataWebDataSet1ORDER_DATE: TDateField;
XDataWebDataSet1START_DATE: TDateField;
XDataWebDataSet1END_DATE: TDateField;
XDataWebDataSet1ORDER_STATUS: TStringField;
XDataWebDataSet1SCHED_JSON: TStringField;
XDataWebDataSet1NAME: TStringField;
XDataWebDataSet1SHORT_NAME: TStringField;
XDataWebDataSet1staff_fields_ship_via: TStringField;
XDataWebDataSet1staff_fields_price: TStringField;
XDataWebDataSet1staff_fields_invoice_to: TStringField;
XDataWebDataSet1staff_fields_invoice_attention: TStringField;
XDataWebDataSet1staff_fields_ship_to: TStringField;
XDataWebDataSet1staff_fields_ship_attention: TStringField;
XDataWebDataSet1staff_fields_po_number: TStringField;
XDataWebDataSet1staff_fields_job_name: TStringField;
XDataWebDataSet1plates_job_number: TStringField;
XDataWebDataSet1supplied_by_customer_b_w_copy: TBooleanField;
XDataWebDataSet1supplied_by_customer_dimension: TStringField;
XDataWebDataSet1supplied_by_customer_e_mail: TStringField;
XDataWebDataSet1supplied_by_customer_ftp: TStringField;
XDataWebDataSet1supplied_by_customer_other: TStringField;
XDataWebDataSet1supplied_by_customer_existing_: TStringField;
XDataWebDataSet1supplied_by_customer_ref_art_p: TStringField;
XDataWebDataSet1supplied_by_customer_ref_art_a: TStringField;
XDataWebDataSet1cut_die_cutdier: TStringField;
XDataWebDataSet1cut_die_cutdieb: TStringField;
XDataWebDataSet1cut_die_cutdief: TStringField;
XDataWebDataSet1cut_die_cutdierkr: TStringField;
XDataWebDataSet1cut_die_cutdiefkr: TStringField;
XDataWebDataSet1cut_die_cad_file: TStringField;
XDataWebDataSet1cut_die_attached: TStringField;
XDataWebDataSet1cut_die_boxpol250: TStringField;
XDataWebDataSet1cut_die_boxpol155: TStringField;
XDataWebDataSet1cut_die_boxpol125: TStringField;
XDataWebDataSet1cut_die_brub: TStringField;
XDataWebDataSet1proofing_fax: TStringField;
XDataWebDataSet1proofing_fax_attn: TStringField;
XDataWebDataSet1proofing_e_mail: TStringField;
XDataWebDataSet1proofing_ship_to: TStringField;
XDataWebDataSet1proofing_other: TStringField;
XDataWebDataSet1proofing_changes_required: TStringField;
XDataWebDataSet1proofing_changes_date: TDateField;
XDataWebDataSet1layout_rsc_l: TStringField;
XDataWebDataSet1layout_rcs_w: TStringField;
XDataWebDataSet1layout_rcs_d: TStringField;
XDataWebDataSet1layout_die_cut_no: TStringField;
XDataWebDataSet1layout_accross_no: TStringField;
XDataWebDataSet1layout_around_no: TStringField;
XDataWebDataSet1layout_cad_file: TStringField;
XDataWebDataSet1mounting_standard_setup: TStringField;
XDataWebDataSet1mounting_custom_backing: TStringField;
XDataWebDataSet1mounting_custom_adhesive: TStringField;
XDataWebDataSet1colors_cylinder_size: TStringField;
XDataWebDataSet1colors_cross_hairs: TStringField;
XDataWebDataSet1colors_machine_ident: TStringField;
XDataWebDataSet1colors_clemson: TStringField;
XDataWebDataSet1plates_thickness: TStringField;
XDataWebDataSet1plates_plate_material: TStringField;
XDataWebDataSet1general_special_instructions: TStringField;
XDataWebDataSet1colors_colors: TStringField;
XDataWebDataSet1staff_fields_quickbooks_item: TStringField;
XDataWebDataSet1staff_fields_quantity: TStringField;
XDataWebDataSet1layout_rsc_style: TStringField;
XDataWebDataSet1staff_fields_art_location: TStringField;
XDataWebDataSet1supplied_by_customer_color_copy: TBooleanField;
XDataWebDataSet1supplied_by_customer_plates: TBooleanField;
XDataWebDataSet1supplied_by_customer_sample_ca: TBooleanField;
XDataWebDataSet1supplied_by_customer_disk_or_cd: TBooleanField;
XDataWebDataSet1mounting_loose: TStringField;
XDataWebDataSet1mounting_sticky_bak: TBooleanField;
XDataWebDataSet1mounting_full_mount: TBooleanField;
XDataWebDataSet1mounting_strip_mount: TStringField;
XDataWebDataSet1layout_excalibur_die: TBooleanField;
XDataWebDataSet1proofing_full_size_panel: TBooleanField;
XDataWebDataSet1proofing_print_card: TBooleanField;
XDataWebDataSet1proofing_wide_format: TBooleanField;
XDataWebDataSet1proofing_pdf_file: TBooleanField;
XDataWebDataSet1proofing_art_approved_as_is: TBooleanField;
XDataWebDataSet1proofing_e_mail_attn: TStringField;
XDataWebDataSet1proofing_approved_date: TStringField;
XDataWebDataSet1staff_fields_order_date: TStringField;
XDataWebDataSet1staff_fields_proof_date: TStringField;
XDataWebDataSet1staff_fields_ship_date: TStringField;
XDataWebDataSet1staff_fields_art_due: TStringField;
XDataWebDataSet1staff_fields_plate_due: TStringField;
XDataWebDataSet1staff_fields_mount_due: TStringField;
XDataWebDataSet1ADDRESS_LIST: TStringField;
XDataWebDataSet1supplied_by_customer_order_date: TStringField;
XDataWebClient1: TXDataWebClient;
tmrScrollTop: TWebTimer;
WebLabel2: TWebLabel;
edtCompanyAccountName: TWebDBEdit;
edtInQuickBooks: TWebDBEdit;
WebLabel1: TWebLabel;
dtpOrderDate: TWebDateTimePicker;
dtpProofDate: TWebDateTimePicker;
dtpShipDate: TWebDateTimePicker;
edtShipVia: TWebDBEdit;
edtQuantity: TWebDBEdit;
edtPrice: TWebDBEdit;
edtInvoiceTo: TWebDBEdit;
wdbcbShipTo: TWebDBComboBox;
edtPONumber: TWebDBEdit;
edtJobName: TWebDBEdit;
edtQuickBooksItem: TWebDBEdit;
wdsShipTo: TWebDataSource;
xdwdsShipTo: TXDataWebDataSet;
xdwdsShipToADDRESS: TStringField;
WebLabel9: TWebLabel;
edtSpecialInstructions: TWebDBEdit;
btnConfirm: TWebButton;
btnCancel: TWebButton;
pnlMessage: TWebPanel;
lblMessage: TWebLabel;
btnCloseNotification: TWebButton;
edtCompanyName: TWebDBEdit;
procedure btnConfirmClick(Sender: TObject);
procedure btnCancelClick(Sender: TObject);
procedure WebFormCreate(Sender: TObject);
procedure HideNotification();
procedure ShowNotification(Notification: string);
procedure WebFormShow(Sender: TObject);
[async] procedure GetCuttingDieOrder(Order_ID: string);
[async] procedure GetCustomer(customerID: string);
procedure tmrScrollTopTimer(Sender: TObject);
[async] procedure AddCuttingDieOrder(orderJSON: TJSONObject);
private
FAgencyCode: string;
FCurrentReportType: string;
FSelectProc: TSelectProc;
orderID: string;
customerID: string;
mode: string;
public
class function CreateForm(AElementID, orderInfo, customerInfo, mode: string): TWebForm;
end;
var
FOrderEntryCuttingDie: TFOrderEntryCuttingDie;
implementation
{$R *.dfm}
uses
View.Home, View.Main;
procedure TFOrderEntryCuttingDie.btnConfirmClick(Sender: TObject);
// Converts all the information on the page into a JSON to then send to the server
var
I, J: integer;
orderJSON: TJSONObject;
fieldNames: TStringList;
itemList: TJSNodeList;
header, value: string;
Field: TField;
Response: TXDataClientResponse;
begin
orderJSON := TJSONObject.Create;
XDataWebDataSet1.Edit;
//Convert all dates to strings because I was having less issues with that data type.
XDataWebDataSet1staff_fields_proof_date.Value := DateTimeToStr(dtpProofDate.Date);
XDataWebDataSet1staff_fields_ship_date.Value := DateTimeToStr(dtpShipDate.Date);
XDataWebDataSet1staff_fields_order_date.Value := DateTimeToStr(dtpOrderDate.Date);
XDataWebDataSet1.Post;
XDataWebDataSet1.First;
while not XDataWebDataSet1.Eof do
begin
for Field in XDataWebDataSet1.Fields do
begin
if Field is TStringField then
begin
if Field.AsString = '' then
orderJSON.AddPair(Field.FieldName, '')
else
orderJSON.AddPair(Field.FieldName, Field.AsString); // Add all other fields
end
else if Field is TBooleanField then
begin
if Field.AsBoolean then
orderJSON.AddPair(Field.FieldName, 'T')
else
orderJSON.AddPair(Field.FieldName, '');
end;
end;
XDataWebDataSet1.Next;
end;
orderJSON.AddPair('COMPANY_ID', customerID);
orderJSON.AddPair('USER_ID', '1011');
orderJSON.AddPair('mode', mode);
if mode = 'EDIT' then
orderJSON.AddPair('ORDER_ID', orderID);
AddCuttingDieOrder(orderJSON);
FViewMain.ViewOrders('Success');
end;
procedure TFOrderEntryCuttingDie.AddCuttingDieOrder(orderJSON: TJSONObject);
// sends the order JSON object to the server
var
Response: TXDataClientResponse;
begin
Response := await(XDataWebClient1.RawInvokeAsync('ILookupService.AddCuttingDieOrder',
[orderJSON.ToString]));
end;
class function TFOrderEntryCuttingDie.CreateForm(AElementID, orderInfo, customerInfo, mode: string): TWebForm;
var
localMode: string;
begin
localMode := mode;
Application.CreateForm(TFOrderEntryCuttingDie, AElementID, Result,
procedure(AForm: TObject)
begin
with TFOrderEntryCuttingDie(AForm) do
begin
HideNotification;
TFOrderEntryCuttingDie(AForm).customerID := customerInfo;
TFOrderEntryCuttingDie(AForm).orderID := orderInfo;
TFOrderEntryCuttingDie(AForm).mode := localMode;
end;
end
);
end;
procedure TFOrderEntryCuttingDie.btnCancelClick(Sender: TObject);
begin
FViewMain.ViewOrders('');
end;
procedure TFOrderEntryCuttingDie.WebFormCreate(Sender: TObject);
begin
if not DMConnection.ApiConnection.Connected then
begin
DMConnection.ApiConnection.OpenAsync;
console.log('report requirements connection open')
end;
end;
procedure TFOrderEntryCuttingDie.getCuttingDieOrder(Order_ID: string);
// retrieves an order from the server then loads the info into the page
var
xdcResponse: TXDataClientResponse;
orderList : TJSObject;
i: integer;
data: TJSArray;
order: TJSObject;
begin
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.GetOrder',
[Order_ID]));
order := TJSObject(xdcResponse.Result);
data := TJSArray(order['data']);
XDataWebDataSet1.Close;
XDataWebDataSet1.SetJsonData(order);
XDataWebDataSet1.Open;
// Check boxes and dates need to be manually set
if not (XDataWebDataSet1staff_fields_order_date.AsString = '') then
dtpOrderDate.Date := StrToDateTime(XDataWebDataSet1staff_fields_order_date.Value)
else
dtpOrderDate.Date := 0;
if not (XDataWebDataSet1staff_fields_proof_date.AsString = '') then
dtpProofDate.Date := StrToDateTime(XDataWebDataSet1staff_fields_proof_date.AsString)
else
dtpProofDate.Date := 0;
if not (XDataWebDataSet1staff_fields_ship_date.AsString = '') then
dtpShipDate.Date := StrToDateTime(XDataWebDataSet1staff_fields_ship_date.AsString)
else
dtpShipDate.Date := 0;
console.log(mode);
console.log(XDataWebDataSet1COMPANY_ID.AsString);
if mode = 'EDIT' then
CustomerID := XDataWebDataSet1COMPANY_ID.AsString;
console.log(CustomerID);
end;
procedure TFOrderEntryCuttingDie.getCustomer(customerID: string);
// gets a customer from the database then loads the appropiate fields
var
xdcResponse: TXDataClientResponse;
customer : TJSObject;
address: string;
begin
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.GetCustomer',
[customerID]));
customer := TJSObject(xdcResponse.Result);
console.log(customer);
XDataWebDataSet1.Close;
XDataWebDataSet1.SetJsonData(customer);
XDataWebDataSet1.Open;
console.log(XDataWebDataSet1NAME.AsString);
xdwdsShipTo.Close;
xdwdsShipTo.SetJSONData(customer['ADDRESS_LIST']);
xdwdsShipTo.Open;
end;
procedure TFOrderEntryCuttingDie.WebFormShow(Sender: TObject);
begin
if mode <> 'ADD' then
getCuttingDieOrder(orderID)
else
getCustomer(customerID);
HideNotification();
end;
procedure TFOrderEntryCuttingDie.HideNotification;
begin
pnlMessage.ElementHandle.hidden := True;
end;
procedure TFOrderEntryCuttingDie.ShowNotification(Notification: string);
begin
if Notification <> '' then
begin
lblMessage.Caption := Notification;
pnlMessage.ElementHandle.hidden := False;
end;
end;
procedure TFOrderEntryCuttingDie.tmrScrollTopTimer(Sender: TObject);
begin
tmrScrollTop.Enabled := False;
window.scrollTo(0, 0);
end;
initialization
RegisterClass(TFOrderEntryCuttingDie);
end.
\ No newline at end of file
...@@ -75,7 +75,7 @@ type ...@@ -75,7 +75,7 @@ type
procedure ClearTable(); procedure ClearTable();
procedure GeneratePagination(TotalPages: Integer); procedure GeneratePagination(TotalPages: Integer);
function GenerateSearchOptions(): string; function GenerateSearchOptions(): string;
procedure orderEntry(orderInfo, customerInfo, mode: string); procedure orderEntry(orderInfo, customerInfo, mode, orderType: string);
procedure HideNotification(); procedure HideNotification();
procedure ShowNotification(Notification: string); procedure ShowNotification(Notification: string);
procedure ShowAddOrderForm(); procedure ShowAddOrderForm();
...@@ -242,7 +242,15 @@ begin ...@@ -242,7 +242,15 @@ begin
procedure(AValue: TModalResult) procedure(AValue: TModalResult)
begin begin
if newform.confirm then if newform.confirm then
orderEntry('', newForm.edtID.Text, 'ADD'); begin
if newform.cbCorrugatedPlate.Checked then
orderType := 'corrugated'
else if newform.cbWebPlate.Checked then
orderType := 'web'
else
orderType := 'cutting';
orderEntry('', newForm.edtID.Text, 'ADD', orderType);
end;
end end
); );
end; end;
...@@ -351,7 +359,8 @@ procedure TFViewOrders.wdbtcOrdersDblClickCell(Sender: TObject; ACol, ...@@ -351,7 +359,8 @@ procedure TFViewOrders.wdbtcOrdersDblClickCell(Sender: TObject; ACol,
ARow: Integer); ARow: Integer);
begin begin
OrderID := wdbtcOrders.Cells[0, ARow]; OrderID := wdbtcOrders.Cells[0, ARow];
orderEntry(OrderID, '', 'EDIT'); orderType := wdbtcOrders.Cells[3, ARow].Split([' '])[0];
orderEntry(OrderID, '', 'EDIT', orderType);
end; end;
procedure TFViewOrders.GeneratePagination(TotalPages: Integer); procedure TFViewOrders.GeneratePagination(TotalPages: Integer);
...@@ -611,9 +620,14 @@ begin ...@@ -611,9 +620,14 @@ begin
end; end;
procedure TFViewOrders.orderEntry(orderInfo, customerInfo, mode: string); procedure TFViewOrders.orderEntry(orderInfo, customerInfo, mode, orderType: string);
begin begin
FViewMain.ViewOrderEntry(orderInfo, customerInfo, mode); if orderType = 'corrugated' then
FViewMain.ViewOrderEntryCorrugated(orderInfo, customerInfo, mode)
else if orderType = 'web' then
orderType := orderType
else
FViewMain.ViewOrderEntryCuttingDie(orderInfo, customerInfo, mode);
end; end;
procedure TFViewOrders.btnCloseNotificationClick(Sender: TObject); procedure TFViewOrders.btnCloseNotificationClick(Sender: TObject);
...@@ -676,7 +690,6 @@ begin ...@@ -676,7 +690,6 @@ begin
end; end;
end; end;
console.log(orderType);
if ( ( orderType <> '' ) AND ( orderType <> 'Any' ) ) then if ( ( orderType <> '' ) AND ( orderType <> 'Any' ) ) then
searchOptions := searchOptions + '&orderType=' + orderType; searchOptions := searchOptions + '&orderType=' + orderType;
......
...@@ -17,10 +17,11 @@ uses ...@@ -17,10 +17,11 @@ uses
View.Users in 'View.Users.pas' {FViewUsers: TWebForm} {*.html}, View.Users in 'View.Users.pas' {FViewUsers: TWebForm} {*.html},
View.EditUser in 'View.EditUser.pas' {FViewEditUser: TWebForm} {*.html}, View.EditUser in 'View.EditUser.pas' {FViewEditUser: TWebForm} {*.html},
View.Orders in 'View.Orders.pas' {FViewOrders: TWebForm} {*.html}, View.Orders in 'View.Orders.pas' {FViewOrders: TWebForm} {*.html},
View.OrderEntryCorrugated in 'View.OrderEntryCorrugated.pas' {FOrderEntry: TWebForm} {*.html}, View.OrderEntryCorrugated in 'View.OrderEntryCorrugated.pas' {FOrderEntryCorrugated: TWebForm} {*.html},
View.AddOrder in 'View.AddOrder.pas' {FAddOrder: TWebForm} {*.html}, View.AddOrder in 'View.AddOrder.pas' {FAddOrder: TWebForm} {*.html},
View.Search in 'View.Search.pas' {FSearch: TWebForm} {*.html}, View.Search in 'View.Search.pas' {FSearch: TWebForm} {*.html},
View.SetStatus in 'View.SetStatus.pas' {FSetStatus: TWebForm} {*.html}; View.SetStatus in 'View.SetStatus.pas' {FSetStatus: TWebForm} {*.html},
View.OrderEntryCuttingDie in 'View.OrderEntryCuttingDie.pas' {FOrderEntryCuttingDie: TWebForm} {*.html};
{$R *.res} {$R *.res}
......
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
<DesignClass>TWebForm</DesignClass> <DesignClass>TWebForm</DesignClass>
</DCCReference> </DCCReference>
<DCCReference Include="View.OrderEntryCorrugated.pas"> <DCCReference Include="View.OrderEntryCorrugated.pas">
<Form>FOrderEntry</Form> <Form>FOrderEntryCorrugated</Form>
<FormType>dfm</FormType> <FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass> <DesignClass>TWebForm</DesignClass>
</DCCReference> </DCCReference>
...@@ -185,6 +185,11 @@ ...@@ -185,6 +185,11 @@
<FormType>dfm</FormType> <FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass> <DesignClass>TWebForm</DesignClass>
</DCCReference> </DCCReference>
<DCCReference Include="View.OrderEntryCuttingDie.pas">
<Form>FOrderEntryCuttingDie</Form>
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
<None Include="index.html"/> <None Include="index.html"/>
<None Include="css\app.css"/> <None Include="css\app.css"/>
<None Include="config\config.json"/> <None Include="config\config.json"/>
......
[Settings] [Settings]
MemoLogLevel=4 MemoLogLevel=4
FileLogLevel=5 FileLogLevel=5
LogFileNum=91 LogFileNum=95
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