Commit 39e0e52b by cam

fixed minor bugs and began work on edit mode

parent b2e1a1b8
......@@ -46,7 +46,8 @@ type
procedure ShowForm( AFormClass: TWebFormClass );
procedure EditUser( Mode, Username, Password, Name, Status, Email,
Access, Rights, Perspective, QB: string);
procedure ViewOrderEntry( orderInfo: string);
procedure ViewOrderEntry(orderInfo, mode: string);
procedure ViewOrders(info: string);
procedure ShowUserForm(Info: string);
end;
......@@ -171,11 +172,20 @@ begin
Password, Name, Status, Email, Access, Rights, Perspective, QB);
end;
procedure TFViewMain.ViewOrderEntry(orderInfo: string);
procedure TFViewMain.ViewOrders(info: string);
begin
if Assigned(FChildForm) then
FChildForm.Free;
FChildForm := TFOrderEntry.CreateForm(WebPanel1.ElementID, orderInfo);
console.log(info);
FChildForm := TFViewOrders.CreateForm(WebPanel1.ElementID, info);
end;
procedure TFViewMain.ViewOrderEntry(orderInfo, mode: string);
begin
if Assigned(FChildForm) then
FChildForm.Free;
FChildForm := TFOrderEntry.CreateForm(WebPanel1.ElementID, orderInfo, mode);
end;
procedure TFViewMain.ShowUserForm(Info: string);
......
......@@ -379,34 +379,9 @@ object FOrderEntry: TFOrderEntry
DataField = 'staff_fields_quickbooks_item'
DataSource = WebDataSource1
end
object edtArtLocation: TWebDBEdit
Left = 26
Top = 628
Width = 121
Height = 22
ChildOrder = 79
ElementID = 'edtartlocation'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'staff_fields_art_location'
DataSource = WebDataSource1
end
object edtDimensionalLayout: TWebDBEdit
Left = 316
Top = 314
Width = 121
Height = 22
AutoSize = True
ChildOrder = 79
ElementID = 'edtdimensionallayout'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'supplied_by_customer_dimension'
DataSource = WebDataSource1
end
object edtEmail: TWebDBEdit
Left = 316
Top = 368
Top = 376
Width = 121
Height = 22
AutoSize = True
......@@ -417,22 +392,9 @@ object FOrderEntry: TFOrderEntry
DataField = 'supplied_by_customer_e_mail'
DataSource = WebDataSource1
end
object edtFTP: TWebDBEdit
Left = 316
Top = 390
Width = 121
Height = 22
AutoSize = True
ChildOrder = 79
ElementID = 'edtftp'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'supplied_by_customer_ftp'
DataSource = WebDataSource1
end
object edtOther: TWebDBEdit
Left = 316
Top = 418
Top = 348
Width = 121
Height = 22
AutoSize = True
......@@ -443,45 +405,6 @@ object FOrderEntry: TFOrderEntry
DataField = 'supplied_by_customer_other'
DataSource = WebDataSource1
end
object edtExistingCuttingDie: TWebDBEdit
Left = 316
Top = 446
Width = 121
Height = 22
AutoSize = True
ChildOrder = 79
ElementID = 'edtexistingcuttingdie'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'supplied_by_customer_existing_'
DataSource = WebDataSource1
end
object edtRefArtPrintCard: TWebDBEdit
Left = 316
Top = 474
Width = 121
Height = 22
AutoSize = True
ChildOrder = 79
ElementID = 'edtrefartprintcard'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'supplied_by_customer_ref_art_p'
DataSource = WebDataSource1
end
object edtRefArtAPDF: TWebDBEdit
Left = 316
Top = 508
Width = 121
Height = 22
AutoSize = True
ChildOrder = 79
ElementID = 'edtrefartapdf'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'supplied_by_customer_ref_art_a'
DataSource = WebDataSource1
end
object edtCADFile: TWebDBEdit
Left = 496
Top = 207
......@@ -947,19 +870,6 @@ object FOrderEntry: TFOrderEntry
DataField = 'layout_excalibur_die'
DataSource = WebDataSource1
end
object cbDiskorCD: TWebDBCheckBox
Left = 320
Top = 342
Width = 113
Height = 22
Caption = 'Disk or CD'
ChildOrder = 79
ElementID = 'cbdiskorcd'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'supplied_by_customer_disk_or_cd'
DataSource = WebDataSource1
end
object cbSampleCarton: TWebDBCheckBox
Left = 316
Top = 286
......@@ -999,19 +909,6 @@ object FOrderEntry: TFOrderEntry
DataField = 'supplied_by_customer_color_copy'
DataSource = WebDataSource1
end
object cbBWCopy: TWebDBCheckBox
Left = 316
Top = 207
Width = 113
Height = 22
Caption = 'B/W Copy'
ChildOrder = 79
ElementID = 'cbbwcopy'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'supplied_by_customer_b_w_copy'
DataSource = WebDataSource1
end
object edtSpecialInstructions: TWebDBEdit
Left = 852
Top = 185
......@@ -1037,6 +934,50 @@ object FOrderEntry: TFOrderEntry
WidthPercent = 100.000000000000000000
OnClick = btnConfirmClick
end
object cbRefArtAPDF: TWebCheckBox
Left = 316
Top = 463
Width = 113
Height = 22
Caption = 'Ref Art A PDF?'
ChildOrder = 76
ElementID = 'edtrefartapdf'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object cbRefArtPrintCard: TWebCheckBox
Left = 316
Top = 435
Width = 113
Height = 22
Caption = 'Ref Art Print Card?'
ChildOrder = 76
ElementID = 'edtrefartprintcard'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object cbExistingCuttingDie: TWebCheckBox
Left = 316
Top = 407
Width = 113
Height = 22
Caption = 'Existing Cutting Die?'
ChildOrder = 76
ElementID = 'edtexistingcuttingdie'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object cbFTP: TWebCheckBox
Left = 320
Top = 318
Width = 113
Height = 22
Caption = 'FTP?'
ChildOrder = 76
ElementID = 'edtftp'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection
Left = 244
......
......@@ -92,52 +92,44 @@
<hr class="custom-hr">
<div class="row">
<div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">B/W Copy:</label>
<input type="checkbox" id="cbbwcopy">
</div>
<div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">Color Copy:</label>
<label class='pe-2' style="font-weight: 700; font-size: 15px;">Color Copy:</label>
<input type="checkbox" id="cbcolorcopy">
</div>
<div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">Plates:</label>
<label class='pe-2' style="font-weight: 700; font-size: 15px;">Plates:</label>
<input type="checkbox" id="cbplates">
</div>
<div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">Simple Carton:</label>
<label class='pe-2' style="font-weight: 700; font-size: 15px;">Simple Carton:</label>
<input type="checkbox" id="cbsimpleCarton">
</div>
<div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">Dimensional Layout:</label>
<input id="edtdimensionallayout" class="form-control input-sm" width='50%'/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">Disk or CD:</label>
<label class='pe-2' style="font-weight: 700; font-size: 15px;">Disk or CD:</label>
<input type="checkbox" id="cbdiskorcd">
</div>
<div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">Email:</label>
<input id="edtemail" class="form-control input-sm" width='50%'/>
<label class='pe-2' style="font-weight: 700; font-size: 15px;">Email:</label>
<input type="checkbox" id="edtemail" width='50%'/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">FTP:</label>
<input id="edtftp" class="form-control input-sm" width='50%'/>
<label class='pe-2' style="font-weight: 700; font-size: 15px;">FTP:</label>
<input type="checkbox" id="edtftp" width='50%'/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">Other:</label>
<label class='pe-2' style="font-weight: 700; font-size: 15px;">Other:</label>
<input class="form-control input-sm" id="edtother" width='50%'/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">Existing Cutting Die:</label>
<input class="form-control input-sm" id="edtexistingcuttingdie" width='50%'/>
<label class='pe-2' style="font-weight: 700; font-size: 15px;">Existing Cutting Die:</label>
<input type="checkbox" id="edtexistingcuttingdie" width='50%'/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">Ref Art Print Card:</label>
<input class="form-control input-sm" id="edtrefartprintcard" width='50%'/>
<label class='pe-2' style="font-weight: 700; font-size: 15px;">Ref Art Print Card:</label>
<input type="checkbox" id="edtrefartprintcard" width='50%'/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">Ref Art A PDF:</label>
<input id="edtrefartapdf" class="form-control input-sm" width='50%'/>
<label class='pe-2' style="font-weight: 700; font-size: 15px;">Ref Art A PDF:</label>
<input type="checkbox" id="edtrefartapdf" width='50%'/>
</div>
</div>
<h4 class="custom-h4 mt-3">Layout</h4>
......
......@@ -42,14 +42,8 @@ type
edtPONumber: TWebDBEdit;
edtJobName: TWebDBEdit;
edtQuickBooksItem: TWebDBEdit;
edtArtLocation: TWebDBEdit;
edtDimensionalLayout: TWebDBEdit;
edtEmail: TWebDBEdit;
edtFTP: TWebDBEdit;
edtOther: TWebDBEdit;
edtExistingCuttingDie: TWebDBEdit;
edtRefArtPrintCard: TWebDBEdit;
edtRefArtAPDF: TWebDBEdit;
edtCADFile: TWebDBEdit;
edtAroundNo: TWebDBEdit;
edtAcrossNo: TWebDBEdit;
......@@ -86,11 +80,9 @@ type
cbStickyBak: TWebDBCheckBox;
WebDBCheckBox9: TWebDBCheckBox;
cbExcaliburDie: TWebDBCheckBox;
cbDiskorCD: TWebDBCheckBox;
cbSampleCarton: TWebDBCheckBox;
cbPlate: TWebDBCheckBox;
cbColorCopy: TWebDBCheckBox;
cbBWCopy: TWebDBCheckBox;
XDataWebClient1: TXDataWebClient;
edtSpecialInstructions: TWebDBEdit;
tmrScrollTop: TWebTimer;
......@@ -186,6 +178,10 @@ type
XDataWebDataSet1staff_fields_art_due: TStringField;
XDataWebDataSet1staff_fields_plate_due: TStringField;
XDataWebDataSet1staff_fields_mount_due: TStringField;
cbRefArtAPDF: TWebCheckBox;
cbRefArtPrintCard: TWebCheckBox;
cbExistingCuttingDie: TWebCheckBox;
cbFTP: TWebCheckBox;
procedure WebFormCreate(Sender: TObject);
procedure HideNotification();
procedure ShowNotification(Notification: string);
......@@ -201,9 +197,10 @@ type
FCurrentReportType: string;
FSelectProc: TSelectProc;
orderID: string;
mode: string;
//FJSONProc1: TJSONProc1;
public
class function CreateForm(AElementID, orderInfo: string): TWebForm;
class function CreateForm(AElementID, orderInfo, mode: string): TWebForm;
end;
var
......@@ -214,7 +211,7 @@ implementation
{$R *.dfm}
uses
View.Home;
View.Home, View.Main;
procedure TFOrderEntry.btnConfirmClick(Sender: TObject);
var
......@@ -239,7 +236,6 @@ begin
begin
colorJSON := TJSONObject.Create;
itemList := colorCollection[I].childNodes;
//console.log(itemList.length);
for J := 0 to itemList.length - 2 do
begin
header := TJSHTMLElement(itemList[J]).children[0].innerText.Replace(':', '').Trim();
......@@ -258,6 +254,22 @@ begin
XDataWebDataSet1staff_fields_mount_due.Value := DateTimeToStr(dtpMountDue.Date);
XDataWebDataSet1staff_fields_plate_due.Value := DateTimeToStr(dtpPlateDue.Date);
XDataWebDataSet1ORDER_DATE.Value := dtpOrderDate.Date;
if cbFTP.Checked then
XDataWebDataSet1supplied_by_customer_ftp.AsString := 'T'
else
XDataWebDataSet1supplied_by_customer_ftp.AsString := '';
if cbExistingCuttingDie.Checked then
XDataWebDataSet1supplied_by_customer_existing_.AsString := 'T'
else
XDataWebDataSet1supplied_by_customer_existing_.AsString := '';
if cbRefArtPrintCard.Checked then
XDataWebDataSet1supplied_by_customer_ref_art_p.AsString := 'T'
else
XDataWebDataSet1supplied_by_customer_ref_art_p.AsString := '';
if cbRefArtAPDF.Checked then
XDataWebDataSet1supplied_by_customer_ref_art_a.AsString := 'T'
else
XDataWebDataSet1supplied_by_customer_ref_art_a.AsString := '';
XDataWebDataSet1.Post;
XDataWebDataSet1.First;
while not XDataWebDataSet1.Eof do
......@@ -277,7 +289,7 @@ begin
orderJSON.AddPair('COMPANY_ID', '749');
orderJSON.AddPair('USER_ID', '1011');
AddCorrugatedOrder(orderJSON);
FViewMain.ViewOrders('Success');
end;
procedure TFOrderEntry.AddCorrugatedOrder(orderJSON: TJSONObject);
......@@ -286,11 +298,13 @@ Response: TXDataClientResponse;
begin
Response := await(XDataWebClient1.RawInvokeAsync('ILookupService.AddCorrugatedOrder',
[orderJSON.ToString]));
console.log(Response);
end;
class function TFOrderEntry.CreateForm(AElementID, orderInfo: string): TWebForm;
class function TFOrderEntry.CreateForm(AElementID, orderInfo, mode: string): TWebForm;
var
localMode: string;
begin
localMode := mode;
Application.CreateForm(TFOrderEntry, AElementID, Result,
procedure(AForm: TObject)
begin
......@@ -298,6 +312,8 @@ begin
begin
HideNotification;
TFOrderEntry(AForm).orderID := orderInfo;
TFOrderEntry(AForm).mode := localMode;
console.log(TFOrderEntry(AForm).mode);
end;
end
);
......@@ -431,8 +447,23 @@ begin
dtpApprovedDate.Date := StrToDateTime(XDataWebDataSet1proofing_approved_date.AsString)
else
dtpApprovedDate.Date := 0;
console.log(dtpApprovedDate.Date);
console.log(DateTimeToStr(dtpApprovedDate.Date));
if XDataWebDataSet1supplied_by_customer_ftp.AsString = 'T' then
cbFTP.Checked := true
else
cbFTP.Checked := false;
if XDataWebDataSet1supplied_by_customer_existing_.AsString = 'T' then
cbExistingCuttingDie.Checked := true
else
cbExistingCuttingDie.Checked := false;
if XDataWebDataSet1supplied_by_customer_ref_art_a.AsString = 'T' then
cbRefArtAPDF.Checked := true
else
cbRefArtAPDF.Checked := false;
if XDataWebDataSet1supplied_by_customer_ref_art_p.AsString = 'T' then
cbRefArtPrintCard.Checked := true
else
cbRefArtPrintCard.Checked := false;
end;
procedure TFOrderEntry.WebFormShow(Sender: TObject);
......
......@@ -10,6 +10,7 @@ object FViewOrders: TFViewOrders
Font.Style = []
ParentFont = False
OnCreate = WebFormCreate
OnShow = WebFormShow
object lblEntries: TWebLabel
Left = 0
Top = 336
......@@ -169,6 +170,50 @@ object FViewOrders: TFViewOrders
Role = ''
Text = ''
end
object pnlMessage: TWebPanel
Left = 266
Top = 61
Width = 121
Height = 33
ElementClassName = 'card'
ElementID = 'pnl_message'
ChildOrder = 5
ElementBodyClassName = 'card-body'
ElementFont = efCSS
ElementPosition = epRelative
Role = 'alert'
TabOrder = 8
object lblMessage: TWebLabel
Left = 28
Top = 9
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 XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection
Left = 426
......
......@@ -4,6 +4,14 @@
<div class="container mt-4">
<div class="row justify-content-center">
<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>
<div class="mb-3" id="filter_info" style="display: none;">
<h4 class="custom-h4 mt-3">Filters</h4>
<hr class="custom-hr">
......
......@@ -48,18 +48,25 @@ type
XDataWebDataSet1plateDue: TStringField;
XDataWebDataSet1plateDone: TStringField;
XDataWebDataSet1orderType: TStringField;
pnlMessage: TWebPanel;
lblMessage: TWebLabel;
btnCloseNotification: TWebButton;
procedure WebFormCreate(Sender: TObject);
procedure btnApplyClick(Sender: TObject);
procedure btnSearchClick(Sender: TObject);
procedure btnaddOrderClick(Sender: TObject);
procedure btnFiltersClick(Sender: TObject);
procedure btnCloseNotificationClick(Sender: TObject);
procedure WebFormShow(Sender: TObject);
private
FChildForm: TWebForm;
procedure AddRowToTable(temp: string);
procedure ClearTable();
procedure GeneratePagination(TotalPages: Integer);
function GenerateSearchOptions(): string;
procedure orderEntry(orderInfo: string);
procedure orderEntry(orderInfo, mode: string);
procedure HideNotification();
procedure ShowNotification(Notification: string);
[async] procedure Search(searchOptions: string);
[async] procedure GetOrders(searchOptions: string);
[async] procedure getUser();
......@@ -72,7 +79,9 @@ type
OrderBy: string;
Caller: string;
filters: boolean;
info: string;
public
class function CreateForm(AElementID, Info: string): TWebForm;
end;
......@@ -105,6 +114,12 @@ begin
getOrders(GenerateSearchOptions());
end;
procedure TFViewOrders.WebFormShow(Sender: TObject);
begin
console.log(info);
ShowNotification(info);
end;
procedure TFViewOrders.getUser();
var
xdcResponse: TXDataClientResponse;
......@@ -118,6 +133,22 @@ begin
user := TJSObject(data[0]);
end;
class function TFViewOrders.CreateForm(AElementID, Info: string): TWebForm;
var
localInfo: string;
begin
localInfo := info;
Application.CreateForm(TFViewOrders, AElementID, Result,
procedure(AForm: TObject)
begin
with TFViewOrders(AForm) do
begin
TFViewOrders(AForm).info := LocalInfo;
end;
end
);
end;
procedure TFViewOrders.AddRowToTable(temp: string);
// Adds rows to the table
// PhoneNumber: phone number of the location
......@@ -138,7 +169,7 @@ begin
NewRow.Attrs['orderType'] := XDataWebDataSet1orderType.Value;
NewRow.addEventListener('click', procedure
begin
orderEntry(NewRow.Attrs['id']);
orderEntry(NewRow.Attrs['id'], 'EDIT');
end);
// Order ID Cell
NewRow.Attrs['id'] := XDataWebDataSet1ID.Value;
......@@ -569,12 +600,12 @@ end;
procedure TFViewOrders.btnaddOrderClick(Sender: TObject);
begin
orderEntry('');
orderEntry('', 'ADD');
end;
procedure TFViewOrders.orderEntry(orderInfo: string);
procedure TFViewOrders.orderEntry(orderInfo, mode: string);
begin
FViewMain.ViewOrderEntry(orderInfo);
FViewMain.ViewOrderEntry(orderInfo, mode);
end;
procedure TFViewOrders.btnApplyClick(Sender: TObject);
......@@ -594,6 +625,11 @@ begin
GetOrders(searchOptions);
end;
procedure TFViewOrders.btnCloseNotificationClick(Sender: TObject);
begin
HideNotification();
end;
procedure TFViewOrders.btnFiltersClick(Sender: TObject);
var
filterSection: TJSHTMLElement;
......@@ -680,5 +716,20 @@ begin
Result := searchOptions;
end;
procedure TFViewOrders.HideNotification;
begin
pnlMessage.ElementHandle.hidden := True;
end;
procedure TFViewOrders.ShowNotification(Notification: string);
begin
if Notification <> '' then
begin
console.log('hit');
lblMessage.Caption := Notification;
pnlMessage.ElementHandle.hidden := False;
end;
end;
end.
[Options]
LogFileNum=196
LogFileNum=198
UpdateTimerLength=0
......
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