Commit ec0623e0 by Cam Hayes

update qb customer and item is now working along with linking to quickbooks

parent 4d546ae6
...@@ -19,7 +19,7 @@ type ...@@ -19,7 +19,7 @@ type
FUnauthorizedAccessProc: TUnauthorizedAccessProc; FUnauthorizedAccessProc: TUnauthorizedAccessProc;
public public
const clientVersion = '0.9.13'; const clientVersion = '0.9.13.3';
procedure InitApp(SuccessProc: TSuccessProc; procedure InitApp(SuccessProc: TSuccessProc;
UnauthorizedAccessProc: TUnauthorizedAccessProc); UnauthorizedAccessProc: TUnauthorizedAccessProc);
procedure SetClientConfig(Callback: TVersionCheckCallback); procedure SetClientConfig(Callback: TVersionCheckCallback);
......
...@@ -4,40 +4,14 @@ object FViewAddCustomer: TFViewAddCustomer ...@@ -4,40 +4,14 @@ object FViewAddCustomer: TFViewAddCustomer
CSSLibrary = cssBootstrap CSSLibrary = cssBootstrap
ElementFont = efCSS ElementFont = efCSS
object lblFormState: TWebLabel object lblFormState: TWebLabel
Left = 19 Left = 395
Top = 578 Top = 8
Width = 3 Width = 26
Height = 15 Height = 15
ElementID = 'lbl_form_state' ElementID = 'lbl_form_state'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object dtpStartDate: TWebDateTimePicker
Left = 19
Top = 216
Width = 170
Height = 22
ElementID = 'dtpstartdate'
BorderStyle = bsSingle
ChildOrder = 10
Color = clWhite
Date = 45779.471405393520000000
Role = ''
Text = ''
end
object dtpEndDate: TWebDateTimePicker
Left = 19
Top = 248
Width = 170
Height = 22
ElementID = 'dtpenddate'
BorderStyle = bsSingle
ChildOrder = 10
Color = clWhite
Date = 45779.471405393520000000
Role = ''
Text = ''
end
object edtShortName: TWebDBEdit object edtShortName: TWebDBEdit
Left = 24 Left = 24
Top = 12 Top = 12
...@@ -45,6 +19,7 @@ object FViewAddCustomer: TFViewAddCustomer ...@@ -45,6 +19,7 @@ object FViewAddCustomer: TFViewAddCustomer
Height = 22 Height = 22
ChildOrder = 12 ChildOrder = 12
ElementID = 'edtcompanyaccountname' ElementID = 'edtcompanyaccountname'
Enabled = False
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
DataField = 'SHORT_NAME' DataField = 'SHORT_NAME'
...@@ -57,6 +32,7 @@ object FViewAddCustomer: TFViewAddCustomer ...@@ -57,6 +32,7 @@ object FViewAddCustomer: TFViewAddCustomer
Height = 22 Height = 22
ChildOrder = 12 ChildOrder = 12
ElementID = 'edtcompanyname' ElementID = 'edtcompanyname'
Enabled = False
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
DataField = 'NAME' DataField = 'NAME'
...@@ -69,6 +45,7 @@ object FViewAddCustomer: TFViewAddCustomer ...@@ -69,6 +45,7 @@ object FViewAddCustomer: TFViewAddCustomer
Height = 22 Height = 22
ChildOrder = 12 ChildOrder = 12
ElementID = 'edtbillingaddress' ElementID = 'edtbillingaddress'
Enabled = False
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
DataField = 'BILL_ADDRESS' DataField = 'BILL_ADDRESS'
...@@ -81,6 +58,7 @@ object FViewAddCustomer: TFViewAddCustomer ...@@ -81,6 +58,7 @@ object FViewAddCustomer: TFViewAddCustomer
Height = 22 Height = 22
ChildOrder = 12 ChildOrder = 12
ElementID = 'edtbillingcity' ElementID = 'edtbillingcity'
Enabled = False
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
DataField = 'BILL_CITY' DataField = 'BILL_CITY'
...@@ -93,6 +71,7 @@ object FViewAddCustomer: TFViewAddCustomer ...@@ -93,6 +71,7 @@ object FViewAddCustomer: TFViewAddCustomer
Height = 22 Height = 22
ChildOrder = 12 ChildOrder = 12
ElementID = 'edtbillingstate' ElementID = 'edtbillingstate'
Enabled = False
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
DataField = 'BILL_STATE' DataField = 'BILL_STATE'
...@@ -105,6 +84,7 @@ object FViewAddCustomer: TFViewAddCustomer ...@@ -105,6 +84,7 @@ object FViewAddCustomer: TFViewAddCustomer
Height = 22 Height = 22
ChildOrder = 12 ChildOrder = 12
ElementID = 'edtbillingzip' ElementID = 'edtbillingzip'
Enabled = False
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
DataField = 'BILL_ZIP' DataField = 'BILL_ZIP'
...@@ -117,35 +97,12 @@ object FViewAddCustomer: TFViewAddCustomer ...@@ -117,35 +97,12 @@ object FViewAddCustomer: TFViewAddCustomer
Height = 22 Height = 22
ChildOrder = 12 ChildOrder = 12
ElementID = 'edtbillingcontact' ElementID = 'edtbillingcontact'
Enabled = False
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
DataField = 'BILL_CONTACT' DataField = 'BILL_CONTACT'
DataSource = WebDataSource1 DataSource = WebDataSource1
end end
object edtPhone: TWebDBEdit
Left = 19
Top = 276
Width = 121
Height = 22
ChildOrder = 12
ElementID = 'edtphone'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'PHONE'
DataSource = WebDataSource1
end
object edtFax: TWebDBEdit
Left = 19
Top = 304
Width = 121
Height = 22
ChildOrder = 12
ElementID = 'edtfax'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'FAX'
DataSource = WebDataSource1
end
object btnSave: TWebButton object btnSave: TWebButton
Left = 19 Left = 19
Top = 402 Top = 402
...@@ -238,7 +195,7 @@ object FViewAddCustomer: TFViewAddCustomer ...@@ -238,7 +195,7 @@ object FViewAddCustomer: TFViewAddCustomer
end end
object wdbtcAddresses: TWebDBTableControl object wdbtcAddresses: TWebDBTableControl
Left = 190 Left = 190
Top = 204 Top = 196
Width = 631 Width = 631
Height = 200 Height = 200
ElementClassName = 'table' ElementClassName = 'table'
...@@ -456,7 +413,7 @@ object FViewAddCustomer: TFViewAddCustomer ...@@ -456,7 +413,7 @@ object FViewAddCustomer: TFViewAddCustomer
end end
object wdblcbRep: TWebDBLookupComboBox object wdblcbRep: TWebDBLookupComboBox
Left = 19 Left = 19
Top = 336 Top = 216
Width = 145 Width = 145
Height = 22 Height = 22
ElementID = 'wdblcbrep' ElementID = 'wdblcbrep'
...@@ -468,6 +425,32 @@ object FViewAddCustomer: TFViewAddCustomer ...@@ -468,6 +425,32 @@ object FViewAddCustomer: TFViewAddCustomer
ListField = 'representative' ListField = 'representative'
ListSource = wdsUsers ListSource = wdsUsers
end end
object btnLink: TWebButton
Left = 19
Top = 566
Width = 96
Height = 25
Caption = 'Link to QB'
ChildOrder = 84
ElementID = 'btnlink'
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnLinkClic
end
object btnUpdate: TWebButton
Left = 19
Top = 340
Width = 96
Height = 25
Caption = 'Update'
ChildOrder = 84
ElementID = 'btnupdate'
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnUpdateClick
end
object XDataWebClient1: TXDataWebClient object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection Connection = DMConnection.ApiConnection
Left = 454 Left = 454
......
...@@ -15,6 +15,12 @@ ...@@ -15,6 +15,12 @@
<li class="nav-item pe-2"> <li class="nav-item pe-2">
<button id="btnedit" class="btn btn-primary btn-sm">Edit</button> <button id="btnedit" class="btn btn-primary btn-sm">Edit</button>
</li> </li>
<li class="nav-item pe-2">
<button id="btnupdate" class="btn btn-primary btn-sm">Edit</button>
</li>
<li class="nav-item pe-2">
<button id="btnlink" class="btn btn-primary btn-sm">Link</button>
</li>
<li class="nav-item pe-2"> <li class="nav-item pe-2">
<button id="btndelete" class="btn btn-danger btn-sm">Delete</button> <button id="btndelete" class="btn btn-danger btn-sm">Delete</button>
</li> </li>
...@@ -58,22 +64,6 @@ ...@@ -58,22 +64,6 @@
</div> </div>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Start Date:</label>
<input class="form-control input-sm" id="dtpstartdate" type="date" required>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">End Date:</label>
<input class="form-control input-sm" id="dtpenddate" type="date" required>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Phone:</label>
<input id="edtphone" 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">Fax:</label>
<input id="edtfax" class="form-control input-sm"style="width: 200px"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Representative:</label> <label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Representative:</label>
<select id="wdblcbrep" class='form-select'></select> <select id="wdblcbrep" class='form-select'></select>
</div> </div>
......
...@@ -13,8 +13,6 @@ uses ...@@ -13,8 +13,6 @@ uses
type type
TFViewAddCustomer = class(TWebForm) TFViewAddCustomer = class(TWebForm)
dtpStartDate: TWebDateTimePicker;
dtpEndDate: TWebDateTimePicker;
edtShortName: TWebDBEdit; edtShortName: TWebDBEdit;
edtName: TWebDBEdit; edtName: TWebDBEdit;
edtBillAddress: TWebDBEdit; edtBillAddress: TWebDBEdit;
...@@ -22,8 +20,6 @@ type ...@@ -22,8 +20,6 @@ type
edtBillState: TWebDBEdit; edtBillState: TWebDBEdit;
edtBillZip: TWebDBEdit; edtBillZip: TWebDBEdit;
edtBillContact: TWebDBEdit; edtBillContact: TWebDBEdit;
edtPhone: TWebDBEdit;
edtFax: TWebDBEdit;
btnSave: TWebButton; btnSave: TWebButton;
btnCancel: TWebButton; btnCancel: TWebButton;
btnDelete: TWebButton; btnDelete: TWebButton;
...@@ -80,7 +76,9 @@ type ...@@ -80,7 +76,9 @@ type
xdwdsUsersfull_name: TStringField; xdwdsUsersfull_name: TStringField;
lblFormState: TWebLabel; lblFormState: TWebLabel;
[async] [async]
xdwdsUsersrepresentative: TStringField; procedure btnSaveClick(Sender: TObject); xdwdsUsersrepresentative: TStringField;
btnLink: TWebButton;
btnUpdate: TWebButton; procedure btnSaveClick(Sender: TObject);
procedure btnCancelClick(Sender: TObject); procedure btnCancelClick(Sender: TObject);
procedure btnCloseClick(Sender: TObject); procedure btnCloseClick(Sender: TObject);
procedure btnEditClick(Sender: TObject); procedure btnEditClick(Sender: TObject);
...@@ -96,6 +94,8 @@ type ...@@ -96,6 +94,8 @@ type
[async] procedure btnShipSaveClick(Sender: TObject); [async] procedure btnShipSaveClick(Sender: TObject);
procedure btnShipDeleteClick(Sender: TObject); procedure btnShipDeleteClick(Sender: TObject);
procedure btnShipCancelClick(Sender: TObject); procedure btnShipCancelClick(Sender: TObject);
procedure btnLinkClic(Sender: TObject);
procedure btnUpdateClick(Sender: TObject);
private private
{ Private declarations } { Private declarations }
procedure ViewMode(); procedure ViewMode();
...@@ -105,6 +105,7 @@ type ...@@ -105,6 +105,7 @@ type
[async] procedure SendAddressToServer(); [async] procedure SendAddressToServer();
[async] procedure DelAddress(); [async] procedure DelAddress();
[async] procedure Save(); [async] procedure Save();
[async] procedure UpdateCustomer();
function VerifyCustomer(): boolean; function VerifyCustomer(): boolean;
function VerifyAddress(): boolean; function VerifyAddress(): boolean;
procedure Clear(); procedure Clear();
...@@ -112,12 +113,12 @@ type ...@@ -112,12 +113,12 @@ type
[async] procedure InitializeForm; [async] procedure InitializeForm;
var var
customerID: string; customerID: string;
notification: string; qbCustJSON: string;
mode: string; mode: string;
shipmode: string; shipmode: string;
public public
{ Public declarations } { Public declarations }
class function CreateForm(AElementID, customerInfo, info: string): TWebForm; class function CreateForm(AElementID, custID, custJSON: string): TWebForm;
end; end;
var var
...@@ -130,15 +131,15 @@ implementation ...@@ -130,15 +131,15 @@ implementation
uses View.Main, View.Customers, View.Customer.Select, Utils; uses View.Main, View.Customers, View.Customer.Select, Utils;
class function TFViewAddCustomer.CreateForm(AElementID, customerInfo, info: string): TWebForm; class function TFViewAddCustomer.CreateForm(AElementID, custID, custJSON: string): TWebForm;
begin begin
Application.CreateForm(TFViewAddCustomer, AElementID, Result, Application.CreateForm(TFViewAddCustomer, AElementID, Result,
procedure(AForm: TObject) procedure(AForm: TObject)
begin begin
with TFViewAddCustomer(AForm) do with TFViewAddCustomer(AForm) do
begin begin
customerID := customerInfo; customerID := custID;
notification := info; qbCustJSON := custJSON;
InitializeForm; InitializeForm;
end; end;
...@@ -148,26 +149,51 @@ end; ...@@ -148,26 +149,51 @@ end;
[async] procedure TFViewAddCustomer.InitializeForm; [async] procedure TFViewAddCustomer.InitializeForm;
var
JSONObj: TJSONObject;
begin begin
if customerID = '' then if customerID = '' then
mode := 'ADD' begin
mode := 'ADD';
JSONObj := TJSONObject.ParseJSONValue(qbCustJSON) as TJSONObject;
try
XDataWebDataSet1.Open;
XDataWebDataSet1.Append;
XDataWebDataSet1.FieldByName('NAME').AsString := JSONObj.GetValue('NAME').Value;
XDataWebDataSet1.FieldByName('QB_LIST_ID').AsString := JSONObj.GetValue('QB_LIST_ID').Value;
XDataWebDataSet1.FieldByName('BILL_ADDRESS').AsString := JSONObj.GetValue('BILL_ADDRESS').Value;
XDataWebDataSet1.FieldByName('BILL_CITY').AsString := JSONObj.GetValue('BILL_CITY').Value;
XDataWebDataSet1.FieldByName('BILL_STATE').AsString := JSONObj.GetValue('BILL_STATE').Value;
XDataWebDataSet1.FieldByName('BILL_ZIP').AsString := JSONObj.GetValue('BILL_ZIP').Value;
//XDataWebDataSet1.FieldByName('BILL_ADDRESS_BLOCK').AsString := JSONObj.GetValue('BILL_ADDRESS_BLOCK').Value;
XDataWebDataSet1.Post;
xdwdsShipTo.Open;
xdwdsShipTo.Append;
xdwdsShipTo.FieldByName('shipping_address').AsString := JSONObj.GetValue('address').Value;
xdwdsShipTo.FieldByName('city').AsString := JSONObj.GetValue('city').Value;
xdwdsShipTo.FieldByName('state').AsString := JSONObj.GetValue('state').Value;
xdwdsShipTo.FieldByName('zip').AsString := JSONObj.GetValue('zip').Value;
xdwdsShipTo.Post;
//XDataWebDataSet1.FieldByName('SHIP_BLOCK').AsString := JSONObj.GetValue('ship_block').Value;
EditMode();
finally
JSONObj.Free;
end;
end
else else
mode := 'EDIT'; mode := 'EDIT';
if notification <> '' then
ShowToast(notification);
if mode = 'ADD' then if mode = 'ADD' then
EditMode() EditMode()
else else
ViewMode(); ViewMode();
await(GetCustomer); await(GetCustomer);
dtpStartDate.Date := 0;
dtpEndDate.Date := 0;
dtpStartDate.Date := XDataWebDataSet1.FieldByName('START_DATE').AsDateTime;
dtpEndDate.Date := XDataWebDataSet1.FieldByName('END_DATE').AsDateTime;
end; end;
procedure TFViewAddCustomer.Clear(); procedure TFViewAddCustomer.Clear();
...@@ -189,7 +215,7 @@ var ...@@ -189,7 +215,7 @@ var
begin begin
newform := TFSelectCustomer.CreateNew; newform := TFSelectCustomer.CreateNew;
newform.Caption := 'Select Customer and Order Type'; newform.Caption := 'Select Customer to Add';
newForm.Popup := True; newForm.Popup := True;
newForm.Border := fbDialog; newForm.Border := fbDialog;
newForm.Position := poScreenCenter; newForm.Position := poScreenCenter;
...@@ -316,6 +342,34 @@ begin ...@@ -316,6 +342,34 @@ begin
EditMode(); EditMode();
end; end;
procedure TFViewAddCustomer.btnLinkClic(Sender: TObject);
var
newform: TFSelectCustomer;
begin
EditMode();
newform := TFSelectCustomer.CreateNew;
newform.Caption := 'Select Customer to Link';
newForm.Popup := True;
newForm.Border := fbDialog;
newForm.Position := poScreenCenter;
// used to manage Back button handling to close subform
window.location.hash := 'subform';
newform.ShowModal(
procedure(AValue: TModalResult)
begin
if newform.confirm then
begin
XDataWebDataSet1.Edit;
XDataWebDataSet1QB_LIST_ID.AsString := newform.QB_ID;
XDataWebDataSet1.Post;
end;
end
);
end;
procedure TFViewAddCustomer.edtShippingAddressChange(Sender: TObject); procedure TFViewAddCustomer.edtShippingAddressChange(Sender: TObject);
// Puts the form into Address Edit Mode // Puts the form into Address Edit Mode
begin begin
...@@ -345,6 +399,76 @@ begin ...@@ -345,6 +399,76 @@ begin
btnShipDelete.Enabled := true; btnShipDelete.Enabled := true;
end; end;
procedure TFViewAddCustomer.btnUpdateClick(Sender: TObject);
begin
if XDataWebDataSet1QB_LIST_ID.AsString = '' then
ShowToast('Failure:Company must be linked to quickbooks to update!')
else
UpdateCustomer();
end;
procedure TFViewAddCustomer.UpdateCustomer;
var
customer: TJSObject;
xdcResponse: TXDataClientResponse;
msg: string;
count: integer;
begin
Utils.ShowSpinner('spinner');
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.UpdateCustomer', [XDataWebDataSet1QB_LIST_ID.AsString]));
customer := TJSObject(xdcResponse.Result);
msg := 'The following fields have been updated:' + #13#10;
count := 0;
if string(customer['NAME']) <> XDataWebDataSet1NAME.AsString then
begin
msg := msg + 'Company Name' + #13#10;
count := count + 1;
end;
if string(customer['BILL_ADDRESS']) <> XDataWebDataSet1BILL_ADDRESS.AsString then
begin
count := count + 1;
msg := msg + 'Billing Address' + #13#10;
end;
if string(customer['BILL_CITY']) <> XDataWebDataSet1BILL_CITY.AsString then
begin
count := count + 1;
if count > 2 then
msg := msg + #160#160#160#160#160#160#160#160#160#160#160#160#160#160;
msg := msg + 'Billing City' + #13#10;
end;
if string(customer['BILL_STATE']) <> XDataWebDataSet1BILL_STATE.AsString then
begin
count := count + 1;
if count > 2 then
msg := msg + #160#160#160#160#160#160#160#160#160#160#160#160#160#160;
msg := msg + 'Billing State' + #13#10;
end;
if string(customer['BILL_ZIP']) <> XDataWebDataSet1BILL_ZIP.AsString then
begin
count := count + 1;
if count > 2 then
msg := msg + #160#160#160#160#160#160#160#160#160#160#160#160#160#160;
msg := msg + 'Billing Zip' + #13#10;
end;
if msg = 'The following fields have been updated:' + #13#10 then
msg := 'No fields needed to be updated';
XDataWebDataSet1.Close;
XDataWebDataSet1.SetJsonData(customer);
XDataWebDataSet1.Open;
memoAddressBlock.Text := string(customer['staff_fields_invoice_to']);
Utils.HideSpinner('spinner');
if msg <> 'No fields needed to be updated' then
EditMode;
ShowMessage(msg);
end;
procedure TFViewAddCustomer.SendCustomerToServer(); procedure TFViewAddCustomer.SendCustomerToServer();
// Creates the customer JSON and then sends it to the server. // Creates the customer JSON and then sends it to the server.
...@@ -357,51 +481,54 @@ var ...@@ -357,51 +481,54 @@ var
msg: string; msg: string;
BILL_ADDRESS_BLOCK: string; BILL_ADDRESS_BLOCK: string;
begin begin
if mode = 'EDIT' then
customerJSON := TJSONObject.Create;
if dtpStartDate.Date <> 0 then
XDataWebDataSet1START_DATE.Value := DateTimeToStr(dtpStartDate.Date);
if dtpEndDate.Date <> 0 then
XDataWebDataSet1END_DATE.Value := DateTimeToStr(dtpEndDate.Date);
XDataWebDataSet1.First;
while not XDataWebDataSet1.Eof do
begin begin
for Field in XDataWebDataSet1.Fields do customerJSON := TJSONObject.Create;
XDataWebDataSet1.First;
while not XDataWebDataSet1.Eof do
begin begin
if Field is TStringField then for Field in XDataWebDataSet1.Fields do
begin
if Field.AsString = '' then
customerJSON.AddPair(Field.FieldName, '')
else
customerJSON.AddPair(Field.FieldName, Field.AsString); // Add all other fields
end
else if Field is TIntegerField then
begin begin
customerJSON.AddPair(Field.FieldName, Field.AsString); if Field is TStringField then
begin
if Field.AsString = '' then
customerJSON.AddPair(Field.FieldName, '')
else
customerJSON.AddPair(Field.FieldName, Field.AsString); // Add all other fields
end
else if Field is TIntegerField then
begin
customerJSON.AddPair(Field.FieldName, Field.AsString);
end;
end; end;
XDataWebDataSet1.Next;
end; end;
XDataWebDataSet1.Next;
end;
BILL_ADDRESS_BLOCK := edtName.Text + slinebreak +
edtBillContact.Text + slinebreak +
edtBillAddress.Text + slinebreak +
edtBillCity.Text + ', ' + edtBillState.Text + ' ' + edtBillZip.Text;
CustomerJSON.AddPair('BILL_ADDRESS_BLOCK', BILL_ADDRESS_BLOCK); BILL_ADDRESS_BLOCK := edtName.Text + slinebreak +
edtBillContact.Text + slinebreak +
customerJSON.AddPair('mode', mode); edtBillAddress.Text + slinebreak +
if mode = 'EDIT' then edtBillCity.Text + ', ' + edtBillState.Text + ' ' + edtBillZip.Text;
customerJSON.AddPair('CUSTOMER_ID', customerID);
CustomerJSON.AddPair('BILL_ADDRESS_BLOCK', BILL_ADDRESS_BLOCK);
Response := await(XDataWebClient1.RawInvokeAsync('ILookupService.AddCustomer', customerJSON.AddPair('mode', mode);
[customerJSON.ToString])); if mode = 'EDIT' then
customerJSON.AddPair('CUSTOMER_ID', customerID);
Response := await(XDataWebClient1.RawInvokeAsync('ILookupService.AddCustomer',
[customerJSON.ToJSON]));
end
else
begin
console.log(qbCustJSON);
Response := await(XDataWebClient1.RawInvokeAsync('ILookupService.ImportQBCustomer',
[qbCustJSON]));
mode := 'EDIT';
XDataWebDataSet1.Edit;
XDataWebDataSet1Customer_ID.AsInteger := integer(notification['CustomerID']);
XDataWebDataSet1.Post;
end;
notification := TJSObject(Response.Result); notification := TJSObject(Response.Result);
msg := string(notification['status']); msg := string(notification['status']);
if CustomerID = '' then if CustomerID = '' then
...@@ -410,9 +537,6 @@ begin ...@@ -410,9 +537,6 @@ begin
edtCustomerID.Text := CustomerID; edtCustomerID.Text := CustomerID;
ShowToast(msg); ShowToast(msg);
//TODO update the BILL_ADDRESS_BLOCK memo after saving.
if msg.Contains('Failure') then if msg.Contains('Failure') then
begin begin
input := TJSHTMLInputElement(document.getElementById('edtcompanyaccountname')); input := TJSHTMLInputElement(document.getElementById('edtcompanyaccountname'));
...@@ -420,7 +544,6 @@ begin ...@@ -420,7 +544,6 @@ begin
input := TJSHTMLInputElement(document.getElementById('shortnamefeedback')); input := TJSHTMLInputElement(document.getElementById('shortnamefeedback'));
input.innerHTML := 'Company Account Name must be Unique.' ; input.innerHTML := 'Company Account Name must be Unique.' ;
end; end;
end; end;
procedure TFViewAddCustomer.btnSaveClick(Sender: TObject); procedure TFViewAddCustomer.btnSaveClick(Sender: TObject);
...@@ -521,8 +644,6 @@ begin ...@@ -521,8 +644,6 @@ begin
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.GetCustomer', [customerID])); xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.GetCustomer', [customerID]));
customer := TJSObject(xdcResponse.Result); customer := TJSObject(xdcResponse.Result);
XDataWebDataSet1.Close; XDataWebDataSet1.Close;
XDataWebDataSet1.SetJsonData(customer); XDataWebDataSet1.SetJsonData(customer);
XDataWebDataSet1.Open; XDataWebDataSet1.Open;
...@@ -530,12 +651,6 @@ begin ...@@ -530,12 +651,6 @@ begin
edtCustomerID.Text := CustomerID; edtCustomerID.Text := CustomerID;
if XDataWebDataSet1.FieldByName('START_DATE').AsString <> '' then
dtpStartDate.Date := XDataWebDataSet1.FieldByName('START_DATE').AsDateTime;
if XDataWebDataSet1.FieldByName('END_DATE').AsString <> '' then
dtpEndDate.Date := XDataWebDataSet1.FieldByName('End_DATE').AsDateTime;
xdwdsShipTo.Close; xdwdsShipTo.Close;
xdwdsShipTo.SetJSONData(customer['SHIPPING_ADDRESS_LIST']); xdwdsShipTo.SetJSONData(customer['SHIPPING_ADDRESS_LIST']);
xdwdsShipTo.Open; xdwdsShipTo.Open;
...@@ -588,14 +703,14 @@ begin ...@@ -588,14 +703,14 @@ begin
input.classList.remove('is-invalid'); input.classList.remove('is-invalid');
input := TJSHTMLInputElement(document.getElementById('edtcompanyaccountname')); // input := TJSHTMLInputElement(document.getElementById('edtcompanyaccountname'));
if edtShortName.Text = '' then // if edtShortName.Text = '' then
begin // begin
input.classList.add('is-invalid'); // input.classList.add('is-invalid');
result := false; // result := false;
end // end
else // else
input.classList.remove('is-invalid'); // input.classList.remove('is-invalid');
// Billing Information Verification // Billing Information Verification
...@@ -635,14 +750,14 @@ begin ...@@ -635,14 +750,14 @@ begin
else else
input.classList.remove('is-invalid'); input.classList.remove('is-invalid');
input := TJSHTMLInputElement(document.getElementById('edtbillingcontact')); // input := TJSHTMLInputElement(document.getElementById('edtbillingcontact'));
if edtBillContact.Text = '' then // if edtBillContact.Text = '' then
begin // begin
input.classList.add('is-invalid'); // input.classList.add('is-invalid');
result := false; // result := false;
end // end
else // else
input.classList.remove('is-invalid'); // input.classList.remove('is-invalid');
end; end;
function TFViewAddCustomer.VerifyAddress: Boolean; function TFViewAddCustomer.VerifyAddress: Boolean;
...@@ -718,6 +833,7 @@ begin ...@@ -718,6 +833,7 @@ begin
btnSave.Enabled := true; btnSave.Enabled := true;
btnCancel.Enabled := True; btnCancel.Enabled := True;
btnEdit.Enabled := false; btnEdit.Enabled := false;
btnLink.Enabled := false;
// Disable Shipping Address Editting // Disable Shipping Address Editting
edtShippingAddress.Enabled := false; edtShippingAddress.Enabled := false;
...@@ -749,6 +865,7 @@ begin ...@@ -749,6 +865,7 @@ begin
btnCancel.Enabled := false; btnCancel.Enabled := false;
btnEdit.Enabled := false; btnEdit.Enabled := false;
btnAdd.Enabled := false; btnAdd.Enabled := false;
btnLink.Enabled := false;
btnShipDelete.Enabled := false; btnShipDelete.Enabled := false;
btnShipSave.Enabled := true; btnShipSave.Enabled := true;
...@@ -763,17 +880,6 @@ begin ...@@ -763,17 +880,6 @@ begin
edtShippingContact.Enabled := true; edtShippingContact.Enabled := true;
edtFirstLine.Enabled := true; edtFirstLine.Enabled := true;
edtName.Enabled := false;
edtShortName.Enabled := false;
edtBillAddress.Enabled := false;
edtBillCity.Enabled := false;
edtBillState.Enabled := false;
edtBillZip.Enabled := false;
edtBillContact.Enabled := false;
dtpStartDate.Enabled := false;
dtpEndDate.Enabled := false;
edtFax.Enabled := false;
edtPhone.enabled := false;
wdblcbRep.Enabled := false; wdblcbRep.Enabled := false;
lblFormState.Caption := 'Edit Address'; lblFormState.Caption := 'Edit Address';
...@@ -791,6 +897,7 @@ begin ...@@ -791,6 +897,7 @@ begin
btnSave.Enabled := false; btnSave.Enabled := false;
btnCancel.Enabled := false; btnCancel.Enabled := false;
btnEdit.Enabled := true; btnEdit.Enabled := true;
btnLink.Enabled := true;
FViewMain.change := false; FViewMain.change := false;
btnShipAdd.Enabled := true; btnShipAdd.Enabled := true;
...@@ -808,18 +915,6 @@ begin ...@@ -808,18 +915,6 @@ begin
btnShipSave.Enabled := false; btnShipSave.Enabled := false;
btnShipCancel.Enabled := false; btnShipCancel.Enabled := false;
edtName.Enabled := true;
edtShortName.Enabled := true;
edtBillAddress.Enabled := true;
edtBillCity.Enabled := true;
edtBillState.Enabled := true;
edtBillZip.Enabled := true;
edtBillContact.Enabled := true;
dtpStartDate.Enabled := true;
dtpEndDate.Enabled := true;
edtFax.Enabled := true;
edtPhone.Enabled := true;
wdblcbRep.Enabled := true; wdblcbRep.Enabled := true;
lblFormState.Caption := 'View Mode'; lblFormState.Caption := 'View Mode';
......
...@@ -42,7 +42,6 @@ type ...@@ -42,7 +42,6 @@ type
xdwdsCustomersInKGOrders: TBooleanField; xdwdsCustomersInKGOrders: TBooleanField;
procedure WebFormCreate(Sender: TObject); procedure WebFormCreate(Sender: TObject);
procedure WebFormShow(Sender: TObject); procedure WebFormShow(Sender: TObject);
procedure TMSFNCGrid1CellDblClick(Sender: TObject; ACol, ARow: Integer);
procedure btnConfirmClick(Sender: TObject); procedure btnConfirmClick(Sender: TObject);
procedure TMSFNCGrid1CellClick(Sender: TObject; ACol, ARow: Integer); procedure TMSFNCGrid1CellClick(Sender: TObject; ACol, ARow: Integer);
procedure edtSearchChange(Sender: TObject); procedure edtSearchChange(Sender: TObject);
...@@ -58,6 +57,8 @@ type ...@@ -58,6 +57,8 @@ type
msg: string; msg: string;
public public
{ Public declarations } { Public declarations }
QB_ID: string;
confirm: boolean;
end; end;
var var
...@@ -80,6 +81,7 @@ end; ...@@ -80,6 +81,7 @@ end;
procedure TFSelectCustomer.WebFormShow(Sender: TObject); procedure TFSelectCustomer.WebFormShow(Sender: TObject);
begin begin
confirm := false;
getCustomers(); getCustomers();
end; end;
...@@ -89,13 +91,47 @@ begin ...@@ -89,13 +91,47 @@ begin
end; end;
procedure TFSelectCustomer.btnConfirmClick(Sender: TObject); procedure TFSelectCustomer.btnConfirmClick(Sender: TObject);
var
CustomerJSON: TJSONObject;
begin begin
if edtID.Text = '' then if edtID.Text = '' then
ShowToast('Please Select a Customer', 'danger') ShowToast('Please Select a Customer', 'danger')
else else
begin begin
xdwdsCustomers.Locate('Id', edtID.Text, []); if ( string(self.Caption).ToLower.Contains('add') and xdwdsCustomers.FieldByName('In KGOrders').AsBoolean) then
SendCustomerToServer(); ShowToast('failure:Customer Already in Database')
else
begin
if string(self.Caption).ToLower.Contains('link') then
begin
confirm := true;
QB_ID := xdwdsCustomers.FieldByName('Id').AsString;
end
else
begin
xdwdsCustomers.Locate('Id', edtID.Text, []);
CustomerJSON := TJSONObject.Create;
CustomerJSON.AddPair('NAME', xdwdsCustomers.FieldByName('CompanyName').AsString);
CustomerJSON.AddPair('QB_LIST_ID', xdwdsCustomers.FieldByName('Id').AsString);
CustomerJSON.AddPair('PHONE', xdwdsCustomers.FieldByName('PrimaryPhone').AsString);
CustomerJSON.AddPair('BILL_ADDRESS', xdwdsCustomers.FieldByName('BillAddrLine1').AsString);
CustomerJSON.AddPair('BILL_CITY', xdwdsCustomers.FieldByName('BillAddrCity').AsString);
CustomerJSON.AddPair('BILL_STATE', xdwdsCustomers.FieldByName('BillAddrState').AsString);
CustomerJSON.AddPair('BILL_ZIP', xdwdsCustomers.FieldByName('BillAddrZip').AsString);
CustomerJSON.AddPair('BILL_ADDRESS_BLOCK', xdwdsCustomers.FieldByName('BillAddr').AsString);
CustomerJSON.AddPair('address', xdwdsCustomers.FieldByName('ShipAddrLine1').AsString);
CustomerJSON.AddPair('city', xdwdsCustomers.FieldByName('ShipAddrCity').AsString);
CustomerJSON.AddPair('state', xdwdsCustomers.FieldByName('ShipAddrState').AsString);
CustomerJSON.AddPair('zip', xdwdsCustomers.FieldByName('ShipAddrZip').AsString);
CustomerJSON.AddPair('ship_block', xdwdsCustomers.FieldByName('ShipAddr').AsString);
CustomerJSON.AddPair('name', xdwdsCustomers.FieldByName('CompanyName').AsString);
CustomerJSON.AddPair('mode', 'ADD');
FViewMain.ViewAddCustomer('', CustomerJSON.ToString);
end;
Close();
end;
end; end;
end; end;
...@@ -171,17 +207,11 @@ end; ...@@ -171,17 +207,11 @@ end;
procedure TFSelectCustomer.TMSFNCGrid1CellClick(Sender: TObject; ACol, procedure TFSelectCustomer.TMSFNCGrid1CellClick(Sender: TObject; ACol,
ARow: Integer); ARow: Integer);
begin begin
xdwdsCustomers.Locate('Id', TMSFNCGrid1.Cells[0, ARow], [] );
edtID.Text := TMSFNCGrid1.Cells[0, ARow]; edtID.Text := TMSFNCGrid1.Cells[0, ARow];
edtName.Text := TMSFNCGrid1.Cells[1, ARow]; edtName.Text := TMSFNCGrid1.Cells[1, ARow];
end; end;
procedure TFSelectCustomer.TMSFNCGrid1CellDblClick(Sender: TObject; ACol,
ARow: Integer);
begin
edtID.Text := TMSFNCGrid1.Cells[2, ARow];
xdwdsCustomers.Locate('Id', TMSFNCGrid1.Cells[0, ARow], [] );
end;
procedure TFSelectCustomer.SendCustomerToServer; procedure TFSelectCustomer.SendCustomerToServer;
var var
CustomerJSON: TJSONObject; CustomerJSON: TJSONObject;
......
...@@ -71,7 +71,7 @@ var ...@@ -71,7 +71,7 @@ var
begin begin
newform := TFSelectCustomer.CreateNew; newform := TFSelectCustomer.CreateNew;
newform.Caption := 'Select Customer and Order Type'; newform.Caption := 'Select Customer to Add';
newForm.Popup := True; newForm.Popup := True;
newForm.Border := fbDialog; newForm.Border := fbDialog;
newForm.Position := poScreenCenter; newForm.Position := poScreenCenter;
......
...@@ -6,9 +6,9 @@ object fViewAddItem: TfViewAddItem ...@@ -6,9 +6,9 @@ object fViewAddItem: TfViewAddItem
object WebLabel1: TWebLabel object WebLabel1: TWebLabel
Left = 8 Left = 8
Top = 81 Top = 81
Width = 95 Width = 67
Height = 15 Height = 15
Caption = 'Search Customers' Caption = 'Search Items'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
......
...@@ -40,6 +40,8 @@ type ...@@ -40,6 +40,8 @@ type
[async] procedure getItems(); [async] procedure getItems();
procedure PopulateGridManually(); procedure PopulateGridManually();
[async] procedure SendItemToServer(); [async] procedure SendItemToServer();
var
mode: string;
public public
{ Public declarations } { Public declarations }
notification: string; notification: string;
...@@ -66,6 +68,10 @@ end; ...@@ -66,6 +68,10 @@ end;
procedure TfViewAddItem.WebFormShow(Sender: TObject); procedure TfViewAddItem.WebFormShow(Sender: TObject);
begin begin
//Utils.ShowSpinner('spinner'); //Utils.ShowSpinner('spinner');
if String(Self.Caption).Contains('Add') then
mode := 'ADD'
else
mode := 'UPDATE';
getItems(); getItems();
end; end;
...@@ -79,7 +85,7 @@ begin ...@@ -79,7 +85,7 @@ begin
xdwdsCustomers.Locate('qb_item_name', edtName.Text, []); xdwdsCustomers.Locate('qb_item_name', edtName.Text, []);
if edtName.Text = '' then if edtName.Text = '' then
edtNotification.Text := 'Please Select an Item' edtNotification.Text := 'Please Select an Item'
else if xdwdsCustomers.FieldByName('qb_items_id').AsString <> '' then else if ( ( xdwdsCustomers.FieldByName('qb_items_id').AsString <> '' ) and ( mode = 'ADD' ) ) then
edtNotification.Text := 'Item Already In Database' edtNotification.Text := 'Item Already In Database'
else else
begin begin
...@@ -93,7 +99,6 @@ begin ...@@ -93,7 +99,6 @@ begin
confirm := true; confirm := true;
Close; Close;
end; end;
//SendItemToServer();
end; end;
procedure TfViewAddItem.getItems; procedure TfViewAddItem.getItems;
......
...@@ -114,12 +114,12 @@ object FViewItems: TFViewItems ...@@ -114,12 +114,12 @@ object FViewItems: TFViewItems
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = btnDeleteClick OnClick = btnDeleteClick
end end
object btnEdit: TWebButton object btnUpdate: TWebButton
Left = 567 Left = 567
Top = 411 Top = 411
Width = 96 Width = 96
Height = 25 Height = 25
Caption = 'Edit' Caption = 'Update'
ChildOrder = 83 ChildOrder = 83
ElementID = 'btnedit' ElementID = 'btnedit'
ElementFont = efCSS ElementFont = efCSS
...@@ -127,7 +127,7 @@ object FViewItems: TFViewItems ...@@ -127,7 +127,7 @@ object FViewItems: TFViewItems
HeightStyle = ssAuto HeightStyle = ssAuto
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = btnEditClick OnClick = btnUpdateClick
end end
object wdbtcItems: TWebDBTableControl object wdbtcItems: TWebDBTableControl
Left = 16 Left = 16
...@@ -193,6 +193,7 @@ object FViewItems: TFViewItems ...@@ -193,6 +193,7 @@ object FViewItems: TFViewItems
ChildOrder = 8 ChildOrder = 8
ElementID = 'edtname' ElementID = 'edtname'
ElementFont = efCSS ElementFont = efCSS
Enabled = False
HeightStyle = ssAuto HeightStyle = ssAuto
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
...@@ -207,6 +208,7 @@ object FViewItems: TFViewItems ...@@ -207,6 +208,7 @@ object FViewItems: TFViewItems
ChildOrder = 8 ChildOrder = 8
ElementID = 'edtdescription' ElementID = 'edtdescription'
ElementFont = efCSS ElementFont = efCSS
Enabled = False
HeightStyle = ssAuto HeightStyle = ssAuto
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
...@@ -225,6 +227,7 @@ object FViewItems: TFViewItems ...@@ -225,6 +227,7 @@ object FViewItems: TFViewItems
ElementLabelClassName = 'custom-control-label' ElementLabelClassName = 'custom-control-label'
ElementID = 'cbstatus' ElementID = 'cbstatus'
ElementFont = efCSS ElementFont = efCSS
Enabled = False
HeightStyle = ssAuto HeightStyle = ssAuto
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
......
...@@ -24,7 +24,7 @@ type ...@@ -24,7 +24,7 @@ type
btnSave: TWebButton; btnSave: TWebButton;
btnCancel: TWebButton; btnCancel: TWebButton;
btnDelete: TWebButton; btnDelete: TWebButton;
btnEdit: TWebButton; btnUpdate: TWebButton;
wdbtcItems: TWebDBTableControl; wdbtcItems: TWebDBTableControl;
wdsItems: TWebDataSource; wdsItems: TWebDataSource;
xdwdsItemsstatus: TStringField; xdwdsItemsstatus: TStringField;
...@@ -38,7 +38,7 @@ type ...@@ -38,7 +38,7 @@ type
lblFormState: TWebLabel; lblFormState: TWebLabel;
procedure btnAddClick(Sender: TObject); procedure btnAddClick(Sender: TObject);
procedure wcbPageSizeChange(Sender: TObject); procedure wcbPageSizeChange(Sender: TObject);
procedure btnEditClick(Sender: TObject); procedure btnUpdateClick(Sender: TObject);
procedure btnSaveClick(Sender: TObject); procedure btnSaveClick(Sender: TObject);
procedure btnDeleteClick(Sender: TObject); procedure btnDeleteClick(Sender: TObject);
procedure btnCancelClick(Sender: TObject); procedure btnCancelClick(Sender: TObject);
...@@ -439,12 +439,10 @@ begin ...@@ -439,12 +439,10 @@ begin
end; end;
procedure TFViewItems.btnAddClick(Sender: TObject); procedure TFViewItems.btnAddClick(Sender: TObject);
// Button that effectively functions as a GetItems() button
var var
itemOptions: string; itemOptions: string;
newform: TFViewAddItem; newform: TFViewAddItem;
begin begin
console.log(AuthService.TokenPayload.Properties['qb_enabled']);
if AuthService.TokenPayload.Properties['qb_enabled'] then if AuthService.TokenPayload.Properties['qb_enabled'] then
begin begin
newform := TFViewAddItem.CreateNew; newform := TFViewAddItem.CreateNew;
...@@ -506,9 +504,44 @@ begin ...@@ -506,9 +504,44 @@ begin
ShowNotificationModal('Deleting items is not yet implemented.'); ShowNotificationModal('Deleting items is not yet implemented.');
end; end;
procedure TFViewItems.btnEditClick(Sender: TObject); procedure TFViewItems.btnUpdateClick(Sender: TObject);
var
itemOptions: string;
newform: TFViewAddItem;
begin begin
EditMode(); if AuthService.TokenPayload.Properties['qb_enabled'] then
begin
newform := TFViewAddItem.CreateNew;
newform.Caption := 'Select Item to Update';
newForm.Popup := True;
newForm.position:= poScreenCenter;
newForm.Border := fbDialog;
// used to manage Back button handling to close subform
window.location.hash := 'subform';
newform.ShowModal(
procedure(AValue: TModalResult)
begin
if newform.confirm then
begin
xdwdsItems.Edit;
xdwdsItems.FieldByName('QB_ID').AsString := newform.QB_ID;
xdwdsItems.FieldByName('name').AsString := newform.name;
xdwdsItems.FieldByName('description').AsString := newform.description;
xdwdsItems.FieldByName('status').AsString := newform.status;
xdwdsItems.Post;
EditMode();
lblFormState.Caption := 'Edit Mode';
end;
end
);
end
else
ShowNotificationModal('QuickBooks interface is not currently active.');
end; end;
procedure TFViewItems.btnSaveClick(Sender: TObject); procedure TFViewItems.btnSaveClick(Sender: TObject);
...@@ -603,7 +636,7 @@ begin ...@@ -603,7 +636,7 @@ begin
btnDelete.Enabled := true; btnDelete.Enabled := true;
btnSave.Enabled := false; btnSave.Enabled := false;
btnCancel.Enabled := false; btnCancel.Enabled := false;
btnEdit.Enabled := true; btnUpdate.Enabled := true;
FViewMain.change := false; FViewMain.change := false;
lblFormState.Caption := 'View Mode'; lblFormState.Caption := 'View Mode';
...@@ -624,11 +657,8 @@ begin ...@@ -624,11 +657,8 @@ begin
btnDelete.Enabled := false; btnDelete.Enabled := false;
btnSave.Enabled := true; btnSave.Enabled := true;
btnCancel.Enabled := True; btnCancel.Enabled := True;
btnEdit.Enabled := false; btnUpdate.Enabled := false;
edtName.Enabled := true;
edtDescription.Enabled := true;
cbStatus.enabled := true;
DisablePagination(); DisablePagination();
lblFormState.Caption := 'Edit Mode'; lblFormState.Caption := 'Edit Mode';
......
...@@ -35,9 +35,6 @@ type ...@@ -35,9 +35,6 @@ type
procedure lblordersClick(Sender: TObject); procedure lblordersClick(Sender: TObject);
procedure lblCustomersClick(Sender: TObject); procedure lblCustomersClick(Sender: TObject);
procedure lblLinkToQBClick(Sender: TObject); procedure lblLinkToQBClick(Sender: TObject);
private
const
qbLink = 'https://appcenter.intuit.com/connect/oauth2?client_id=ABYqlDx1EsacZYXvHIJ7RDB7zmnQdwABU3fwQLIZPmBgU0VW1P&response_type=code&scope=com.intuit.quickbooks.accounting&redirect_uri=http://localhost:2004/kgOrders/auth/AuthService/Authorize&state=7';
{ Private declarations } { Private declarations }
private private
FUserInfo: string; FUserInfo: string;
...@@ -182,8 +179,14 @@ end; ...@@ -182,8 +179,14 @@ end;
procedure TFViewMain.lblLinkToQBClick(Sender: TObject); procedure TFViewMain.lblLinkToQBClick(Sender: TObject);
var var
qblink: string;
qbWindow: TJSWindow; qbWindow: TJSWindow;
begin begin
qblink := 'https://appcenter.intuit.com/connect/oauth2';
qblink := qblink + '?client_id=ABYqlDx1EsacZYXvHIJ7RDB7zmnQdwABU3fwQLIZPmBgU0VW1P';
qblink := qblink + '&response_type=code';
qblink := qblink + '&scope=com.intuit.quickbooks.accounting';
qblink := qblink + '&redirect_uri=http://localhost:2004/kgOrders/auth/AuthService/Authorize&state=7';
qbWindow := window.open('', '_blank'); qbWindow := window.open('', '_blank');
if Assigned(qbWindow) then if Assigned(qbWindow) then
qbWindow.location.href := qbLink; qbWindow.location.href := qbLink;
......
...@@ -208,7 +208,7 @@ var ...@@ -208,7 +208,7 @@ var
restRequest: TRESTRequest; restRequest: TRESTRequest;
restResponse: TRESTResponse; restResponse: TRESTResponse;
param: TRESTRequestParameter; param: TRESTRequestParameter;
Client, Secret, authString, AccessToken, RefreshToken: string; Client, Secret, authString, AccessToken, RefreshToken, RedirectUri: string;
jsonObj: TJSONObject; jsonObj: TJSONObject;
begin begin
logger.Log(3, 'AuthService.ExchangeAuthCode - start'); logger.Log(3, 'AuthService.ExchangeAuthCode - start');
...@@ -225,6 +225,7 @@ begin ...@@ -225,6 +225,7 @@ begin
Client := iniFile.ReadString('Quickbooks', 'ClientID', ''); Client := iniFile.ReadString('Quickbooks', 'ClientID', '');
Secret := iniFile.ReadString('Quickbooks', 'ClientSecret', ''); Secret := iniFile.ReadString('Quickbooks', 'ClientSecret', '');
RedirectUri := iniFile.ReadString('Quickbooks', 'RedirectUri', '');
authString := TNetEncoding.Base64.Encode(Client + ':' + Secret).Replace(#13,'').Replace(#10,''); authString := TNetEncoding.Base64.Encode(Client + ':' + Secret).Replace(#13,'').Replace(#10,'');
...@@ -255,7 +256,7 @@ begin ...@@ -255,7 +256,7 @@ begin
param := restRequest.Params.AddItem; param := restRequest.Params.AddItem;
param.Name := 'redirect_uri'; param.Name := 'redirect_uri';
param.Kind := pkGETorPOST; param.Kind := pkGETorPOST;
param.Value := 'http://localhost:2004/kgOrders/auth/AuthService/Authorize'; param.Value := RedirectUri;
restRequest.Execute; restRequest.Execute;
...@@ -268,12 +269,13 @@ begin ...@@ -268,12 +269,13 @@ begin
AccessToken := jsonObj.GetValue<string>('access_token'); AccessToken := jsonObj.GetValue<string>('access_token');
RefreshToken := jsonObj.GetValue<string>('refresh_token'); RefreshToken := jsonObj.GetValue<string>('refresh_token');
logger.Log(3, 'Access Token: ' + AccessToken); logger.Log(5, 'Access Token: ' + AccessToken);
logger.Log(3, 'Refresh Token: ' + RefreshToken); logger.Log(5, 'Refresh Token: ' + RefreshToken);
iniFile.WriteString('Quickbooks', 'AccessToken', AccessToken); iniFile.WriteString('Quickbooks', 'AccessToken', AccessToken);
iniFile.WriteString('Quickbooks', 'RefreshToken', RefreshToken); iniFile.WriteString('Quickbooks', 'RefreshToken', RefreshToken);
iniFile.WriteString('Quickbooks', 'LastRefresh', DateTimeToStr(Now)); iniFile.WriteString('Quickbooks', 'LastRefresh', DateTimeToStr(Now));
result := 'Quickbooks successfully linked!';
end; end;
except except
...@@ -283,7 +285,6 @@ begin ...@@ -283,7 +285,6 @@ begin
logger.Log(1, 'ExchangeAuthCode Error: ' + E.Message); logger.Log(1, 'ExchangeAuthCode Error: ' + E.Message);
end; end;
end; end;
result := 'Quickbooks successfully linked!';
finally finally
restClient.Free; restClient.Free;
restRequest.Free; restRequest.Free;
......
...@@ -487,6 +487,7 @@ type ...@@ -487,6 +487,7 @@ type
[HttpGet] function getQBCustomers(): TJSONArray; [HttpGet] function getQBCustomers(): TJSONArray;
[HttpGet] function getQBItems(): TJSONArray; [HttpGet] function getQBItems(): TJSONArray;
[HttpGet] function GetRepUsers(): TList<TUserItem>; [HttpGet] function GetRepUsers(): TList<TUserItem>;
[HttpGet] function UpdateCustomer(QB_ID: string): TCustomerItem;
function AddUser(userInfo: string): string; function AddUser(userInfo: string): string;
......
...@@ -39,6 +39,7 @@ type ...@@ -39,6 +39,7 @@ type
function GetQBCustomers: TJSONArray; function GetQBCustomers: TJSONArray;
function GetQBItems: TJSONArray; function GetQBItems: TJSONArray;
function GetRepUsers(): TList<TUserItem>; function GetRepUsers(): TList<TUserItem>;
function UpdateCustomer(QB_ID: string): TCustomerItem;
function EditUser(const editOptions: string): string; function EditUser(const editOptions: string): string;
...@@ -93,7 +94,7 @@ var ...@@ -93,7 +94,7 @@ var
restRequest: TRESTRequest; restRequest: TRESTRequest;
restResponse: TRESTResponse; restResponse: TRESTResponse;
param: TRESTRequestParameter; param: TRESTRequestParameter;
res: string; res, BaseUrl: string;
i: integer; i: integer;
jsValue: TJSONValue; jsValue: TJSONValue;
Customer: TJSONValue; Customer: TJSONValue;
...@@ -144,7 +145,7 @@ begin ...@@ -144,7 +145,7 @@ begin
restRequest := TRESTRequest.Create(nil); restRequest := TRESTRequest.Create(nil);
restResponse := TRESTResponse.Create(nil); restResponse := TRESTResponse.Create(nil);
iniFile := TIniFile.Create(ExtractFilePath(Application.ExeName) + 'kgOrdersServer.ini'); iniFile := TIniFile.Create(ExtractFilePath(Application.ExeName) + 'kgOrdersServer.ini');
Logger.Log(3, 'TLookupService.AddEstimate'); Logger.Log(3, 'TLookupService.AddEstimate - start');
try try
try try
JSONData := TJSONObject.ParseJSONValue(orderInfo) as TJSONObject; JSONData := TJSONObject.ParseJSONValue(orderInfo) as TJSONObject;
...@@ -250,9 +251,11 @@ begin ...@@ -250,9 +251,11 @@ begin
estimateJSON.AddPair('ShipDate', ordersDB.UniQuery1.FieldByName('staff_fields_ship_date').AsString) estimateJSON.AddPair('ShipDate', ordersDB.UniQuery1.FieldByName('staff_fields_ship_date').AsString)
end; end;
//logger.Log(5, 'estimateJSON finished construction'); logger.Log(5, 'estimateJSON finished construction');
restClient.BaseURL := 'https://sandbox-quickbooks.api.intuit.com'; BaseUrl := iniFile.ReadString('Quickbooks', 'BaseUrl', '');
restClient.BaseURL := BaseUrl;
restRequest.Client := restClient; restRequest.Client := restClient;
...@@ -335,6 +338,7 @@ begin ...@@ -335,6 +338,7 @@ begin
end; end;
end; end;
finally finally
logger.Log(3, 'TLookupService.AddEstimate - end');
iniFile.Free; iniFile.Free;
restClient.Free; restClient.Free;
restRequest.Free; restRequest.Free;
...@@ -372,7 +376,7 @@ var ...@@ -372,7 +376,7 @@ var
ADDRESS_LIST: TJSONArray; ADDRESS_LIST: TJSONArray;
ADDRESS: TJSONObject; ADDRESS: TJSONObject;
begin begin
logger.Log(3, 'TLookupService.DelShippingAddress'); logger.Log(3, 'TLookupService.DelShippingAddress - start');
SQL := 'DELETE FROM customers_ship WHERE customer_ship_id = ' + AddressID; SQL := 'DELETE FROM customers_ship WHERE customer_ship_id = ' + AddressID;
logger.Log(5, 'Deleting shipping address with SQL: ' + SQL); logger.Log(5, 'Deleting shipping address with SQL: ' + SQL);
OrdersDB.UniQuery1.SQL.Text := SQL; OrdersDB.UniQuery1.SQL.Text := SQL;
...@@ -400,7 +404,7 @@ begin ...@@ -400,7 +404,7 @@ begin
Result.AddPair('ADDRESS', ADDRESS_LIST); Result.AddPair('ADDRESS', ADDRESS_LIST);
TXDataOperationContext.Current.Handler.ManagedObjects.Add(Result); TXDataOperationContext.Current.Handler.ManagedObjects.Add(Result);
logger.Log(3, 'DelShippingAddress Finished'); logger.Log(3, 'TLookupService.DelShippingAddress - end');
end; end;
...@@ -414,7 +418,7 @@ var ...@@ -414,7 +418,7 @@ var
PageNum, PageSize: integer; PageNum, PageSize: integer;
offset,limit: string; offset,limit: string;
begin begin
logger.Log(3, 'TLookupService.GetCustomers'); logger.Log(3, 'TLookupService.GetCustomers - start');
params := TStringList.Create; params := TStringList.Create;
try try
params.StrictDelimiter := true; params.StrictDelimiter := true;
...@@ -469,7 +473,7 @@ begin ...@@ -469,7 +473,7 @@ begin
doQuery(ordersDB.UniQuery1, SQL); doQuery(ordersDB.UniQuery1, SQL);
Result.count := ordersDB.UniQuery1.FieldByName('total_count').AsInteger; Result.count := ordersDB.UniQuery1.FieldByName('total_count').AsInteger;
ordersDB.UniQuery1.Close; ordersDB.UniQuery1.Close;
logger.Log(3, 'GetCustomers finished'); logger.Log(3, 'TLookupService.GetCustomers - end');
except except
on E: Exception do on E: Exception do
begin begin
...@@ -490,7 +494,7 @@ var ...@@ -490,7 +494,7 @@ var
SQL: string; SQL: string;
ADDRESS: TAddressItem; ADDRESS: TAddressItem;
begin begin
logger.Log(3, 'TLookupService.GetCustomer'); logger.Log(3, 'TLookupService.GetCustomer - start');
try try
if ID = '' then if ID = '' then
SQL := 'select * FROM customers c LEFT JOIN customers_ship s ON c.CUSTOMER_ID = s.customer_id WHERE c.CUSTOMER_ID = -1' SQL := 'select * FROM customers c LEFT JOIN customers_ship s ON c.CUSTOMER_ID = s.customer_id WHERE c.CUSTOMER_ID = -1'
...@@ -535,7 +539,7 @@ begin ...@@ -535,7 +539,7 @@ begin
ordersDB.UniQuery1.Next; ordersDB.UniQuery1.Next;
end; end;
logger.Log(3, 'GetCustomer Finished'); logger.Log(3, 'TLookupService.GetCustomer - end');
except except
on E: Exception do on E: Exception do
begin begin
...@@ -552,9 +556,10 @@ var ...@@ -552,9 +556,10 @@ var
USER: TUserItem; USER: TUserItem;
SQL: string; SQL: string;
begin begin
Logger.Log(3, 'TLookupService.GetRepUsers'); Logger.Log(3, 'TLookupService.GetRepUsers - start');
SQL := 'SELECT USER_ID, NAME, STATUS from users ORDER BY NAME'; SQL := 'SELECT USER_ID, NAME, STATUS from users ORDER BY NAME';
result := TList<TUserItem>.Create; result := TList<TUserItem>.Create;
logger.Log(5, 'Retrieving Rep Users with SQL: ' + SQL);
doQuery(ordersDB.uqUsers, SQL); doQuery(ordersDB.uqUsers, SQL);
while not ordersDB.uqUsers.Eof do while not ordersDB.uqUsers.Eof do
begin begin
...@@ -566,7 +571,7 @@ begin ...@@ -566,7 +571,7 @@ begin
result.Add(USER); result.Add(USER);
ordersDB.uqUsers.Next; ordersDB.uqUsers.Next;
end; end;
logger.Log(3, 'GetRepUsers finished'); logger.Log(3, 'TLookupService.GetRepUsers - end');
end; end;
...@@ -578,7 +583,7 @@ var ...@@ -578,7 +583,7 @@ var
CompanyID, CompanyName: string; CompanyID, CompanyName: string;
params: TStringList; params: TStringList;
begin begin
logger.Log(3, 'TLookupService.GenerateOrderListPDF'); logger.Log(3, 'TLookupService.GenerateOrderListPDF - start');
rptOrderList := TrptOrderList.Create(nil); rptOrderList := TrptOrderList.Create(nil);
params := TStringList.Create; params := TStringList.Create;
try try
...@@ -598,6 +603,7 @@ begin ...@@ -598,6 +603,7 @@ begin
if companyID <> '' then if companyID <> '' then
begin begin
SQL := 'Select NAME from customers c where CUSTOMER_ID = ' + companyID; SQL := 'Select NAME from customers c where CUSTOMER_ID = ' + companyID;
logger.Log(5, 'Retrieving customers with SQL: ' + SQL);
doQuery(ordersDB.UniQuery1, SQL); doQuery(ordersDB.UniQuery1, SQL);
CompanyName := 'Company: ' + ordersDB.UniQuery1.FieldByName('NAME').AsString; CompanyName := 'Company: ' + ordersDB.UniQuery1.FieldByName('NAME').AsString;
end end
...@@ -608,6 +614,7 @@ begin ...@@ -608,6 +614,7 @@ begin
result := rptOrderList.PrepareReport(SQL, CompanyName); result := rptOrderList.PrepareReport(SQL, CompanyName);
Logger.log(5, 'PDF Report successfully generated for searchOptions: ' + params.DelimitedText); Logger.log(5, 'PDF Report successfully generated for searchOptions: ' + params.DelimitedText);
Logger.Log(3, 'TLookupService.GenerateOrdersListReport - end');
except except
on E: Exception do on E: Exception do
begin begin
...@@ -621,7 +628,6 @@ begin ...@@ -621,7 +628,6 @@ begin
end; end;
end; end;
function TLookupService.AddShippingAddress(AddressInfo: string): TJSONObject; function TLookupService.AddShippingAddress(AddressInfo: string): TJSONObject;
var var
JSONData: TJSONObject; JSONData: TJSONObject;
...@@ -635,7 +641,7 @@ var ...@@ -635,7 +641,7 @@ var
ADDRESS_LIST:TJSONArray; ADDRESS_LIST:TJSONArray;
CustomerID: string; CustomerID: string;
begin begin
logger.Log(3, 'TLookupSerivce.AddShippingAddress'); logger.Log(3, 'TLookupSerivce.AddShippingAddress - start');
result := TJSONObject.Create; result := TJSONObject.Create;
JSONData := TJSONObject.ParseJSONValue(AddressInfo) as TJSONObject; JSONData := TJSONObject.ParseJSONValue(AddressInfo) as TJSONObject;
...@@ -708,11 +714,12 @@ begin ...@@ -708,11 +714,12 @@ begin
Result.AddPair('status', msg); Result.AddPair('status', msg);
Result.AddPair('ADDRESS', ADDRESS_LIST); Result.AddPair('ADDRESS', ADDRESS_LIST);
TXDataOperationContext.Current.Handler.ManagedObjects.Add(Result); TXDataOperationContext.Current.Handler.ManagedObjects.Add(Result);
logger.Log(3, 'AddShippingAddress finished'); logger.Log(3, 'TLookupService.AddShippingAddress - end');
except except
on E: Exception do on E: Exception do
begin begin
Result.AddPair('error', E.Message); Result.AddPair('error', E.Message);
Logger.Log(1, 'Error in TLookupService.AddShippingAddress: ' + E.Message);
end end
end; end;
end; end;
...@@ -730,7 +737,7 @@ var ...@@ -730,7 +737,7 @@ var
msg: string; msg: string;
unique: boolean; unique: boolean;
begin begin
logger.Log(3, 'TLookupService.AddCustomer'); logger.Log(3, 'TLookupService.AddCustomer - start');
DateFormat := TFormatSettings.Create; DateFormat := TFormatSettings.Create;
DateFormat.ShortDateFormat := 'yyyy-mm-dd'; DateFormat.ShortDateFormat := 'yyyy-mm-dd';
DateFormat.DateSeparator := '-'; DateFormat.DateSeparator := '-';
...@@ -749,6 +756,7 @@ begin ...@@ -749,6 +756,7 @@ begin
// Retrieve updated RevisionID // Retrieve updated RevisionID
SQL := 'select KEYVALUE from idfield where KEYNAME = ' + quotedStr('GEN_CUSTOMER_ID'); SQL := 'select KEYVALUE from idfield where KEYNAME = ' + quotedStr('GEN_CUSTOMER_ID');
logger.Log(5, 'Retrieving new Key with SQL: ' + SQL);
doQuery(OrdersDB.UniQuery1, SQL); doQuery(OrdersDB.UniQuery1, SQL);
CustomerID := OrdersDB.UniQuery1.FieldByName('KEYVALUE').AsInteger; CustomerID := OrdersDB.UniQuery1.FieldByName('KEYVALUE').AsInteger;
end end
...@@ -822,6 +830,7 @@ begin ...@@ -822,6 +830,7 @@ begin
Result := TJSONObject.Create.AddPair('status', msg); Result := TJSONObject.Create.AddPair('status', msg);
Result.AddPair('CustomerID', CustomerID); Result.AddPair('CustomerID', CustomerID);
TXDataOperationContext.Current.Handler.ManagedObjects.Add(Result); TXDataOperationContext.Current.Handler.ManagedObjects.Add(Result);
logger.Log(3,'TLookupService.AddCustomer - end');
except except
on E: Exception do on E: Exception do
begin begin
...@@ -2273,6 +2282,7 @@ begin ...@@ -2273,6 +2282,7 @@ begin
ordersDB.UniQuery1.FieldByName('qb_item_name').AsString := Name; ordersDB.UniQuery1.FieldByName('qb_item_name').AsString := Name;
ordersDB.UniQuery1.FieldByName('item_desc').AsString := Description; ordersDB.UniQuery1.FieldByName('item_desc').AsString := Description;
ordersDB.UniQuery1.FieldByName('status').AsString := status; ordersDB.UniQuery1.FieldByName('status').AsString := status;
ordersDB.UniQuery1.FieldByName('qb_items_qb_id').AsString := JSONData.GetValue<string>('qb_items_qb_id');
ordersDB.UniQuery1.Post; ordersDB.UniQuery1.Post;
Result.AddPair('msg', 'Success: Item successfully edited'); Result.AddPair('msg', 'Success: Item successfully edited');
...@@ -2696,7 +2706,6 @@ begin ...@@ -2696,7 +2706,6 @@ begin
ordersDB.UniQuery1.Post; ordersDB.UniQuery1.Post;
end; end;
function TLookupService.getQBCustomers: TJSONArray; function TLookupService.getQBCustomers: TJSONArray;
var var
iniFile: TIniFile; iniFile: TIniFile;
...@@ -2710,7 +2719,7 @@ var ...@@ -2710,7 +2719,7 @@ var
jsObj: TJSONObject; jsObj: TJSONObject;
PhoneObj: TJSONObject; PhoneObj: TJSONObject;
CustomerList: TJSONArray; CustomerList: TJSONArray;
AccessToken, RefreshToken, CompanyID, Client, Secret: string; AccessToken, RefreshToken, CompanyID, Client, Secret, BaseUrl, Line1, Line2: string;
LastRefresh: TDateTime; LastRefresh: TDateTime;
I: integer; I: integer;
SQL: string; SQL: string;
...@@ -2740,8 +2749,9 @@ begin ...@@ -2740,8 +2749,9 @@ begin
CompanyID := iniFile.ReadString('Quickbooks', 'CompanyID', ''); CompanyID := iniFile.ReadString('Quickbooks', 'CompanyID', '');
RefreshToken := iniFile.ReadString('Quickbooks', 'RefreshToken', ''); RefreshToken := iniFile.ReadString('Quickbooks', 'RefreshToken', '');
AccessToken := iniFile.ReadString('Quickbooks', 'AccessToken', ''); AccessToken := iniFile.ReadString('Quickbooks', 'AccessToken', '');
BaseUrl := iniFile.ReadString('Quickbooks', 'BaseUrl', '');
restClient.BaseURL := 'https://sandbox-quickbooks.api.intuit.com'; restClient.BaseURL := BaseUrl;
restRequest.Method := rmGET; restRequest.Method := rmGET;
res := '/v3/company/' + CompanyID + '/query?query=select * from Customer&minorversion=75'; res := '/v3/company/' + CompanyID + '/query?query=select * from Customer&minorversion=75';
restRequest.Resource := res; restRequest.Resource := res;
...@@ -2785,38 +2795,85 @@ begin ...@@ -2785,38 +2795,85 @@ begin
if Customer.GetValue('BillAddr') is TJSONObject then if Customer.GetValue('BillAddr') is TJSONObject then
begin begin
BillAddr := Customer.GetValue('BillAddr') as TJSONObject; BillAddr := Customer.GetValue('BillAddr') as TJSONObject;
Line1 := BillAddr.GetValue<string>('Line1', '');
Line2 := BillAddr.GetValue<string>('Line2', '');
ParsedCustomer.AddPair('BillAddrLine1', TJSONString.Create(BillAddr.GetValue<string>('Line1', ''))); ParsedCustomer.AddPair('BillAddrLine1', TJSONString.Create(BillAddr.GetValue<string>('Line1', '')));
ParsedCustomer.AddPair('BillAddrCity', TJSONString.Create(BillAddr.GetValue<string>('City', ''))); ParsedCustomer.AddPair('BillAddrCity', TJSONString.Create(BillAddr.GetValue<string>('City', '')));
ParsedCustomer.AddPair('BillAddrState', TJSONString.Create(BillAddr.GetValue<string>('CountrySubDivisionCode', ''))); ParsedCustomer.AddPair('BillAddrState', TJSONString.Create(BillAddr.GetValue<string>('CountrySubDivisionCode', '')));
ParsedCustomer.AddPair('BillAddrZip', TJSONString.Create(BillAddr.GetValue<string>('PostalCode', ''))); ParsedCustomer.AddPair('BillAddrZip', TJSONString.Create(BillAddr.GetValue<string>('PostalCode', '')));
ParsedCustomer.AddPair('BillAddr',
if Line2 <> '' then
begin
ParsedCustomer.AddPair('BillAddrLine1', TJSONString.Create(Line2));
ParsedCustomer.AddPair('BillAddrContact', TJSONString.Create(Line1));
ParsedCustomer.AddPair('BillAddr',
TJSONString.Create( TJSONString.Create(
Customer.GetValue<string>('DisplayName') + sLineBreak + Customer.GetValue<string>('DisplayName') + sLineBreak +
BillAddr.GetValue('Line1', '') + ',' + sLineBreak + BillAddr.GetValue('Line1', '') + sLineBreak +
BillAddr.GetValue('Line2', '') + sLineBreak +
BillAddr.GetValue('City', '') + ', ' + BillAddr.GetValue('City', '') + ', ' +
BillAddr.GetValue('CountrySubDivisionCode', '') + ' ' + BillAddr.GetValue('CountrySubDivisionCode', '') + ' ' +
BillAddr.GetValue('PostalCode', '') BillAddr.GetValue('PostalCode', '')
) )
); );
end
else
begin
ParsedCustomer.AddPair('BillAddrLine1', TJSONString.Create(Line1));
ParsedCustomer.AddPair('BillAddr',
TJSONString.Create(
Customer.GetValue<string>('DisplayName') + sLineBreak +
BillAddr.GetValue('Line1', '') + sLineBreak +
BillAddr.GetValue('City', '') + ', ' +
BillAddr.GetValue('CountrySubDivisionCode', '') + ' ' +
BillAddr.GetValue('PostalCode', '')
)
);
end;
end; end;
// Handle Ship Address // Handle Ship Address
if Customer.GetValue('ShipAddr') is TJSONObject then if Customer.GetValue('ShipAddr') is TJSONObject then
begin begin
BillAddr := Customer.GetValue('ShipAddr') as TJSONObject; BillAddr := Customer.GetValue('BillAddr') as TJSONObject;
Line1 := BillAddr.GetValue<string>('Line1', '');
Line2 := BillAddr.GetValue<string>('Line2', '');
ParsedCustomer.AddPair('ShipAddrLine1', TJSONString.Create(BillAddr.GetValue<string>('Line1', ''))); ParsedCustomer.AddPair('ShipAddrLine1', TJSONString.Create(BillAddr.GetValue<string>('Line1', '')));
ParsedCustomer.AddPair('ShipAddrCity', TJSONString.Create(BillAddr.GetValue<string>('City', ''))); ParsedCustomer.AddPair('ShipAddrCity', TJSONString.Create(BillAddr.GetValue<string>('City', '')));
ParsedCustomer.AddPair('ShipAddrState', TJSONString.Create(BillAddr.GetValue<string>('CountrySubDivisionCode', ''))); ParsedCustomer.AddPair('ShipAddrState', TJSONString.Create(BillAddr.GetValue<string>('CountrySubDivisionCode', '')));
ParsedCustomer.AddPair('ShipAddrZip', TJSONString.Create(BillAddr.GetValue<string>('PostalCode', ''))); ParsedCustomer.AddPair('BillAddrZip', TJSONString.Create(BillAddr.GetValue<string>('PostalCode', '')));
ParsedCustomer.AddPair('ShipAddr',
if Line2 <> '' then
begin
ParsedCustomer.AddPair('ShipAddrLine1', TJSONString.Create(Line2));
ParsedCustomer.AddPair('ShipAddrContact', TJSONString.Create(Line1));
ParsedCustomer.AddPair('ShipAddr',
TJSONString.Create(
Customer.GetValue<string>('DisplayName') + sLineBreak +
BillAddr.GetValue('Line1', '') + sLineBreak +
BillAddr.GetValue('Line2', '') + sLineBreak +
BillAddr.GetValue('City', '') + ', ' +
BillAddr.GetValue('CountrySubDivisionCode', '') + ' ' +
BillAddr.GetValue('PostalCode', '')
)
);
end
else
begin
ParsedCustomer.AddPair('ShipAddrLine1', TJSONString.Create(Line1));
ParsedCustomer.AddPair('ShipAddr',
TJSONString.Create( TJSONString.Create(
Customer.GetValue<string>('DisplayName') + sLineBreak + Customer.GetValue<string>('DisplayName') + sLineBreak +
BillAddr.GetValue('Line1', '') + ',' + sLineBreak + BillAddr.GetValue('Line1', '') + sLineBreak +
BillAddr.GetValue('City', '') + ', ' + BillAddr.GetValue('City', '') + ', ' +
BillAddr.GetValue('CountrySubDivisionCode', '') + ' ' + BillAddr.GetValue('CountrySubDivisionCode', '') + ' ' +
BillAddr.GetValue('PostalCode', '') BillAddr.GetValue('PostalCode', '')
) )
); );
end;
end; end;
Result.AddElement(ParsedCustomer); Result.AddElement(ParsedCustomer);
...@@ -2840,7 +2897,6 @@ begin ...@@ -2840,7 +2897,6 @@ begin
end; end;
end; end;
function TLookupService.GetQBItems: TJSONArray; function TLookupService.GetQBItems: TJSONArray;
var var
restClient: TRESTClient; restClient: TRESTClient;
...@@ -2853,7 +2909,7 @@ var ...@@ -2853,7 +2909,7 @@ var
ItemList: TJSONArray; ItemList: TJSONArray;
ParsedItem, Item: TJSONObject; ParsedItem, Item: TJSONObject;
I: integer; I: integer;
AccessToken, RefreshToken, CompanyID, Client, Secret, SQL, desc: string; AccessToken, RefreshToken, CompanyID, Client, Secret, SQL, desc, BaseUrl: string;
LastRefresh: TDateTime; LastRefresh: TDateTime;
iniFile: TIniFile; iniFile: TIniFile;
begin begin
...@@ -2885,8 +2941,9 @@ begin ...@@ -2885,8 +2941,9 @@ begin
CompanyID := iniFile.ReadString('Quickbooks', 'CompanyID', ''); CompanyID := iniFile.ReadString('Quickbooks', 'CompanyID', '');
RefreshToken := iniFile.ReadString('Quickbooks', 'RefreshToken', ''); RefreshToken := iniFile.ReadString('Quickbooks', 'RefreshToken', '');
AccessToken := iniFile.ReadString('Quickbooks', 'AccessToken', ''); AccessToken := iniFile.ReadString('Quickbooks', 'AccessToken', '');
BaseUrl := iniFile.ReadString('Quickbooks', 'BaseUrl', '');
restClient.BaseURL := 'https://sandbox-quickbooks.api.intuit.com'; restClient.BaseURL := BaseUrl;
restRequest.Method := rmGET; restRequest.Method := rmGET;
res := '/v3/company/' + companyID + '/query?query=select * from Item&minorversion=75'; res := '/v3/company/' + companyID + '/query?query=select * from Item&minorversion=75';
...@@ -2940,6 +2997,143 @@ begin ...@@ -2940,6 +2997,143 @@ begin
end; end;
end; end;
function TLookupService.UpdateCustomer(QB_ID: string): TCustomerItem;
var
iniFile: TIniFile;
restClient: TRESTClient;
restRequest: TRESTRequest;
restResponse: TRESTResponse;
param: TRESTRequestParameter;
res: string;
jsValue: TJSONValue;
ParsedCustomer, Customer, BillAddr: TJSONObject;
jsObj: TJSONObject;
PhoneObj: TJSONObject;
CustomerList: TJSONArray;
AccessToken, RefreshToken, CompanyID, Client, Secret, BaseUrl, Line1, Line2: string;
LastRefresh: TDateTime;
I: integer;
SQL: string;
custItem: TCustomerItem;
begin
logger.Log(3, 'TLookupService.UpdateCustomer - start');
iniFile := TIniFile.Create(ExtractFilePath(Application.ExeName) + 'kgOrdersServer.ini');
restClient := TRESTClient.Create(nil);
restRequest := TRESTRequest.Create(nil);
restResponse := TRESTResponse.Create(nil);
try
try
restRequest.Client := restClient;
restRequest.Response := restResponse;
if iniFile.ReadString('Quickbooks', 'LastRefresh', '') = '' then
LastRefresh := 0
else
LastRefresh := StrToDateTime(iniFile.ReadString('Quickbooks', 'LastRefresh', ''));
if MinutesBetween(Now, LastRefresh) > 58 then
RefreshAccessToken();
Client := iniFile.ReadString('Quickbooks', 'ClientID', '');
Secret := iniFile.ReadString('Quickbooks', 'ClientSecret', '');
CompanyID := iniFile.ReadString('Quickbooks', 'CompanyID', '');
RefreshToken := iniFile.ReadString('Quickbooks', 'RefreshToken', '');
AccessToken := iniFile.ReadString('Quickbooks', 'AccessToken', '');
BaseUrl := iniFile.ReadString('Quickbooks', 'BaseUrl', '');
restClient.BaseURL := BaseUrl;
restRequest.Method := rmGET;
res := '/v3/company/' + CompanyID + '/query?query=select * from Customer where Id = ' + quotedStr(QB_ID) + '&minorversion=75';
restRequest.Resource := res;
param := restRequest.Params.AddItem;
param.Name := 'Authorization';
param.Kind := pkHTTPHEADER;
param.Options := param.Options + [TRESTRequestParameterOption.poDoNotEncode];
param.Value := 'Bearer ' + AccessToken;
restRequest.Execute;
jsValue := restResponse.JSONValue;
if not Assigned(jsValue) then
Exit;
jsObj := jsValue as TJSONObject;
if not Assigned(jsObj) then
Exit;
CustomerList := jsObj.GetValue<TJSONArray>('QueryResponse.Customer');
if not Assigned(CustomerList) then
Exit;
Customer := CustomerList.Items[I] as TJSONObject;
ParsedCustomer := TJSONObject.Create;
custItem := TCustomerItem.Create;
sql := 'select CUSTOMER_ID, SHORT_NAME, REP_USER_ID from customers where QB_LIST_ID = ' + Customer.GetValue<string>('Id');
doQuery(ordersDB.UniQuery1, SQL);
try
custItem.QB_LIST_ID := Customer.GetValue<string>('Id');
custItem.NAME := Customer.GetValue<string>('DisplayName');
custItem.CUSTOMER_ID := ordersDB.UniQuery1.FieldByName('CUSTOMER_ID').AsInteger;
custItem.SHORT_NAME := ordersDB.UniQuery1.FieldByName('SHORT_NAME').AsString;
custItem.REP_USER_ID := ordersDB.UniQuery1.FieldByName('REP_USER_ID').AsString;
// Handle Bill Address
if Customer.GetValue('BillAddr') is TJSONObject then
begin
BillAddr := Customer.GetValue('BillAddr') as TJSONObject;
Line1 := BillAddr.GetValue<string>('Line1', '');
Line2 := BillAddr.GetValue<string>('Line2', '');
custItem.BILL_CITY := BillAddr.GetValue<string>('City', '');
custItem.BILL_STATE := BillAddr.GetValue<string>('CountrySubDivisionCode', '');
custItem.BILL_ZIP := BillAddr.GetValue<string>('PostalCode', '');
if Line2 <> '' then
begin
custItem.BILL_ADDRESS := Line2;
custItem.BILL_CONTACT := Line1;
custItem.staff_fields_invoice_to := Customer.GetValue<string>('DisplayName') + sLineBreak +
BillAddr.GetValue('Line1', '') + sLineBreak +
BillAddr.GetValue('Line2', '') + sLineBreak +
BillAddr.GetValue('City', '') + ', ' +
BillAddr.GetValue('CountrySubDivisionCode', '') + ' ' +
BillAddr.GetValue('PostalCode', '')
end
else
begin
custItem.BILL_ADDRESS := Line1;
custItem.staff_fields_invoice_to := Customer.GetValue<string>('DisplayName') + sLineBreak +
BillAddr.GetValue('Line1', '') + sLineBreak +
BillAddr.GetValue('City', '') + ', ' +
BillAddr.GetValue('CountrySubDivisionCode', '') + ' ' +
BillAddr.GetValue('PostalCode', '')
end;
end;
Result := custItem;
except
ParsedCustomer.Free;
raise;
end;
except
on E: Exception do
begin
Logger.Log(2, 'Error in UpdateCustomer: ' + E.Message);
raise EXDataHttpException.Create(500, 'Unable to retrieve QuickBooks Customers: A QuickBooks interface error has occurred!');
end;
end;
finally
iniFile.Free;
restClient.Free;
restRequest.Free;
restResponse.Free;
end;
logger.Log(3, 'TLookupService.UpdateCustomer - end');
end;
function TLookupService.RefreshAccessToken: string; function TLookupService.RefreshAccessToken: string;
// Refresh Token changes so make sure to save refresh token. // Refresh Token changes so make sure to save refresh token.
var var
...@@ -3045,7 +3239,7 @@ var ...@@ -3045,7 +3239,7 @@ var
CustomerID: Integer; CustomerID: Integer;
mode: string; mode: string;
msg: string; msg: string;
QB_LIST_ID: string; QB_LIST_ID, BaseUrl: string;
begin begin
logger.Log(3, 'TLookupService.ImportQBCustomer'); logger.Log(3, 'TLookupService.ImportQBCustomer');
DateFormat := TFormatSettings.Create; DateFormat := TFormatSettings.Create;
......
[Settings]
MemoLogLevel=3
FileLogLevel=4
webClientVersion=0.9.13.2
LogFileNum=123
[Database]
--Database=kg_order_entry
--Username=root
--Password=emsys01
--Server=192.168.116.131
Server=192.168.159.10
--Server=192.168.116.132
--Server=192.168.102.129
--Server=192.168.75.133
--Password=emsys!012
[Quickbooks]
Enabled=1
BaseUrl=https://sandbox-quickbooks.api.intuit.com
--BaseUrl=https://quickbooks.api.intuit.com/v3
--RedirectUri=https://webapps.em-sys.net/kgOrdersTest/auth/AuthService/Authorize
--RedirectUri=https://webapps.em-sys.net/kgOrders/auth/AuthService/Authorize
RedirectUri=http://localhost:2004/kgOrders/auth/AuthService/Authorize
CompanyID=9341454336461805
ClientID=ABYqlDx1EsacZYXvHIJ7RDB7zmnQdwABU3fwQLIZPmBgU0VW1P
ClientSecret=PM7OnvQWsgOqjWfDpZAnyRttDN9446Am6d85pDxr
RefreshToken=RT1-247-H0-17820557806jgiv9npad8srv5wix30
AccessToken=eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwieC5vcmciOiJIMCJ9..UJs-kGD2vMVnniwh5pEOWg.KUOqaQFsO4ksf51-bBo09GpLoVFIUMCR2ii1TzaXVIaUAqe53a43S5SZBSX3UeqnPm9cHLlrL4_xgLITi_-8CemLaWvfTreRuR93g6y82Hli-5UaVc_os29rcEkEhh87G0TRS2br-63o-yqihxBO9zYECIPZ9DGBTaFdizPM_d3DMPQJ3FfKlxors2HzYKhmU-4njzLAdK6o5GxpUnB5MDC7Hu3HpSwDQDP6RXLak9Fy_lot_bJY2V0rqdPoVqWaLELOCk_9ZJSTfCVwzCX-2ZiIIo_MFzenqxDK8RcTOAvnPMKSFur3LFsSxvME7Ve-63N0k2Zvf8wbzsdMjY0U1PMc8SPHkWnuUooVfRspUr7lt5NWxPKGSN02j-XGL8S4AgafUVXAb4C2HlvVQDR6yP9YLTOpTtLjUjDIkd_-fMfhBlRvukXzpPB8_0etuR4Ajbne9Fs6PXQO-HfPXPUlyQUDE0Tq5kCmih5fKm8BBUQ.3kNe3BzqWg_QaQ8BqQfJ-A
LastRefresh=3/12/2026 11:29:41 AM
<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
<nav class="navbar navbar-expand navbar-light bg-light sticky-top border-light" style="z-index: 100;">
<div class="container-fluid d-flex align-items-center ps-0 pe-0">
<!-- Left-aligned form state label -->
<div class="me-auto ps-3">
<label id="lbl_form_state" class="form-label mb-0 fw-bold text-uppercase text-nowrap text-danger" style="font-size: 16px;">View Mode</label>
</div>
<!-- Right-aligned buttons -->
<ul class="navbar-nav ms-auto pe-2 mb-0">
<li class="nav-item pe-2">
<button id="btnadd" class="btn btn-primary btn-sm">Add</button>
</li>
<li class="nav-item pe-2">
<button id="btnedit" class="btn btn-primary btn-sm">Edit</button>
</li>
<li class="nav-item pe-2">
<button id="btndelete" class="btn btn-danger btn-sm">Delete</button>
</li>
<li class="nav-item pe-2">
<button id="btnconfirm" class="btn btn-success btn-sm">Save</button>
</li>
<li class="nav-item pe-2">
<button id="btncancel" class="btn btn-danger btn-sm">Cancel</button>
</li>
<li class="nav-item">
<button id="btnclose" class="btn btn-primary btn-sm">Close</button>
</li>
</ul>
</div>
</nav>
<div class="row mx-5">
<h4 class="custom-h4 mt-3">Customer Information</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">Customer Num</label>
<input id="edtcompanyid" class="form-control input-sm"style="width: 100px" required/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">QB ID:</label>
<input id="edtqbid" class="form-control input-sm"style="width: 200px" required/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Customer Name:</label>
<input id="edtcompanyname" type="text" class="form-control" style="width: 300px;" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Company Name.
</div>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Customer ID:</label>
<input id="edtcompanyaccountname"type="text" class="form-control" style="width: 150px" required/>
<div class="invalid-feedback" id="shortnamefeedback" style="font-size: 15px;">
Please Provide a Company Account Name.
</div>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Start Date:</label>
<input class="form-control input-sm" id="dtpstartdate" type="date" required>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">End Date:</label>
<input class="form-control input-sm" id="dtpenddate" type="date" required>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Phone:</label>
<input id="edtphone" 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">Fax:</label>
<input id="edtfax" class="form-control input-sm"style="width: 200px"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Representative:</label>
<select id="wdblcbrep" class='form-select'></select>
</div>
</div>
<h4 class="custom-h4 mt-3">Billing Information</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">Billing Address:</label>
<input id="edtbillingaddress" class="form-control input-sm" style="width: 300px" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Address.
</div>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Billing City</label>
<input id="edtbillingcity" class="form-control input-sm" style="width: 250px" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a City.
</div>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Billing State:</label>
<input id="edtbillingstate" class="form-control input-sm" style="width: 100px" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a State.
</div>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Billing Zip Code:</label>
<input id="edtbillingzip" class="form-control input-sm" style="width: 200px" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Zip Code.
</div>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Billing Contact:</label>
<input id="edtbillingcontact" class="form-control input-sm" style="width: 250px" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Billing Contact.
</div>
</div>
</div>
<div class="row mt-3">
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label">Billing Address Block</label>
<textarea id="memoaddressblock" class="form-control" style=" width: 500px; height: 150px;" required></textarea>
<div class="invalid-feedback" style="font-size: 15px;">
Please Enter a Billing Address Block.
</div>
</div>
</div>
<h4 class="custom-h4 mt-3">Shipping Addresses</h4>
<hr class="custom-hr">
<div class="row">
<div class="overflow-auto mt-2"
style="max-height: calc(100vh - 250px); padding-bottom: 0; width: 100%;">
<table id="tblPhoneGrid" class="table table-striped table-bordered" style="width: 100%;">
<thead class="sticky-top thead-light">
<tr style="font-size: 0.875rem;">
<!-- headers -->
</tr>
</thead>
<tbody id="orderTableBody" class="align-middle">
<!-- rows -->
</tbody>
</table>
</div>
</div>
<div class="row mt-1">
<div class="col-auto">
<button id="btnshipadd" class="btn btn-primary btn-sm">Add</button>
</div>
<div class="col-auto">
<button id="btnshipedit" class="btn btn-primary btn-sm">Edit</button>
</div>
<div class="col-auto">
<button id="btnshipdelete" class="btn btn-danger btn-sm">Delete</button>
</div>
<div class="col-auto">
<button id="btnshipconfirm" class="btn btn-success btn-sm">Save</button>
</div>
<div class="col-auto">
<button id="btnshipcancel" class="btn btn-danger btn-sm">Cancel</button>
</div>
</div>
<div class="row mt-3">
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">First Line:</label>
<input id="edtfirstline" class="form-control input-sm" style="width: 300px" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Enter the First Line.
</div>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Address:</label>
<input id="edtshippingaddress" class="form-control input-sm" style="width: 300px" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Enter an Address.
</div>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">City</label>
<input id="edtshippingcity" class="form-control input-sm" style="width: 250px" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Enter a City.
</div>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">State:</label>
<input id="edtshippingstate" class="form-control input-sm" style="width: 100px" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Enter a State.
</div>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Zip Code:</label>
<input id="edtshippingzip" class="form-control input-sm" style="width: 200px" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Enter a Zip Code.
</div>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Contact:</label>
<input id="edtshippingcontact" class="form-control input-sm" style="width: 250px" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Enter a Shipping Contact.
</div>
</div>
</div>
<div class="row my-3">
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label">Shipping Block</label>
<textarea id="memoshipblock" class="form-control" style=" width: 500px; height: 150px;" required></textarea>
<div class="invalid-feedback" style="font-size: 15px;">
Please Enter a Shipping Block.
</div>
</div>
</div>
</div>
<div id="spinner" class="position-absolute top-50 start-50 translate-middle d-none">
<div class="lds-roller">
<div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div>
</div>
</div>
<div class="container h-100 d-flex flex-column mt-0" style="max-width: 100%; padding-bottom: 0;">
<!-- Actions Row -->
<div class="row mt-3 justify-content-center align-items-end">
<div class="col-auto">
<label for="wcbpagesize" class="form-label fw-bold" style="font-size: 1.1rem;">
Show
<select class="form-select d-inline-block w-auto" id="wcbpagesize" style="font-size: 1rem;"></select>
entries
</label>
</div>
<div class="col-auto">
<button id="btnaddcustomer" class="btn btn-secondary">Add Customer</button>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Customer ID:</label>
<input id="edtfilter" type="text" class="form-control" style="width: 200px;" />
</div>
</div>
<!-- Entries Label Section d-flex justify-content-between w-100 mt-2-->
<!-- Table Section -->
<div class="row justify-content-center">
<div class="col-12 col-md-8">
<div class="row">
<div class="col-auto">
<label id="lblentries" style="font-size: 1.10rem;"></label>
</div>
</div>
<div id="order_table_section"
class="overflow-auto mt-2"
style="max-height: calc(100vh - 250px);">
<table id="tblPhoneGrid"
class="table table-striped table-bordered w-100">
<thead class="sticky-top thead-light">
<tr style="font-size: 0.875rem;"></tr>
</thead>
<tbody id="orderTableBody" class="align-middle"></tbody>
</table>
</div>
</div>
</div>
<!-- Pagination Section -->
<div class="d-flex justify-content-center w-100 mt-4">
<nav aria-label="Page navigation">
<ul id="pagination" class="pagination">
<!-- Pagination items added dynamically -->
</ul>
</nav>
</div>
</div>
<div class="container">
<br />
<div class="panel panel-red">
<div id="view.errorpage.title" class="panel-heading">
Error Page
</div>
<div id="view.errorpage.message" class="panel-body">
Message
</div>
<div class="panel-footer">
<a href=".">Reload web application</a>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<h1 class="page-header pt-3" id="view.home.title" style="font-size: 24px;">Home</h1>
<div class="row card-body">
<div class="form-outline mb-4">
<textarea class="form-control" id="view.home.notesmemo" rows="20"></textarea>
</div>
</div>
</div>
</div>
<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
<nav class="navbar navbar-expand navbar-light bg-light sticky-top border-light" style="z-index: 100;">
<div class="container-fluid d-flex align-items-center ps-0 pe-0">
<!-- Left-aligned form state label -->
<div class="me-auto ps-3">
<label id="lbl_form_state" class="form-label mb-0 fw-bold text-uppercase text-nowrap text-danger" style="font-size: 16px;">View Mode</label>
</div>
<!-- Right-aligned buttons -->
<ul class="navbar-nav ms-auto pe-2 mb-0">
<li class="nav-item pe-2">
<button id="btnadd" class="btn btn-primary btn-sm">Add</button>
</li>
<li class="nav-item pe-2">
<button id="btnedit" class="btn btn-primary btn-sm">Edit</button>
</li>
<li class="nav-item pe-2">
<button id="btndelete" class="btn btn-danger btn-sm">Delete</button>
</li>
<li class="nav-item pe-2">
<button id="btnconfirm" class="btn btn-success btn-sm">Save</button>
</li>
<li class="nav-item pe-2">
<button id="btncancel" class="btn btn-danger btn-sm">Cancel</button>
</li>
</ul>
</div>
</nav>
<div class="row">
<div class="col-12">
<div class="container mt-4">
<div class="row justify-content-center">
<div class="col-12 col-md-8">
<form class="form-inline">
<div class="row">
<div class="col-sm-6">
<label style="font-weight: 700;">Name:</label>
<input class="form-control input-sm" id="edtname">
</div>
<div class="col-sm-6">
<label class= 'pe-2'style="font-weight: 700;">Description:</label>
<input class="form-control input-sm" id="edtdescription">
</div>
</div>
</form>
<div class="row">
<div class="col-sm">
<form class='form-inline'>
<div class="col-sm">
<div class="form-cells"><input type="checkbox" id="cbstatus"></div>
<div class="form-cells ps-1 py-2"><label style="font-weight: 700;font-size: 15px" id="lblactive">Active?</label></div>
</div>
</form>
</div>
</div>
<form class="form-inline">
<div class= "row">
<div class="col-sm-5">
<label class="py-2" style="font-weight: 700;">Show <select class="custom-select" id="wcbpagesize" style="font-size: 1.00rem;"></select> entries</label>
</div>
</div>
</form>
<!-- Table Section -->
<div id="order_table_section" class="overflow-auto mt-2"
style="max-height: calc(100vh - 250px); padding-bottom: 0; width: 100%;">
<table id="tblPhoneGrid" class="table table-striped table-bordered border-light" style="width: 100%;">
<thead class="sticky-top thead-light">
<tr style="font-size: 0.875rem;">
<!-- Table headers are dynamically generated -->
</tr>
</thead>
<tbody id="orderTableBody" class="align-middle">
<!-- Table rows are dynamically generated -->
</tbody>
</table>
</div>
<label id="lblentries"></label>
<nav aria-label="Page navigation">
<ul class="pagination justify-content-center" id="pagination">
<!-- Pagination items will be added dynamically via Delphi code -->
</ul>
</nav>
</div>
</div>
</div>
</div>
</div>
</div>
<nav class="navbar navbar-light bg-light login-navbar">
<div class="d-flex align-items-center">
<a id="view.login.apptitle" class="navbar-brand ps-2" href="index.html"> Koehler-Gibson Orders</a>
<span id="view.login.version" class="small text-muted ms-2"></span>
</div>
</nav>
<div class="container mt-5">
<div class="row justify-content-center">
<div class="col-auto">
<img id="kgpicture" style="width: 250px; height: 250px;">
</div>
<div class="col-md-6 col-lg-4">
<div class="card login-card">
<div class="card-header">
<h3 id="view.login.title" class="fs-6 card-title">Please Sign In</h3>
</div>
<div class="card-body">
<div role="form">
<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>
<fieldset>
<div class="mb-3">
<input id="view.login.edtusername" class="form-control" type="text" autofocus placeholder="Username">
</div>
<div class="mb-3">
<input id="view.login.edtpassword" class="form-control" type="password" placeholder="Password">
</div>
<div class="mb-3">
<button id="view.login.btnlogin" class="btn btn-primary w-100">Login</button>
</div>
<div class="text-end text-muted small mt-1">
<span id="lbl_client_version"></span>
</div>
</fieldset>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="wrapper">
<nav class="navbar navbar-expand navbar-light bg-light" style="margin-bottom: 0px;">
<div class="container-fluid">
<div class="d-flex align-items-center">
<a id="view.main.apptitle" class="navbar-brand" href="index.html">Koehler-Gibson Orders</a>
<span id="view.main.version" class="small text-muted ms-2"></span>
</div>
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="dropdown-item" id="lblorders" href="#"><i class="fa fa-tags fa-fw"></i><span> Orders</span></a>
</li>
<li class="nav-item">
<a class="dropdown-item" id="lblcustomers" href="#"><i class="fa fa-tags fa-fw"></i><span> Customers</span></a>
</li>
<li class="nav-item">
<a class="dropdown-item" id="dropdown.menu.itemlist" href="#"><i class="fa fa-cubes fa-fw"></i><span> Items</span></a>
</li>
</ul>
<div class="collapse navbar-collapse show" id="navbarNavDropdown">
<ul class="navbar-nav ms-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="navbarDropdownMenuLink" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<i class="fa fa-user fa-fw"></i><span class="panel-title" id="view.main.username"> Username </span>
</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdownMenuLink">
<li>
<a class="dropdown-item" id="dropdown.menu.home" href="#"><i class="fa fa-home fa-fw"></i><span> Home</span></a>
</li>
<li>
<a class="dropdown-item" id="dropdown.menu.userprofile" href="#"><i class="fa fa-user fa-fw"></i><span> User Profile</span></a>
</li>
<li>
<a class="dropdown-item" id="dropdown.menu.users" href="#"><i class="fas fa-address-book fa-fw"></i><span> Users</span></a>
</li>
<li>
<a class="dropdown-item" id="dropdown.menu.linktoqb" href="#"><i class="fas fa-book fa-fw"></i><span> Link to QB</span></a>
</li>
<li>
<hr class="dropdown-divider">
</li>
<li>
<a class="dropdown-item" id="dropdown.menu.logout" href="#"><i class="fa fa-sign-out fa-fw"></i><span> Logout</span></a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<!-- Toast wrapper directly under navbar -->
<div id="toast-wrapper"
class="position-fixed top-0 start-0 mt-5 ms-4"
style="z-index: 1080; min-width: 300px; max-width: 500px;">
<div id="bootstrapToast"
class="toast align-items-center text-white bg-success border-0 shadow"
role="alert" aria-live="assertive" aria-atomic="true">
<div class="d-flex">
<div class="toast-body" id="bootstrapToastBody">
Success message
</div>
<button type="button" class="btn-close btn-close-white me-2 m-auto"
data-bs-dismiss="toast" aria-label="Close"></button>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div id="main.webpanel" class="col-12"></div>
</div>
<div class="row">
<div class="col-12">
<div class="form-outline">
<textarea class="form-control" id="main.debugmemo" rows="4"></textarea>
</div>
</div>
</div>
</div>
</div>
<div id="spinner" class="position-absolute top-50 start-50 translate-middle d-none">
<div class="lds-roller">
<div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div>
</div>
</div>
<div class="modal fade" id="main_errormodal" tabindex="-1" aria-labelledby="main_lblmodal" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content shadow-lg">
<div class="modal-header">
<h5 class="modal-title" id="main_lblmodal">Error</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body fs-6 fw-bold" id="main_lblmodal_body">
Please contact EMSystems to solve the issue.
</div>
<div class="modal-footer justify-content-center">
<button type="button" id="btn_modal_restart" class="btn btn-primary">Back to Orders</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="main_confirmation_modal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content shadow-lg">
<div class="modal-header">
<h5 class="modal-title">Confirm</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body fw-bold" id="main_modal_body">
Placeholder text
</div>
<div class="modal-footer justify-content-center">
<button type="button" class="btn btn-primary me-3" id="btn_confirm_left">Cancel</button>
<button type="button" class="btn btn-secondary" id="btn_confirm_right">Confirm</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="main_notification_modal" tabindex="-1" aria-labelledby="main_lblmodal" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content shadow-lg">
<div class="modal-header">
<h5 class="modal-title" id="main_notification_modal">Info</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body fs-6 fw-bold" id="main_notification_modal_body">
Please contact EMSystems to solve the issue.
</div>
<div class="modal-footer justify-content-center">
<button type="button" id="btn_modal_close" class="btn btn-primary">Close</button>
</div>
</div>
</div>
</div>
<div id="spinner" class="position-absolute top-50 start-50 translate-middle d-none">
<div class="lds-roller">
<div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div>
</div>
</div>
<nav class="navbar navbar-expand navbar-light bg-light border-light sticky-top" style="z-index: 100;">
<div class="container-fluid d-flex align-items-center ps-0 pe-0">
<!-- Left-aligned label -->
<div class="me-auto ps-3">
<label id="lbl_form_state" class="form-label mb-0 fw-bold text-uppercase text-nowrap text-danger" style="font-size: 16px;">Test</label>
</div>
<!-- Right-aligned buttons -->
<ul class="navbar-nav ms-auto pe-2 mb-0">
<li class="nav-item pe-2">
<button id="btnadd" class="btn btn-primary btn-sm">Add</button>
</li>
<li class="nav-item pe-2">
<button id="btnedit" class="btn btn-primary btn-sm">Edit</button>
</li>
<li class="nav-item pe-2">
<button id="btncopy" class="btn btn-primary btn-sm">Copy</button>
</li>
<li class="nav-item pe-2">
<button id="btndelete" class="btn btn-danger btn-sm">Delete</button>
</li>
<li class="nav-item pe-2">
<button id="btnconfirm" class="btn btn-success btn-sm">Save</button>
</li>
<li class="nav-item pe-2">
<button id="btncancel" class="btn btn-danger btn-sm">Cancel</button>
</li>
<li class="nav-item pe-2">
<button id="btnpdf" class="btn btn-primary btn-sm">PDF</button>
</li>
<li class="nav-item pe-2">
<button id="btnsendtoqb" class="btn btn-primary btn-sm">Send To QB</button>
</li>
<li class="nav-item">
<button id="btnclose" class="btn btn-primary btn-sm">Close</button>
</li>
</ul>
</div>
</nav>
<div class="row mx-5">
<h4 class="custom-h4 mt-3">Customer</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">Customer Name:</label>
<input id="edtcompanyname" type="text" class="form-control" style="width: 300px;" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Customer Name.
</div>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Customer ID:</label>
<input id="edtaccountcompanyname"type="text" class="form-control" style="width: 150px" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Customer ID Name.
</div>
</div>
<div class="col-auto d-flex flex-column">
<label for="wdbcbinqb" class="form-label mt-2" style="font-weight: 700; font-size: 15px;">In QB?:</label>
<input id="wdbcbinqb" type="checkbox" class="form-check-input mt-1"
style="transform: scale(1.2); width: 20px; height: 20px;">
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">QB Order Number:</label>
<input id="edtqbordernum"type="text" class="form-control" style="width: 150px" required/>
</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 Num:</label>
<input id="edtordernum" 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">Order Date:</label>
<input class="form-control input-sm" id="dtporderdate" type="date" required>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide an Order Date.
</div>
</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" type="number" min="1" required/>
<div class="invalid-feedback" style="font-size: 15px;" required>
Please Provide a Valid Quantity.
</div>
</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="1" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Valid Price.
</div>
</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" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide an Invoice Address.
</div>
</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' required></select>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Ship To Address.
</div>
<div class="mt-2">
<button id="btnaddaddress" class="btn btn-primary btn-sm">Add Address</button>
</div>
</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 style="font-weight: 700; font-size: 15px;" class="form-label mt-2">QB Item:</label>
<select id="wcbqbitem" class='form-select' required></select>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a QB Item.
</div>
</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" style="width: 600px"/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Job Name.
</div>
</div>
<div class="row">
<div class="col-12">
<label for="edtitemdescription" class="form-label mt-2" style="font-weight: 700; font-size: 15px;">
Item Description:
</label>
<input id="edtitemdescription" class="form-control" style="width: 100%;" />
</div>
</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>
<input class="form-control input-sm" id="dtpartdue" type="date">
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Plate Due:</label>
<input class="form-control input-sm" id="dtpplatedue" type="date">
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Mount Due:</label>
<input class="form-control input-sm" id="dtpmountdue" type="date">
</div>
</div>
<h4 class="custom-h4 mt-3">Supplied by Customer</h4>
<hr class="custom-hr">
<div class="row">
<div class="col-auto">
<input type="checkbox" id="cbcolorcopy">
<label class='pe-2' style="font-weight: 700; font-size: 15px;">Color Copy?</label>
</div>
<div class="col-auto">
<input type="checkbox" id="cbplates">
<label class='pe-2' style="font-weight: 700; font-size: 15px;">Plates?</label>
</div>
<div class="col-auto">
<input type="checkbox" id="cbsampleCarton">
<label class='pe-2' style="font-weight: 700; font-size: 15px;">Sample Carton?</label>
</div>
<div class="col-auto">
<input type="checkbox" id="edtemail"/>
<label class='pe-2' style="font-weight: 700; font-size: 15px;">Email?</label>
</div>
<div class="col-auto">
<input type="checkbox" id="cbftp"/>
<label class='pe-2' style="font-weight: 700; font-size: 15px;">FTP?</label>
</div>
<div class="col-auto">
<label class='pe-2' style="font-weight: 700; font-size: 15px;">Other:</label>
<input class="form-control input-sm" id="edtother" style="width: 150px"/>
</div>
<div class="col-auto">
<input type="checkbox" id="edtexistingcuttingdie"/>
<label class='pe-2' style="font-weight: 700; font-size: 15px;">Existing Cutting Die?</label>
</div>
<div class="col-auto">
<input type="checkbox" id="edtrefartprintcard"/>
<label class='pe-2' style="font-weight: 700; font-size: 15px;">Ref Art Print Card?</label>
</div>
<div class="col-auto">
<input type="checkbox" id="edtrefartapdf"/>
<label class='pe-2' style="font-weight: 700; font-size: 15px;">Ref Art A PDF?</label>
</div>
</div>
<h4 class="custom-h4 mt-3">Layout</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">RSC L:</label>
<input id="edtrscl" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">RSC W:</label>
<input id="edtrscw" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">RSC D:</label>
<input id="edtrscd" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Die Cut No:</label>
<input class="form-control input-sm" id="edtdiecutno" style="width: 150px"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Across No:</label>
<input class="form-control input-sm" id="edtacrossno" style="width: 150px"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Around No:</label>
<input class="form-control input-sm" id="edtaroundno" style="width: 150px"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">CAD File:</label>
<input id="edtcadfile" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<input type="checkbox" id="cbexcaliburdie">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Excalibur Die?</label>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">RSC Style:</label>
<input id="edtrscstyle" class="form-control input-sm" style="width: 150px"/>
</div>
</div>
<h4 class="custom-h4 mt-3">Mounting</h4>
<hr class="custom-hr">
<div class="row">
<div class="col-auto">
<input type="checkbox" id="cbloose">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Loose:</label>
<input id="edtloose" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<input type="checkbox" id="cbstickybak">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Sticky Bak?</label>
</div>
<div class="col-auto">
<input type="checkbox" id="cbfullmount">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Full Mount?</label>
</div>
<div class="col-auto">
<input type="checkbox" id="cbstripmount">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Strip Mount:</label>
<input id="edtstripmount" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Standard Setup:</label>
<input id="edtstandardsetup" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Custom Backing:</label>
<input id="edtcustombacking" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Custom Adhesive:</label>
<input id="edtcustomadhesive" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Cylinder Size:</label>
<input id="edtcylindersize" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Machine Indent:</label>
<input id="edtmachineindent" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Cross Hairs:</label>
<input id="edtcrosshairs" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Clemson:</label>
<input id="edtclemson" class="form-control input-sm" style="width: 150px"/>
</div>
</div>
<h4 class="custom-h4 mt-3">Colors</h4>
<hr class="custom-hr">
<div class="row align-items-center">
<!-- placeholders for the 4 dynamic input columns to center the Add Color button the dynamically created Remove button -->
<div class="col-sm"></div>
<div class="col-sm"></div>
<div class="col-sm"></div>
<div class="col-sm"></div>
<div class="col-auto d-flex justify-content-center">
<!-- Delphi-generated TWebButton stays here -->
<button id="btnaddcolor" class="btn btn-primary btn-sm me-3">
Add Color
</button>
</div>
</div>
<!-- your existing container for the dynamic rows -->
<div id="additionalFields" class="row mt-3"></div>
<h4 class="custom-h4 mt-3">Proofing</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">Fax:</label>
<input id="edtfax" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Fax Attn:</label>
<input id="edtfaxattn" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Email:</label>
<input id="edtproofemail" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Email Attn:</label>
<input id="edtemailattn" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Ship To:</label>
<input id="edtproofshipto" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<input type="checkbox" id="cbfullsizepanel">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Full Size Panel?</label>
</div>
<div class="col-auto">
<input type="checkbox" id="cbprintcard">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Print Card?</label>
</div>
<div class="col-auto">
<input type="checkbox" id="cbwideformat">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Wide Format?</label>
</div>
<div class="col-auto">
<input type="checkbox" id="cbpdffile">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">PDF File?</label>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Other:</label>
<input id="edtproofother" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<input type="checkbox" id="cbartapprovedasis">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Art Approved As Is?</label>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Approved Date:</label>
<input class="form-control input-sm" id="dtpapproveddate" type="date">
</div>
</div>
<h4 class="custom-h4 mt-3">Plates</h4>
<hr class="custom-hr">
<div class="row">
<div class="col-auto">
<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 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="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>
<h4 class="custom-h4 mt-3">General</h4>
<hr class="custom-hr">
<div class="row pb-3">
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label">Special Instructions (Max Length 2048 characters)</label>
<textarea id="edtspecialinstructions" class="form-control mb-3" style=" width: 1100px; height: 150px;" maxlength="2048"></textarea>
</div>
</div>
</div>
<nav class="navbar navbar-expand navbar-light bg-light border-light sticky-top" style="z-index: 100;">
<div class="container-fluid d-flex align-items-center ps-0 pe-0">
<!-- Left-aligned label -->
<div class="me-auto ps-3">
<label id="lbl_order_type" class="form-label mb-0 fw-bold text-uppercase text-nowrap" style="font-size: 16px;">Cutting Die -</label>
</div>
<div class="me-auto ps-2">
<label id="lbl_form_state" class="form-label mb-0 fw-bold text-uppercase text-nowrap text-danger" style="font-size: 16px;"> View Mode</label>
</div>
<!-- Right-aligned buttons -->
<ul class="navbar-nav ms-auto pe-2 mb-0">
<li class="nav-item pe-2">
<button id="btnadd" class="btn btn-primary btn-sm">Add</button>
</li>
<li class="nav-item pe-2">
<button id="btnedit" class="btn btn-primary btn-sm">Edit</button>
</li>
<li class="nav-item pe-2">
<button id="btncopy" class="btn btn-primary btn-sm">Copy</button>
</li>
<li class="nav-item pe-2">
<button id="btndelete" class="btn btn-danger btn-sm">Delete</button>
</li>
<li class="nav-item pe-2">
<button id="btnconfirm" class="btn btn-success btn-sm">Save</button>
</li>
<li class="nav-item pe-2">
<button id="btncancel" class="btn btn-danger btn-sm">Cancel</button>
</li>
<li class="nav-item pe-2">
<button id="btnpdf" class="btn btn-primary btn-sm">PDF</button>
</li>
<li class="nav-item pe-2">
<button id="btnsendtoqb" class="btn btn-primary btn-sm">Send To QB</button>
</li>
<li class="nav-item">
<button id="btnclose" class="btn btn-primary btn-sm">Close</button>
</li>
</ul>
</div>
</nav>
<div class="row mx-5">
<h4 class="custom-h4 mt-3">Customer</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">Customer Name:</label>
<input id="edtcompanyname" type="text" class="form-control" style="width: 300px;" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Customer Name.
</div>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Customer ID:</label>
<input id="edtaccountcompanyname"type="text" class="form-control" style="width: 150px" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Customer ID.
</div>
</div>
<div class="col-auto d-flex flex-column">
<label for="wdbcbinqb" class="form-label mt-2" style="font-weight: 700; font-size: 15px;">In QB?:</label>
<input id="wdbcbinqb" type="checkbox" class="form-check-input mt-1"
style="transform: scale(1.2); width: 20px; height: 20px;">
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">QB Order Number:</label>
<input id="edtqbordernum"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 Num:</label>
<input id="edtordernum" 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">Order Date:</label>
<input class="form-control input-sm" id="dtporderdate" type="date" required>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide an Order Date.
</div>
</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" type="number" min="1" required/>
<div class="invalid-feedback" style="font-size: 15px;" required>
Please Provide a Valid Quantity.
</div>
</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="1" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Valid Price.
</div>
</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" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide an Invoice Address.
</div>
</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' required></select>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Ship To Address.
</div>
<div class="mt-2">
<button id="btnaddaddress" class="btn btn-primary btn-sm">Add Address</button>
</div>
</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 style="font-weight: 700; font-size: 15px;" class="form-label mt-2">QB Item:</label>
<select id="wcbqbitem" class='form-select' required></select>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a QB Item.
</div>
</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" style="width: 600px"/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Job Name.
</div>
</div>
<div class="row">
<div class="col-12">
<label for="edtitemdescription" class="form-label mt-2" style="font-weight: 700; font-size: 15px;">
Item Description:
</label>
<input id="edtitemdescription" class="form-control" style="width: 100%;" />
</div>
</div>
</div>
<h4 class="custom-h4 mt-3 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 (Max Length 2048 characters)</label>
<textarea id="edtspecialinstructions" class="form-control mb-3" style=" width: 1100px; height: 150px;" maxlength="2048"></textarea>
</div>
</div>
</div>
<nav class="navbar navbar-expand navbar-light bg-light border-light sticky-top" style="z-index: 100;">
<div class="container-fluid d-flex align-items-center ps-0 pe-0">
<!-- Left-aligned label -->
<div class="me-auto ps-3">
<label id="lbl_form_state" class="form-label mb-0 fw-bold text-uppercase text-nowrap text-danger" style="font-size: 16px;">Test</label>
</div>
<!-- Right-aligned buttons -->
<ul class="navbar-nav ms-auto pe-2 mb-0">
<li class="nav-item pe-2">
<button id="btnadd" class="btn btn-primary btn-sm">Add</button>
</li>
<li class="nav-item pe-2">
<button id="btnedit" class="btn btn-primary btn-sm">Edit</button>
</li>
<li class="nav-item pe-2">
<button id="btncopy" class="btn btn-primary btn-sm">Copy</button>
</li>
<li class="nav-item pe-2">
<button id="btndelete" class="btn btn-danger btn-sm">Delete</button>
</li>
<li class="nav-item pe-2">
<button id="btnconfirm" class="btn btn-success btn-sm">Save</button>
</li>
<li class="nav-item pe-2">
<button id="btncancel" class="btn btn-danger btn-sm">Cancel</button>
</li>
<li class="nav-item pe-2">
<button id="btnpdf" class="btn btn-primary btn-sm">PDF</button>
</li>
<li class="nav-item pe-2">
<button id="btnsendtoqb" class="btn btn-primary btn-sm">Send To QB</button>
</li>
<li class="nav-item">
<button id="btnclose" class="btn btn-primary btn-sm">Close</button>
</li>
</ul>
</div>
</nav>
<div class="row mx-5">
<h4 class="custom-h4 mt-3">Customer</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">Customer Name:</label>
<input id="edtcompanyname" type="text" class="form-control" style="width: 300px;" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Customer Name.
</div>
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Customer ID:</label>
<input id="edtaccountcompanyname"type="text" class="form-control" style="width: 150px" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Customer ID.
</div>
</div>
<div class="col-auto d-flex flex-column">
<label for="wdbcbinqb" class="form-label mt-2" style="font-weight: 700; font-size: 15px;">In QB?:</label>
<input id="wdbcbinqb" type="checkbox" class="form-check-input mt-1"
style="transform: scale(1.2); width: 20px; height: 20px;">
</div>
<div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">QB Order Number:</label>
<input id="edtqbordernum"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 Num:</label>
<input id="edtordernum" 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">Order Date:</label>
<input class="form-control input-sm" id="dtporderdate" type="date" required>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide an Order Date.
</div>
</div>
<div class="col-auto">
<label 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 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 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" type="number" min="1" required/>
<div class="invalid-feedback" style="font-size: 15px;" required>
Please Provide a Valid Quantity.
</div>
</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="1" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Valid Price.
</div>
</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" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide an Invoice Address.
</div>
</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' required></select>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Ship To Address.
</div>
<div class="mt-2">
<button id="btnaddaddress" class="btn btn-primary btn-sm">Add Address</button>
</div>
</div>
<div class="col-auto">
<label 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 style="font-weight: 700; font-size: 15px;" class="form-label mt-2">QB Item:</label>
<select id="wcbqbitem" class='form-select' required></select>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a QB Item.
</div>
</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" style="width: 600px"/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Job Name.
</div>
</div>
<div class="row">
<div class="col-12">
<label for="edtitemdescription" class="form-label mt-2" style="font-weight: 700; font-size: 15px;">
Item Description:
</label>
<input id="edtitemdescription" class="form-control" style="width: 100%;" />
</div>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Art Due:</label>
<input class="form-control input-sm" id="dtpartdue" type="date">
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Plate Due:</label>
<input class="form-control input-sm" id="dtpplatedue" type="date">
</div>
</div>
<h4 class="custom-h4 mt-3">Supplied by Customer</h4>
<hr class="custom-hr">
<div class="row">
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">B/W or Color Copy:</label>
<input id="edtbworcolorcopy" class="form-control input-sm" width='50%'/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Plates:</label>
<input id="edtplates" class="form-control input-sm" width='50%'/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Sample:</label>
<input id="edtsample" class="form-control input-sm" width='50%'/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Dimensional Layout:</label>
<input id="edtdimensionallayout" class="form-control input-sm" width='50%'/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Other:</label>
<input id="edtother" class="form-control input-sm" width='50%'/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Email:</label>
<input id="edtemail" class="form-control input-sm" width='50%'/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">FTP:</label>
<input id="edtftp" class="form-control input-sm" width='50%'/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Total Inches Used:</label>
<input id="edttotalinchesused" class="form-control input-sm" width='50%'/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Sheets Used:</label>
<input id="edtsheetsused" class="form-control input-sm" width='50%'/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Initials:</label>
<input id="edtinitials" class="form-control input-sm" width='50%'/>
</div>
</div>
<h4 class="custom-h4 mt-3">Proofing</h4>
<hr class="custom-hr">
<div class="row">
<div class="col-auto">
<input type="checkbox" id="cbpdf">
<label label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">PDF?</label>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">PDF To:</label>
<input id="edtpdfto" class="form-control input-sm" width='50%'/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">PDF Date 1:</label>
<input class="form-control input-sm" id="dtppdfdate1" type="date">
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">PDF Date 2:</label>
<input class="form-control input-sm" id="dtppdfdate2" type="date">
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">PDF Date 3:</label>
<input class="form-control input-sm" id="dtppdfdate3" type="date">
</div>
<div class="col-auto">
<input type="checkbox" id="cbfullsizeinkjet">
<label label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Full Size Ink Jet For Layout Content Only?</label>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Ink Jet To:</label>
<input id="edtinkjetto" class="form-control input-sm" width='50%'/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Ink Jet To 2:</label>
<input id="edtinkjetto2" class="form-control input-sm" width='50%'/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Ink Jet Date 1:</label>
<input class="form-control input-sm" id="dtpinkjetdate1" type="date">
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Ink Jet Date 2:</label>
<input class="form-control input-sm" id="dtpinkjetdate2" type="date">
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Ink Jet Date 3:</label>
<input class="form-control input-sm" id="dtpinkjetdate3" type="date">
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Color Contract:</label>
<select id="wcbcolorcontract" class='form-select'></select>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Color Contract To:</label>
<input id="edtcolorcontrastto" class="form-control input-sm" width='50%'/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Color Contract Date 1:</label>
<input class="form-control input-sm" id="dtpcolorcontrastdate1" type="date">
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Color Contract Date 2:</label>
<input class="form-control input-sm" id="dtpcolorcontrastdate2" type="date">
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Digital Color Key:</label>
<input id="edtdigitalcolorkey" class="form-control input-sm" width='50%'/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Digital Color To:</label>
<input id="edtdigitalcolorto" class="form-control input-sm" width='50%'/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Digital Color Date:</label>
<input class="form-control input-sm" id="dtpdigitalcolordate" type="date">
</div>
</div>
<h4 class="custom-h4 mt-3">Quantity</h4>
<hr class="custom-hr">
<div class="row">
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Press Name:</label>
<input id="edtpressname" class="form-control input-sm" width="50%" />
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Anilax Info:</label>
<input id="edtanilaxinfo" class="form-control input-sm" width="50%" />
</div>
</div>
<h4 class="custom-h4 mt-3">Colors</h4>
<hr class="custom-hr">
<div class="row align-items-center">
<!-- placeholders for the 4 dynamic input columns to center the Add Color button -->
<div class="col-sm"></div>
<div class="col-sm"></div>
<div class="col-sm"></div>
<div class="col-sm"></div>
<div class="col-auto d-flex justify-content-center">
<!-- Delphi-generated TWebButton stays here -->
<button id="btnaddcolor" class="btn btn-primary btn-sm me-3">
Add Color
</button>
</div>
</div>
<!-- Dynamically injected color rows go here -->
<div id="additionalFields" class="row mt-3"></div>
<h4 class="custom-h4 mt-3">Plate Marks</h4>
<hr class="custom-hr">
<div class="row">
<div class="col-auto">
<label label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Microdots:</label>
<input id="edtmicrodots" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Microdots Comments:</label>
<input id="edtmicrodotscomments" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Crosshairs:</label>
<input id="edtcrosshairs" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Crosshairs Comments:</label>
<input id="edtcrosshairscomments" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Color Bars:</label>
<input id="edtcolorbars" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Color Bars Comments:</label>
<input id="edtcolorbarscomments" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Other:</label>
<input id="edtplateother" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Microdots Comments:</label>
<input id="edtplateothercomments" class="form-control input-sm" style="width: 150px"/>
</div>
</div>
<h4 class="custom-h4 mt-3">Layout</h4>
<hr class="custom-hr">
<div class="row">
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Around:</label>
<input id="edtaround" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Accross:</label>
<input id="edtaccross" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Surface Print:</label>
<input id="edtsurfaceprint" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Reverse Print:</label>
<input id="edtreverseprint" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Cylinder Repeat:</label>
<input id="edtcylinderrepeat" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Cutoff Dimension:</label>
<input id="edtcutoffdimension" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Pitch:</label>
<input id="edtpitch" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Teeth:</label>
<input id="edtteeth" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Bleed:</label>
<input id="edtbleed" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Cutback:</label>
<input id="edtcutback" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Minimum Trap Dimension:</label>
<input id="edtminimumtrapdimension" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Maximum Trap Dimension:</label>
<input id="edtmaximumtrapdimension" class="form-control input-sm" style="width: 150px"/>
</div>
</div>
<h4 class="custom-h4 mt-3">Print Orientation</h4>
<hr class="custom-hr">
<div class="row">
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Print Orientation:</label>
<select id="wcbprint" class='form-select'></select>
</div>
</div>
<h4 class="custom-h4 mt-3">UPC</h4>
<hr class="custom-hr">
<div class="row">
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Size:</label>
<input id="edtsize" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Bar Width Reduction:</label>
<input id="edtbarwidthreduction" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Distortion Percent:</label>
<input id="edtdistortionpercent" class="form-control input-sm" style="width: 150px"/>
</div>
<div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Distortion Amount:</label>
<input id="edtdistortionamount" class="form-control input-sm" style="width: 150px"/>
</div>
<h4 class="custom-h4 mt-3">Plates</h4>
<hr class="custom-hr">
<div class="row">
<div class="col-auto">
<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 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 style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Job Number:</label>
<input id="edtjobnumber" class="form-control input-sm" style="width: 150px"/>
</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 (Max Length 2048 characters)</label>
<textarea id="edtcomments" class="form-control mb-3" style=" width: 1100px; height: 150px;" maxlength="2048"></textarea>
</div>
</div>
</div>
<div class="container h-100 d-flex flex-column mt-0 py-0" style="max-width: 100%;">
<!-- Actions Row -->
<div class="row mt-2 justify-content-center">
<div class="col-auto d-flex align-items-center">
<label class="mt-3" style="font-weight: 700;">
Show <select class="custom-select" id="wcbpagesize" style="font-size: 1.00rem;"></select> entries
</label>
</div>
<div class="col-auto d-flex align-items-center">
<label class="mt-3" style="font-weight: 700;">
Order By: <select class="custom-select" id="wlcborderby" style="font-size: 1.00rem;"></select>
</label>
</div>
<div class="col-auto">
<button id="btnorderby" class="btn btn-secondary mt-3">Descending <i class="fa fa-arrow-down"></i></button>
</div>
<div class="col-auto">
<button id="btnaddorder" class="btn btn-secondary mt-3">Add Order</button>
</div>
<div class="col-auto">
<button id="btnsetstatus" class="btn btn-secondary mt-3">Set Status</button>
</div>
<div class="col-auto">
<button id="btngeneratepdf" class="btn btn-secondary mt-3" type="button">Generate PDF</button>
<div class="invalid-feedback">
No order selected. Please select an order to generate a PDF.
</div>
</div>
<div class="col-auto">
<button id="btnfilters" class="btn btn-secondary mt-3">Filters</button>
</div>
</div>
<!-- Entries Label Section d-flex justify-content-between w-100 mt-2-->
<div class="row">
<div class="col-auto">
<label id="lblentries"></label>
</div>
</div>
<div class="row">
<div class="col-12">
<input id="edtsearch" type="text" class="form-control" style="width: 100%;"/>
</div>
</div>
<!-- Table Section -->
<div id="order_table_section" class="overflow-auto mt-2"
style="max-height: calc(100vh - 250px); padding-bottom: 0; width: 100%;">
<table id="tblPhoneGrid" class="table table-striped table-bordered border-light" style="width: 100%;">
<thead class="sticky-top thead-light">
<tr style="font-size: 0.875rem;">
<!-- Table headers are dynamically generated -->
</tr>
</thead>
<tbody id="orderTableBody" class="align-middle">
<!-- Table rows are dynamically generated -->
</tbody>
</table>
</div>
<!-- Pagination Section -->
<div class="d-flex justify-content-center w-100 mt-2">
<nav aria-label="Page navigation">
<ul id="pagination" class="pagination">
<!-- Pagination items added dynamically -->
</ul>
</nav>
</div>
</div>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>TMS Web Project</title>
<style>
</style>
</head>
<body>
</body>
</html>
<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
<div class="container">
<!-- Edit-User form -->
<div class="row">
<div class="col-lg-10 col-xl-8 mx-auto">
<form id="edituserform" class="row g-3" novalidate>
<div class="col-md-6">
<label id="lblusername" for="edtusername" class="form-label">Username</label>
<input id="edtusername" class="form-control" required>
<div class="invalid-feedback">Username is required.</div>
</div>
<div class="col-md-6">
<label id="lblpassword" for="edtpassword" class="form-label">Password</label>
<input id="edtpassword" type="password" class="form-control" required>
<div class="invalid-feedback">Passwords is required.</div>
</div>
<div class="col-md-6">
<label id="lblfullname" for="edtfullname" class="form-label">Full&nbsp;Name</label>
<input id="edtfullname" class="form-control" required>
<div class="invalid-feedback">Full Name is required.</div>
</div>
<div class="col-md-6">
<label id="lblactive" for="cbstatus" class="form-label">Active</label>
<div class="form-check mt-1">
<input id="cbstatus" class="form-check-input" type="checkbox" style="width: 1.5em; height: 1.5em;">
</div>
</div>
<div class="col-md-6">
<label id="lblemail" for="edtemail" class="form-label">Email&nbsp;Address</label>
<input id="edtemail" type="email" class="form-control">
</div>
<div class="col-md-6">
<label id="lblQB" for="edtQB" class="form-label">QuickBooks&nbsp;ID</label>
<input id="edtQB" class="form-control">
</div>
<div class="col-md-6">
<label id="lblrights" for="edtrights" class="form-label">System&nbsp;Rights</label>
<input id="edtrights" class="form-control">
</div>
<div class="col-md-6">
<label id="lblaccess" for="cbaccess" class="form-label">Access&nbsp;Type</label>
<select id="cbaccess" class="form-select">
</select>
</div>
<div class="gap-2 mt-4">
<button id="btnconfirm" type="button" class="btn btn-primary">
Confirm
</button>
<button id="btncancel" type="button" class="btn btn-danger">
Cancel
</button>
</div>
</form>
</div>
</div>
</div>
<!-- Confirmation modal -->
<div class="modal fade" id="confirmation_modal" tabindex="-1" aria-labelledby="confirmation_modal_label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="confirmation_modal_label">Confirm</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
Are you sure you want to make these changes?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" id="btn_confirm_changes">Confirm</button>
</div>
</div>
</div>
</div>
<div class="container">
<!-- Profile form -->
<div class="row">
<div class="col-lg-8 col-xl-6 mx-auto">
<form id="userprofileform" class="needs-validation" role="form" autocomplete="off" novalidate>
<div class="mb-3">
<label id="view.userprofile.form.lblUserID"
for="view.userprofile.form.edtUserID"
class="form-label">User&nbsp;ID</label>
<input id="view.userprofile.form.edtUserID"
class="form-control"
readonly>
</div>
<div class="mb-3">
<label id="view.userprofile.form.lblUserName"
for="view.userprofile.form.edtUsername"
class="form-label">Username</label>
<input id="view.userprofile.form.edtUsername"
class="form-control">
</div>
<div class="mb-3">
<label id="view.userprofile.form.lblFullName"
for="view.userprofile.form.edtFullName"
class="form-label">Full&nbsp;Name</label>
<input id="view.userprofile.form.edtFullName"
class="form-control">
</div>
<div class="mb-3">
<label id="view.userprofile.form.lblEmail"
for="view.userprofile.form.edtEmail"
class="form-label">Email&nbsp;Address</label>
<input id="view.userprofile.form.edtEmail"
type="email"
class="form-control">
</div>
<div class="mb-3">
<label id="view.userprofile.form.lblAccessType"
for="view.userprofile.form.edtAccessType"
class="form-label">Email&nbsp;Address</label>
<input id="view.userprofile.form.edtAccessType"
type="email"
class="form-control">
</div>
<div class="mb-3">
<label id="view.userprofile.form.lblQBID"
for="view.userprofile.form.edtQBID"
class="form-label">Email&nbsp;Address</label>
<input id="view.userprofile.form.edtQBID"
type="email"
class="form-control">
</div>
</form>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="container mt-4 px-0">
<div class="row justify-content-center">
<div class="col-12 col-md-8">
<div class="row">
<div class=col-sm>
</div>
</div>
</div>
<div class="row justify-content-center py-2">
<div class="col-sm">
<button id="btnadduser" class="btn btn-primary">Add User></button>
</div>
</div class="table-user-responsive">
<table class="table table-striped table-bordered" id="tblPhoneGrid">
<thead class="thead-dark">
<tr>
<th scope="col">UserID</th>
<th scope="col">Username</th>
<th scope="col">Password</th>
<th scope="col">Full Name</th>
<th scope="col">Status</th>
<th scope="col">Email Address</th>
<th scope="col">Access Type</th>
<th scope="col">System Rights</th>
<th scope="col">QB ID</th>
<th scope="col">Edit</th>
</tr>
</thead>
<tbody>
<!-- Rows will be added dynamically via Delphi code -->
</tbody>
</table>
<label id="lblentries"></label>
<nav aria-label="Page navigation">
<ul class="pagination justify-content-center" id="pagination">
<!-- Pagination items will be added dynamically via Delphi code -->
</ul>
</nav>
</div>
</div>
</div>
</div>
{
"AuthUrl" : "http://localhost:2004/kgOrders/auth/",
"ApiUrl" : "http://localhost:2004/kgOrders/api/"
}
.login-card {
display: inline-block;
width: 300px; /* Adjust width as needed */
padding: 0;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
background-color: #fff;
}
.tbl-min-120 {
min-width: 120px;
}
input[type="text"] {
min-width: 50px;
max-width: 100%;
width: auto;
padding-left: 5px;
}
/* Chrome, Safari, Edge, Opera */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Firefox */
input[type=number] {
-moz-appearance: textfield;
}
is-invalid .form-check-input {
border: 1px solid #dc3545 !important;
}
.is-invalid .form-check-label {
color: #dc3545 !important;
}
input[type="checkbox"]:focus,
input[type="checkbox"]:focus-visible {
outline: auto !important
}
.input-search input {
width: 100px; /* Adjust the width of the input */
height: 35px; /* Set the height to match label height */
padding: 5px; /* Padding for input text */
font-size: 14px; /* Font size for input text */
border: 1px solid #ced4da; /* Border style */
border-radius: 5px; /* Rounded corners for the input */
box-sizing: border-box; /* Ensures padding and border are included in the element's total width and height */
}
.card-header {
width: 100%;
text-align: left; /* Align text to the left */
background-color: #f8f9fa; /* Match the card background */
padding: 0.75rem 1.25rem;
border-bottom: 1px solid rgba(0, 0, 0, 0.125);
border-top-left-radius: 10px;
border-top-right-radius: 10px;
margin: 0; /* Remove any margin */
box-sizing: border-box; /* Ensure padding is included in the element's total width and height */
}
/* Ensure that the title does not affect the navbar layout */
#view.main.apptitle {
display: flex;
align-items: center;
justify-content: flex-start; /* Align title to the left */
width: auto; /* Ensure it doesn't stretch the container */
margin-right: 20px; /* Optional: add space between title and navbar items */
}
/* Fixed width for title area to prevent shifting */
#title {
white-space: nowrap; /* Prevent the title text from wrapping */
width: 200px; /* Fixed width for the title */
text-overflow: ellipsis; /* Truncate text with ellipsis if it overflows */
overflow: hidden;
font-weight: bold; /* Optional: make the title text bold */
}
/* 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 */
.navbar-nav {
display: flex;
justify-content: flex-end; /* Align navbar items to the right */
width: 100%;
}
/* Additional mobile responsiveness (optional) */
@media (max-width: 1200px) {
.navbar-nav {
flex-direction: column; /* Stack items vertically on smaller screens */
align-items: flex-start; /* Align items to the left */
}
.navbar-nav-spaced .nav-item {
padding: 10px 0; /* Adjust vertical spacing between items */
}
}
/* Make sure active navbar item color gets applied */
.navbar-nav .nav-item a.active {
color: #fff !important; /* Set text color to white for active item */
background-color: #004F84 !important; /* Darker blue for active background */
font-weight: bold;
}
/* Default navbar item color */
.navbar-nav .nav-item a {
color: #000 !important; /* Default color for links */
transition: color 0.3s ease;
}
/* Navbar item hover state */
.navbar-nav .nav-item a:hover {
color: #fff !important; /* Set hover text color to white */
background-color: #286090 !important; /* Light blue on hover */
}
.nav-item {
padding: 0 20px; /* Adjust this value for desired spacing between labels */
}
.mr-2 {
margin-right: 0.5rem;
}
.custom-h4 {
margin-bottom: 5px;
}
.custom-hr {
margin-top: 5px;
margin-bottom: 10px;
}
.custom-select-large {
font-size: 1.25rem;
padding: 0.5rem;
height: 2.5rem;
}
.player-container {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: #fff;
border: 1px solid #ccc;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
z-index: 1000;
}
.player-container audio {
width: 100%;
}
.close-btn {
position: absolute;
top: 10px;
right: 10px;
cursor: pointer;
}
.card-title {
margin: 0;
font-size: 1.25rem; /* Adjust font size as needed */
}
.card-body {
padding: 2rem;
}
.table tbody tr:hover {
background-color: #d1e7fd; /* Light blue color for hover effect */
cursor: pointer;
margin-top: 5px;
}
.form-input{
display: table;
}
.form-cells{
display: table-cell
}
.table tbody tr {
transition: background-color 0.3s ease;
}
.table thead th{
border: 2px;
background-color: #e6e6e6;
}
.table thead {
border-color: #e6e6e6;
}
.min-w-80 {
min-width: 80px;
}
.table {
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-radius: 5px;
}
.navbar-nav {
margin-left: auto; /* Align the dropdown to the right */
}
.container {
margin-top: 50px; /* Adjust the top margin as needed */
}
@media (max-width: 1200px) {
.table-responsive {
display: block;
width: 100%;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.table thead {
display: none;
}
.table tbody, .table tr, .table td {
display: block;
width: 100%;
}
.table tr {
margin-bottom: 1rem;
}
.table td {
text-align: right;
padding-left: 50%; /* Adjust padding to accommodate the data-label */
position: relative;
}
.table td::before {
content: attr(data-label);
position: absolute;
left: 0;
width: 50%;
padding-left: 15px; /* Adjust as necessary */
font-weight: bold;
text-align: left;
}
.table td .transcript {
margin-top: 20px; /* Set top margin to 20px */
text-align: left; /* Ensure text alignment is left */
margin-left: 8px;
white-space: normal; /* Prevent text from being cut off */
}
}
.btn-primary {
background-color: #286090 !important;
border-color: #286090 !important;
color: #fff !important;
}
.btn-primary:hover {
background-color: #204d74 !important;
border-color: #204d74 !important;
}
.login-navbar {
max-width: 1200px; /* Set the max-width to match a medium screen */
margin: auto;
border-bottom-left-radius: 10px; /* Round the bottom left corner */
border-bottom-right-radius: 10px; /* Round the bottom right corner */
border: 1px solid #d3d3d3;
}
.navbar-toggler {
display: none;
}
.dropdown-menu a {
display: flex; /* Use flexbox for alignment */
align-items: center; /* Vertically center the content */
width: 100%; /* Ensure they take up the full width */
padding: 0.5rem 1rem; /* Add padding to make them clickable */
color: #000; /* Adjust the text color if necessary */
text-decoration: none; /* Remove underlines */
}
.dropdown-menu a:hover {
background-color: #204d74;
color: #fff;
}
.dropdown-menu a span {
flex-grow: 1; /* Make the span take up the remaining space */
}
/* Style for the selected number */
.selected-number .page-link {
background-color: #204d74;
color: #fff !important;
}
/* Style for the unselected numbers and text (previous/next) */
.pagination .page-item a,
.pagination .page-item span {
color: #204d74;
}
.pagination .page-item.active .page-link,
.pagination .page-item.active .page-link:hover,
.pagination .page-item.active .page-link:focus {
background-color: #204d74;
border-color: #204d74;
color: #fff !important;
}
.card {
border: none !important;
box-shadow: none !important; /* If shadow is causing the issue */
}
.color-column {
width: 200px; /* Fixed width for the column */
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis; /* Adds ellipsis */
}
.grid-container {
position: relative; /* Ensure the container is the reference for child positioning */
height: 400px; /* Set the height for the grid */
width: 100%; /* Full width of the parent container */
overflow: hidden; /* Prevent unintended overflow */
}
#TFAddOrder_TMSFNCGrid2 {
top: 0px !important; /* Reset the top offset */
left: 0px !important; /* Reset the left offset */
position: absolute !important; /* Use relative positioning to align with the grid container */
}
#TFAddOrder_TMSFNCGrid2_Canvas {
position: relative !important; /* Ensure absolute positioning within the parent */
width: 100% !important; /* Make the canvas fill the container width */
height: 100% !important; /* Make the canvas fill the container height */
left: 0px !important; /* Align canvas to the left */
}
#TFAddOrder_ScrollBar5 {
top: 0px !important; /* Align scrollbar to the top */
right: 0px !important; /* Align scrollbar to the right edge */
position: absolute !important; /* Position within the grid container */
height: 400px !important; /* Match the height of the grid container */
box-sizing: border-box !important; /* Prevent borders from affecting dimensions */
}
#tblPhoneGrid {
--bs-table-bg: #fff;
--bs-table-border-color: #dee2e6; /* or whatever border tone you like */
}
/* and make sure the table collapses borders so there are no gaps */
#tblPhoneGrid {
border-collapse: collapse !important;
}
@keyframes slideInLeft {
from {
transform: translateX(-120%);
opacity: 0;
}
to {
transform: translateX(0);
opacity: 1;
}
}
.toast.slide-in {
animation: slideInLeft 0.4s ease-out forwards;
}
#spinner {
position: fixed !important;
z-index: 9999 !important;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.lds-roller {
display: inline-block;
position: relative;
width: 80px;
height: 80px;
}
.lds-roller div {
animation: lds-roller 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
transform-origin: 40px 40px;
}
.lds-roller div:after {
content: " ";
display: block;
position: absolute;
width: 10px;
height: 10px;
border-radius: 50%;
background: #204d74;
margin: -5px 0 0 -5px;
}
.lds-roller div:nth-child(1) {
animation-delay: -0.036s;
}
.lds-roller div:nth-child(1):after {
top: 63px;
left: 63px;
}
.lds-roller div:nth-child(2) {
animation-delay: -0.072s;
}
.lds-roller div:nth-child(2):after {
top: 68px;
left: 56px;
}
.lds-roller div:nth-child(3) {
animation-delay: -0.108s;
}
.lds-roller div:nth-child(3):after {
top: 71px;
left: 48px;
}
.lds-roller div:nth-child(4) {
animation-delay: -0.144s;
}
.lds-roller div:nth-child(4):after {
top: 72px;
left: 40px;
}
.lds-roller div:nth-child(5) {
animation-delay: -0.18s;
}
.lds-roller div:nth-child(5):after {
top: 71px;
left: 32px;
}
.lds-roller div:nth-child(6) {
animation-delay: -0.216s;
}
.lds-roller div:nth-child(6):after {
top: 68px;
left: 24px;
}
.lds-roller div:nth-child(7) {
animation-delay: -0.252s;
}
.lds-roller div:nth-child(7):after {
top: 63px;
left: 17px;
}
.lds-roller div:nth-child(8) {
animation-delay: -0.288s;
}
.lds-roller div:nth-child(8):after {
top: 56px;
left: 12px;
}
@keyframes lds-roller {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta content="width=device-width, initial-scale=1" name="viewport"/>
<noscript>Your browser does not support JavaScript!</noscript>
<link href="data:;base64,=" rel="icon"/>
<title>EM Systems webKGOrders App</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/2.3.1/css/flag-icon.min.css" rel="stylesheet"/>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/all.min.css" rel="stylesheet"/>
<link href="css/app.css" rel="stylesheet" type="text/css"/>
<link href="css/spinner.css" rel="stylesheet" type="text/css"/>
<script crossorigin="anonymous" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js" type="text/javascript"></script>
<link crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet"/>
<script src="webKGOrders.js" type="text/javascript"></script>
</head>
<body>
</body>
<script type="text/javascript">rtl.run();</script>
</html>
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -114,11 +114,11 @@ ...@@ -114,11 +114,11 @@
<VerInfo_Locale>1033</VerInfo_Locale> <VerInfo_Locale>1033</VerInfo_Locale>
<DCC_ExeOutput>.\bin</DCC_ExeOutput> <DCC_ExeOutput>.\bin</DCC_ExeOutput>
<DCC_UnitSearchPath>C:\RADTOOLS\FastMM4;$(DCC_UnitSearchPath)</DCC_UnitSearchPath> <DCC_UnitSearchPath>C:\RADTOOLS\FastMM4;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<VerInfo_Keys>CompanyName=EM Systems;FileDescription=$(MSBuildProjectName);FileVersion=0.9.13.2;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=0.9.11;Comments=</VerInfo_Keys> <VerInfo_Keys>CompanyName=EM Systems;FileDescription=$(MSBuildProjectName);FileVersion=0.9.13.3;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=0.9.11;Comments=</VerInfo_Keys>
<VerInfo_MajorVer>0</VerInfo_MajorVer> <VerInfo_MajorVer>0</VerInfo_MajorVer>
<VerInfo_MinorVer>9</VerInfo_MinorVer> <VerInfo_MinorVer>9</VerInfo_MinorVer>
<VerInfo_Release>13</VerInfo_Release> <VerInfo_Release>13</VerInfo_Release>
<VerInfo_Build>2</VerInfo_Build> <VerInfo_Build>3</VerInfo_Build>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win64)'!=''"> <PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode> <AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
...@@ -229,12 +229,7 @@ ...@@ -229,12 +229,7 @@
<Source> <Source>
<Source Name="MainSource">kgOrdersServer.dpr</Source> <Source Name="MainSource">kgOrdersServer.dpr</Source>
</Source> </Source>
<Excluded_Packages> <Excluded_Packages/>
<Excluded_Packages Name="$(BDSBIN)\bcboffice2k290.bpl">Embarcadero C++Builder Office 2000 Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcbofficexp290.bpl">Embarcadero C++Builder Office XP Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k290.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp290.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality> </Delphi.Personality>
<Deployment Version="5"> <Deployment Version="5">
<DeployFile LocalName="bin\kgOrdersServer.exe" Configuration="Debug" Class="ProjectOutput"> <DeployFile LocalName="bin\kgOrdersServer.exe" Configuration="Debug" Class="ProjectOutput">
......
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