Commit b956dc72 by Mac Stephens

Merge branch 'cam3'

parents 29f8d956 95296f5f
object FViewAddAddress: TFViewAddAddress
Width = 281
Height = 402
object WebLabel1: TWebLabel
Left = 8
Top = 283
Width = 92
Height = 15
Caption = 'Shipping Contact'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object WebLabel2: TWebLabel
Left = 8
Top = 234
Width = 67
Height = 15
Caption = 'Shipping Zip'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object WebLabel3: TWebLabel
Left = 8
Top = 136
Width = 71
Height = 15
Caption = 'Shipping City'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object WebLabel4: TWebLabel
Left = 8
Top = 185
Width = 76
Height = 15
Caption = 'Shipping State'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object WebLabel5: TWebLabel
Left = 8
Top = 87
Width = 92
Height = 15
Caption = 'Shipping Address'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object WebLabel6: TWebLabel
Left = 8
Top = 36
Width = 47
Height = 15
Caption = 'First Line'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object edtState: TWebEdit
Left = 8
Top = 206
Width = 78
Height = 22
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object edtFirstLine: TWebEdit
Left = 8
Top = 59
Width = 198
Height = 22
ChildOrder = 1
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object edtCity: TWebEdit
Left = 8
Top = 157
Width = 149
Height = 22
ChildOrder = 2
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object edtZip: TWebEdit
Left = 8
Top = 255
Width = 121
Height = 22
ChildOrder = 3
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object edtContact: TWebEdit
Left = 8
Top = 304
Width = 198
Height = 22
ChildOrder = 4
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object edtAddress: TWebEdit
Left = 8
Top = 108
Width = 198
Height = 22
ChildOrder = 1
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object edtNotification: TWebEdit
Left = 8
Top = 8
Width = 198
Height = 22
ChildOrder = 12
Enabled = False
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object btnSave: TWebButton
Left = 8
Top = 340
Width = 96
Height = 25
Caption = 'Save'
ChildOrder = 13
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnSaveClick
end
object btnCancel: TWebButton
Left = 110
Top = 340
Width = 96
Height = 25
Caption = 'Cancel'
ChildOrder = 13
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnCancelClick
end
end
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>TMS Web Project</title>
<style>
</style>
</head>
<body>
</body>
</html>
\ No newline at end of file
// Small Pop-Up page when adding orders if you want to quickly add an address
unit View.AddAddress;
interface
uses
System.SysUtils, System.Classes, JS, Web, WEBLib.Graphics, WEBLib.Controls,
WEBLib.Forms, WEBLib.Dialogs, Vcl.Controls, Vcl.StdCtrls, WEBLib.StdCtrls;
type
TFViewAddAddress = class(TWebForm)
edtState: TWebEdit;
edtFirstLine: TWebEdit;
edtCity: TWebEdit;
edtZip: TWebEdit;
edtContact: TWebEdit;
edtAddress: TWebEdit;
WebLabel1: TWebLabel;
WebLabel2: TWebLabel;
WebLabel3: TWebLabel;
WebLabel4: TWebLabel;
WebLabel5: TWebLabel;
WebLabel6: TWebLabel;
edtNotification: TWebEdit;
btnSave: TWebButton;
btnCancel: TWebButton;
procedure btnCancelClick(Sender: TObject);
procedure btnSaveClick(Sender: TObject);
private
{ Private declarations }
function Verify(): boolean;
public
{ Public declarations }
var
confirm: boolean;
end;
var
FViewAddAddress: TFViewAddAddress;
implementation
{$R *.dfm}
procedure TFViewAddAddress.btnSaveClick(Sender: TObject);
begin
if Verify() then
begin
confirm := true;
Close;
end;
end;
function TFViewAddAddress.Verify(): boolean;
// Makes sure the address is filled in.
begin
result := true;
if edtFirstLine.Text = '' then
begin
edtNotification.Text := 'Please Fill in the First Line';
result := false;
end
else if edtAddress.Text = '' then
begin
edtNotification.Text := 'Please Fill in the Address';
result := false;
end
else if edtCity.Text = '' then
begin
edtNotification.Text := 'Please Fill in the City';
result := false;
end
else
if edtState.Text = '' then
begin
edtNotification.Text := 'Please Fill in the State';
result := false;
end
else if edtZip.Text = '' then
begin
edtNotification.Text := 'Please Fill in the Zip Code';
result := false;
end
else if edtContact.Text = '' then
begin
edtNotification.Text := 'Please Fill in the Contact';
result := false;
end
end;
procedure TFViewAddAddress.btnCancelClick(Sender: TObject);
begin
Close;
end;
end.
\ No newline at end of file
...@@ -5,18 +5,27 @@ object FAddOrder: TFAddOrder ...@@ -5,18 +5,27 @@ object FAddOrder: TFAddOrder
object WebLabel1: TWebLabel object WebLabel1: TWebLabel
Left = 4 Left = 4
Top = 81 Top = 81
Width = 35 Width = 95
Height = 15 Height = 15
Caption = 'Search' Caption = 'Search Customers'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object WebLabel2: TWebLabel object WebLabel2: TWebLabel
Left = 143 Left = 135
Top = 81 Top = 81
Width = 113 Width = 113
Height = 15 Height = 15
Caption = 'Selected Company ID' Caption = 'Selected Customer ID'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object WebLabel3: TWebLabel
Left = 283
Top = 81
Width = 134
Height = 15
Caption = 'Selected Customer Name'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
...@@ -30,7 +39,7 @@ object FAddOrder: TFAddOrder ...@@ -30,7 +39,7 @@ object FAddOrder: TFAddOrder
OnChange = edtSearchChange OnChange = edtSearchChange
end end
object edtID: TWebEdit object edtID: TWebEdit
Left = 143 Left = 135
Top = 102 Top = 102
Width = 142 Width = 142
Height = 22 Height = 22
...@@ -74,7 +83,7 @@ object FAddOrder: TFAddOrder ...@@ -74,7 +83,7 @@ object FAddOrder: TFAddOrder
Font.Name = 'Segoe UI' Font.Name = 'Segoe UI'
Font.Style = [] Font.Style = []
ID = '' ID = ''
Width = 70.000000000000000000 Width = 90.000000000000000000
end end
item item
BorderWidth = 1 BorderWidth = 1
...@@ -119,7 +128,7 @@ object FAddOrder: TFAddOrder ...@@ -119,7 +128,7 @@ object FAddOrder: TFAddOrder
Font.Name = 'Segoe UI' Font.Name = 'Segoe UI'
Font.Style = [] Font.Style = []
ID = '' ID = ''
Width = 382.000000000000000000 Width = 362.000000000000000000
end end
item item
BorderWidth = 1 BorderWidth = 1
...@@ -220,8 +229,8 @@ object FAddOrder: TFAddOrder ...@@ -220,8 +229,8 @@ object FAddOrder: TFAddOrder
OnClick = cbWebPlateClick OnClick = cbWebPlateClick
end end
object btnCancel: TWebButton object btnCancel: TWebButton
Left = 436 Left = 542
Top = 105 Top = 101
Width = 96 Width = 96
Height = 25 Height = 25
Caption = 'Cancel' Caption = 'Cancel'
...@@ -231,8 +240,8 @@ object FAddOrder: TFAddOrder ...@@ -231,8 +240,8 @@ object FAddOrder: TFAddOrder
OnClick = btnCancelClick OnClick = btnCancelClick
end end
object btnConfirm: TWebButton object btnConfirm: TWebButton
Left = 328 Left = 436
Top = 105 Top = 101
Width = 96 Width = 96
Height = 25 Height = 25
Caption = 'Select' Caption = 'Select'
...@@ -273,6 +282,16 @@ object FAddOrder: TFAddOrder ...@@ -273,6 +282,16 @@ object FAddOrder: TFAddOrder
TabOrder = 1 TabOrder = 1
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object edtName: TWebEdit
Left = 283
Top = 102
Width = 142
Height = 22
ChildOrder = 1
Enabled = False
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object XDataWebClient1: TXDataWebClient object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection Connection = DMConnection.ApiConnection
Left = 780 Left = 780
...@@ -282,9 +301,6 @@ object FAddOrder: TFAddOrder ...@@ -282,9 +301,6 @@ object FAddOrder: TFAddOrder
Connection = DMConnection.ApiConnection Connection = DMConnection.ApiConnection
Left = 726 Left = 726
Top = 7 Top = 7
object xdwdsCustomersID: TIntegerField
FieldName = 'ID'
end
object xdwdsCustomersNAME: TStringField object xdwdsCustomersNAME: TStringField
FieldName = 'NAME' FieldName = 'NAME'
end end
...@@ -294,6 +310,9 @@ object FAddOrder: TFAddOrder ...@@ -294,6 +310,9 @@ object FAddOrder: TFAddOrder
object xdwdsCustomersstaff_fields_invoice_to: TStringField object xdwdsCustomersstaff_fields_invoice_to: TStringField
FieldName = 'staff_fields_invoice_to' FieldName = 'staff_fields_invoice_to'
end end
object xdwdsCustomersCUSTOMER_ID: TIntegerField
FieldName = 'CUSTOMER_ID'
end
end end
object wdsCustomers: TWebDataSource object wdsCustomers: TWebDataSource
DataSet = xdwdsCustomers DataSet = xdwdsCustomers
......
...@@ -26,13 +26,15 @@ type ...@@ -26,13 +26,15 @@ type
WebLabel2: TWebLabel; WebLabel2: TWebLabel;
XDataWebClient1: TXDataWebClient; XDataWebClient1: TXDataWebClient;
xdwdsCustomers: TXDataWebDataSet; xdwdsCustomers: TXDataWebDataSet;
xdwdsCustomersID: TIntegerField;
xdwdsCustomersNAME: TStringField; xdwdsCustomersNAME: TStringField;
xdwdsCustomersSHORT_NAME: TStringField; xdwdsCustomersSHORT_NAME: TStringField;
wdsCustomers: TWebDataSource; wdsCustomers: TWebDataSource;
cbCuttingDie: TWebCheckBox; cbCuttingDie: TWebCheckBox;
edtNotification: TWebEdit; edtNotification: TWebEdit;
xdwdsCustomersstaff_fields_invoice_to: TStringField; xdwdsCustomersstaff_fields_invoice_to: TStringField;
xdwdsCustomersCUSTOMER_ID: TIntegerField;
WebLabel3: TWebLabel;
edtName: TWebEdit;
procedure WebFormShow(Sender: TObject); procedure WebFormShow(Sender: TObject);
procedure edtSearchChange(Sender: TObject); procedure edtSearchChange(Sender: TObject);
procedure cbCorrugatedPlateClick(Sender: TObject); procedure cbCorrugatedPlateClick(Sender: TObject);
...@@ -154,9 +156,9 @@ begin ...@@ -154,9 +156,9 @@ begin
// Set up column headers // Set up column headers
TMSFNCGrid1.ColumnCount := 4; TMSFNCGrid1.ColumnCount := 4;
TMSFNCGrid1.RowCount := 1; TMSFNCGrid1.RowCount := 1;
TMSFNCGrid1.Cells[0, 0] := 'DBID'; TMSFNCGrid1.Cells[0, 0] := 'Customer Num';
TMSFNCGrid1.Cells[1, 0] := 'ID'; TMSFNCGrid1.Cells[1, 0] := 'Customer ID';
TMSFNCGrid1.Cells[2, 0] := 'Name'; TMSFNCGrid1.Cells[2, 0] := 'Customer Name';
TMSFNCGrid1.Cells[3, 0] := 'Address'; TMSFNCGrid1.Cells[3, 0] := 'Address';
// Populate the grid with data from the dataset // Populate the grid with data from the dataset
...@@ -166,7 +168,7 @@ begin ...@@ -166,7 +168,7 @@ begin
while not xdwdsCustomers.EOF do while not xdwdsCustomers.EOF do
begin begin
TMSFNCGrid1.RowCount := RowIndex + 1; TMSFNCGrid1.RowCount := RowIndex + 1;
TMSFNCGrid1.Cells[0, RowIndex] := xdwdsCustomers.FieldByName('ID').AsString; TMSFNCGrid1.Cells[0, RowIndex] := xdwdsCustomers.FieldByName('CUSTOMER_ID').AsString;
TMSFNCGrid1.Cells[1, RowIndex] := xdwdsCustomers.FieldByName('SHORT_NAME').AsString; TMSFNCGrid1.Cells[1, RowIndex] := xdwdsCustomers.FieldByName('SHORT_NAME').AsString;
TMSFNCGrid1.Cells[2, RowIndex] := xdwdsCustomers.FieldByName('NAME').AsString; TMSFNCGrid1.Cells[2, RowIndex] := xdwdsCustomers.FieldByName('NAME').AsString;
TMSFNCGrid1.Cells[3, RowIndex] := xdwdsCustomers.FieldByName('staff_fields_invoice_to').AsString; TMSFNCGrid1.Cells[3, RowIndex] := xdwdsCustomers.FieldByName('staff_fields_invoice_to').AsString;
...@@ -185,6 +187,7 @@ end; ...@@ -185,6 +187,7 @@ end;
procedure TFAddOrder.TMSFNCGrid1CellClick(Sender: TObject; ACol, ARow: Integer); procedure TFAddOrder.TMSFNCGrid1CellClick(Sender: TObject; ACol, ARow: Integer);
begin begin
edtID.Text := TMSFNCGrid1.Cells[1, ARow]; edtID.Text := TMSFNCGrid1.Cells[1, ARow];
edtName.Text := TMSFNCGrid1.Cells[2, ARow];
DBID := TMSFNCGrid1.Cells[0, ARow]; DBID := TMSFNCGrid1.Cells[0, ARow];
end; end;
......
object FViewCustomers: TFViewCustomers
Width = 640
Height = 480
OnCreate = WebFormCreate
object lblEntries: TWebLabel
Left = 12
Top = 117
Width = 81
Height = 15
Caption = 'Showing 0 of ...'
ElementID = 'lblentries'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object btnAddCustomer: TWebButton
Left = 12
Top = 81
Width = 96
Height = 25
Caption = 'Add Customer'
ChildOrder = 5
ElementID = 'btnaddcustomer'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
TabOrder = 6
TabStop = False
WidthPercent = 100.000000000000000000
OnClick = btnAddCustomerClick
end
object wcbPageSize: TWebComboBox
Left = 22
Top = 52
Width = 145
Height = 23
ElementClassName = 'custom-select'
ElementID = 'wcbpagesize'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
Text = '500'
WidthPercent = 100.000000000000000000
ItemIndex = -1
Items.Strings = (
'100'
'250'
'500'
'1000')
end
object pnlMessage: TWebPanel
Left = 12
Top = 16
Width = 121
Height = 33
ElementID = 'view.login.message'
ChildOrder = 17
TabOrder = 2
object lblMessage: TWebLabel
Left = 16
Top = 11
Width = 46
Height = 15
Caption = 'Message'
ElementID = 'view.login.message.label'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object btnCloseNotification: TWebButton
Left = 96
Top = 3
Width = 22
Height = 25
ChildOrder = 1
ElementID = 'view.login.message.button'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
end
object wdbtcCustomers: TWebDBTableControl
Left = 8
Top = 202
Width = 631
Height = 200
ElementClassName = 'table'
ElementId = 'tblPhoneGrid'
BorderColor = clSilver
ChildOrder = 11
ElementFont = efCSS
ElementHeaderClassName = 'thead-light sticky-top bg-light'
ElementPosition = epRelative
ElementTableClassName = 'table table-striped table-hover table-bordered text-sm'
Footer.ButtonActiveElementClassName = 'btn btn-primary'
Footer.ButtonElementClassName = 'btn btn-light'
Footer.DropDownElementClassName = 'form-control'
Footer.InputElementClassName = 'form-control'
Footer.LinkActiveElementClassName = 'link-primary'
Footer.LinkElementClassName = 'link-secondary'
Footer.ListElementClassName = 'pagination'
Footer.ListItemElementClassName = 'page-item'
Footer.ListLinkElementClassName = 'page-link'
Header.ButtonActiveElementClassName = 'btn btn-primary'
Header.ButtonElementClassName = 'btn btn-light'
Header.DropDownElementClassName = 'form-control'
Header.InputElementClassName = 'form-control'
Header.LinkActiveElementClassName = 'link-primary'
Header.LinkElementClassName = 'link-secondary'
Header.ListElementClassName = 'pagination'
Header.ListItemElementClassName = 'page-item'
Header.ListLinkElementClassName = 'page-link'
WordWrap = True
OnDblClickCell = wdbtcCustomersDblClickCell
Columns = <
item
DataField = 'CUSTOMER_ID'
Title = 'Customer Num'
end
item
DataField = 'SHORT_NAME'
Title = 'Customer ID'
end
item
DataField = 'NAME'
Title = 'Customer Name'
end
item
DataField = 'START_DATE'
Title = 'Start Date'
end>
DataSource = wdsCustomers
end
object edtFilter: TWebEdit
Left = 246
Top = 20
Width = 121
Height = 22
ChildOrder = 5
ElementID = 'edtfilter'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnChange = edtFilterChange
end
object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection
Left = 158
Top = 90
end
object wdsCustomers: TWebDataSource
DataSet = xdwdsCustomers
Left = 262
Top = 116
end
object xdwdsCustomers: TXDataWebDataSet
Connection = DMConnection.ApiConnection
Left = 346
Top = 92
object xdwdsCustomersSHORT_NAME: TStringField
FieldName = 'SHORT_NAME'
Size = 0
end
object xdwdsCustomersNAME: TStringField
FieldName = 'NAME'
end
object xdwdsCustomersSTART_DATE: TStringField
FieldName = 'START_DATE'
end
object xdwdsCustomersCUSTOMER_ID: TIntegerField
FieldName = 'CUSTOMER_ID'
end
end
end
<div class="container h-100 d-flex flex-column mt-0" style="max-width: 100%; padding-bottom: 0;">
<!-- Alert Section -->
<div class="row">
<div class=col-sm>
<div id="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>
</div>
</div>
<!-- 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-->
<div class="row">
<div class="col-auto">
<label id="lblentries" style="font-size: 1.10rem;"></label>
</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" 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-4">
<nav aria-label="Page navigation">
<ul id="pagination" class="pagination">
<!-- Pagination items added dynamically -->
</ul>
</nav>
</div>
</div>
...@@ -24,17 +24,6 @@ object FViewEditUser: TFViewEditUser ...@@ -24,17 +24,6 @@ object FViewEditUser: TFViewEditUser
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object lblQB: TWebLabel
Left = 256
Top = 65
Width = 80
Height = 15
Caption = 'Quickbooks ID:'
Color = clBtnFace
ElementID = 'lblQB'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object WebLabel5: TWebLabel object WebLabel5: TWebLabel
Left = 284 Left = 284
Top = 8 Top = 8
...@@ -92,20 +81,21 @@ object FViewEditUser: TFViewEditUser ...@@ -92,20 +81,21 @@ object FViewEditUser: TFViewEditUser
object lblAccess: TWebLabel object lblAccess: TWebLabel
Left = 272 Left = 272
Top = 96 Top = 96
Width = 66 Width = 67
Height = 15 Height = 15
Caption = 'Access Type:' Caption = 'Access Type:'
ElementID = 'lblaccess' ElementID = 'lblaccess'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object lblPerspective: TWebLabel object lblQB: TWebLabel
Left = 3 Left = 256
Top = 132 Top = 65
Width = 77 Width = 80
Height = 15 Height = 15
Caption = 'Perspective ID:' Caption = 'Quickbooks ID:'
ElementID = 'lblperspective' Color = clBtnFace
ElementID = 'lblQB'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
...@@ -256,16 +246,6 @@ object FViewEditUser: TFViewEditUser ...@@ -256,16 +246,6 @@ object FViewEditUser: TFViewEditUser
ParentFont = False ParentFont = False
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object edtQB: TWebEdit
Left = 348
Top = 62
Width = 121
Height = 22
ChildOrder = 7
ElementID = 'edtQB'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object edtRights: TWebEdit object edtRights: TWebEdit
Left = 96 Left = 96
Top = 93 Top = 93
...@@ -293,13 +273,13 @@ object FViewEditUser: TFViewEditUser ...@@ -293,13 +273,13 @@ object FViewEditUser: TFViewEditUser
'ALL' 'ALL'
'ACTIVE') 'ACTIVE')
end end
object edtPerspective: TWebEdit object edtQB: TWebEdit
Left = 96 Left = 346
Top = 129 Top = 62
Width = 121 Width = 121
Height = 22 Height = 22
ChildOrder = 23 ChildOrder = 7
ElementID = 'edtperspective' ElementID = 'edtQB'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
......
...@@ -48,15 +48,10 @@ ...@@ -48,15 +48,10 @@
</div> </div>
</form> </form>
<div class="row"> <div class="row">
<div class="col-sm"> <div class="col-6">
<label class='pe-2' style="font-weight: 700;font-size: 15px;" id="lblrights">System Rights:</label> <label class='pe-2' style="font-weight: 700;font-size: 15px;" id="lblrights">System Rights:</label>
<input id="edtrights" class= "form-control input-sm" width='50%'/> <input id="edtrights" class= "form-control input-sm" width='50%'/>
</div> </div>
<div class="col-sm-6">
<label class='pe-2' style="font-weight: 700;font-size: 15px;" id="lblperspective">Perspective ID:</label>
<input id="edtperspective" class= "form-control input-sm" width='50%'/>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm py-3"> <div class="col-sm py-3">
......
...@@ -14,7 +14,6 @@ type ...@@ -14,7 +14,6 @@ type
TFViewEditUser = class(TWebForm) TFViewEditUser = class(TWebForm)
WebLabel2: TWebLabel; WebLabel2: TWebLabel;
WebLabel3: TWebLabel; WebLabel3: TWebLabel;
lblQB: TWebLabel;
WebLabel5: TWebLabel; WebLabel5: TWebLabel;
WebLabel6: TWebLabel; WebLabel6: TWebLabel;
WebLabel7: TWebLabel; WebLabel7: TWebLabel;
...@@ -34,12 +33,11 @@ type ...@@ -34,12 +33,11 @@ type
lblactive: TWebLabel; lblactive: TWebLabel;
cbStatus: TWebCheckBox; cbStatus: TWebCheckBox;
lblRights: TWebLabel; lblRights: TWebLabel;
edtQB: TWebEdit;
edtRights: TWebEdit; edtRights: TWebEdit;
lblAccess: TWebLabel; lblAccess: TWebLabel;
cbAccess: TWebComboBox; cbAccess: TWebComboBox;
lblPerspective: TWebLabel; lblQB: TWebLabel;
edtPerspective: TWebEdit; edtQB: TWebEdit;
procedure WebFormCreate(Sender: TObject); procedure WebFormCreate(Sender: TObject);
procedure btnConfirmClick(Sender: TObject); procedure btnConfirmClick(Sender: TObject);
procedure btnCancelClick(Sender: TObject); procedure btnCancelClick(Sender: TObject);
...@@ -120,7 +118,6 @@ begin ...@@ -120,7 +118,6 @@ begin
'&access=' + cbAccess.Text + '&access=' + cbAccess.Text +
'&newuser=' + edtUsername.Text + '&newuser=' + edtUsername.Text +
'&rights=' + edtRights.Text + '&rights=' + edtRights.Text +
'&perspective=' + edtPerspective.Text +
'&QB=' + edtQB.Text; '&QB=' + edtQB.Text;
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.AddUser', xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.AddUser',
...@@ -159,7 +156,6 @@ begin ...@@ -159,7 +156,6 @@ begin
'&access=' + cbAccess.Text + '&access=' + cbAccess.Text +
'&newuser=' + edtUsername.Text + '&newuser=' + edtUsername.Text +
'&rights=' + edtRights.Text + '&rights=' + edtRights.Text +
'&perspective=' + edtPerspective.Text +
'&QB=' + edtQB.Text; '&QB=' + edtQB.Text;
console.log(editOptions); console.log(editOptions);
...@@ -214,7 +210,6 @@ begin ...@@ -214,7 +210,6 @@ begin
edtQB.Text := QB; edtQB.Text := QB;
if Status = 'ACTIVE' then if Status = 'ACTIVE' then
cbStatus.checked := true; cbStatus.checked := true;
edtPerspective.Text := Perspective
end; end;
procedure TFViewEditUser.WebTimer1Timer(Sender: TObject); procedure TFViewEditUser.WebTimer1Timer(Sender: TObject);
......
...@@ -55,7 +55,9 @@ type ...@@ -55,7 +55,9 @@ type
procedure ViewOrderEntryWeb(orderInfo, customerInfo, mode, info: string); procedure ViewOrderEntryWeb(orderInfo, customerInfo, mode, info: string);
procedure ViewOrderEntryCuttingDie(orderInfo, customerInfo, mode, info: string); procedure ViewOrderEntryCuttingDie(orderInfo, customerInfo, mode, info: string);
procedure ViewOrders(info: string); procedure ViewOrders(info: string);
procedure ViewCustomerList(info: string);
procedure ShowUserForm(Info: string); procedure ShowUserForm(Info: string);
procedure ViewAddCustomer(customerInfo, info: string);
var var
search: string; search: string;
change: boolean; change: boolean;
...@@ -77,7 +79,8 @@ uses ...@@ -77,7 +79,8 @@ uses
View.Orders, View.Orders,
View.OrderEntryCorrugated, View.OrderEntryCorrugated,
View.OrderEntryCuttingDie, View.OrderEntryCuttingDie,
View.OrderEntryWeb; View.OrderEntryWeb,
View.Customers, AddCustomer;
{$R *.dfm} {$R *.dfm}
...@@ -109,7 +112,7 @@ procedure TFViewMain.lblCustomersClick(Sender: TObject); ...@@ -109,7 +112,7 @@ procedure TFViewMain.lblCustomersClick(Sender: TObject);
begin begin
if ( not ( change ) ) then if ( not ( change ) ) then
begin begin
//ShowForm(TFViewCustomers); ShowForm(TFViewCustomers);
lblAppTitle.Caption := 'Koehler-Gibson Customers'; lblAppTitle.Caption := 'Koehler-Gibson Customers';
setActive('Customers'); setActive('Customers');
end end
...@@ -251,6 +254,11 @@ begin ...@@ -251,6 +254,11 @@ begin
Application.CreateForm(AFormClass, WebPanel1.ElementID, FChildForm); Application.CreateForm(AFormClass, WebPanel1.ElementID, FChildForm);
end; end;
procedure TFViewMain.ViewCustomerList(info: string);
begin
end;
procedure TFViewMain.EditUser(Mode, Username, Password, Name, Status, Email, procedure TFViewMain.EditUser(Mode, Username, Password, Name, Status, Email,
Access, Rights, Perspective, QB: string); Access, Rights, Perspective, QB: string);
begin begin
...@@ -292,6 +300,14 @@ begin ...@@ -292,6 +300,14 @@ begin
FChildForm := TFOrderEntryCuttingDie.CreateForm(WebPanel1.ElementID, orderInfo, customerInfo, mode, info); FChildForm := TFOrderEntryCuttingDie.CreateForm(WebPanel1.ElementID, orderInfo, customerInfo, mode, info);
end; end;
procedure TFViewMain.ViewAddCustomer(customerInfo: string; info: string);
begin
lblAppTitle.Caption := 'Koehler-Gibson Add Customer';
if Assigned(FChildForm) then
FChildForm.Free;
FChildForm := TFViewAddCustomer.CreateForm(WebPanel1.ElementID, customerInfo, info);
end;
procedure TFViewMain.ShowUserForm(Info: string); procedure TFViewMain.ShowUserForm(Info: string);
begin begin
if Assigned(FChildForm) then if Assigned(FChildForm) then
......
...@@ -864,7 +864,7 @@ object FOrderEntryCorrugated: TFOrderEntryCorrugated ...@@ -864,7 +864,7 @@ object FOrderEntryCorrugated: TFOrderEntryCorrugated
DataSource = WebDataSource1 DataSource = WebDataSource1
end end
object btnSave: TWebButton object btnSave: TWebButton
Left = 526 Left = 530
Top = 560 Top = 560
Width = 96 Width = 96
Height = 25 Height = 25
...@@ -1226,6 +1226,18 @@ object FOrderEntryCorrugated: TFOrderEntryCorrugated ...@@ -1226,6 +1226,18 @@ object FOrderEntryCorrugated: TFOrderEntryCorrugated
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = btnAddClick OnClick = btnAddClick
end end
object WebButton2: TWebButton
Left = 186
Top = 429
Width = 96
Height = 25
Caption = 'Add Address'
ChildOrder = 85
ElementID = 'btnaddaddress'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = WebButton2Click
end
object XDataWebClient1: TXDataWebClient object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection Connection = DMConnection.ApiConnection
Left = 1014 Left = 1014
......
...@@ -38,25 +38,25 @@ ...@@ -38,25 +38,25 @@
<div class="col-12 col-md-8"> <div class="col-12 col-md-8">
</div> </div>
<h4 class="custom-h4 mt-3">Company</h4> <h4 class="custom-h4 mt-3">Customer</h4>
<hr class="custom-hr"> <hr class="custom-hr">
<div class="row"> <div class="row">
<div class="col-auto"> <div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">Company Name:</label> <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/> <input id="edtcompanyname" type="text" class="form-control" style="width: 300px;" required/>
<div class="invalid-feedback" style="font-size: 15px;"> <div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Company Name. Please Provide a Customer Name.
</div> </div>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">Account Company Name:</label> <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/> <input id="edtaccountcompanyname"type="text" class="form-control" style="width: 150px" required/>
<div class="invalid-feedback" style="font-size: 15px;"> <div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Company Account Name. Please Provide a Customer ID Name.
</div> </div>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">In Quickbooks?:</label> <label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">In Quickbooks?:</label>
<input id="edtinquickbooks"type="text" class="form-control" style="width: 150px"/> <input id="edtinquickbooks"type="text" class="form-control" style="width: 150px"/>
</div> </div>
</div> </div>
...@@ -107,6 +107,9 @@ ...@@ -107,6 +107,9 @@
<div class="invalid-feedback" style="font-size: 15px;"> <div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Ship To Address. Please Provide a Ship To Address.
</div> </div>
<div class="mt-2">
<button id="btnaddaddress" class="btn btn-primary btn-sm">Add Address</button>
</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">PO Number:</label> <label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">PO Number:</label>
......
...@@ -202,6 +202,7 @@ type ...@@ -202,6 +202,7 @@ type
tmrReturn: TWebTimer; tmrReturn: TWebTimer;
btnEdit: TWebButton; btnEdit: TWebButton;
btnAdd: TWebButton; btnAdd: TWebButton;
WebButton2: TWebButton;
procedure WebFormCreate(Sender: TObject); procedure WebFormCreate(Sender: TObject);
procedure HideNotification(); procedure HideNotification();
procedure ShowNotification(Notification: string); procedure ShowNotification(Notification: string);
...@@ -238,6 +239,9 @@ type ...@@ -238,6 +239,9 @@ type
procedure btnAddClick(Sender: TObject); procedure btnAddClick(Sender: TObject);
procedure xdwdsQBItemAfterEdit(DataSet: TDataSet); procedure xdwdsQBItemAfterEdit(DataSet: TDataSet);
procedure ViewMode(); procedure ViewMode();
procedure WebButton2Click(Sender: TObject);
procedure ShowAddAddressForm();
[async] procedure SendAddressToServer(AddressJSON: TJSONObject);
private private
FAgencyCode: string; FAgencyCode: string;
FCurrentReportType: string; FCurrentReportType: string;
...@@ -260,9 +264,12 @@ implementation ...@@ -260,9 +264,12 @@ implementation
{$R *.dfm} {$R *.dfm}
uses uses
View.Home, View.Main, View.AddOrder, Utils; View.Home, View.Main, View.AddOrder, View.AddAddress, Utils;
procedure TFOrderEntryCorrugated.sendOrderToServer(); procedure TFOrderEntryCorrugated.sendOrderToServer();
// This can be improved. I was struggling to get the checkboxes to work with
// The dataset at first, but if you just change the fields in the database to be
// Booleans it should work
var var
colorList: TJSONArray; colorList: TJSONArray;
container: TJSElement; container: TJSElement;
...@@ -577,7 +584,8 @@ begin ...@@ -577,7 +584,8 @@ begin
Response := await(XDataWebClient1.RawInvokeAsync('ILookupService.AddCorrugatedOrder', Response := await(XDataWebClient1.RawInvokeAsync('ILookupService.AddCorrugatedOrder',
[orderJSON.ToString])); [orderJSON.ToString]));
jsObj := JS.TJSObject(Response.Result); jsObj := JS.TJSObject(Response.Result);
OrderID := JS.toString(jsObj.Properties['OrderID']); if mode = 'ADD' then
OrderID := String(jsObj.Properties['OrderID']);
mode := 'EDIT'; mode := 'EDIT';
end; end;
...@@ -667,6 +675,73 @@ begin ...@@ -667,6 +675,73 @@ begin
addColorRow('','','',''); addColorRow('','','','');
end; end;
procedure TFOrderEntryCorrugated.WebButton2Click(Sender: TObject);
begin
ShowAddAddressForm();
end;
procedure TFOrderEntryCorrugated.SendAddressToServer(AddressJSON: TJSONObject);
var
Response: TXDataClientResponse;
notification: TJSObject;
begin
Response := await(XDataWebClient1.RawInvokeAsync('ILookupService.AddShippingAddress',
[AddressJSON.ToString]));
notification := TJSObject(Response.Result);
ShowNotification(string(notification['status']));
xdwdsShipTo.Close;
xdwdsShipTo.SetJSONData(notification['ADDRESS']);
xdwdsShipTo.Open;
end;
procedure TFOrderEntryCorrugated.ShowAddAddressForm;
// displays the search pop-up that allows the user to filter the order list
var
newform: TFViewAddAddress;
AddressJSON: TJSONObject;
ship_block: string;
begin
newform := TFViewAddAddress.CreateNew;
newform.Caption := 'Input Shipping Information';
newForm.Popup := True;
newForm.Border := fbDialog;
// used to manage Back button handling to close subform
window.location.hash := 'subform';
newform.ShowModal(
procedure(AValue: TModalResult)
var
searchOptions: string;
begin
if newform.confirm then
begin
AddressJSON := TJSONObject.Create;
AddressJSON.AddPair('address', newform.edtAddress.Text);
AddressJSON.AddPair('city', newform.edtCity.Text);
AddressJSON.AddPair('state', newform.edtState.Text);
AddressJSON.AddPair('zip', newform.edtZip.Text);
AddressJSON.AddPair('contact', newform.edtContact.Text);
AddressJSON.AddPair('customer_id', customerID);
ship_block := newform.edtFirstLine.Text + slinebreak +
edtCompanyName.Text + slinebreak +
newform.edtContact.Text + slinebreak +
newform.edtAddress.Text + slinebreak +
newform.edtCity.Text + ', ' + newform.edtState.Text + ' ' + newform.edtZip.Text;
AddressJSON.AddPair('ship_block', ship_block);
AddressJSON.AddPair('mode', 'ADD');
sendAddressToServer(AddressJSON);
end;
end
);
end;
procedure TFOrderEntryCorrugated.btnAddClick(Sender: TObject); procedure TFOrderEntryCorrugated.btnAddClick(Sender: TObject);
var var
newform: TFAddOrder; newform: TFAddOrder;
......
...@@ -386,6 +386,18 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -386,6 +386,18 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = btnAddClick OnClick = btnAddClick
end end
object WebButton2: TWebButton
Left = 186
Top = 429
Width = 96
Height = 25
Caption = 'Add Address'
ChildOrder = 85
ElementID = 'btnaddaddress'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = WebButton2Click
end
object WebDataSource1: TWebDataSource object WebDataSource1: TWebDataSource
DataSet = XDataWebDataSet1 DataSet = XDataWebDataSet1
Left = 22 Left = 22
...@@ -470,13 +482,13 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -470,13 +482,13 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
end end
object wdsShipTo: TWebDataSource object wdsShipTo: TWebDataSource
DataSet = xdwdsShipTo DataSet = xdwdsShipTo
Left = 212 Left = 302
Top = 436 Top = 418
end end
object xdwdsShipTo: TXDataWebDataSet object xdwdsShipTo: TXDataWebDataSet
AfterEdit = xdwdsShipToAfterEdit AfterEdit = xdwdsShipToAfterEdit
Left = 270 Left = 288
Top = 436 Top = 370
object xdwdsShipToADDRESS: TStringField object xdwdsShipToADDRESS: TStringField
FieldName = 'ADDRESS' FieldName = 'ADDRESS'
end end
......
...@@ -34,25 +34,25 @@ ...@@ -34,25 +34,25 @@
</div> </div>
</nav> </nav>
<div class="row mx-5"> <div class="row mx-5">
<h4 class="custom-h4 mt-3">Company</h4> <h4 class="custom-h4 mt-3">Customer</h4>
<hr class="custom-hr"> <hr class="custom-hr">
<div class="row"> <div class="row">
<div class="col-auto"> <div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">Company Name:</label> <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/> <input id="edtcompanyname" type="text" class="form-control" style="width: 300px;" required/>
<div class="invalid-feedback" style="font-size: 15px;"> <div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Company Name. Please Provide a Customer Name.
</div> </div>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">Account Company Name:</label> <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/> <input id="edtaccountcompanyname"type="text" class="form-control" style="width: 150px" required/>
<div class="invalid-feedback" style="font-size: 15px;"> <div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Company Account Name. Please Provide a Customer ID.
</div> </div>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">In Quickbooks?:</label> <label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">In Quickbooks?:</label>
<input id="edtinquickbooks"type="text" class="form-control" style="width: 150px"/> <input id="edtinquickbooks"type="text" class="form-control" style="width: 150px"/>
</div> </div>
</div> </div>
...@@ -103,6 +103,9 @@ ...@@ -103,6 +103,9 @@
<div class="invalid-feedback" style="font-size: 15px;"> <div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Ship To Address. Please Provide a Ship To Address.
</div> </div>
<div class="mt-2">
<button id="btnaddaddress" class="btn btn-primary btn-sm">Add Address</button>
</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">PO Number:</label> <label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">PO Number:</label>
...@@ -125,32 +128,6 @@ ...@@ -125,32 +128,6 @@
<textarea id="edtspecialinstructions" class="form-control" style=" width: 500px; height: 150px;"></textarea> <textarea id="edtspecialinstructions" class="form-control" style=" width: 500px; height: 150px;"></textarea>
</div> </div>
</div> </div>
<div class="row">
<div class="col-auto">
<button id="btnconfirm" class="btn btn-primary btn-sm float-end my-2">Save</button>
</div>
<div class="col-auto">
<button id="btncancel" class="btn btn-primary btn-sm float-end my-2">Cancel</button>
</div>
<div class="col-auto">
<button id="btncopy" class="btn btn-primary btn-sm float-end my-2">Copy</button>
</div>
<div class="col-auto">
<button id="btnpdf" class="btn btn-primary btn-sm float-end my-2">PDF</button>
</div>
<div class="col-auto">
<button id="btndelete" class="btn btn-primary btn-sm float-end my-2">Delete</button>
</div>
<div class="col-auto">
<button id="btnclose" class="btn btn-primary btn-sm float-end my-2">Close</button>
</div>
<div class="col-auto">
<button id="btnedit" class="btn btn-primary btn-sm float-end my-2">Edit</button>
</div>
<div class="col-auto">
<button id="btnadd" class="btn btn-primary btn-sm float-end my-2">Add</button>
</div>
</div>
</div> </div>
<div class="modal fade" id="confirmation_modal" tabindex="-1" aria-labelledby="confirmation_modal_label" aria-hidden="true"> <div class="modal fade" id="confirmation_modal" tabindex="-1" aria-labelledby="confirmation_modal_label" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
......
...@@ -73,6 +73,7 @@ type ...@@ -73,6 +73,7 @@ type
tmrReturn: TWebTimer; tmrReturn: TWebTimer;
btnEdit: TWebButton; btnEdit: TWebButton;
btnAdd: TWebButton; btnAdd: TWebButton;
WebButton2: TWebButton;
procedure btnSaveClick(Sender: TObject); procedure btnSaveClick(Sender: TObject);
procedure btnCancelClick(Sender: TObject); procedure btnCancelClick(Sender: TObject);
procedure WebFormCreate(Sender: TObject); procedure WebFormCreate(Sender: TObject);
...@@ -101,6 +102,9 @@ type ...@@ -101,6 +102,9 @@ type
procedure dtpOrderDateChange(Sender: TObject); procedure dtpOrderDateChange(Sender: TObject);
procedure btnEditClick(Sender: TObject); procedure btnEditClick(Sender: TObject);
procedure ViewMode(); procedure ViewMode();
procedure WebButton2Click(Sender: TObject);
procedure ShowAddAddressForm();
[async] procedure SendAddressToServer(AddressJSON: TJSONObject);
private private
FAgencyCode: string; FAgencyCode: string;
FCurrentReportType: string; FCurrentReportType: string;
...@@ -121,7 +125,73 @@ implementation ...@@ -121,7 +125,73 @@ implementation
{$R *.dfm} {$R *.dfm}
uses uses
View.Home, View.Main, View.AddOrder, Utils; View.Home, View.Main, View.AddOrder, View.AddAddress, Utils;
procedure TFOrderEntryCuttingDie.WebButton2Click(Sender: TObject);
begin
ShowAddAddressForm();
end;
procedure TFOrderEntryCuttingDie.SendAddressToServer(AddressJSON: TJSONObject);
var
Response: TXDataClientResponse;
notification: TJSObject;
begin
Response := await(XDataWebClient1.RawInvokeAsync('ILookupService.AddShippingAddress',
[AddressJSON.ToString]));
notification := TJSObject(Response.Result);
ShowNotification(string(notification['status']));
xdwdsShipTo.Close;
xdwdsShipTo.SetJSONData(notification['ADDRESS']);
xdwdsShipTo.Open;
end;
procedure TFOrderEntryCuttingDie.ShowAddAddressForm;
// displays the search pop-up that allows the user to filter the order list
var
newform: TFViewAddAddress;
AddressJSON: TJSONObject;
ship_block: string;
begin
newform := TFViewAddAddress.CreateNew;
newform.Caption := 'Shipping Information';
newForm.Popup := True;
newForm.Border := fbDialog;
// used to manage Back button handling to close subform
window.location.hash := 'subform';
newform.ShowModal(
procedure(AValue: TModalResult)
var
searchOptions: string;
begin
if newform.confirm then
begin
AddressJSON := TJSONObject.Create;
AddressJSON.AddPair('address', newform.edtAddress.Text);
AddressJSON.AddPair('city', newform.edtCity.Text);
AddressJSON.AddPair('state', newform.edtState.Text);
AddressJSON.AddPair('zip', newform.edtZip.Text);
AddressJSON.AddPair('contact', newform.edtContact.Text);
AddressJSON.AddPair('customer_id', customerID);
ship_block := newform.edtFirstLine.Text + slinebreak +
edtCompanyName.Text + slinebreak +
newform.edtContact.Text + slinebreak +
newform.edtAddress.Text + slinebreak +
newform.edtCity.Text + ', ' + newform.edtState.Text + ' ' + newform.edtZip.Text;
AddressJSON.AddPair('ship_block', ship_block);
AddressJSON.AddPair('mode', 'ADD');
sendAddressToServer(AddressJSON);
end;
end
);
end;
function TFOrderEntryCuttingDie.VerifyOrder: Boolean; function TFOrderEntryCuttingDie.VerifyOrder: Boolean;
var var
...@@ -224,8 +294,6 @@ begin ...@@ -224,8 +294,6 @@ begin
orderJSON.AddPair('mode', mode); orderJSON.AddPair('mode', mode);
if mode = 'EDIT' then if mode = 'EDIT' then
orderJSON.AddPair('ORDER_ID', orderID); orderJSON.AddPair('ORDER_ID', orderID);
console.log(orderJSON.GetValue('ORDER_ID'));
console.log(orderJSON);
if mode = 'ADD' then if mode = 'ADD' then
ShowNotification('Success:Order Added Successfully!') ShowNotification('Success:Order Added Successfully!')
...@@ -345,10 +413,15 @@ end; ...@@ -345,10 +413,15 @@ end;
procedure TFOrderEntryCuttingDie.AddCuttingDieOrder(orderJSON: TJSONObject); procedure TFOrderEntryCuttingDie.AddCuttingDieOrder(orderJSON: TJSONObject);
// sends the order JSON object to the server // sends the order JSON object to the server
var var
Response: TXDataClientResponse; Response: TXDataClientResponse;
jsObj: TJSObject;
begin begin
Response := await(XDataWebClient1.RawInvokeAsync('ILookupService.AddCuttingDieOrder', Response := await(XDataWebClient1.RawInvokeAsync('ILookupService.AddCuttingDieOrder',
[orderJSON.ToString])); [orderJSON.ToString]));
jsObj := JS.TJSObject(Response.Result);
if mode = 'ADD' then
OrderID := String(jsObj.Properties['OrderID']);
mode := 'EDIT';
end; end;
class function TFOrderEntryCuttingDie.CreateForm(AElementID, orderInfo, customerInfo, mode, info: string): TWebForm; class function TFOrderEntryCuttingDie.CreateForm(AElementID, orderInfo, customerInfo, mode, info: string): TWebForm;
...@@ -513,6 +586,10 @@ begin ...@@ -513,6 +586,10 @@ begin
XDataWebDataSet1.Open; XDataWebDataSet1.Open;
console.log(XDataWebDataSet1NAME.AsString); console.log(XDataWebDataSet1NAME.AsString);
dtpOrderDate.Date := 0;
dtpProofDate.Date := 0;
dtpShipDate.Date := 0;
xdwdsShipTo.Close; xdwdsShipTo.Close;
xdwdsShipTo.SetJSONData(customer['ADDRESS_LIST']); xdwdsShipTo.SetJSONData(customer['ADDRESS_LIST']);
xdwdsShipTo.Open; xdwdsShipTo.Open;
......
...@@ -1284,6 +1284,18 @@ object FOrderEntryWeb: TFOrderEntryWeb ...@@ -1284,6 +1284,18 @@ object FOrderEntryWeb: TFOrderEntryWeb
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = btnAddClick OnClick = btnAddClick
end end
object WebButton2: TWebButton
Left = 174
Top = 372
Width = 96
Height = 25
Caption = 'Add Address'
ChildOrder = 85
ElementID = 'btnaddaddress'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = WebButton2Click
end
object XDataWebClient1: TXDataWebClient object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection Connection = DMConnection.ApiConnection
Left = 160 Left = 160
......
...@@ -34,25 +34,25 @@ ...@@ -34,25 +34,25 @@
</div> </div>
</nav> </nav>
<div class="row mx-5"> <div class="row mx-5">
<h4 class="custom-h4 mt-3">Company</h4> <h4 class="custom-h4 mt-3">Customer</h4>
<hr class="custom-hr"> <hr class="custom-hr">
<div class="row"> <div class="row">
<div class="col-auto"> <div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">Company Name:</label> <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/> <input id="edtcompanyname" type="text" class="form-control" style="width: 300px;" required/>
<div class="invalid-feedback" style="font-size: 15px;"> <div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Company Name. Please Provide a Customer Name.
</div> </div>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">Account Company Name:</label> <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/> <input id="edtaccountcompanyname"type="text" class="form-control" style="width: 150px" required/>
<div class="invalid-feedback" style="font-size: 15px;"> <div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Company Account Name. Please Provide a Customer ID.
</div> </div>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<label for="wdbe_first_name" class="form-label mt-2">In Quickbooks?:</label> <label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">In Quickbooks?:</label>
<input id="edtinquickbooks"type="text" class="form-control" style="width: 150px"/> <input id="edtinquickbooks"type="text" class="form-control" style="width: 150px"/>
</div> </div>
</div> </div>
...@@ -103,6 +103,9 @@ ...@@ -103,6 +103,9 @@
<div class="invalid-feedback" style="font-size: 15px;"> <div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Ship To Address. Please Provide a Ship To Address.
</div> </div>
<div class="mt-2">
<button id="btnaddaddress" class="btn btn-primary btn-sm">Add Address</button>
</div>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">PO Number:</label> <label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">PO Number:</label>
......
...@@ -206,6 +206,7 @@ type ...@@ -206,6 +206,7 @@ type
tmrReturn: TWebTimer; tmrReturn: TWebTimer;
btnEdit: TWebButton; btnEdit: TWebButton;
btnAdd: TWebButton; btnAdd: TWebButton;
WebButton2: TWebButton;
procedure WebFormCreate(Sender: TObject); procedure WebFormCreate(Sender: TObject);
procedure HideNotification(); procedure HideNotification();
procedure ShowNotification(Notification: string); procedure ShowNotification(Notification: string);
...@@ -235,6 +236,9 @@ type ...@@ -235,6 +236,9 @@ type
procedure XDataWebDataSet1AfterEdit(DataSet: TDataSet); procedure XDataWebDataSet1AfterEdit(DataSet: TDataSet);
procedure dtpOrderDateChange(Sender: TObject); procedure dtpOrderDateChange(Sender: TObject);
procedure ViewMode(); procedure ViewMode();
procedure WebButton2Click(Sender: TObject);
procedure ShowAddAddressForm();
[async] procedure SendAddressToServer(AddressJSON: TJSONObject);
private private
FAgencyCode: string; FAgencyCode: string;
FCurrentReportType: string; FCurrentReportType: string;
...@@ -256,7 +260,73 @@ implementation ...@@ -256,7 +260,73 @@ implementation
{$R *.dfm} {$R *.dfm}
uses uses
View.Home, View.Main, View.AddOrder, Utils; View.Home, View.Main, View.AddOrder, View.AddAddress, Utils;
procedure TFOrderEntryWeb.WebButton2Click(Sender: TObject);
begin
ShowAddAddressForm();
end;
procedure TFOrderEntryWeb.SendAddressToServer(AddressJSON: TJSONObject);
var
Response: TXDataClientResponse;
notification: TJSObject;
begin
Response := await(XDataWebClient1.RawInvokeAsync('ILookupService.AddShippingAddress',
[AddressJSON.ToString]));
notification := TJSObject(Response.Result);
ShowNotification(string(notification['status']));
xdwdsShipTo.Close;
xdwdsShipTo.SetJSONData(notification['ADDRESS']);
xdwdsShipTo.Open;
end;
procedure TFOrderEntryWeb.ShowAddAddressForm;
// displays the search pop-up that allows the user to filter the order list
var
newform: TFViewAddAddress;
AddressJSON: TJSONObject;
ship_block: string;
begin
newform := TFViewAddAddress.CreateNew;
newform.Caption := 'Input Shipping Information';
newForm.Popup := True;
newForm.Border := fbDialog;
// used to manage Back button handling to close subform
window.location.hash := 'subform';
newform.ShowModal(
procedure(AValue: TModalResult)
var
searchOptions: string;
begin
if newform.confirm then
begin
AddressJSON := TJSONObject.Create;
AddressJSON.AddPair('address', newform.edtAddress.Text);
AddressJSON.AddPair('city', newform.edtCity.Text);
AddressJSON.AddPair('state', newform.edtState.Text);
AddressJSON.AddPair('zip', newform.edtZip.Text);
AddressJSON.AddPair('contact', newform.edtContact.Text);
AddressJSON.AddPair('customer_id', customerID);
ship_block := newform.edtFirstLine.Text + slinebreak +
edtCompanyName.Text + slinebreak +
newform.edtContact.Text + slinebreak +
newform.edtAddress.Text + slinebreak +
newform.edtCity.Text + ', ' + newform.edtState.Text + ' ' + newform.edtZip.Text;
AddressJSON.AddPair('ship_block', ship_block);
AddressJSON.AddPair('mode', 'ADD');
sendAddressToServer(AddressJSON);
end;
end
);
end;
procedure TFOrderEntryWeb.btnSaveClick(Sender: TObject); procedure TFOrderEntryWeb.btnSaveClick(Sender: TObject);
begin begin
...@@ -297,7 +367,6 @@ begin ...@@ -297,7 +367,6 @@ begin
input := TJSHTMLInputElement(document.getElementById('edtinvoiceto')); input := TJSHTMLInputElement(document.getElementById('edtinvoiceto'));
if edtInvoiceTo.Text = '' then if edtInvoiceTo.Text = '' then
begin begin
console.log('hot');
input.classList.add('is-invalid'); input.classList.add('is-invalid');
result := false; result := false;
end end
...@@ -530,7 +599,6 @@ var ...@@ -530,7 +599,6 @@ var
begin begin
// Call the server method to generate the PDF // Call the server method to generate the PDF
console.log(orderID);
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.GenerateOrderWebPDF', [orderID])); xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.GenerateOrderWebPDF', [orderID]));
jsObject := JS.TJSObject(xdcResponse.Result); jsObject := JS.TJSObject(xdcResponse.Result);
pdfURL := JS.toString(jsObject.Properties['value']); pdfURL := JS.toString(jsObject.Properties['value']);
...@@ -538,16 +606,21 @@ begin ...@@ -538,16 +606,21 @@ begin
// Open the PDF in a new browser tab without needing a different form // Open the PDF in a new browser tab without needing a different form
// This method is much faster too, even for large datasets // This method is much faster too, even for large datasets
window.open(pdfURL, '_blank'); window.open(pdfURL, '_blank');
console.log(pdfURL);
end; end;
procedure TFOrderEntryWeb.AddWebOrder(orderJSON: TJSONObject); procedure TFOrderEntryWeb.AddWebOrder(orderJSON: TJSONObject);
// sends the order JSON object to the server // sends the order JSON object to the server
var var
Response: TXDataClientResponse; Response: TXDataClientResponse;
jsObj: TJSObject;
begin begin
Response := await(XDataWebClient1.RawInvokeAsync('ILookupService.AddWebOrder', Response := await(XDataWebClient1.RawInvokeAsync('ILookupService.AddWebOrder',
[orderJSON.ToString])); [orderJSON.ToString]));
jsObj := JS.TJSObject(Response.Result);
if mode = 'ADD' then
OrderID := String(jsObj.Properties['OrderID']);
console.log(OrderID);
mode := 'EDIT';
end; end;
class function TFOrderEntryWeb.CreateForm(AElementID, orderInfo, customerInfo, mode, info: string): TWebForm; class function TFOrderEntryWeb.CreateForm(AElementID, orderInfo, customerInfo, mode, info: string): TWebForm;
...@@ -725,7 +798,6 @@ begin ...@@ -725,7 +798,6 @@ begin
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.GetWebOrder', xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.GetWebOrder',
[Order_ID])); [Order_ID]));
order := TJSObject(xdcResponse.Result); order := TJSObject(xdcResponse.Result);
console.log(order);
data := TJSArray(order['data']); data := TJSArray(order['data']);
XDataWebDataSet1.Close; XDataWebDataSet1.Close;
XDataWebDataSet1.SetJsonData(order); XDataWebDataSet1.SetJsonData(order);
...@@ -733,12 +805,10 @@ begin ...@@ -733,12 +805,10 @@ begin
if XDataWebDataSet1quantity_and_colors_qty_colors.Value <> '' then if XDataWebDataSet1quantity_and_colors_qty_colors.Value <> '' then
begin begin
colorObject := TJSObject(TJSJSON.parse(XDataWebDataSet1quantity_and_colors_qty_colors.Value)); colorObject := TJSObject(TJSJSON.parse(XDataWebDataSet1quantity_and_colors_qty_colors.Value));
console.log(colorObject);
colorList := TJSArray(colorObject['items']); colorList := TJSArray(colorObject['items']);
for I := 0 to colorList.length -1 do for I := 0 to colorList.length -1 do
begin begin
color := TJSObject(colorList[i]); color := TJSObject(colorList[i]);
console.log(color);
addColorRow(String(color['#']), string(color['Color']), string(color['LPI']), string(color['Size'])); addColorRow(String(color['#']), string(color['Color']), string(color['LPI']), string(color['Size']));
end; end;
end; end;
......
...@@ -129,11 +129,11 @@ object FViewOrders: TFViewOrders ...@@ -129,11 +129,11 @@ object FViewOrders: TFViewOrders
end end
item item
DataField = 'ID' DataField = 'ID'
Title = 'ID' Title = 'Customer ID'
end end
item item
DataField = 'companyName' DataField = 'companyName'
Title = 'Company Name' Title = 'Customer Name'
end end
item item
DataField = 'jobName' DataField = 'jobName'
...@@ -443,4 +443,10 @@ object FViewOrders: TFViewOrders ...@@ -443,4 +443,10 @@ object FViewOrders: TFViewOrders
Left = 346 Left = 346
Top = 412 Top = 412
end end
object tmrReturn: TWebTimer
Enabled = False
OnTimer = tmrReturnTimer
Left = 294
Top = 362
end
end end
...@@ -60,6 +60,7 @@ type ...@@ -60,6 +60,7 @@ type
lblMessage: TWebLabel; lblMessage: TWebLabel;
btnCloseNotification: TWebButton; btnCloseNotification: TWebButton;
xdwdsOrdersDBID: TStringField; xdwdsOrdersDBID: TStringField;
tmrReturn: TWebTimer;
procedure WebFormCreate(Sender: TObject); procedure WebFormCreate(Sender: TObject);
procedure btnAddOrderClick(Sender: TObject); procedure btnAddOrderClick(Sender: TObject);
procedure btnSearchClick(Sender: TObject); procedure btnSearchClick(Sender: TObject);
...@@ -71,6 +72,7 @@ type ...@@ -71,6 +72,7 @@ type
procedure wdbtcOrdersDblClickCell(Sender: TObject; ACol, ARow: Integer); procedure wdbtcOrdersDblClickCell(Sender: TObject; ACol, ARow: Integer);
procedure wdbtcOrdersClickCell(Sender: TObject; ACol, ARow: Integer); procedure wdbtcOrdersClickCell(Sender: TObject; ACol, ARow: Integer);
procedure WebButton1Click(Sender: TObject); procedure WebButton1Click(Sender: TObject);
procedure tmrReturnTimer(Sender: TObject);
private private
FChildForm: TWebForm; FChildForm: TWebForm;
procedure ClearTable(); procedure ClearTable();
...@@ -192,7 +194,7 @@ begin ...@@ -192,7 +194,7 @@ begin
DMConnection.ApiConnection.Connected := True; DMConnection.ApiConnection.Connected := True;
PageNumber := 1; PageNumber := 1;
TotalPages := 1; // Initial total pages TotalPages := 1; // Initial total pages
console.log(FViewMain.search = '');
if FViewMain.search = '' then if FViewMain.search = '' then
begin begin
//Status 1 //Status 1
...@@ -251,7 +253,8 @@ begin ...@@ -251,7 +253,8 @@ begin
else else
null2 := StrToBool(params.Values['null2']); null2 := StrToBool(params.Values['null2']);
end; end;
getOrders(GenerateSearchOptions()); FViewMain.search := GenerateSearchOptions();
getOrders(FViewMain.search);
end; end;
...@@ -393,6 +396,9 @@ begin ...@@ -393,6 +396,9 @@ begin
begin begin
if newform.confirm then if newform.confirm then
begin begin
asm
startSpinner();
end;
StatusJSON := TJSONObject.Create; StatusJSON := TJSONObject.Create;
StatusJSON.AddPair('ORDER_ID', OrderID); StatusJSON.AddPair('ORDER_ID', OrderID);
StatusJSON.AddPair('date', DateTimeToStr(newform.dtpDate.Date)); StatusJSON.AddPair('date', DateTimeToStr(newform.dtpDate.Date));
...@@ -403,16 +409,26 @@ begin ...@@ -403,16 +409,26 @@ begin
StatusJSON.AddPair('staff_fields_mount_due', DateToStr(newForm.dtpNewMountDue.Date)); StatusJSON.AddPair('staff_fields_mount_due', DateToStr(newForm.dtpNewMountDue.Date));
StatusJSON.AddPair('staff_fields_plate_due', DateToStr(newForm.dtpNewPlateDue.Date)); StatusJSON.AddPair('staff_fields_plate_due', DateToStr(newForm.dtpNewPlateDue.Date));
StatusJSON.AddPair('staff_fields_art_due', DateToStr(newForm.dtpNewArtDue.Date)); StatusJSON.AddPair('staff_fields_art_due', DateToStr(newForm.dtpNewArtDue.Date));
StatusJSON.AddPair('OrderType', NewForm.OrderType);
SetStatus(StatusJSON.ToString); SetStatus(StatusJSON.ToString);
OrderID := ''; OrderID := '';
getOrders(GenerateSearchOptions()); tmrReturn.Enabled := true;
end; end;
end end
); );
end; end;
procedure TFViewOrders.tmrReturnTimer(Sender: TObject);
begin
asm
endSpinner();
end;
tmrReturn.Enabled := false;
getOrders(fViewMain.search);
end;
procedure TFViewOrders.SetStatus(statusInfo: string); procedure TFViewOrders.SetStatus(statusInfo: string);
var var
xdcResponse: TXDataClientResponse; xdcResponse: TXDataClientResponse;
...@@ -712,7 +728,7 @@ end; ...@@ -712,7 +728,7 @@ end;
procedure TFViewOrders.btnSearchClick(Sender: TObject); procedure TFViewOrders.btnSearchClick(Sender: TObject);
var var
filterSection: TJSHTMLElement; filterSection: TJSHTMLElement;
begin begin
ShowSearchForm(); ShowSearchForm();
end; end;
......
...@@ -149,7 +149,7 @@ object FSearch: TFSearch ...@@ -149,7 +149,7 @@ object FSearch: TFSearch
Top = 56 Top = 56
Width = 107 Width = 107
Height = 14 Height = 14
Caption = 'Search Companies:' Caption = 'Search Customers:'
Font.Charset = ANSI_CHARSET Font.Charset = ANSI_CHARSET
Font.Color = clBlack Font.Color = clBlack
Font.Height = -11 Font.Height = -11
...@@ -162,9 +162,9 @@ object FSearch: TFSearch ...@@ -162,9 +162,9 @@ object FSearch: TFSearch
object lblCompanyID: TWebLabel object lblCompanyID: TWebLabel
Left = 174 Left = 174
Top = 56 Top = 56
Width = 68 Width = 72
Height = 14 Height = 14
Caption = 'Company ID:' Caption = 'Customer ID:'
Font.Charset = ANSI_CHARSET Font.Charset = ANSI_CHARSET
Font.Color = clBlack Font.Color = clBlack
Font.Height = -11 Font.Height = -11
...@@ -207,9 +207,9 @@ object FSearch: TFSearch ...@@ -207,9 +207,9 @@ object FSearch: TFSearch
object WebLabel5: TWebLabel object WebLabel5: TWebLabel
Left = 338 Left = 338
Top = 56 Top = 56
Width = 89 Width = 93
Height = 14 Height = 14
Caption = 'Company Name:' Caption = 'Customer Name:'
Font.Charset = ANSI_CHARSET Font.Charset = ANSI_CHARSET
Font.Color = clBlack Font.Color = clBlack
Font.Height = -11 Font.Height = -11
...@@ -457,7 +457,7 @@ object FSearch: TFSearch ...@@ -457,7 +457,7 @@ object FSearch: TFSearch
Font.Name = 'Segoe UI' Font.Name = 'Segoe UI'
Font.Style = [] Font.Style = []
ID = '' ID = ''
Width = 40.000000000000000000 Width = 80.000000000000000000
end end
item item
BorderWidth = 1 BorderWidth = 1
...@@ -502,7 +502,7 @@ object FSearch: TFSearch ...@@ -502,7 +502,7 @@ object FSearch: TFSearch
Font.Name = 'Segoe UI' Font.Name = 'Segoe UI'
Font.Style = [] Font.Style = []
ID = '' ID = ''
Width = 320.000000000000000000 Width = 280.000000000000000000
end end
item item
BorderWidth = 1 BorderWidth = 1
...@@ -717,8 +717,8 @@ object FSearch: TFSearch ...@@ -717,8 +717,8 @@ object FSearch: TFSearch
object xdwdsCustomersstaff_fields_invoice_to: TStringField object xdwdsCustomersstaff_fields_invoice_to: TStringField
FieldName = 'staff_fields_invoice_to' FieldName = 'staff_fields_invoice_to'
end end
object xdwdsCustomersID: TIntegerField object xdwdsCustomersCUSTOMER_ID: TIntegerField
FieldName = 'ID' FieldName = 'CUSTOMER_ID'
end end
end end
object wdsCustomers: TWebDataSource object wdsCustomers: TWebDataSource
......
...@@ -55,7 +55,7 @@ type ...@@ -55,7 +55,7 @@ type
WebLabel5: TWebLabel; WebLabel5: TWebLabel;
edtCompanyName: TWebEdit; edtCompanyName: TWebEdit;
xdwdsCustomersSHORT_NAME: TStringField; xdwdsCustomersSHORT_NAME: TStringField;
xdwdsCustomersID: TIntegerField; xdwdsCustomersCUSTOMER_ID: TIntegerField;
procedure btnConfirmClick(Sender: TObject); procedure btnConfirmClick(Sender: TObject);
procedure WebFormShow(Sender: TObject); procedure WebFormShow(Sender: TObject);
procedure btnCancelClick(Sender: TObject); procedure btnCancelClick(Sender: TObject);
...@@ -116,7 +116,6 @@ begin ...@@ -116,7 +116,6 @@ begin
DateFormatSettings := TFormatSettings.Create; DateFormatSettings := TFormatSettings.Create;
DateFormatSettings.ShortDateFormat := 'yyyy/mm/dd'; DateFormatSettings.ShortDateFormat := 'yyyy/mm/dd';
console.log(UpperCase(Copy(params.Values['orderType'], 1, 1)) + LowerCase(Copy(params.Values['orderType'], 2, MaxInt)));
wcbOrderType.Text := UpperCase(Copy(params.Values['orderType'], 1, 1)) + LowerCase(Copy(params.Values['orderType'], 2, MaxInt)); wcbOrderType.Text := UpperCase(Copy(params.Values['orderType'], 1, 1)) + LowerCase(Copy(params.Values['orderType'], 2, MaxInt));
edtOrderID.Text := params.Values['orderID']; edtOrderID.Text := params.Values['orderID'];
edtCompanyID.Text := params.Values['companyID']; edtCompanyID.Text := params.Values['companyID'];
...@@ -279,9 +278,9 @@ begin ...@@ -279,9 +278,9 @@ begin
// Set up column headers // Set up column headers
TMSFNCGrid1.ColumnCount := 4; TMSFNCGrid1.ColumnCount := 4;
TMSFNCGrid1.RowCount := 1; TMSFNCGrid1.RowCount := 1;
TMSFNCGrid1.Cells[0, 0] := 'DBID'; TMSFNCGrid1.Cells[0, 0] := 'Customer Num';
TMSFNCGrid1.Cells[1, 0] := 'ID'; TMSFNCGrid1.Cells[1, 0] := 'Customer ID';
TMSFNCGrid1.Cells[2, 0] := 'Name'; TMSFNCGrid1.Cells[2, 0] := 'Customer Name';
TMSFNCGrid1.Cells[3, 0] := 'Address'; TMSFNCGrid1.Cells[3, 0] := 'Address';
// Populate the grid with data from the dataset // Populate the grid with data from the dataset
...@@ -291,7 +290,7 @@ begin ...@@ -291,7 +290,7 @@ begin
while not xdwdsCustomers.EOF do while not xdwdsCustomers.EOF do
begin begin
TMSFNCGrid1.RowCount := RowIndex + 1; TMSFNCGrid1.RowCount := RowIndex + 1;
TMSFNCGrid1.Cells[0, RowIndex] := xdwdsCustomers.FieldByName('ID').AsString; TMSFNCGrid1.Cells[0, RowIndex] := xdwdsCustomers.FieldByName('CUSTOMER_ID').AsString;
TMSFNCGrid1.Cells[1, RowIndex] := xdwdsCustomers.FieldByName('SHORT_NAME').AsString; TMSFNCGrid1.Cells[1, RowIndex] := xdwdsCustomers.FieldByName('SHORT_NAME').AsString;
TMSFNCGrid1.Cells[2, RowIndex] := xdwdsCustomers.FieldByName('NAME').AsString; TMSFNCGrid1.Cells[2, RowIndex] := xdwdsCustomers.FieldByName('NAME').AsString;
TMSFNCGrid1.Cells[3, RowIndex] := xdwdsCustomers.FieldByName('staff_fields_invoice_to').AsString; TMSFNCGrid1.Cells[3, RowIndex] := xdwdsCustomers.FieldByName('staff_fields_invoice_to').AsString;
......
object FAddOrder: TFAddOrder object FSelectCustomer: TFSelectCustomer
Width = 894 Width = 765
Height = 633 Height = 480
Align = alClient OnCreate = WebFormCreate
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
OnShow = WebFormShow OnShow = WebFormShow
object cbWebPlate: TWebCheckBox object WebLabel1: TWebLabel
Left = 172 Left = 8
Top = 55 Top = 81
Width = 113 Width = 95
Height = 22 Height = 15
Caption = 'Web Plate' Caption = 'Search Customers'
ChildOrder = 5
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthStyle = ssAuto
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = cbWebPlateClick
end end
object cbCorrugatedPlate: TWebCheckBox object WebLabel2: TWebLabel
Left = 40 Left = 279
Top = 55 Top = 81
Width = 113 Width = 134
Height = 22 Height = 15
Caption = 'Corrugated Plate' Caption = 'Selected Customer Name'
Checked = True
ChildOrder = 5
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
State = cbChecked
WidthStyle = ssAuto
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = cbCorrugatedPlateClick
end end
object edtSearch: TWebEdit object WebLabel3: TWebLabel
Left = 306 Left = 131
Top = 55 Top = 81
Width = 146 Width = 113
Height = 22 Height = 15
ChildOrder = 8 Caption = 'Selected Customer ID'
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthStyle = ssAuto
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnChange = edtSearchChange
end end
object edtID: TWebEdit object edtSearch: TWebEdit
Left = 475 Left = 4
Top = 55 Top = 102
Width = 121 Width = 121
Height = 22 Height = 22
ChildOrder = 8 ChildOrder = 2
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthStyle = ssAuto
WidthPercent = 100.000000000000000000
end
object btnConfirm: TWebButton
Left = 612
Top = 52
Width = 96
Height = 25
Caption = 'Confirm'
ChildOrder = 9
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthStyle = ssAuto
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = btnConfirmClick
end end
object btnCancel: TWebButton object edtName: TWebEdit
Left = 730 Left = 279
Top = 52 Top = 102
Width = 96 Width = 142
Height = 25 Height = 22
Caption = 'Cancel' ChildOrder = 1
ChildOrder = 9 Enabled = False
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthStyle = ssAuto
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = btnCancelClick
end end
object TMSFNCGrid1: TTMSFNCGrid object TMSFNCGrid1: TTMSFNCGrid
Left = 0 Left = 0
Top = 220 Top = 163
Width = 894 Width = 765
Height = 413 Height = 317
Align = alBottom Align = alBottom
ParentDoubleBuffered = False ParentDoubleBuffered = False
DoubleBuffered = True DoubleBuffered = True
TabOrder = 6 TabOrder = 2
DefaultRowHeight = 40.000000000000000000 DefaultRowHeight = 40.000000000000000000
FixedColumns = 0 FixedColumns = 0
ColumnCount = 3 ColumnCount = 4
Options.Bands.Enabled = True Options.Bands.Enabled = True
Options.ColumnSize.Stretch = True Options.ColumnSize.Stretch = True
Options.Editing.CalcFormat = '%g' Options.Editing.CalcFormat = '%g'
...@@ -121,7 +84,7 @@ object FAddOrder: TFAddOrder ...@@ -121,7 +84,7 @@ object FAddOrder: TFAddOrder
Font.Name = 'Segoe UI' Font.Name = 'Segoe UI'
Font.Style = [] Font.Style = []
ID = '' ID = ''
Width = 327.000000000000000000 Width = 90.000000000000000000
end end
item item
BorderWidth = 1 BorderWidth = 1
...@@ -136,7 +99,7 @@ object FAddOrder: TFAddOrder ...@@ -136,7 +99,7 @@ object FAddOrder: TFAddOrder
Font.Name = 'Segoe UI' Font.Name = 'Segoe UI'
Font.Style = [] Font.Style = []
ID = '' ID = ''
Width = 327.000000000000000000 Width = 150.000000000000000000
end end
item item
BorderWidth = 1 BorderWidth = 1
...@@ -151,7 +114,37 @@ object FAddOrder: TFAddOrder ...@@ -151,7 +114,37 @@ object FAddOrder: TFAddOrder
Font.Name = 'Segoe UI' Font.Name = 'Segoe UI'
Font.Style = [] Font.Style = []
ID = '' ID = ''
Width = 239.000000000000000000 Width = 200.000000000000000000
end
item
BorderWidth = 1
FixedFont.Charset = DEFAULT_CHARSET
FixedFont.Color = 4539717
FixedFont.Height = -11
FixedFont.Name = 'Segoe UI'
FixedFont.Style = [fsBold]
Font.Charset = DEFAULT_CHARSET
Font.Color = 8026746
Font.Height = -11
Font.Name = 'Segoe UI'
Font.Style = []
ID = ''
Width = 306.000000000000000000
end
item
BorderWidth = 1
FixedFont.Charset = DEFAULT_CHARSET
FixedFont.Color = 4539717
FixedFont.Height = -11
FixedFont.Name = 'Segoe UI'
FixedFont.Style = [fsBold]
Font.Charset = DEFAULT_CHARSET
Font.Color = 8026746
Font.Height = -11
Font.Name = 'Segoe UI'
Font.Style = []
ID = ''
Width = 90.000000000000000000
end> end>
DefaultFont.Charset = DEFAULT_CHARSET DefaultFont.Charset = DEFAULT_CHARSET
DefaultFont.Color = clWindowText DefaultFont.Color = clWindowText
...@@ -211,30 +204,115 @@ object FAddOrder: TFAddOrder ...@@ -211,30 +204,115 @@ object FAddOrder: TFAddOrder
LeftCol = 0 LeftCol = 0
ScrollMode = scmItemScrolling ScrollMode = scmItemScrolling
DesignTimeSampleData = True DesignTimeSampleData = True
ExplicitWidth = 982 OnCellClick = TMSFNCGrid1CellClick
end
object btnCancel: TWebButton
Left = 556
Top = 101
Width = 96
Height = 25
Caption = 'Cancel'
ChildOrder = 5
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object btnConfirm: TWebButton
Left = 440
Top = 101
Width = 96
Height = 25
Caption = 'Select'
ChildOrder = 5
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnConfirmClick
end
object edtNotification: TWebEdit
Left = 4
Top = 16
Width = 510
Height = 22
HelpType = htKeyword
TabStop = False
ChildOrder = 8
ElementFont = efCSS
Enabled = False
Font.Charset = ANSI_CHARSET
Font.Color = clRed
Font.Height = -13
Font.Name = 'Arial'
Font.Style = []
HeightPercent = 100.000000000000000000
HideSelection = False
ParentFont = False
TabOrder = 1
WidthPercent = 100.000000000000000000
end
object edtID: TWebEdit
Left = 131
Top = 102
Width = 142
Height = 22
ChildOrder = 1
Enabled = False
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end end
object XDataWebClient1: TXDataWebClient object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection Connection = DMConnection.ApiConnection
Left = 370 Left = 630
Top = 562 Top = 47
end end
object xdwdsCustomers: TXDataWebDataSet object xdwdsCustomers: TXDataWebDataSet
Connection = DMConnection.ApiConnection Connection = DMConnection.ApiConnection
Left = 206 Left = 166
Top = 564 Top = 129
object xdwdsCustomersID: TIntegerField object xdwdsCustomersBillAddr: TStringField
FieldName = 'ID' FieldName = 'BillAddr'
end
object xdwdsCustomersCompanyName: TStringField
FieldName = 'CompanyName'
end
object xdwdsCustomersId: TStringField
FieldName = 'Id'
end
object xdwdsCustomersPrimaryPhone: TStringField
FieldName = 'PrimaryPhone'
end
object xdwdsCustomersShipAddr: TStringField
FieldName = 'ShipAddr'
end
object xdwdsCustomersShipAddrLine1: TStringField
FieldName = 'ShipAddrLine1'
end
object xdwdsCustomersShipAddrCity: TStringField
FieldName = 'ShipAddrCity'
end
object xdwdsCustomersShipAddrState: TStringField
FieldName = 'ShipAddrState'
end
object xdwdsCustomersShipAddrZip: TStringField
FieldName = 'ShipAddrZip'
end
object xdwdsCustomersBillAddrLine1: TStringField
FieldName = 'BillAddrLine1'
end
object xdwdsCustomersBillAddrCity: TStringField
FieldName = 'BillAddrCity'
end
object xdwdsCustomersBillAddrState: TStringField
FieldName = 'BillAddrState'
end end
object xdwdsCustomersNAME: TStringField object xdwdsCustomersBillAddrZip: TStringField
FieldName = 'NAME' FieldName = 'BillAddrZip'
end end
object xdwdsCustomersSHORT_NAME: TStringField object xdwdsCustomersInKGOrders: TBooleanField
FieldName = 'SHORT_NAME' FieldName = 'In KGOrders'
end end
end end
object wdsCustomers: TWebDataSource object wdsCustomers: TWebDataSource
DataSet = xdwdsCustomers DataSet = xdwdsCustomers
Left = 38 Left = 104
Top = 562 Top = 135
end end
end end
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>TMS Web Project</title>
<style>
</style>
</head>
<body>
</body>
</html>
\ No newline at end of file
unit View.SelectCustomer;
interface
uses
System.SysUtils, System.Generics.Collections, System.Classes, JS, Web, WEBLib.Graphics, WEBLib.Controls,
WEBLib.Forms, WEBLib.Dialogs, WEBLib.Menus, WEBLib.ExtCtrls, WEBLib.StdCtrls,
WEBLib.JSON, Auth.Service, XData.Web.Client, WebLib.Storage,
ConnectionModule, App.Types, Vcl.StdCtrls, Vcl.Controls, WEBLib.DBCtrls,
Data.DB, XData.Web.JsonDataset, XData.Web.Dataset, WEBLib.DB, VCL.TMSFNCTypes, VCL.TMSFNCUtils,
VCL.TMSFNCGraphics, VCL.TMSFNCGraphicsTypes, VCL.TMSFNCGridCell,
VCL.TMSFNCGridOptions, VCL.TMSFNCCustomControl, VCL.TMSFNCCustomScrollControl,
VCL.TMSFNCGridData, VCL.TMSFNCCustomGrid, VCL.TMSFNCGrid;
type
TFSelectCustomer = class(TWebForm)
WebLabel1: TWebLabel;
WebLabel2: TWebLabel;
edtSearch: TWebEdit;
edtName: TWebEdit;
TMSFNCGrid1: TTMSFNCGrid;
btnCancel: TWebButton;
btnConfirm: TWebButton;
edtNotification: TWebEdit;
XDataWebClient1: TXDataWebClient;
xdwdsCustomers: TXDataWebDataSet;
wdsCustomers: TWebDataSource;
xdwdsCustomersBillAddr: TStringField;
xdwdsCustomersCompanyName: TStringField;
xdwdsCustomersId: TStringField;
xdwdsCustomersPrimaryPhone: TStringField;
xdwdsCustomersShipAddr: TStringField;
xdwdsCustomersShipAddrLine1: TStringField;
xdwdsCustomersShipAddrCity: TStringField;
xdwdsCustomersShipAddrState: TStringField;
xdwdsCustomersShipAddrZip: TStringField;
xdwdsCustomersBillAddrLine1: TStringField;
xdwdsCustomersBillAddrCity: TStringField;
xdwdsCustomersBillAddrState: TStringField;
xdwdsCustomersBillAddrZip: TStringField;
WebLabel3: TWebLabel;
edtID: TWebEdit;
xdwdsCustomersInKGOrders: TBooleanField;
procedure WebFormCreate(Sender: TObject);
procedure WebFormShow(Sender: TObject);
procedure TMSFNCGrid1CellDblClick(Sender: TObject; ACol, ARow: Integer);
procedure btnConfirmClick(Sender: TObject);
procedure TMSFNCGrid1CellClick(Sender: TObject; ACol, ARow: Integer);
private
{ Private declarations }
[Async] procedure GetCustomers();
[Async] procedure SendCustomerToServer();
procedure PopulateGridManually();
public
{ Public declarations }
end;
var
FSelectCustomer: TFSelectCustomer;
implementation
{$R *.dfm}
uses View.Main;
procedure TFSelectCustomer.WebFormCreate(Sender: TObject);
begin
if not DMConnection.ApiConnection.Connected then
begin
DMConnection.ApiConnection.OpenAsync;
console.log('report requirements connection open')
end;
end;
procedure TFSelectCustomer.WebFormShow(Sender: TObject);
begin
asm
startSpinner();
end;
getCustomers();
end;
procedure TFSelectCustomer.btnConfirmClick(Sender: TObject);
begin
if edtID.Text = '' then
edtNotification.Text := 'Please Select a Customer'
else
begin
xdwdsCustomers.Locate('Id', edtID.Text, []);
SendCustomerToServer();
end;
end;
[async] procedure TFSelectCustomer.getCustomers();
// retrieves customer list from server
var
xdcResponse: TXDataClientResponse;
customerList: TJSObject;
i: integer;
begin
// Fetch data from XData service
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.getQBCustomers', []));
customerList := TJSObject(xdcResponse.Result);
//console.log(customerList);
// Load data into TXDataWebDataset
xdwdsCustomers.Close;
xdwdsCustomers.SetJsonData(customerList);
xdwdsCustomers.Open;
// Manually populate the grid
PopulateGridManually;
asm
endSpinner();
end;
end;
procedure TFSelectCustomer.PopulateGridManually;
// populates the grid with customers manually.
var
RowIndex: Integer;
begin
TMSFNCGrid1.BeginUpdate;
try
TMSFNCGrid1.Clear; // Clear any existing data
// Set up column headers
TMSFNCGrid1.ColumnCount := 4;
TMSFNCGrid1.RowCount := 1;
TMSFNCGrid1.Cells[0, 0] := 'Quickbooks ID';
TMSFNCGrid1.Cells[1, 0] := 'Customer Name';
TMSFNCGrid1.Cells[2, 0] := 'Address';
TMSFNCGrid1.Cells[3, 0] := 'In KGOrders';
// Populate the grid with data from the dataset
xdwdsCustomers.First;
RowIndex := 1;
while not xdwdsCustomers.EOF do
begin
TMSFNCGrid1.RowCount := RowIndex + 1;
TMSFNCGrid1.Cells[0, RowIndex] := xdwdsCustomers.FieldByName('Id').AsString;
TMSFNCGrid1.Cells[1, RowIndex] := xdwdsCustomers.FieldByName('CompanyName').AsString;
TMSFNCGrid1.Cells[2, RowIndex] := xdwdsCustomers.FieldByName('BillAddr').AsString;
TMSFNCGrid1.Cells[3, RowIndex] := xdwdsCustomers.FieldByName('In KGOrders').AsString;
Inc(RowIndex);
xdwdsCustomers.Next;
end;
finally
TMSFNCGrid1.EndUpdate;
end;
end;
procedure TFSelectCustomer.TMSFNCGrid1CellClick(Sender: TObject; ACol,
ARow: Integer);
begin
edtID.Text := TMSFNCGrid1.Cells[0, ARow];
edtName.Text := TMSFNCGrid1.Cells[1, ARow];
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;
var
CustomerJSON: TJSONObject;
Response: TXDataClientResponse;
notification: TJSObject;
begin
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');
asm
startSpinner()
end;
Response := await(XDataWebClient1.RawInvokeAsync('ILookupService.ImportQBCustomer',
[customerJSON.ToString]));
notification := TJSObject(Response.Result);
asm
endSpinner();
end;
FViewMain.ViewAddCustomer(string(notification['CustomerID']), string(notification['status']));
Close();
end;
end.
\ No newline at end of file
...@@ -191,27 +191,7 @@ object FSetStatus: TFSetStatus ...@@ -191,27 +191,7 @@ object FSetStatus: TFSetStatus
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
ItemIndex = -1 ItemIndex = -1
LookupValues = < LookupValues = <>
item
Value = 'PROOF'
DisplayText = 'Proof Done'
end
item
Value = 'ART'
DisplayText = 'Art Done'
end
item
Value = 'PLATE'
DisplayText = 'Plate Done'
end
item
Value = 'MOUNT'
DisplayText = 'Mount Done'
end
item
Value = 'SHIP'
DisplayText = 'Ship Done'
end>
end end
object dtpDate: TWebDateTimePicker object dtpDate: TWebDateTimePicker
Left = 484 Left = 484
......
...@@ -78,6 +78,10 @@ begin ...@@ -78,6 +78,10 @@ begin
end; end;
procedure TFSetStatus.WebFormShow(Sender: TObject); procedure TFSetStatus.WebFormShow(Sender: TObject);
var
ItemsToRemove: TStringList;
i: integer;
filteredItems: TJSArray;
begin begin
HideNotification(); HideNotification();
edtOrderID.Text := OrderID; edtOrderID.Text := OrderID;
...@@ -91,14 +95,17 @@ begin ...@@ -91,14 +95,17 @@ begin
dtpNewMountDue.Date := 0; dtpNewMountDue.Date := 0;
dtpNewPlateDue.Date := 0; dtpNewPlateDue.Date := 0;
dtpNewArtDue.Date := 0; dtpNewArtDue.Date := 0;
ItemsToRemove := TStringList.Create;
if orderType = 'web plate' then if orderType = 'web plate' then
begin begin
dtpNewMountDue.Visible := false; dtpNewMountDue.Visible := false;
dtpMountDue.Visible := false; dtpMountDue.Visible := false;
lblMount.Visible := false; lblMount.Visible := false;
lblMountNew.Visible := false; lblMountNew.Visible := false;
wlcbStatus.LookupValues.AddPair('PROOF', 'Proof Done');
wlcbStatus.LookupValues.AddPair('Art', 'Art Done');
wlcbStatus.LookupValues.AddPair('PLATE', 'Plate Done');
wlcbStatus.LookupValues.AddPair('SHIP', 'Ship Done');
end end
else if orderType = 'cutting die' then else if orderType = 'cutting die' then
begin begin
...@@ -116,9 +123,18 @@ begin ...@@ -116,9 +123,18 @@ begin
dtpNewArtDue.Visible := false; dtpNewArtDue.Visible := false;
lblArt.Visible := false; lblArt.Visible := false;
lblArtNew.Visible := false; lblArtNew.Visible := false;
end;
wlcbStatus.LookupValues.AddPair('PROOF', 'Proof Done');
wlcbStatus.LookupValues.AddPair('SHIP', 'Ship Done');
end
else
begin
wlcbStatus.LookupValues.AddPair('PROOF', 'Proof Done');
wlcbStatus.LookupValues.AddPair('Art', 'Art Done');
wlcbStatus.LookupValues.AddPair('PLATE', 'Plate Done');
wlcbStatus.LookupValues.AddPair('MOUNT', 'Mount Done');
wlcbStatus.LookupValues.AddPair('SHIP', 'Ship Done');
end;
end; end;
procedure TFSetStatus.HideNotification; procedure TFSetStatus.HideNotification;
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
<th scope="col">Email Address</th> <th scope="col">Email Address</th>
<th scope="col">Access Type</th> <th scope="col">Access Type</th>
<th scope="col">System Rights</th> <th scope="col">System Rights</th>
<th scope="col">Perspective ID</th>
<th scope="col">QB ID</th> <th scope="col">QB ID</th>
<th scope="col">Edit</th> <th scope="col">Edit</th>
</tr> </tr>
......
...@@ -433,12 +433,6 @@ begin ...@@ -433,12 +433,6 @@ begin
Cell.innerText := IntToStr(Rights); Cell.innerText := IntToStr(Rights);
NewRow.appendChild(Cell); NewRow.appendChild(Cell);
// Perspective ID Cell
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Perspective ID');
Cell.innerText := PID;
NewRow.appendChild(Cell);
// QB ID Cell // QB ID Cell
Cell := TJSHTMLElement(document.createElement('td')); Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'QB ID'); Cell.setAttribute('data-label', 'QB ID');
......
program webKGOrders; program webKGOrders;
uses uses
...@@ -24,6 +25,10 @@ uses ...@@ -24,6 +25,10 @@ uses
View.SetStatus in 'View.SetStatus.pas' {FSetStatus: TWebForm} {*.html}, View.SetStatus in 'View.SetStatus.pas' {FSetStatus: TWebForm} {*.html},
View.OrderEntryCuttingDie in 'View.OrderEntryCuttingDie.pas' {FOrderEntryCuttingDie: TWebForm} {*.html}, View.OrderEntryCuttingDie in 'View.OrderEntryCuttingDie.pas' {FOrderEntryCuttingDie: TWebForm} {*.html},
View.OrderEntryWeb in 'View.OrderEntryWeb.pas' {FOrderEntryWeb: TWebForm} {*.html}, View.OrderEntryWeb in 'View.OrderEntryWeb.pas' {FOrderEntryWeb: TWebForm} {*.html},
View.Customers in 'View.Customers.pas' {FViewCustomers: TWebForm} {*.html},
AddCustomer in 'AddCustomer.pas' {FViewAddCustomer: TWebForm} {*.html},
View.AddAddress in 'View.AddAddress.pas' {FViewAddAddress: TWebForm} {*.html},
View.SelectCustomer in 'View.SelectCustomer.pas' {FSelectCustomer: TWebForm} {*.html};
Utils in 'Utils.pas'; Utils in 'Utils.pas';
{$R *.res} {$R *.res}
......
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ProjectGuid>{DB6F5DBF-7E4B-45DA-AFFA-6C8DF15BA740}</ProjectGuid> <ProjectGuid>{DB6F5DBF-7E4B-45DA-AFFA-6C8DF15BA740}</ProjectGuid>
<ProjectVersion>20.2</ProjectVersion> <ProjectVersion>20.2</ProjectVersion>
...@@ -185,6 +185,26 @@ ...@@ -185,6 +185,26 @@
<Form>FOrderEntryWeb</Form> <Form>FOrderEntryWeb</Form>
<DesignClass>TWebForm</DesignClass> <DesignClass>TWebForm</DesignClass>
</DCCReference> </DCCReference>
<DCCReference Include="View.Customers.pas">
<Form>FViewCustomers</Form>
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
<DCCReference Include="AddCustomer.pas">
<Form>FViewAddCustomer</Form>
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
<DCCReference Include="View.AddAddress.pas">
<Form>FViewAddAddress</Form>
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
<DCCReference Include="View.SelectCustomer.pas">
<Form>FSelectCustomer</Form>
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
<DCCReference Include="Utils.pas"/> <DCCReference Include="Utils.pas"/>
<None Include="index.html"/> <None Include="index.html"/>
<None Include="css\app.css"/> <None Include="css\app.css"/>
...@@ -220,6 +240,12 @@ ...@@ -220,6 +240,12 @@
<Deployment Version="5"> <Deployment Version="5">
<DeployFile LocalName="Win32\Debug\webCharms.exe" Configuration="Debug" Class="ProjectOutput"/> <DeployFile LocalName="Win32\Debug\webCharms.exe" Configuration="Debug" Class="ProjectOutput"/>
<DeployFile LocalName="Win32\Debug\webKGOrders.exe" Configuration="Debug" Class="ProjectOutput"/> <DeployFile LocalName="Win32\Debug\webKGOrders.exe" Configuration="Debug" Class="ProjectOutput"/>
<DeployFile LocalName="Win32\Debug\webKGOrders.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>webKGOrders.exe</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="Win32\Release\webKGOrders.exe" Configuration="Release" Class="ProjectOutput"> <DeployFile LocalName="Win32\Release\webKGOrders.exe" Configuration="Release" Class="ProjectOutput">
<Platform Name="Win32"> <Platform Name="Win32">
<RemoteName>webKGOrders.exe</RemoteName> <RemoteName>webKGOrders.exe</RemoteName>
...@@ -227,6 +253,12 @@ ...@@ -227,6 +253,12 @@
</Platform> </Platform>
</DeployFile> </DeployFile>
<DeployFile LocalName="config\config.json" Configuration="Debug" Class="ProjectFile"/> <DeployFile LocalName="config\config.json" Configuration="Debug" Class="ProjectFile"/>
<DeployFile LocalName="config\config.json" Configuration="Debug" Class="ProjectFile">
<Platform Name="Win32">
<RemoteDir>.\</RemoteDir>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="config\config.json" Configuration="Release" Class="ProjectFile"> <DeployFile LocalName="config\config.json" Configuration="Release" Class="ProjectFile">
<Platform Name="Win32"> <Platform Name="Win32">
<RemoteDir>.\</RemoteDir> <RemoteDir>.\</RemoteDir>
...@@ -234,6 +266,12 @@ ...@@ -234,6 +266,12 @@
</Platform> </Platform>
</DeployFile> </DeployFile>
<DeployFile LocalName="css\app.css" Configuration="Debug" Class="ProjectFile"/> <DeployFile LocalName="css\app.css" Configuration="Debug" Class="ProjectFile"/>
<DeployFile LocalName="css\app.css" Configuration="Debug" Class="ProjectFile">
<Platform Name="Win32">
<RemoteDir>.\</RemoteDir>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="css\app.css" Configuration="Release" Class="ProjectFile"> <DeployFile LocalName="css\app.css" Configuration="Release" Class="ProjectFile">
<Platform Name="Win32"> <Platform Name="Win32">
<RemoteDir>.\</RemoteDir> <RemoteDir>.\</RemoteDir>
...@@ -247,6 +285,12 @@ ...@@ -247,6 +285,12 @@
</Platform> </Platform>
</DeployFile> </DeployFile>
<DeployFile LocalName="index.html" Configuration="Debug" Class="ProjectFile"/> <DeployFile LocalName="index.html" Configuration="Debug" Class="ProjectFile"/>
<DeployFile LocalName="index.html" Configuration="Debug" Class="ProjectFile">
<Platform Name="Win32">
<RemoteDir>.\</RemoteDir>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="index.html" Configuration="Release" Class="ProjectFile"> <DeployFile LocalName="index.html" Configuration="Release" Class="ProjectFile">
<Platform Name="Win32"> <Platform Name="Win32">
<RemoteDir>.\</RemoteDir> <RemoteDir>.\</RemoteDir>
......
unit QBService;
interface
uses
XData.Service.Common,
Aurelius.Mapping.Attributes,
System.JSON,
System.Generics.Collections,
System.Classes;
type
[ServiceContract]
IQBService = interface(IInvokable)
['{D119A273-0644-484B-B75E-B6FE57BB422C}']
[HttpGet] function getCustomers(): TJSONArray;
end;
implementation
initialization
RegisterServiceType(TypeInfo(IQBService));
end.
unit QBServiceImplementation;
interface
uses
XData.Server.Module,
XData.Service.Common,
Api.Database, Data.DB, frxClass, frxExportPDF, JS, System.Hash, System.JSON,
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, MemDS, DBAccess, Uni,
hyiedefs, hyieutils, iexBitmaps, iesettings, iexLayers, iexRulers,
iexToolbars, iexUserInteractions, imageenio, imageenproc, QuickRpt, QRCtrls,
dbimageen, Vcl.ExtCtrls, ieview, imageenview, IdBaseComponent, IdComponent,
IdTCPConnection, IdTCPClient, IdExplicitTLSClientServerBase, IdFTP,
iexProcEffects, frCoreClasses, Common.Logging,
DateUtils, QBService, WEBLib.REST, WEBLib.WebTools,System.Net.HttpClient,
System.Net.URLClient, System.Net.HttpClientComponent, System.netencoding,
IdHTTP, IdSSLOpenSSL, IdSSLOpenSSLHeaders, System.IniFiles, REST.Client, REST.Types;
type
[ServiceImplementation]
TQBService = class(TInterfacedObject, IQBService)
private
procedure SaveTokens(AccessToken, RefreshToken: string);
function getCustomers(): TJSONArray;
function refreshAccessToken(): string;
var
AccessToken,RefreshToken,CompanyID,Client,Secret: string;
LastRefresh: TDateTime;
end;
implementation
function TQBService.getCustomers: TJSONArray;
var
restClient: TRESTClient;
restRequest: TRESTRequest;
restResponse: TRESTResponse;
param: TRESTRequestParameter;
res: string;
jsValue: TJSONValue;
Customer: TJSONValue;
jsObj: TJSONObject;
CustomerList: TJSONArray;
pair: TJSONPair;
begin
restClient := TRESTClient.Create(nil);
restClient.BaseURL := 'https://sandbox-quickbooks.api.intuit.com';
restRequest := TRESTRequest.Create(nil);
restRequest.Client := restClient;
restResponse := TRESTResponse.Create(nil);
restRequest.Response := restResponse;
if MinutesBetween(Now, LastRefresh) > 58 then
begin
RefreshAccessToken();
end;
restRequest.Method := rmGET;
//GET /v3/company/<realmId>/customer/<customerId>
res := '/v3/company/' + companyid + '/customer/58';
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;
jsObj := TJSONObject(jsValue);
CustomerList := TJSONArray( TJSONObject( jsObj.GetValue('QueryResponse') ).GetValue('Customer')) ;
result := CustomerList;
// LoadJSONArray( CustomerList );
restClient.Free;
restRequest.Free;
restResponse.Free;
end;
function TQBService.RefreshAccessToken: string;
// Refresh Token changes so make sure to save refresh token.
var
IdHTTP: TIdHTTP;
SSLIO: TIdSSLIOHandlerSocketOpenSSL;
RequestStream: TStringStream;
EncodedAuth, EncodedAuth2, PostData, response: string;
f: TStringList;
fi: string;
JSObj: TJSONObject;
iniFile: TIniFile;
Encoder: TBase64Encoding;
begin
// 1. Encode credentials (same as working Postman request)
// TNetEncoding.Base64.Encode adds a new line every 72 chars, this stops that
Encoder := TBase64Encoding.Create(0);
if( (Client = '') or (Secret = '') ) then
begin
Logger.Log(1, 'Missing Client ID or Client Secret in INI File');
Exit();
end;
EncodedAuth := Encoder.Encode(Client + ':' + Secret);
if RefreshToken = '' then
begin
Logger.Log(3, 'Missing Refresh Token, Please Manually Get a New One and Store in INI File');
Exit();
end;
// 2. Prepare POST data (EXACTLY as in Postman)
PostData := 'grant_type=refresh_token&refresh_token=' + RefreshToken;
// 3. Configure HTTP client
IdHTTP := TIdHTTP.Create(nil);
SSLIO := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
try
// Force TLS 1.2
SSLIO.SSLOptions.Method := sslvTLSv1_2;
SSLIO.SSLOptions.SSLVersions := [sslvTLSv1_2];
IdHTTP.IOHandler := SSLIO;
// Set headers (EXACT match with Postman)
IdHTTP.Request.ContentType := 'application/x-www-form-urlencoded';
IdHTTP.Request.Accept := 'application/json';
IdHTTP.Request.CustomHeaders.AddValue('Authorization', 'Basic ' + EncodedAuth);
// 4. Create and send request
RequestStream := TStringStream.Create(PostData, TEncoding.UTF8);
try
// Execute POST
try
response := IdHTTP.Post('https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer', RequestStream);
JSObj := TJSONObject.ParseJSONValue(response) as TJSONObject;
RefreshToken := JSObj.GetValue('refresh_token').ToString.Trim(['"']);
AccessToken := JSObj.GetValue('access_token').ToString.Trim(['"']);
SaveTokens(AccessToken, RefreshToken);
Result := AccessToken;
Logger.Log(1, 'qbAPI - Tokens Successfully Saved');
except
on E: EIdHTTPProtocolException do
// Memo2.Lines.Add('Error: ' + E.Message + #13#10 + 'Response: ' + E.ErrorMessage);
end;
finally
RequestStream.Free;
end;
finally
SSLIO.Free;
IdHTTP.Free;
end;
end;
procedure TQBService.SaveTokens(AccessToken, RefreshToken: string);
var
f: TStringList;
iniStr, line: string;
iniFile: TIniFile;
begin
iniFile := TIniFile.Create( ExtractFilePath(Application.ExeName) + 'kgOrdersServer.ini' );
try
iniFile.WriteString('Quickbooks', 'RefreshToken', RefreshToken);
LastRefresh := Now;
Logger.Log(1, 'Tokens Successfully Saved');
finally
IniFile.Free;
end;
f := TStringList.Create;
// Save to file (overwrites existing file)
f.SaveToFile('QB.txt');
f.Free;
end;
initialization
RegisterServiceType(TQBService);
end.
...@@ -43,6 +43,8 @@ object FData: TFData ...@@ -43,6 +43,8 @@ object FData: TFData
Lines.Strings = ( Lines.Strings = (
'Memo1') 'Memo1')
TabOrder = 1 TabOrder = 1
ExplicitLeft = -2
ExplicitTop = 435
end end
object DBAdvGrid1: TDBAdvGrid object DBAdvGrid1: TDBAdvGrid
Left = 6 Left = 6
...@@ -1602,8 +1604,8 @@ object FData: TFData ...@@ -1602,8 +1604,8 @@ object FData: TFData
object uqWeb: TUniQuery object uqWeb: TUniQuery
SQL.Strings = ( SQL.Strings = (
'select * from web_plate_orders') 'select * from web_plate_orders')
Left = 745 Left = 743
Top = 464 Top = 476
object uqWebORDER_ID: TIntegerField object uqWebORDER_ID: TIntegerField
FieldName = 'ORDER_ID' FieldName = 'ORDER_ID'
Required = True Required = True
......
...@@ -109,16 +109,34 @@ type ...@@ -109,16 +109,34 @@ type
TAddressItem = class TAddressItem = class
Public Public
ADDRESS: string; ADDRESS: string;
shipping_address: string;
city: string;
state: string;
contact: string;
zip: string;
ship_id: string;
end; end;
TCustomerItem = class TCustomerItem = class
Public Public
NAME: string; NAME: string;
ID: integer; CUSTOMER_ID: integer;
SHORT_NAME: string; SHORT_NAME: string;
BILL_ADDRESS: string;
BILL_CITY: string;
BILL_STATE: string;
BILL_ZIP: string;
BILL_CONTACT: string;
PHONE: string;
staff_fields_invoice_to: string; staff_fields_invoice_to: string;
START_DATE: String;
END_DATE: string;
QB_LIST_ID: string;
FFAX: string;
REP_USER_ID: string;
ADDRESS_LIST: TList<TAddressItem>; ADDRESS_LIST: TList<TAddressItem>;
ITEMS: TItemList; ITEMS: TItemList;
USERS: TList<TUserItem>
end; end;
TCustomerList = class TCustomerList = class
...@@ -375,10 +393,13 @@ type ...@@ -375,10 +393,13 @@ type
[HttpGet] function GenerateOrderCorrugatedPDF(orderID: string): string; [HttpGet] function GenerateOrderCorrugatedPDF(orderID: string): string;
[HttpGet] function GenerateOrderWebPDF(orderID: string): string; [HttpGet] function GenerateOrderWebPDF(orderID: string): string;
[HttpGet] function GenerateOrderCuttingPDF(orderID: string): string; [HttpGet] function GenerateOrderCuttingPDF(orderID: string): string;
[HttpGet] function getQBCustomers(): TJSONArray;
function AddUser(userInfo: string): string; function AddUser(userInfo: string): string;
function AddItem(itemInfo: string): string; function AddItem(itemInfo: string): string;
function AddShippingAddress(Addressinfo: string): TJSONObject;
function DelShippingAddress(AddressID, CustomerID: string): TJSONObject;
function DelUser(username: string): string; function DelUser(username: string): string;
function DelOrder(orderID, orderType, UserID: string): TJSONObject; function DelOrder(orderID, orderType, UserID: string): TJSONObject;
function EditUser(const editOptions: string): string; function EditUser(const editOptions: string): string;
...@@ -387,6 +408,8 @@ type ...@@ -387,6 +408,8 @@ type
function AddCuttingDieOrder(orderInfo: string): TJSONObject; function AddCuttingDieOrder(orderInfo: string): TJSONObject;
function AddStatusSchedule(StatusType: string; order: TJSONObject; ORDER_ID: integer): string; function AddStatusSchedule(StatusType: string; order: TJSONObject; ORDER_ID: integer): string;
function SetStatus(statusOptions: string): string; function SetStatus(statusOptions: string): string;
function AddCustomer(customerInfo: string): TJSONObject;
function ImportQBCustomer(CustomerInfo: string): TJSONObject;
end; end;
implementation implementation
......
...@@ -67,6 +67,15 @@ object FMain: TFMain ...@@ -67,6 +67,15 @@ object FMain: TFMain
TabOrder = 4 TabOrder = 4
OnClick = btnAuthSwaggerUIClick OnClick = btnAuthSwaggerUIClick
end end
object btnQB: TButton
Left = 444
Top = 8
Width = 75
Height = 25
Caption = 'QB'
TabOrder = 5
OnClick = btnQBClick
end
object initTimer: TTimer object initTimer: TTimer
OnTimer = initTimerTimer OnTimer = initTimerTimer
Left = 58 Left = 58
......
...@@ -21,6 +21,7 @@ type ...@@ -21,6 +21,7 @@ type
initTimer: TTimer; initTimer: TTimer;
btnAuthSwaggerUI: TButton; btnAuthSwaggerUI: TButton;
ExeInfo1: TExeInfo; ExeInfo1: TExeInfo;
btnQB: TButton;
procedure btnApiSwaggerUIClick(Sender: TObject); procedure btnApiSwaggerUIClick(Sender: TObject);
procedure btnDataClick(Sender: TObject); procedure btnDataClick(Sender: TObject);
procedure btnExitClick(Sender: TObject); procedure btnExitClick(Sender: TObject);
...@@ -28,6 +29,7 @@ type ...@@ -28,6 +29,7 @@ type
procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure initTimerTimer(Sender: TObject); procedure initTimerTimer(Sender: TObject);
procedure btnAuthSwaggerUIClick(Sender: TObject); procedure btnAuthSwaggerUIClick(Sender: TObject);
procedure btnQBClick(Sender: TObject);
strict private strict private
procedure StartServers; procedure StartServers;
...@@ -44,7 +46,7 @@ uses ...@@ -44,7 +46,7 @@ uses
Common.Config, Common.Config,
Sparkle.Utils, Sparkle.Utils,
Api.Database, Api.Database,
Data; Data, qbAPI;
{$R *.dfm} {$R *.dfm}
...@@ -76,6 +78,13 @@ begin ...@@ -76,6 +78,13 @@ begin
Close; Close;
end; end;
procedure TFMain.btnQBClick(Sender: TObject);
begin
FQB := TfQB.Create( self );
FQB.ShowModal;
FQB.Free;
end;
procedure TFMain.btnAuthSwaggerUIClick(Sender: TObject); procedure TFMain.btnAuthSwaggerUIClick(Sender: TObject);
begin begin
ShellExecute(Handle, 'open', PChar(TSparkleUtils.CombineUrlFast(AuthServerModule.XDataServer.BaseUrl, 'swaggerui')), nil, nil, SW_SHOWNORMAL); ShellExecute(Handle, 'open', PChar(TSparkleUtils.CombineUrlFast(AuthServerModule.XDataServer.BaseUrl, 'swaggerui')), nil, nil, SW_SHOWNORMAL);
......
...@@ -25,7 +25,10 @@ uses ...@@ -25,7 +25,10 @@ uses
rOrderList in 'Source\rOrderList.pas' {rptOrderList: TDataModule}, rOrderList in 'Source\rOrderList.pas' {rptOrderList: TDataModule},
rOrderCorrugated in 'Source\rOrderCorrugated.pas' {rptOrderCorrugated: TDataModule}, rOrderCorrugated in 'Source\rOrderCorrugated.pas' {rptOrderCorrugated: TDataModule},
rOrderWeb in 'Source\rOrderWeb.pas' {rptOrderWeb: TDataModule}, rOrderWeb in 'Source\rOrderWeb.pas' {rptOrderWeb: TDataModule},
rOrderCutting in 'Source\rOrderCutting.pas' {rptOrderCutting: TDataModule}; rOrderCutting in 'Source\rOrderCutting.pas' {rptOrderCutting: TDataModule},
qbAPI in 'Source\qbAPI.pas' {fQB},
QBService in 'QBService.pas',
QBServiceImplementation in 'QBServiceImplementation.pas';
type type
TMemoLogAppender = class( TInterfacedObject, ILogAppender ) TMemoLogAppender = class( TInterfacedObject, ILogAppender )
......
...@@ -203,6 +203,12 @@ ...@@ -203,6 +203,12 @@
<FormType>dfm</FormType> <FormType>dfm</FormType>
<DesignClass>TDataModule</DesignClass> <DesignClass>TDataModule</DesignClass>
</DCCReference> </DCCReference>
<DCCReference Include="Source\qbAPI.pas">
<Form>fQB</Form>
<FormType>dfm</FormType>
</DCCReference>
<DCCReference Include="QBService.pas"/>
<DCCReference Include="QBServiceImplementation.pas"/>
<BuildConfiguration Include="Base"> <BuildConfiguration Include="Base">
<Key>Base</Key> <Key>Base</Key>
</BuildConfiguration> </BuildConfiguration>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
MemoLogLevel=3 MemoLogLevel=3
FileLogLevel=5 FileLogLevel=5
webClientVersion=0.9.3 webClientVersion=0.9.3
LogFileNum=453 LogFileNum=621
[Database] [Database]
--Server=192.168.159.131 --Server=192.168.159.131
...@@ -13,3 +13,10 @@ Username=root ...@@ -13,3 +13,10 @@ Username=root
Password=emsys01 Password=emsys01
--Password=emsys!012 --Password=emsys!012
[Quickbooks]
CompanyID=9341454272655710
ClientID=ABgO14uvjh8XqLud7spQ8lkb98AUpcdA7HbyMJfCAtl65sQ5yy
ClientSecret=bQ06TRemHeAGFzVHRaTUvUoBU9jpU9itK6MOMgqN
RefreshToken=RT1-113-H0-1757255538seyqgsf5e04vo9schkoa
AccessToken=eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwieC5vcmciOiJIMCJ9..Cqnj0xScf85NYKa6g4lanA.LN1AIU3ZlnDDbIMt-J4vl8V_gvcTfynSjGKYsmbhbfBJovq5IfZU4dHt6cqDAwUfnfOm42l-OpbwN9hWrZvUGlVx8x_3MA-vdtxIOByp7neq5vL2t4XcR5svPKIkX-CqlTsTb2ylBARiXehgk3tVHBysbHcnp0Ka0Ic_Waj64wQMYvE3Z-D19gCu-Xn9WFQwDICn8HSgJmHL2huLvRX-OrcxH6uERzLcQqRLsgT7fx9j68UWDW-KL_KRnzE43ieXlxXCwiCDnaF39Ei5iPHstnh19lGMgo1Z1mlF6tVZ9-8Z1prZutpiX8rzaPzS7Wdqo8pKtYaUqQZP6AGa6ZCqWR2BlF3y-R_FtheERNpafRiXWIDW68jOOrgp8QXc1uKA0sxDMjiLE7Bd0t9QAsIzln-0WiWIXFSlLGLimMd2oxxLoR7fpQvgB851I50b4S3V-c891WA8bHfuzScmjVwp40JxofhviFXwAevLNzRYvGkvIyz4oS9d6U6K_ZWKDB3iYxEgJzkFFwnfuPybWX7iNHwnmvFfAXz61jdaL9KRJM-lCChGuaQuv8_df9z_az_sbUtXJw2I8ivEppmDEQVxv49ZwzJlb6bFbqtnhy6ILO7_ecx3G1d4Utg-BrtgvzsR.oFJV6VBShL1-cERGZEqqkw
LastRefresh=5/28/2025 10:46:30 AM
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
"jwtTokenSecret": "super_secret0123super_secret4567", "jwtTokenSecret": "super_secret0123super_secret4567",
"adminPassword": "whatisthisusedfor", "adminPassword": "whatisthisusedfor",
"webAppFolder": "static", "webAppFolder": "static",
"reportsFolder": "reports/" "reportsFolder": "..\\kgOrdersClient\\TMSWeb\\Debug\\"
} }
\ No newline at end of file
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