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
Height = 477
OnShow = WebFormShow
object WebLabel1: TWebLabel
Left = 278
Left = 310
Top = 44
Width = 35
Height = 15
......@@ -12,7 +12,7 @@ object FAddOrder: TFAddOrder
WidthPercent = 100.000000000000000000
end
object WebLabel2: TWebLabel
Left = 414
Left = 452
Top = 44
Width = 58
Height = 15
......@@ -21,7 +21,7 @@ object FAddOrder: TFAddOrder
WidthPercent = 100.000000000000000000
end
object edtSearch: TWebEdit
Left = 278
Left = 310
Top = 62
Width = 121
Height = 22
......@@ -30,7 +30,7 @@ object FAddOrder: TFAddOrder
OnChange = edtSearchChange
end
object edtID: TWebEdit
Left = 414
Left = 452
Top = 62
Width = 69
Height = 22
......@@ -196,7 +196,7 @@ object FAddOrder: TFAddOrder
DesignTimeSampleData = True
end
object cbCorrugatedPlate: TWebCheckBox
Left = 26
Left = 0
Top = 63
Width = 113
Height = 22
......@@ -207,8 +207,8 @@ object FAddOrder: TFAddOrder
OnClick = cbCorrugatedPlateClick
end
object cbWebPlate: TWebCheckBox
Left = 152
Top = 64
Left = 124
Top = 63
Width = 83
Height = 22
Caption = 'Web Plate'
......@@ -239,6 +239,17 @@ object FAddOrder: TFAddOrder
WidthPercent = 100.000000000000000000
OnClick = btnConfirmClick
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
Connection = DMConnection.ApiConnection
Left = 730
......
......@@ -31,6 +31,7 @@ type
xdwdsCustomersSHORT_NAME: TStringField;
wdsCustomers: TWebDataSource;
xdwdsCustomersADDRESS: TStringField;
cbCuttingDie: TWebCheckBox;
procedure WebFormShow(Sender: TObject);
procedure TMSFNCGrid1SelectedCell(Sender: TObject; ACol, ARow: Integer);
procedure edtSearchChange(Sender: TObject);
......@@ -38,6 +39,7 @@ type
procedure cbWebPlateClick(Sender: TObject);
procedure btnConfirmClick(Sender: TObject);
procedure btnCancelClick(Sender: TObject);
procedure cbCuttingDieClick(Sender: TObject);
private
[async] procedure getCustomers;
procedure PopulateGridManually;
......@@ -77,11 +79,19 @@ end;
procedure TFAddOrder.cbCorrugatedPlateClick(Sender: TObject);
begin
cbWebPlate.Checked := False;
cbCuttingDie.Checked := False;
end;
procedure TFAddOrder.cbCuttingDieClick(Sender: TObject);
begin
cbCorrugatedPlate.Checked := False;
cbWebPlate.Checked := False;
end;
procedure TFAddOrder.cbWebPlateClick(Sender: TObject);
begin
cbCorrugatedPlate.Checked := False;
cbCuttingDie.Checked := False;
end;
procedure TFAddOrder.edtSearchChange(Sender: TObject);
......
......@@ -51,7 +51,8 @@ type
procedure ShowForm( AFormClass: TWebFormClass );
procedure EditUser( Mode, Username, Password, Name, Status, Email,
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 ShowUserForm(Info: string);
end;
......@@ -70,7 +71,8 @@ uses
View.Users,
View.EditUser,
View.Orders,
View.OrderEntryCorrugated;
View.OrderEntryCorrugated,
View.OrderEntryCuttingDie;
{$R *.dfm}
......@@ -227,12 +229,20 @@ begin
end;
procedure TFViewMain.ViewOrderEntry(orderInfo, customerInfo, mode: string);
procedure TFViewMain.ViewOrderEntryCorrugated(orderInfo, customerInfo, mode: string);
begin
lblAppTitle.Caption := 'Koehler-Gibson Order Entry';
if Assigned(FChildForm) then
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;
procedure TFViewMain.ShowUserForm(Info: string);
......
object FOrderEntry: TFOrderEntry
object FOrderEntryCorrugated: TFOrderEntryCorrugated
Width = 1018
Height = 764
Font.Charset = ANSI_CHARSET
......@@ -990,8 +990,8 @@ object FOrderEntry: TFOrderEntry
end
object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection
Left = 244
Top = 44
Left = 160
Top = 18
end
object tmrScrollTop: TWebTimer
Interval = 100
......@@ -1001,8 +1001,8 @@ object FOrderEntry: TFOrderEntry
end
object XDataWebDataSet1: TXDataWebDataSet
Connection = DMConnection.ApiConnection
Left = 324
Top = 104
Left = 90
Top = 20
object XDataWebDataSet1ORDER_ID: TIntegerField
FieldName = 'ORDER_ID'
end
......@@ -1279,8 +1279,8 @@ object FOrderEntry: TFOrderEntry
end
object WebDataSource1: TWebDataSource
DataSet = XDataWebDataSet1
Left = 216
Top = 104
Left = 22
Top = 10
end
object wdsShipTo: TWebDataSource
DataSet = xdwdsShipTo
......
......@@ -12,7 +12,7 @@ uses
Data.DB, XData.Web.JsonDataset, XData.Web.Dataset, WEBLib.DB;
type
TFOrderEntry = class(TWebForm)
TFOrderEntryCorrugated = class(TWebForm)
pnlMessage: TWebPanel;
lblMessage: TWebLabel;
btnCloseNotification: TWebButton;
......@@ -216,7 +216,7 @@ type
end;
var
FOrderEntry: TFOrderEntry;
FOrderEntryCorrugated: TFOrderEntryCorrugated;
implementation
......@@ -225,7 +225,7 @@ implementation
uses
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
var
colorList: TJSONArray;
......@@ -269,8 +269,8 @@ begin
XDataWebDataSet1staff_fields_art_due.Value := DateTimeToStr(dtpArtDue.Date);
XDataWebDataSet1staff_fields_mount_due.Value := DateTimeToStr(dtpMountDue.Date);
XDataWebDataSet1staff_fields_plate_due.Value := DateTimeToStr(dtpPlateDue.Date);
XDataWebDataSet1supplied_by_customer_order_date.Value := DateTimeToStr(dtpOrderDate.Date);
XDataWebDataSet1proofing_approved_date.Value := DateTimeToStr(dtpOrderDate.Date);
XDataWebDataSet1staff_fields_order_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
if cbFTP.Checked then
......@@ -363,7 +363,7 @@ begin
FViewMain.ViewOrders('Success');
end;
procedure TFOrderEntry.AddCorrugatedOrder(orderJSON: TJSONObject);
procedure TFOrderEntryCorrugated.AddCorrugatedOrder(orderJSON: TJSONObject);
// sends the order JSON object to the server
var
Response: TXDataClientResponse;
......@@ -372,27 +372,27 @@ begin
[orderJSON.ToString]));
end;
class function TFOrderEntry.CreateForm(AElementID, orderInfo, customerInfo, mode: string): TWebForm;
class function TFOrderEntryCorrugated.CreateForm(AElementID, orderInfo, customerInfo, mode: string): TWebForm;
var
localMode: string;
begin
localMode := mode;
Application.CreateForm(TFOrderEntry, AElementID, Result,
Application.CreateForm(TFOrderEntryCorrugated, AElementID, Result,
procedure(AForm: TObject)
begin
with TFOrderEntry(AForm) do
with TFOrderEntryCorrugated(AForm) do
begin
HideNotification;
TFOrderEntry(AForm).customerID := customerInfo;
TFOrderEntry(AForm).orderID := orderInfo;
TFOrderEntry(AForm).mode := localMode;
TFOrderEntryCorrugated(AForm).customerID := customerInfo;
TFOrderEntryCorrugated(AForm).orderID := orderInfo;
TFOrderEntryCorrugated(AForm).mode := localMode;
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
// all variables are information to be placed in the boxes when loading an order.
// TODO: convert to Delphi
......@@ -445,17 +445,17 @@ begin
end;
end;
procedure TFOrderEntry.WebButton1Click(Sender: TObject);
procedure TFOrderEntryCorrugated.WebButton1Click(Sender: TObject);
begin
addColorRow('','','','');
end;
procedure TFOrderEntry.btnCancelClick(Sender: TObject);
procedure TFOrderEntryCorrugated.btnCancelClick(Sender: TObject);
begin
FViewMain.ViewOrders('');
end;
procedure TFOrderEntry.WebFormCreate(Sender: TObject);
procedure TFOrderEntryCorrugated.WebFormCreate(Sender: TObject);
begin
if not DMConnection.ApiConnection.Connected then
begin
......@@ -464,7 +464,7 @@ begin
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
var
xdcResponse: TXDataClientResponse;
......@@ -550,13 +550,9 @@ begin
else
cbColorCopy.checked := false;
console.log(XDataWebDataSet1supplied_by_customer_ftp.AsString);
if XDataWebDataSet1supplied_by_customer_ftp.AsString <> '' then
begin
console.log('hit');
cbFTP.Checked := true;
console.log(cbFTP.Checked);
end
else
cbFTP.Checked := false;
......@@ -605,15 +601,12 @@ begin
else
cbStripMount.Checked := false;
console.log(mode);
console.log(XDataWebDataSet1COMPANY_ID.AsString);
if mode = 'EDIT' then
CustomerID := XDataWebDataSet1COMPANY_ID.AsString;
console.log(CustomerID);
end;
procedure TFOrderEntry.getCustomer(customerID: string);
procedure TFOrderEntryCorrugated.getCustomer(customerID: string);
// gets a customer from the database then loads the appropiate fields
var
xdcResponse: TXDataClientResponse;
......@@ -635,7 +628,7 @@ begin
end;
procedure TFOrderEntry.WebFormShow(Sender: TObject);
procedure TFOrderEntryCorrugated.WebFormShow(Sender: TObject);
begin
if mode <> 'ADD' then
getOrder(orderID)
......@@ -644,12 +637,12 @@ begin
HideNotification();
end;
procedure TFOrderEntry.HideNotification;
procedure TFOrderEntryCorrugated.HideNotification;
begin
pnlMessage.ElementHandle.hidden := True;
end;
procedure TFOrderEntry.ShowNotification(Notification: string);
procedure TFOrderEntryCorrugated.ShowNotification(Notification: string);
begin
if Notification <> '' then
begin
......@@ -659,14 +652,14 @@ begin
end;
procedure TFOrderEntry.tmrScrollTopTimer(Sender: TObject);
procedure TFOrderEntryCorrugated.tmrScrollTopTimer(Sender: TObject);
begin
tmrScrollTop.Enabled := False;
window.scrollTo(0, 0);
end;
initialization
RegisterClass(TFOrderEntry);
RegisterClass(TFOrderEntryCorrugated);
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>
......@@ -75,7 +75,7 @@ type
procedure ClearTable();
procedure GeneratePagination(TotalPages: Integer);
function GenerateSearchOptions(): string;
procedure orderEntry(orderInfo, customerInfo, mode: string);
procedure orderEntry(orderInfo, customerInfo, mode, orderType: string);
procedure HideNotification();
procedure ShowNotification(Notification: string);
procedure ShowAddOrderForm();
......@@ -242,7 +242,15 @@ begin
procedure(AValue: TModalResult)
begin
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;
......@@ -351,7 +359,8 @@ procedure TFViewOrders.wdbtcOrdersDblClickCell(Sender: TObject; ACol,
ARow: Integer);
begin
OrderID := wdbtcOrders.Cells[0, ARow];
orderEntry(OrderID, '', 'EDIT');
orderType := wdbtcOrders.Cells[3, ARow].Split([' '])[0];
orderEntry(OrderID, '', 'EDIT', orderType);
end;
procedure TFViewOrders.GeneratePagination(TotalPages: Integer);
......@@ -611,9 +620,14 @@ begin
end;
procedure TFViewOrders.orderEntry(orderInfo, customerInfo, mode: string);
procedure TFViewOrders.orderEntry(orderInfo, customerInfo, mode, orderType: string);
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;
procedure TFViewOrders.btnCloseNotificationClick(Sender: TObject);
......@@ -676,7 +690,6 @@ begin
end;
end;
console.log(orderType);
if ( ( orderType <> '' ) AND ( orderType <> 'Any' ) ) then
searchOptions := searchOptions + '&orderType=' + orderType;
......
......@@ -17,10 +17,11 @@ uses
View.Users in 'View.Users.pas' {FViewUsers: TWebForm} {*.html},
View.EditUser in 'View.EditUser.pas' {FViewEditUser: 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.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}
......
......@@ -166,7 +166,7 @@
<DesignClass>TWebForm</DesignClass>
</DCCReference>
<DCCReference Include="View.OrderEntryCorrugated.pas">
<Form>FOrderEntry</Form>
<Form>FOrderEntryCorrugated</Form>
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
......@@ -185,6 +185,11 @@
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
<DCCReference Include="View.OrderEntryCuttingDie.pas">
<Form>FOrderEntryCuttingDie</Form>
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
<None Include="index.html"/>
<None Include="css\app.css"/>
<None Include="config\config.json"/>
......
[Settings]
MemoLogLevel=4
FileLogLevel=5
LogFileNum=91
LogFileNum=95
webClientVersion=1.0.0
[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