Commit 245de583 by Cam Hayes

v0.9.15.1 changes

Added test mode to the top, and added more detailed errors when attempting to connect with quickbooks
parent 58bcb135
......@@ -19,7 +19,7 @@ type
FUnauthorizedAccessProc: TUnauthorizedAccessProc;
public
const clientVersion = '0.9.15.0';
const clientVersion = '0.9.15.1';
procedure InitApp(SuccessProc: TSuccessProc;
UnauthorizedAccessProc: TUnauthorizedAccessProc);
procedure SetClientConfig(Callback: TVersionCheckCallback);
......
......@@ -382,7 +382,6 @@ procedure TFViewAddCustomer.btnLinkClic(Sender: TObject);
var
newform: TFSelectCustomer;
begin
EditMode();
newform := TFSelectCustomer.CreateNew;
newform.Caption := 'Select Customer to Link';
......@@ -398,6 +397,7 @@ begin
begin
if newform.confirm then
begin
EditMode();
XDataWebDataSet1.Edit;
XDataWebDataSet1QB_LIST_ID.AsString := newform.QB_ID;
XDataWebDataSet1.Post;
......@@ -526,7 +526,10 @@ begin
ShowToast('Update successful. No Changes needed');
except
on E: EXDataClientRequestException do
begin
Utils.ShowErrorModal(E.ErrorResult.ErrorMessage);
ViewMode();
end;
end;
end;
......
......@@ -18,9 +18,9 @@ object FViewMain: TFViewMain
Caption = 'lblUsername'
ElementID = 'view.main.username'
ElementPosition = epRelative
HeightPercent = 100.00000000000000000
HeightPercent = 100.000000000000000000
Transparent = False
WidthPercent = 100.00000000000000000
WidthPercent = 100.000000000000000000
end
object wllblUserProfile: TWebLinkLabel
Left = 529
......@@ -28,8 +28,8 @@ object FViewMain: TFViewMain
Width = 59
Height = 14
ElementID = 'dropdown.menu.userprofile'
HeightPercent = 100.00000000000000000
WidthPercent = 100.00000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = wllblUserProfileClick
Caption = ' User Profile'
end
......@@ -39,8 +39,8 @@ object FViewMain: TFViewMain
Width = 36
Height = 14
ElementID = 'dropdown.menu.logout'
HeightPercent = 100.00000000000000000
WidthPercent = 100.00000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = wllblLogoutClick
Caption = ' Logout'
end
......@@ -50,8 +50,8 @@ object FViewMain: TFViewMain
Width = 27
Height = 14
ElementID = 'dropdown.menu.home'
HeightPercent = 100.00000000000000000
WidthPercent = 100.00000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = lblHomeClick
Caption = 'Home'
end
......@@ -63,9 +63,9 @@ object FViewMain: TFViewMain
Caption = 'Koehler-Gibson'
ElementID = 'view.main.apptitle'
ElementPosition = epRelative
HeightPercent = 100.00000000000000000
HeightPercent = 100.000000000000000000
Transparent = False
WidthPercent = 100.00000000000000000
WidthPercent = 100.000000000000000000
end
object lblItemsList: TWebLinkLabel
Left = 560
......@@ -74,8 +74,8 @@ object FViewMain: TFViewMain
Height = 14
ElementID = 'dropdown.menu.itemlist'
ElementFont = efCSS
HeightPercent = 100.00000000000000000
WidthPercent = 100.00000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = lblItemsListClick
Caption = 'Items'
end
......@@ -86,8 +86,8 @@ object FViewMain: TFViewMain
Height = 14
ElementID = 'dropdown.menu.users'
ElementFont = efCSS
HeightPercent = 100.00000000000000000
WidthPercent = 100.00000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = lblUsersClick
Caption = 'Users'
end
......@@ -101,8 +101,8 @@ object FViewMain: TFViewMain
ElementFont = efCSS
ElementPosition = epRelative
HeightStyle = ssAuto
HeightPercent = 100.00000000000000000
WidthPercent = 100.00000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = lblordersClick
end
object lblCustomers: TWebLabel
......@@ -115,8 +115,8 @@ object FViewMain: TFViewMain
ElementFont = efCSS
ElementPosition = epRelative
HeightStyle = ssAuto
HeightPercent = 100.00000000000000000
WidthPercent = 100.00000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = lblCustomersClick
end
object lblVersion: TWebLabel
......@@ -129,8 +129,8 @@ object FViewMain: TFViewMain
ElementFont = efCSS
ElementPosition = epRelative
HeightStyle = ssAuto
HeightPercent = 100.00000000000000000
WidthPercent = 100.00000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object lblQBInfo: TWebLabel
Left = 552
......@@ -141,10 +141,22 @@ object FViewMain: TFViewMain
ElementID = 'dropdown.menu.linktoqb'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.00000000000000000
WidthPercent = 100.00000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = lblQBInfoClick
end
object WebLabel1: TWebLabel
Left = 338
Top = 236
Width = 57
Height = 14
Caption = 'TEST MODE'
ElementID = 'view.main.test'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object WebPanel1: TWebPanel
Left = 77
Top = 112
......@@ -173,7 +185,7 @@ object FViewMain: TFViewMain
ElementID = 'main.debugmemo'
ElementPosition = epRelative
Enabled = False
HeightPercent = 100.00000000000000000
HeightPercent = 100.000000000000000000
Lines.Strings = (
'WebMemo1')
Role = 'null'
......@@ -181,7 +193,7 @@ object FViewMain: TFViewMain
SelStart = 0
ShowFocus = False
Visible = False
WidthPercent = 100.00000000000000000
WidthPercent = 100.000000000000000000
end
object WebMessageDlg1: TWebMessageDlg
Left = 47
......@@ -208,7 +220,7 @@ object FViewMain: TFViewMain
'No to all'
'Help'
'Close')
Opacity = 0.20000000000000000
Opacity = 0.200000000000000000
end
object XDataWebClient: TXDataWebClient
Connection = DMConnection.ApiConnection
......
......@@ -3,7 +3,8 @@
<div class="container-fluid">
<div class="d-flex align-items-center">
<a id="view.main.apptitle" class="navbar-brand" href="index.html">Koehler-Gibson Orders</a>
<span id="view.main.version" class="small text-muted ms-2"></span>
<span id="view.main.version" class="small text-muted ms-2 me-5"></span>
<span id="view.main.test" class="test-warning fw-bold mb-1" style="display: none;">TEST MODE</span>
</div>
<ul class="navbar-nav ml-auto">
<li class="nav-item">
......
......@@ -26,6 +26,7 @@ type
lblCustomers: TWebLabel;
lblVersion: TWebLabel;
lblQBInfo: TWebLabel;
WebLabel1: TWebLabel;
procedure WebFormCreate(Sender: TObject);
procedure mnuLogoutClick(Sender: TObject);
procedure wllblUserProfileClick(Sender: TObject);
......
......@@ -87,7 +87,7 @@ begin
except
on E: EXDataClientRequestException do
begin
Close();
lblConnected.Caption := 'Quickbooks is not connected.';
Utils.ShowErrorModal(E.ErrorResult.ErrorMessage);
end;
end;
......
......@@ -11,6 +11,16 @@
min-width: 120px;
}
.test-warning {
background-color: yellow;
color: black;
font-weight: bold;
padding: 5px 10px;
border-radius: 5px;
display: inline-block;
text-align: center;
}
input[type="text"] {
min-width: 50px;
max-width: 100%;
......
......@@ -2883,6 +2883,13 @@ begin
restRequest.Client := restClient;
restRequest.Response := restResponse;
CompanyID := iniFile.ReadString('Quickbooks', 'CompanyID', '');
if CompanyID = '' then
begin
Logger.Log(1, 'Quickbooks not connected, exiting');
raise EXDataHttpException.Create(500, 'Unable to retrieve QuickBooks Customers: Quickbooks is not currently connected!');
end;
if iniFile.ReadString('Quickbooks', 'LastRefresh', '') = '' then
LastRefresh := 0
else
......@@ -2893,7 +2900,6 @@ begin
Client := iniFile.ReadString('Quickbooks', 'ClientID', '');
Secret := iniFile.ReadString('Quickbooks', 'ClientSecret', '');
CompanyID := iniFile.ReadString('Quickbooks', 'CompanyID', '');
RefreshToken := iniFile.ReadString('Quickbooks', 'RefreshToken', '');
AccessToken := iniFile.ReadString('Quickbooks', 'AccessToken', '');
BaseUrl := iniFile.ReadString('Quickbooks', 'BaseUrl', '');
......@@ -2982,6 +2988,10 @@ begin
end;
end;
except
on E: EXDataHttpException do
begin
raise;
end;
on E: Exception do
begin
Logger.Log(2, 'Error in getQBCustomers: ' + E.Message);
......@@ -3026,6 +3036,13 @@ begin
restRequest.Client := restClient;
restRequest.Response := restResponse;
CompanyID := iniFile.ReadString('Quickbooks', 'CompanyID', '');
if CompanyID = '' then
begin
Logger.Log(1, 'Quickbooks not connected, exiting');
raise EXDataHttpException.Create(500, 'Unable to retrieve QuickBooks Customer: Quickbooks is not currently connected!');
end;
if iniFile.ReadString('Quickbooks', 'LastRefresh', '') = '' then
LastRefresh := 0
else
......@@ -3036,7 +3053,6 @@ begin
Client := iniFile.ReadString('Quickbooks', 'ClientID', '');
Secret := iniFile.ReadString('Quickbooks', 'ClientSecret', '');
CompanyID := iniFile.ReadString('Quickbooks', 'CompanyID', '');
RefreshToken := iniFile.ReadString('Quickbooks', 'RefreshToken', '');
AccessToken := iniFile.ReadString('Quickbooks', 'AccessToken', '');
BaseUrl := iniFile.ReadString('Quickbooks', 'BaseUrl', '');
......@@ -3166,6 +3182,10 @@ begin
end;
end;
except
on E: EXDataHttpException do
begin
raise;
end;
on E: Exception do
begin
Logger.Log(2, 'Error in getQBCustomer: ' + E.Message);
......@@ -3307,6 +3327,13 @@ begin
restRequest.Client := restClient;
restRequest.Response := restResponse;
CompanyID := iniFile.ReadString('Quickbooks', 'CompanyID', '');
if CompanyID = '' then
begin
Logger.Log(1, 'Quickbooks not connected, exiting');
raise EXDataHttpException.Create(500, 'Unable to retrieve QuickBooks Customers: Quickbooks is not currently connected!');
end;
if iniFile.ReadString('Quickbooks', 'LastRefresh', '') = '' then
LastRefresh := 0
else
......@@ -3317,7 +3344,6 @@ begin
Client := iniFile.ReadString('Quickbooks', 'ClientID', '');
Secret := iniFile.ReadString('Quickbooks', 'ClientSecret', '');
CompanyID := iniFile.ReadString('Quickbooks', 'CompanyID', '');
RefreshToken := iniFile.ReadString('Quickbooks', 'RefreshToken', '');
AccessToken := iniFile.ReadString('Quickbooks', 'AccessToken', '');
BaseUrl := iniFile.ReadString('Quickbooks', 'BaseUrl', '');
......@@ -3361,6 +3387,10 @@ begin
end;
except
on E: EXDataHttpException do
begin
raise;
end;
on E: Exception do
begin
Logger.Log(2, 'Error in getQBItems: ' + E.Message);
......@@ -3407,6 +3437,13 @@ begin
restRequest.Client := restClient;
restRequest.Response := restResponse;
CompanyID := iniFile.ReadString('Quickbooks', 'CompanyID', '');
if CompanyID = '' then
begin
Logger.Log(1, 'Quickbooks not connected, exiting');
raise EXDataHttpException.Create(500, 'Unable to retrieve QuickBooks Customers: Quickbooks is not currently connected!');
end;
if iniFile.ReadString('Quickbooks', 'LastRefresh', '') = '' then
LastRefresh := 0
else
......@@ -3417,7 +3454,6 @@ begin
Client := iniFile.ReadString('Quickbooks', 'ClientID', '');
Secret := iniFile.ReadString('Quickbooks', 'ClientSecret', '');
CompanyID := iniFile.ReadString('Quickbooks', 'CompanyID', '');
RefreshToken := iniFile.ReadString('Quickbooks', 'RefreshToken', '');
AccessToken := iniFile.ReadString('Quickbooks', 'AccessToken', '');
BaseUrl := iniFile.ReadString('Quickbooks', 'BaseUrl', '');
......@@ -3467,7 +3503,6 @@ begin
except
on E: EXDataHttpException do
raise;
on E: Exception do
begin
Logger.Log(1, 'Error in UpdateItem: ' + E.Message);
......@@ -3513,6 +3548,13 @@ begin
restRequest.Client := restClient;
restRequest.Response := restResponse;
CompanyID := iniFile.ReadString('Quickbooks', 'CompanyID', '');
if CompanyID = '' then
begin
Logger.Log(1, 'Quickbooks not connected, exiting');
raise EXDataHttpException.Create(500, 'Unable to retrieve QuickBooks Customers: Quickbooks is not currently connected!');
end;
if iniFile.ReadString('Quickbooks', 'LastRefresh', '') = '' then
LastRefresh := 0
else
......@@ -3523,7 +3565,6 @@ begin
Client := iniFile.ReadString('Quickbooks', 'ClientID', '');
Secret := iniFile.ReadString('Quickbooks', 'ClientSecret', '');
CompanyID := iniFile.ReadString('Quickbooks', 'CompanyID', '');
RefreshToken := iniFile.ReadString('Quickbooks', 'RefreshToken', '');
AccessToken := iniFile.ReadString('Quickbooks', 'AccessToken', '');
BaseUrl := iniFile.ReadString('Quickbooks', 'BaseUrl', '');
......@@ -3612,6 +3653,8 @@ begin
raise;
end;
except
on E: EXDataHttpException do
raise;
on E: Exception do
begin
Logger.Log(2, 'Error in UpdateCustomer: ' + E.Message);
......
......@@ -114,10 +114,11 @@
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_ExeOutput>.\bin</DCC_ExeOutput>
<DCC_UnitSearchPath>C:\RADTOOLS\FastMM4;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<VerInfo_Keys>CompanyName=EM Systems;FileDescription=$(MSBuildProjectName);FileVersion=0.9.15.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=0.9.11;Comments=</VerInfo_Keys>
<VerInfo_Keys>CompanyName=EM Systems;FileDescription=$(MSBuildProjectName);FileVersion=0.9.15.1;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=0.9.11;Comments=</VerInfo_Keys>
<VerInfo_MajorVer>0</VerInfo_MajorVer>
<VerInfo_MinorVer>9</VerInfo_MinorVer>
<VerInfo_Release>15</VerInfo_Release>
<VerInfo_Build>1</VerInfo_Build>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
......
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