Commit a72bb77e by Mac Stephens

Merge remote-tracking branch 'origin/cam2'

main code merged in lookupimpl in get corrugated orders
parents 37788721 5b01b1ab
......@@ -3,8 +3,8 @@ object FAddOrder: TFAddOrder
Height = 477
OnShow = WebFormShow
object WebLabel1: TWebLabel
Left = 278
Top = 44
Left = 334
Top = 56
Width = 35
Height = 15
Caption = 'Search'
......@@ -12,8 +12,8 @@ object FAddOrder: TFAddOrder
WidthPercent = 100.000000000000000000
end
object WebLabel2: TWebLabel
Left = 414
Top = 44
Left = 482
Top = 56
Width = 58
Height = 15
Caption = 'Selected ID'
......@@ -21,8 +21,8 @@ object FAddOrder: TFAddOrder
WidthPercent = 100.000000000000000000
end
object edtSearch: TWebEdit
Left = 278
Top = 62
Left = 334
Top = 82
Width = 121
Height = 22
HeightPercent = 100.000000000000000000
......@@ -30,8 +30,8 @@ object FAddOrder: TFAddOrder
OnChange = edtSearchChange
end
object edtID: TWebEdit
Left = 414
Top = 62
Left = 482
Top = 82
Width = 69
Height = 22
ChildOrder = 1
......@@ -196,8 +196,8 @@ object FAddOrder: TFAddOrder
DesignTimeSampleData = True
end
object cbCorrugatedPlate: TWebCheckBox
Left = 26
Top = 63
Left = 4
Top = 83
Width = 113
Height = 22
Caption = 'Corrugated Plate'
......@@ -207,8 +207,8 @@ object FAddOrder: TFAddOrder
OnClick = cbCorrugatedPlateClick
end
object cbWebPlate: TWebCheckBox
Left = 152
Top = 64
Left = 128
Top = 83
Width = 83
Height = 22
Caption = 'Web Plate'
......@@ -218,8 +218,8 @@ object FAddOrder: TFAddOrder
OnClick = cbWebPlateClick
end
object btnCancel: TWebButton
Left = 674
Top = 61
Left = 680
Top = 81
Width = 96
Height = 25
Caption = 'Cancel'
......@@ -229,8 +229,8 @@ object FAddOrder: TFAddOrder
OnClick = btnCancelClick
end
object btnConfirm: TWebButton
Left = 554
Top = 61
Left = 564
Top = 81
Width = 96
Height = 25
Caption = 'Confirm'
......@@ -239,15 +239,48 @@ object FAddOrder: TFAddOrder
WidthPercent = 100.000000000000000000
OnClick = btnConfirmClick
end
object cbCuttingDie: TWebCheckBox
Left = 231
Top = 83
Width = 83
Height = 22
Caption = 'Cutting Die'
ChildOrder = 3
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = cbCuttingDieClick
end
object edtNotification: TWebEdit
Left = 4
Top = 16
Width = 510
Height = 22
HelpType = htKeyword
TabStop = False
ChildOrder = 8
ElementClassName = 'form-control'
ElementFont = efCSS
Enabled = False
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -8
Font.Name = 'Arial'
Font.Style = []
HeightPercent = 100.000000000000000000
HideSelection = False
ParentFont = False
TabOrder = 1
WidthPercent = 100.000000000000000000
end
object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection
Left = 730
Top = 93
Left = 780
Top = 21
end
object xdwdsCustomers: TXDataWebDataSet
Connection = DMConnection.ApiConnection
Left = 600
Top = 95
Left = 726
Top = 7
object xdwdsCustomersID: TIntegerField
FieldName = 'ID'
end
......@@ -264,7 +297,7 @@ object FAddOrder: TFAddOrder
end
object wdsCustomers: TWebDataSource
DataSet = xdwdsCustomers
Left = 468
Top = 93
Left = 660
Top = 1
end
end
// Pop-Up menu that appears when Add Order button is clicked on orders page.
// Used to select customer before entering an order.
unit View.AddOrder;
interface
......@@ -29,6 +31,8 @@ type
xdwdsCustomersSHORT_NAME: TStringField;
wdsCustomers: TWebDataSource;
xdwdsCustomersADDRESS: TStringField;
cbCuttingDie: TWebCheckBox;
edtNotification: TWebEdit;
procedure WebFormShow(Sender: TObject);
procedure TMSFNCGrid1SelectedCell(Sender: TObject; ACol, ARow: Integer);
procedure edtSearchChange(Sender: TObject);
......@@ -36,6 +40,7 @@ type
procedure cbWebPlateClick(Sender: TObject);
procedure btnConfirmClick(Sender: TObject);
procedure btnCancelClick(Sender: TObject);
procedure cbCuttingDieClick(Sender: TObject);
private
[async] procedure getCustomers;
procedure PopulateGridManually;
......@@ -56,14 +61,20 @@ implementation
procedure TFAddOrder.btnCancelClick(Sender: TObject);
begin
edtID.Text := '';
Close;
end;
procedure TFAddOrder.btnConfirmClick(Sender: TObject);
begin
if ( ( not cbCorrugatedPlate.Checked ) and ( not cbWebPlate.Checked ) and ( not cbCuttingDie.Checked ) ) then
edtNotification.Text := 'Please Select an Order Type'
else if edtID.Text = '' then
edtNotification.Text := 'Please Select a Customer'
else
begin
confirm := true;
Close;
end;
end;
procedure TFAddOrder.WebFormShow(Sender: TObject);
......@@ -76,11 +87,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);
......@@ -89,6 +108,7 @@ begin
end;
[async] procedure TFAddOrder.getCustomers();
// retrieves customer list from server
var
xdcResponse: TXDataClientResponse;
customerList: TJSObject;
......@@ -107,6 +127,7 @@ begin
end;
procedure TFAddOrder.PopulateGridManually;
// populates the grid with customers manually.
var
RowIndex: Integer;
begin
......@@ -122,10 +143,6 @@ begin
TMSFNCGrid1.Cells[2, 0] := 'Name';
TMSFNCGrid1.Cells[3, 0] := 'Address';
// TMSFNCGrid1.ColumnWidths[0] := 40;
// TMSFNCGrid1.ColumnWidths[1] := 80;
// TMSFNCGrid1.ColumnWidths[2] := 250;
// Populate the grid with data from the dataset
xdwdsCustomers.First;
RowIndex := 1;
......@@ -152,11 +169,13 @@ end;
procedure TFAddOrder.TMSFNCGrid1SelectedCell(Sender: TObject; ACol,
ARow: Integer);
// When a cell is clicked it puts the ID in the text box
begin
edtID.Text := TMSFNCGrid1.Cells[0, ARow];
end;
procedure TFAddOrder.ApplyFilter;
// filters the grid based on search textbox contents.
var
fd: TTMSFNCGridFilterData;
i: Integer;
......
......@@ -26,7 +26,6 @@ type
cbStatus: TWebCheckBox;
procedure WebFormCreate(Sender: TObject);
procedure btnApplyClick(Sender: TObject);
procedure btnSearchClick(Sender: TObject);
procedure wcbPageSizeChange(Sender: TObject);
private
FChildForm: TWebForm;
......@@ -34,7 +33,6 @@ type
procedure ClearTable();
procedure GeneratePagination(TotalPages: Integer);
function GenerateSearchOptions(): string;
[async] procedure Search(searchOptions: string);
[async] procedure GetItems(searchOptions: string);
[async] procedure getUser();
[async] procedure AddItem(itemOptions: string);
......@@ -86,11 +84,10 @@ end;
procedure TFViewItems.AddRowToTable(ID, Name, Description, Status: string);
// Adds rows to the table
// PhoneNumber: phone number of the location
// Caller: phone number of the caller
// Duration: duration of the call
// Transcript: transcription of the recording
// MediaUrl: Link to the recording
// ID: item ID
// Name: item name
// Description: item description
// Status: inactive or active
var
NewRow, Cell, P, Button, Audio: TJSHTMLElement;
begin
......@@ -293,6 +290,9 @@ begin
end;
procedure TFViewItems.GetItems(searchOptions: string);
// retrieves items from the server.
// searchOptions: info to limit how many items we retrieve from the server.
// probably not needed due to database size.
var
xdcResponse: TXDataClientResponse;
itemList : TJSObject;
......@@ -355,6 +355,7 @@ begin
end;
procedure TFViewItems.AddItem(itemOptions: string);
// adds an item to the database.
var
xdcResponse: TXDataClientResponse;
begin
......@@ -363,48 +364,13 @@ begin
getItems(GenerateSearchOptions());
end;
procedure TFViewItems.Search(searchOptions: string);
// Search method that searches the database for a specific phone number
var
xdcResponse: TXDataClientResponse;
callList : TJSObject;
i: integer;
data: TJSArray;
call: TJSObject;
callListLength: integer;
begin
{if PageNumber > 0 then
begin
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.Search',
[searchOptions]));
callList := TJSObject(xdcResponse.Result);
data := TJSArray(callList['data']);
callListLength := integer(callList['count']);
ClearTable();
for i := 0 to data.Length - 1 do
begin
call := TJSObject(data[i]);
AddRowToTable(string(call['toNumber']), string(call['fromNumber']), string(call['dateCreated']),
string(call['duration']), string(call['transcription']), string(call['mediaUrl']));
end;
TotalPages := (callListLength + PageSize - 1) div PageSize;
lblEntries.Caption := 'Showing entries for phone number: ' + searchOptions;
end; }
end;
procedure TFViewItems.wcbPageSizeChange(Sender: TObject);
// gets a new amount of items based when the page size is changed
begin
PageNumber := 1;
getItems(GenerateSearchOptions());
end;
procedure TFViewItems.btnSearchClick(Sender: TObject);
// item Search method
begin
//Search(edtSearch.Text);
end;
procedure TFViewItems.ClearTable();
// clears the table
var
......
......@@ -51,7 +51,9 @@ 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 ViewOrderEntryWeb(orderInfo, customerInfo, mode: string);
procedure ViewOrderEntryCuttingDie(orderInfo, customerInfo, mode: string);
procedure ViewOrders(info: string);
procedure ShowUserForm(Info: string);
end;
......@@ -70,7 +72,9 @@ uses
View.Users,
View.EditUser,
View.Orders,
View.OrderEntryCorrugated;
View.OrderEntryCorrugated,
View.OrderEntryCuttingDie,
View.OrderEntryWeb;
{$R *.dfm}
......@@ -227,12 +231,28 @@ 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.ViewOrderEntryWeb(orderInfo, customerInfo, mode: string);
begin
lblAppTitle.Caption := 'Koehler-Gibson Order Entry';
if Assigned(FChildForm) then
FChildForm.Free;
FChildForm := TFOrderEntryWeb.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
......@@ -354,19 +354,6 @@ object FOrderEntry: TFOrderEntry
DataField = 'staff_fields_job_name'
DataSource = WebDataSource1
end
object edtQuickBooksItem: TWebDBEdit
Left = 26
Top = 514
Width = 121
Height = 22
AutoSize = True
ChildOrder = 79
ElementID = 'edtquickbooksitem'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'staff_fields_quickbooks_item'
DataSource = WebDataSource1
end
object edtOther: TWebDBEdit
Left = 316
Top = 348
......@@ -692,32 +679,6 @@ object FOrderEntry: TFOrderEntry
DataField = 'plates_job_number'
DataSource = WebDataSource1
end
object edtPlateMaterial: TWebDBEdit
Left = 852
Top = 72
Width = 121
Height = 22
AutoSize = True
ChildOrder = 79
ElementID = 'edtplatematerial'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'plates_plate_material'
DataSource = WebDataSource1
end
object edtThickness: TWebDBEdit
Left = 852
Top = 39
Width = 121
Height = 22
AutoSize = True
ChildOrder = 79
ElementID = 'edtThickness'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'plates_thickness'
DataSource = WebDataSource1
end
object cbArtApprovedAsIs: TWebDBCheckBox
Left = 662
Top = 480
......@@ -797,8 +758,8 @@ object FOrderEntry: TFOrderEntry
DataSource = WebDataSource1
end
object btnConfirm: TWebButton
Left = 752
Top = 558
Left = 652
Top = 560
Width = 96
Height = 25
Caption = 'Confirm'
......@@ -965,10 +926,80 @@ object FOrderEntry: TFOrderEntry
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object btnEdit: TWebButton
Left = 870
Top = 560
Width = 96
Height = 25
Caption = 'Edit'
ChildOrder = 79
ElementID = 'btnedit'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
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 WebDBComboBox2: TWebDBComboBox
Left = 26
Top = 515
Width = 145
Height = 22
ElementID = 'wcbqbitem'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
ItemIndex = -1
DataField = 'staff_fields_quickbooks_item'
DataSource = WebDataSource1
ListField = 'name'
ListSource = wdsQBItem
end
object WebDBComboBox3: TWebDBComboBox
Left = 833
Top = 77
Width = 145
Height = 22
ElementID = 'wcbmaterial'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
ItemIndex = -1
Items.Strings = (
'PhotoPolymer'
'Rubber')
DataField = 'plates_plate_material'
DataSource = WebDataSource1
end
object WebDBComboBox4: TWebDBComboBox
Left = 833
Top = 48
Width = 145
Height = 22
ElementID = 'wcbthickness'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
ItemIndex = -1
Items.Strings = (
'.250'
'.155'
'.107'
'.067'
'.045')
DataField = 'plates_thickness'
DataSource = WebDataSource1
end
object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection
Left = 244
Top = 44
Left = 160
Top = 18
end
object tmrScrollTop: TWebTimer
Interval = 100
......@@ -978,8 +1009,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
......@@ -1256,8 +1287,8 @@ object FOrderEntry: TFOrderEntry
end
object WebDataSource1: TWebDataSource
DataSet = XDataWebDataSet1
Left = 216
Top = 104
Left = 22
Top = 10
end
object wdsShipTo: TWebDataSource
DataSet = xdwdsShipTo
......@@ -1265,10 +1296,22 @@ object FOrderEntry: TFOrderEntry
Top = 436
end
object xdwdsShipTo: TXDataWebDataSet
Left = 192
Top = 486
Left = 202
Top = 416
object xdwdsShipToADDRESS: TStringField
FieldName = 'ADDRESS'
end
end
object wdsQBItem: TWebDataSource
DataSet = xdwdsQBItem
Left = 240
Top = 518
end
object xdwdsQBItem: TXDataWebDataSet
Left = 200
Top = 512
object xdwdsQBItemname: TStringField
FieldName = 'name'
end
end
end
......@@ -68,7 +68,7 @@
</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%'/>
<select id="wcbqbitem" 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">Art Due:</label>
......@@ -278,15 +278,15 @@
<hr class="custom-hr">
<div class="row">
<div class="col-auto">
<label class='pe-2' style="font-weight: 700; font-size: 15px;" id="lblthickness">Thickness:</label>
<input id="edtThickness" class="form-control input-sm" style="width: 150px"/>
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Thickness:</label>
<select id="wcbthickness" class='form-select'></select>
</div>
<div class="col-auto">
<label class='pe-2' style="font-weight: 700; font-size: 15px;" id="lblplatematerial">Plate Material:</label>
<input id="edtplatematerial" class="form-control input-sm" style="width: 150px"/>
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Plate Material:</label>
<select id="wcbmaterial" class='form-select'></select>
</div>
<div class="col-auto">
<label class='pe-2' style="font-weight: 700; font-size: 15px;" id="lbljobnumber">Job Number:</label>
<label class="form-label mt-2" style="font-weight: 700; font-size: 15px;" id="lbljobnumber">Job Number:</label>
<input id="edtjobnumber" class="form-control input-sm" style="width: 150px"/>
</div>
</div>
......@@ -300,7 +300,13 @@
</div>
<div class="row">
<div class="col-auto">
<button id="btnconfirm" class="btn btn-primary btn-sm float-end">Confirm</button>
<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 class="col-auto">
<button id="btnedit" class="btn btn-primary btn-sm float-end my-2">Edit</button>
</div>
</div>
</div>
......
// Order Entry page of Corruguated Orders. Used for both editting and adding
// orders.
unit View.OrderEntryCorrugated;
interface
......@@ -10,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;
......@@ -40,7 +42,6 @@ type
edtInvoiceTo: TWebDBEdit;
edtPONumber: TWebDBEdit;
edtJobName: TWebDBEdit;
edtQuickBooksItem: TWebDBEdit;
edtOther: TWebDBEdit;
edtCADFile: TWebDBEdit;
edtAroundNo: TWebDBEdit;
......@@ -66,8 +67,6 @@ type
edtMachineIndent: TWebDBEdit;
edtCylinderSize: TWebDBEdit;
edtJobNumber: TWebDBEdit;
edtPlateMaterial: TWebDBEdit;
edtThickness: TWebDBEdit;
cbArtApprovedAsIs: TWebDBCheckBox;
cbPDFFile: TWebDBCheckBox;
cbWideFormat: TWebDBCheckBox;
......@@ -187,6 +186,14 @@ type
WebDBComboBox1: TWebDBComboBox;
cbEmail: TWebCheckBox;
XDataWebDataSet1supplied_by_customer_order_date: TStringField;
btnEdit: TWebButton;
btnCancel: TWebButton;
WebDBComboBox2: TWebDBComboBox;
wdsQBItem: TWebDataSource;
xdwdsQBItem: TXDataWebDataSet;
xdwdsQBItemname: TStringField;
WebDBComboBox3: TWebDBComboBox;
WebDBComboBox4: TWebDBComboBox;
procedure WebFormCreate(Sender: TObject);
procedure HideNotification();
procedure ShowNotification(Notification: string);
......@@ -198,6 +205,7 @@ type
procedure addColorRow(num, Color, LPI, Size: string);
procedure btnConfirmClick(Sender: TObject);
[async] procedure AddCorrugatedOrder(orderJSON: TJSONObject);
procedure btnCancelClick(Sender: TObject);
private
FAgencyCode: string;
FCurrentReportType: string;
......@@ -211,7 +219,7 @@ type
end;
var
FOrderEntry: TFOrderEntry;
FOrderEntryCorrugated: TFOrderEntryCorrugated;
implementation
......@@ -220,7 +228,8 @@ 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;
container: TJSElement;
......@@ -263,8 +272,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
......@@ -349,15 +358,16 @@ begin
XDataWebDataSet1.Next;
end;
orderJSON.AddPair('COMPANY_ID', customerID);
orderJSON.AddPair('USER_ID', '1011');
orderJSON.AddPair('USER_ID', JS.toString(AuthService.TokenPayload.Properties['user_id']));
orderJSON.AddPair('mode', mode);
if mode = 'EDIT' then
orderJSON.AddPair('ORDER_ID', orderID);
AddCorrugatedOrder(orderJSON);
FViewMain.ViewOrders('Success');
FViewMain.ViewOrders('Success:Order Successfully Added');
end;
procedure TFOrderEntry.AddCorrugatedOrder(orderJSON: TJSONObject);
procedure TFOrderEntryCorrugated.AddCorrugatedOrder(orderJSON: TJSONObject);
// sends the order JSON object to the server
var
Response: TXDataClientResponse;
begin
......@@ -365,27 +375,30 @@ 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
begin
asm
const container = document.getElementById('additionalFields');
......@@ -435,12 +448,17 @@ begin
end;
end;
procedure TFOrderEntry.WebButton1Click(Sender: TObject);
procedure TFOrderEntryCorrugated.WebButton1Click(Sender: TObject);
begin
addColorRow('','','','');
end;
procedure TFOrderEntry.WebFormCreate(Sender: TObject);
procedure TFOrderEntryCorrugated.btnCancelClick(Sender: TObject);
begin
FViewMain.ViewOrders('');
end;
procedure TFOrderEntryCorrugated.WebFormCreate(Sender: TObject);
begin
if not DMConnection.ApiConnection.Connected then
begin
......@@ -449,7 +467,8 @@ 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;
orderList : TJSObject;
......@@ -464,6 +483,7 @@ var
color: TJSObject;
colorJSON: TJSONObject;
colorListJSON: TJSONArray;
items: TJSObject;
begin
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.GetOrder',
[Order_ID]));
......@@ -534,13 +554,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;
......@@ -589,11 +605,23 @@ begin
else
cbStripMount.Checked := false;
if mode = 'EDIT' then
begin
CustomerID := XDataWebDataSet1COMPANY_ID.AsString;
xdwdsShipTo.Close;
xdwdsShipTo.SetJSONData(order['ADDRESS_LIST']);
xdwdsShipTo.Open;
end;
xdwdsQBItem.Close;
items := TJSObject(order['ITEMS']);
xdwdsQBItem.SetJsonData(items['data']);
xdwdsQBITEM.Open;
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;
customer : TJSObject;
......@@ -606,13 +634,15 @@ begin
XDataWebDataSet1.SetJsonData(customer);
XDataWebDataSet1.Open;
xdwdsShipTo.Close;
xdwdsShipTo.SetJSONData(customer['ADDRESS_LIST']);
xdwdsShipTo.Open;
end;
procedure TFOrderEntry.WebFormShow(Sender: TObject);
procedure TFOrderEntryCorrugated.WebFormShow(Sender: TObject);
begin
if mode <> 'ADD' then
getOrder(orderID)
......@@ -621,12 +651,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
......@@ -636,14 +666,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.
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
DataSet = XDataWebDataSet1
Left = 22
Top = 10
end
object XDataWebDataSet1: TXDataWebDataSet
Connection = DMConnection.ApiConnection
Left = 90
Top = 20
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 XDataWebDataSet1ORDER_STATUS: TStringField
FieldName = 'ORDER_STATUS'
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 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 XDataWebDataSet1ORDER_ID: TStringField
FieldName = 'ORDER_ID'
end
object XDataWebDataSet1NAME: TStringField
FieldName = 'NAME'
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
DataSet = xdwdsShipTo
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;
XDataWebDataSet1COMPANY_ID: TIntegerField;
XDataWebDataSet1USER_ID: TIntegerField;
XDataWebDataSet1ORDER_DATE: TDateField;
XDataWebDataSet1ORDER_STATUS: 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;
XDataWebDataSet1staff_fields_order_date: TStringField;
XDataWebDataSet1staff_fields_proof_date: TStringField;
XDataWebDataSet1staff_fields_ship_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;
XDataWebDataSet1ORDER_ID: TStringField;
XDataWebDataSet1NAME: TStringField;
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
......@@ -56,50 +56,6 @@ object FViewOrders: TFViewOrders
WidthPercent = 100.000000000000000000
OnClick = btnSearchClick
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 = 2
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
Left = 188
Top = 79
......@@ -114,6 +70,7 @@ object FViewOrders: TFViewOrders
TabOrder = 7
TabStop = False
WidthPercent = 100.000000000000000000
OnClick = WebButton1Click
end
object btnPDF: TWebButton
Left = 332
......@@ -163,6 +120,8 @@ object FViewOrders: TFViewOrders
Header.ListItemElementClassName = 'page-item'
Header.ListLinkElementClassName = 'page-link'
WordWrap = True
OnClickCell = wdbtcOrdersClickCell
OnDblClickCell = wdbtcOrdersDblClickCell
Columns = <
item
DataField = 'ID'
......@@ -342,6 +301,36 @@ object FViewOrders: TFViewOrders
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object pnlMessage: TWebPanel
Left = 12
Top = 16
Width = 121
Height = 33
ElementID = 'view.login.message'
ChildOrder = 17
TabOrder = 8
object lblMessage: TWebLabel
Left = 16
Top = 11
Width = 42
Height = 13
Caption = 'Message'
ElementID = 'view.login.message.label'
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'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnCloseNotificationClick
end
end
object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection
Left = 28
......
<div class="container h-100 d-flex flex-column mt-0" style="max-width: 100%; padding-bottom: 0;">
<!-- Alert Section -->
<div class="row">
<div class="col-sm">
<div id="pnl_message" class="alert alert-danger">
<div class=col-sm>
<div id="view.login.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>
......
object FSearch: TFSearch
Width = 1016
Width = 733
Height = 683
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
......@@ -468,7 +468,7 @@ object FSearch: TFSearch
object TMSFNCGrid1: TTMSFNCGrid
Left = 20
Top = 112
Width = 620
Width = 699
Height = 233
ParentDoubleBuffered = False
DoubleBuffered = True
......@@ -544,7 +544,7 @@ object FSearch: TFSearch
Font.Name = 'Segoe UI'
Font.Style = []
ID = ''
Width = 241.000000000000000000
Width = 320.000000000000000000
end
item
BorderWidth = 1
......@@ -742,13 +742,13 @@ object FSearch: TFSearch
end
object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection
Left = 738
Top = 61
Left = 520
Top = 383
end
object xdwdsCustomers: TXDataWebDataSet
Connection = DMConnection.ApiConnection
Left = 666
Top = 73
Left = 418
Top = 393
object xdwdsCustomersID: TIntegerField
FieldName = 'ID'
end
......@@ -764,7 +764,7 @@ object FSearch: TFSearch
end
object wdsCustomers: TWebDataSource
DataSet = xdwdsCustomers
Left = 650
Top = 23
Left = 594
Top = 387
end
end
// Search pop-up form used to filter the list.
// Author: Cameron Hayes
unit View.Search;
interface
......@@ -105,6 +107,7 @@ begin
end;
procedure TFSearch.WebFormShow(Sender: TObject);
// Auto fills information based on previous search
var
params: TStringList;
DateFormatSettings: TFormatSettings;
......@@ -241,6 +244,7 @@ begin
end;
[async] procedure TFSearch.getCustomers();
// Gets a list of customers from the server
var
xdcResponse: TXDataClientResponse;
customerList: TJSObject;
......
object FSetStatus: TFSetStatus
Width = 640
Height = 361
OnShow = WebFormShow
object lblStatus1: TWebLabel
Left = 326
Top = 80
Width = 38
Height = 14
Caption = 'Status:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000
end
object WebLabel1: TWebLabel
Left = 484
Top = 80
Width = 91
Height = 14
Caption = 'Date Completed:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000
end
object WebLabel2: TWebLabel
Left = 14
Top = 80
Width = 48
Height = 14
Caption = 'Order ID:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000
end
object WebLabel3: TWebLabel
Left = 172
Top = 78
Width = 57
Height = 14
Caption = 'Job Name:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000
end
object WebLabel4: TWebLabel
Left = 11
Top = 142
Width = 51
Height = 14
Caption = 'Ship Due:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000
end
object WebLabel5: TWebLabel
Left = 169
Top = 142
Width = 78
Height = 14
Caption = 'New Due Date:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000
end
object WebLabel6: TWebLabel
Left = 326
Top = 140
Width = 62
Height = 14
Caption = 'Mount Due:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000
end
object WebLabel7: TWebLabel
Left = 484
Top = 140
Width = 78
Height = 14
Caption = 'New Due Date:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000
end
object WebLabel8: TWebLabel
Left = 11
Top = 200
Width = 54
Height = 14
Caption = 'Plate Due:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000
end
object WebLabel9: TWebLabel
Left = 169
Top = 200
Width = 78
Height = 14
Caption = 'New Due Date:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000
end
object WebLabel10: TWebLabel
Left = 324
Top = 200
Width = 44
Height = 14
Caption = 'Art Due:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000
end
object WebLabel11: TWebLabel
Left = 482
Top = 200
Width = 78
Height = 14
Caption = 'New Due Date:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000
end
object wlcbStatus: TWebLookupComboBox
Left = 326
Top = 100
Width = 145
Height = 22
ElementClassName = 'custom-select'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
ItemIndex = -1
LookupValues = <
item
Value = 'PROOF'
DisplayText = 'Proof Done'
end
item
Value = 'ART'
DisplayText = 'Art Done'
end
item
Value = 'PLATE'
DisplayText = 'Plate Done'
end
item
Value = 'MOUNT'
DisplayText = 'Mount Done'
end
item
Value = 'SHIP'
DisplayText = 'Ship Done'
end>
end
object dtpDate: TWebDateTimePicker
Left = 484
Top = 100
Width = 145
Height = 22
BorderStyle = bsSingle
ChildOrder = 1
Color = clWhite
Date = 45665.641243414350000000
Role = ''
Text = ''
end
object btnConfirm: TWebButton
Left = 11
Top = 271
Width = 96
Height = 25
Caption = 'Confirm'
ChildOrder = 7
ElementClassName = 'btn btn-secondary'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
TabOrder = 5
TabStop = False
WidthPercent = 100.000000000000000000
OnClick = btnConfirmClick
end
object btnCancel: TWebButton
Left = 133
Top = 271
Width = 96
Height = 25
Caption = 'Cancel'
ChildOrder = 7
ElementClassName = 'btn btn-secondary'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
TabOrder = 5
TabStop = False
WidthPercent = 100.000000000000000000
OnClick = btnCancelClick
end
object edtOrderID: TWebEdit
Left = 14
Top = 100
Width = 145
Height = 22
HelpType = htKeyword
TabStop = False
ChildOrder = 8
ElementClassName = 'form-control'
ElementFont = efCSS
Enabled = False
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -8
Font.Name = 'Arial'
Font.Style = []
HeightPercent = 100.000000000000000000
HideSelection = False
ParentFont = False
TabOrder = 1
WidthPercent = 100.000000000000000000
end
object edtNotification: TWebEdit
Left = 14
Top = 24
Width = 303
Height = 22
HelpType = htKeyword
TabStop = False
ChildOrder = 8
ElementClassName = 'form-control'
ElementFont = efCSS
Enabled = False
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -8
Font.Name = 'Arial'
Font.Style = []
HeightPercent = 100.000000000000000000
HideSelection = False
ParentFont = False
TabOrder = 1
WidthPercent = 100.000000000000000000
end
object edtJobName: TWebEdit
Left = 172
Top = 100
Width = 145
Height = 22
HelpType = htKeyword
TabStop = False
ChildOrder = 8
ElementClassName = 'form-control'
ElementFont = efCSS
Enabled = False
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -8
Font.Name = 'Arial'
Font.Style = []
HeightPercent = 100.000000000000000000
HideSelection = False
ParentFont = False
TabOrder = 1
WidthPercent = 100.000000000000000000
end
object dtpShipDue: TWebDateTimePicker
Left = 11
Top = 162
Width = 145
Height = 22
BorderStyle = bsSingle
ChildOrder = 1
Color = clWhite
Date = 45665.641243414350000000
Enabled = False
Role = ''
Text = ''
end
object dtpNewShipDue: TWebDateTimePicker
Left = 169
Top = 162
Width = 145
Height = 22
BorderStyle = bsSingle
ChildOrder = 1
Color = clWhite
Date = 45665.641243414350000000
Role = ''
Text = ''
end
object dtpMountDue: TWebDateTimePicker
Left = 326
Top = 160
Width = 145
Height = 22
BorderStyle = bsSingle
ChildOrder = 1
Color = clWhite
Date = 45665.641243414350000000
Enabled = False
Role = ''
Text = ''
end
object dtpNewMountDue: TWebDateTimePicker
Left = 484
Top = 160
Width = 145
Height = 22
BorderStyle = bsSingle
ChildOrder = 1
Color = clWhite
Date = 45665.641243414350000000
Role = ''
Text = ''
end
object dtpPlateDue: TWebDateTimePicker
Left = 11
Top = 220
Width = 145
Height = 22
BorderStyle = bsSingle
ChildOrder = 1
Color = clWhite
Date = 45665.641243414350000000
Enabled = False
Role = ''
Text = ''
end
object dtpNewPlateDue: TWebDateTimePicker
Left = 169
Top = 220
Width = 145
Height = 22
BorderStyle = bsSingle
ChildOrder = 1
Color = clWhite
Date = 45665.641243414350000000
Role = ''
Text = ''
end
object dtpArtDue: TWebDateTimePicker
Left = 324
Top = 220
Width = 145
Height = 22
BorderStyle = bsSingle
ChildOrder = 1
Color = clWhite
Date = 45665.641243414350000000
Enabled = False
Role = ''
Text = ''
end
object dtpNewArtDue: TWebDateTimePicker
Left = 482
Top = 220
Width = 145
Height = 22
BorderStyle = bsSingle
ChildOrder = 1
Color = clWhite
Date = 45665.641243414350000000
Role = ''
Text = ''
end
end
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>TMS Web Project</title>
<style>
</style>
</head>
<body>
</body>
</html>
\ No newline at end of file
unit View.SetStatus;
interface
uses
System.SysUtils, System.Classes, JS, Web, WEBLib.Graphics, WEBLib.Controls,
WEBLib.Forms, WEBLib.Dialogs, Vcl.Controls, Vcl.StdCtrls, WEBLib.ExtCtrls,
WEBLib.StdCtrls;
type
TFSetStatus = class(TWebForm)
wlcbStatus: TWebLookupComboBox;
dtpDate: TWebDateTimePicker;
lblStatus1: TWebLabel;
WebLabel1: TWebLabel;
btnConfirm: TWebButton;
btnCancel: TWebButton;
WebLabel2: TWebLabel;
edtOrderID: TWebEdit;
edtNotification: TWebEdit;
edtJobName: TWebEdit;
WebLabel3: TWebLabel;
WebLabel4: TWebLabel;
dtpShipDue: TWebDateTimePicker;
WebLabel5: TWebLabel;
dtpNewShipDue: TWebDateTimePicker;
WebLabel6: TWebLabel;
dtpMountDue: TWebDateTimePicker;
WebLabel7: TWebLabel;
dtpNewMountDue: TWebDateTimePicker;
WebLabel8: TWebLabel;
dtpPlateDue: TWebDateTimePicker;
WebLabel9: TWebLabel;
dtpNewPlateDue: TWebDateTimePicker;
WebLabel10: TWebLabel;
dtpArtDue: TWebDateTimePicker;
WebLabel11: TWebLabel;
dtpNewArtDue: TWebDateTimePicker;
procedure WebFormShow(Sender: TObject);
procedure btnConfirmClick(Sender: TObject);
procedure btnCancelClick(Sender: TObject);
private
{ Private declarations }
procedure HideNotification;
procedure ShowNotification(Notification: string);
public
{ Public declarations }
confirm: boolean;
OrderID, JobName: string;
ShipDue, MountDue, PlateDue, ArtDue: TDateTime;
end;
var
FSetStatus: TFSetStatus;
implementation
{$R *.dfm}
procedure TFSetStatus.btnCancelClick(Sender: TObject);
begin
Close;
end;
procedure TFSetStatus.btnConfirmClick(Sender: TObject);
begin
if ( (dtpDate.Date = 0 ) or ( wlcbStatus.value = '' ) ) then
ShowNotification('Failure:Please fill in all information')
else
begin
confirm := true;
Close;
end;
end;
procedure TFSetStatus.WebFormShow(Sender: TObject);
begin
HideNotification();
edtOrderID.Text := OrderID;
dtpDate.Date := 0;
edtJobName.Text := JobName;
dtpShipDue.Date := ShipDue;
dtpMountDue.Date := MountDue;
dtpPlateDue.Date := PlateDue;
dtpArtDue.Date := ArtDue;
dtpNewShipDue.Date := 0;
dtpNewMountDue.Date := 0;
dtpNewPlateDue.Date := 0;
dtpNewArtDue.Date := 0;
end;
procedure TFSetStatus.HideNotification;
begin
//pnlMessage.ElementHandle.hidden := True;
end;
procedure TFSetStatus.ShowNotification(Notification: string);
begin
if Notification <> '' then
begin
edtNotification.Text := Notification;
end;
end;
end.
\ No newline at end of file
......@@ -57,6 +57,7 @@ input[type="text"] {
/* Navbar items - keep them aligned and spaced out */
.navbar-nav .nav-item {
padding: 0 15px; /* Adjust spacing between navbar items */
z-index: 9999;
}
/* Flexbox for the entire navbar */
......
......@@ -17,9 +17,12 @@ 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.Search in 'View.Search.pas' {FSearch: TWebForm} {*.html},
View.SetStatus in 'View.SetStatus.pas' {FSetStatus: TWebForm} {*.html},
View.OrderEntryCuttingDie in 'View.OrderEntryCuttingDie.pas' {FOrderEntryCuttingDie: TWebForm} {*.html},
View.OrderEntryWeb in 'View.OrderEntryWeb.pas' {FOrderEntryWeb: 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>
......@@ -180,6 +180,21 @@
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
<DCCReference Include="View.SetStatus.pas">
<Form>FSetStatus</Form>
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
<DCCReference Include="View.OrderEntryCuttingDie.pas">
<Form>FOrderEntryCuttingDie</Form>
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
<DCCReference Include="View.OrderEntryWeb.pas">
<Form>FOrderEntryWeb</Form>
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
<None Include="index.html"/>
<None Include="css\app.css"/>
<None Include="config\config.json"/>
......
......@@ -22,9 +22,11 @@ type
userName: string;
userFullName: string;
userId: string;
userAdmin: boolean;
userPhone: string;
userPerspectiveID: string;
userQBID: string;
userAccessType: string;
userEmail: string;
userStatus: string;
procedure AfterConstruction; override;
procedure BeforeDestruction; override;
property Query: TUniQuery read GetQuery;
......@@ -106,9 +108,12 @@ begin
JWT.Claims.SetClaimOfType<string>('user_name', userName);
JWT.Claims.SetClaimOfType<string>('user_fullname', userFullName);
JWT.Claims.SetClaimOfType<string>('user_id', userId);
JWT.Claims.SetClaimOfType<boolean>('user_admin', userAdmin);
JWT.Claims.SetClaimOfType<string>('user_phone', userPhone);
JWT.Claims.SetClaimOfType<string>('user_perspective_id', userPerspectiveID);
JWT.Claims.SetClaimOfType<string>('user_status', userStatus);
JWT.Claims.SetClaimOfType<string>('user_email', userEmail);
JWT.Claims.SetClaimOfType<string>('user_qb_id', userQBID);
JWT.Claims.SetClaimOfType<string>('user_access_type', userAccessType);
Result := TJOSE.SHA256CompactToken(serverConfig.jwtTokenSecret, JWT);
finally
JWT.Free;
......@@ -139,17 +144,15 @@ begin
//checkString := THashSHA2.GetHashString(date_created + password, THashSHA2.TSHA2Version.SHA512).ToUpper;
if password = authDB.uq.FieldByName('PASSWORD').AsString then
begin
{userName := user;
userFullName:= authDB.uq.FieldByName('full_name').AsString;;
userId := authDB.uq.FieldByName('user_id').AsString;
userAdmin := authDB.uq.FieldByName('admin').AsBoolean;
userPhone := authDB.uq.FieldByName('phone_number').AsString;
userEmail := authDB.uq.FieldByName('email').AsString;
userStr := '?username=' + userName;
userStr := userStr + '&fullname=' + userFullName;
userStr := userStr + '&userid=' + userId;
userStr := userStr + '&useradmin=' + BoolToStr(userAdmin);}
userName := user;
userFullName:= authDB.uq.FieldByName('NAME').AsString;;
userId := authDB.uq.FieldByName('USER_ID').AsString;
userStatus := authDB.uq.FieldByName('STATUS').AsString;
userPerspectiveID := authDB.uq.FieldByName('PERSPECTIVE_ID').AsString;
userEmail := authDB.uq.FieldByName('EMAIL').AsString;
userQBID := authDB.uq.FieldByName('QB_ID').AsString;
userAccessType := authDB.uq.FieldByName('ACCESS_TYPE').AsString;
//Logger.Log( 3, Format('AuthDB.SetLoginAuditEntry: "%s"', [user]) );
//AuthDB.SetLoginAuditEntry( userStr );
Result := 3; // Succcess
......
......@@ -125,12 +125,15 @@ type
data: TList<TCustomerItem>;
end;
TFullOrder = class
TFullOrder = class //TODO change name to TCorrugatedOrder
Public
//Company
COMPANY_ID: integer;
NAME: string;
SHORT_NAME: string;
inQuickBooks: string;
ADDRESS_LIST: TList<TAddressItem>;
ITEMS: TItemList;
// Staff Fields:
staff_fields_order_date: string;
......@@ -214,20 +217,126 @@ type
// General
general_special_instructions: string;
end;
TWebOrder = class
Public
//Company
COMPANY_ID: integer;
NAME: string;
SHORT_NAME: string;
inQuickBooks: string;
ADDRESS_LIST: TList<TAddressItem>;
ITEMS: TItemList;
// Staff Fields:
staff_fields_order_date: string;
staff_fields_proof_date: string;
staff_fields_ship_date: string;
staff_fields_ship_via: string;
staff_fields_quantity: string;
staff_fields_price: string;
staff_fields_invoice_to: string;
staff_fields_ship_to: string;
staff_fields_po_number: string;
staff_fields_job_name: string;
staff_fields_quickbooks_item: string;
staff_fields_art_due: string;
staff_fields_plate_due: string;
staff_fields_mount_due: string;
staff_fields_art_location: string;
// Supplied by Customer:
supplied_by_customer_b_w_or_co: string;
supplied_by_customer_plates: string;
supplied_by_customer_sample: string;
supplied_by_customer_dimension: string;
supplied_by_customer_other: string;
supplied_by_customer_disk: string;
supplied_by_customer_e_mail: string;
supplied_by_customer_ftp: string;
supplied_by_customer_total_inc: string;
supplied_by_customer_sheets_us: string;
supplied_by_customer_initials: string;
// Proofing
proofing_pdf: boolean;
proofing_pdf_to: string;
proofing_pdf_date_1: string;
proofing_pdf_date_2: string;
proofing_pdf_date_3: string;
proofing_full_size_ink_jet_for: boolean;
proofing_ink_jet_to: string;
proofing_ink_jet_to_2: string;
proofing_ink_jet_date_1: string;
proofing_ink_jet_date_2: string;
proofing_color_contract: string;
proofing_color_contrac_to: string;
proofing_color_contrac_date_1: string;
proofing_color_contrac_date_2: string;
proofing_digital_color_key: string;
proofing_digital_color_to: string;
proofing_digital_color_date_1: string;
// Print Orientation
print_orientation_print_orient: string;
// Plate
plates_plate_material: string;
plates_thickness: string;
plates_job_number: string;
// Quantity and Color
quantity_and_colors_press_name: string;
quantity_and_colors_anilox_info: string;
quantity_and_colors_qty_colors: string;
// Plate Marks
plate_marks_microdots: string;
plate_marks_microdots_comments: string;
plate_marks_crosshairs: string;
plate_marks_crosshairs_comments: string;
plate_marks_color_bars: string;
plate_marks_color_bars_comments: string;
plate_marks_other: string;
plate_marks_other_comments: string;
// Layout
layout_around: string;
layout_accross: string;
layout_surface_print: string;
layout_reverse_print: string;
layout_cylinder_repeat: string;
layout_cutoff_dimension: string;
layout_pitch: string;
layout_teeth: string;
layout_bleed: string;
layout_cutback: string;
layout_minimum_trap_dim: string;
layout_maximum_trap_dim: string;
// UPC
upc_size: string;
upc_bar_width_reduction: string;
upc_distortion_percent: string;
upc_distortion_amount: string;
// General
general_comments: string;
end;
type
[ServiceContract, Model(API_MODEL)]
ILookupService = interface(IInvokable)
['{F24E1468-5279-401F-A877-CD48B44F4416}']
[HttpGet] function Search(phoneNum: string): TOrderList;
[HttpGet] function GetUsers(searchOptions: string): TUserList;
[HttpGet] function GetItems(searchOptions: string): TItemList;
[HttpGet] function GetOrders(searchOptions: string): TOrderList;
[HttpGet] function GetOrder(orderInfo: string): TFullOrder;
[HttpGet] function GetWebOrder(orderInfo: string): TWebOrder;
[HttpGet] function GetCustomers(): TCustomerList;
[HttpGet] function GetCustomer(ID: string): TCustomerItem;
[HttpGet] function GenerateReportPDF(searchOptions: string): string;
......@@ -238,7 +347,9 @@ type
function DelUser(username: string): string;
function EditUser(const editOptions: string): string;
function AddCorrugatedOrder(orderInfo: string): TJSONObject;
function AddWebOrder(orderInfo: string): TJSONObject;
function AddStatusSchedule(StatusType: string; order: TJSONObject; ORDER_ID: integer): string;
function SetStatus(statusOptions: string): string;
end;
implementation
......
[Settings]
MemoLogLevel=4
FileLogLevel=5
LogFileNum=90
LogFileNum=146
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