Commit 553e411e by Cameron Hayes

Merge remote-tracking branch 'origin/cam3'

parents a063c805 a9c2147a
...@@ -61,6 +61,7 @@ object FViewAddAddress: TFViewAddAddress ...@@ -61,6 +61,7 @@ object FViewAddAddress: TFViewAddAddress
Width = 78 Width = 78
Height = 22 Height = 22
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
TabOrder = 4
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object edtFirstLine: TWebEdit object edtFirstLine: TWebEdit
...@@ -70,6 +71,7 @@ object FViewAddAddress: TFViewAddAddress ...@@ -70,6 +71,7 @@ object FViewAddAddress: TFViewAddAddress
Height = 22 Height = 22
ChildOrder = 1 ChildOrder = 1
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
TabOrder = 1
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object edtCity: TWebEdit object edtCity: TWebEdit
...@@ -79,6 +81,7 @@ object FViewAddAddress: TFViewAddAddress ...@@ -79,6 +81,7 @@ object FViewAddAddress: TFViewAddAddress
Height = 22 Height = 22
ChildOrder = 2 ChildOrder = 2
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
TabOrder = 3
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object edtZip: TWebEdit object edtZip: TWebEdit
...@@ -88,6 +91,7 @@ object FViewAddAddress: TFViewAddAddress ...@@ -88,6 +91,7 @@ object FViewAddAddress: TFViewAddAddress
Height = 22 Height = 22
ChildOrder = 3 ChildOrder = 3
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
TabOrder = 5
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object edtContact: TWebEdit object edtContact: TWebEdit
...@@ -97,6 +101,7 @@ object FViewAddAddress: TFViewAddAddress ...@@ -97,6 +101,7 @@ object FViewAddAddress: TFViewAddAddress
Height = 22 Height = 22
ChildOrder = 4 ChildOrder = 4
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
TabOrder = 6
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object edtAddress: TWebEdit object edtAddress: TWebEdit
...@@ -106,6 +111,7 @@ object FViewAddAddress: TFViewAddAddress ...@@ -106,6 +111,7 @@ object FViewAddAddress: TFViewAddAddress
Height = 22 Height = 22
ChildOrder = 1 ChildOrder = 1
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
TabOrder = 2
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object edtNotification: TWebEdit object edtNotification: TWebEdit
......
...@@ -21,14 +21,17 @@ ...@@ -21,14 +21,17 @@
<button id="btndelete" class="btn btn-danger btn-sm">Delete</button> <button id="btndelete" class="btn btn-danger btn-sm">Delete</button>
</li> </li>
<li class="nav-item pe-2"> <li class="nav-item pe-2">
<button id="btnpdf" class="btn btn-primary btn-sm">PDF</button>
</li>
<li class="nav-item pe-2">
<button id="btnconfirm" class="btn btn-success btn-sm">Save</button> <button id="btnconfirm" class="btn btn-success btn-sm">Save</button>
</li> </li>
<li class="nav-item pe-2"> <li class="nav-item pe-2">
<button id="btncancel" class="btn btn-danger btn-sm">Cancel</button> <button id="btncancel" class="btn btn-danger btn-sm">Cancel</button>
</li> </li>
<li class="nav-item pe-2">
<button id="btnpdf" class="btn btn-primary btn-sm">PDF</button>
</li>
<li class="nav-item pe-2">
<button id="btnsendtoqb" class="btn btn-primary btn-sm">Send To QB</button>
</li>
<li class="nav-item"> <li class="nav-item">
<button id="btnclose" class="btn btn-primary btn-sm">Close</button> <button id="btnclose" class="btn btn-primary btn-sm">Close</button>
</li> </li>
...@@ -37,9 +40,6 @@ ...@@ -37,9 +40,6 @@
</div> </div>
</nav> </nav>
<div class="row mx-5"> <div class="row mx-5">
<div class="col-12 col-md-8">
</div>
<h4 class="custom-h4 mt-3">Customer</h4> <h4 class="custom-h4 mt-3">Customer</h4>
<hr class="custom-hr"> <hr class="custom-hr">
<div class="row"> <div class="row">
...@@ -57,9 +57,13 @@ ...@@ -57,9 +57,13 @@
Please Provide a Customer ID Name. Please Provide a Customer ID Name.
</div> </div>
</div> </div>
<div class="col-auto d-flex flex-column">
<label for="wdbcbinqb" class="form-label mt-2" style="font-weight: 700; font-size: 15px;">In QB?:</label>
<input id="wdbcbinqb" type="checkbox" class="form-check-input mt-1">
</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">In Quickbooks?:</label> <label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">QB Order Number:</label>
<input id="edtinquickbooks"type="text" class="form-control" style="width: 150px"/> <input id="edtqbordernum"type="text" class="form-control" style="width: 150px" required/>
</div> </div>
</div> </div>
<h4 class="custom-h4 mt-3">Staff Fields</h4> <h4 class="custom-h4 mt-3">Staff Fields</h4>
...@@ -90,11 +94,17 @@ ...@@ -90,11 +94,17 @@
</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">Quantity:</label> <label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Quantity:</label>
<input id="edtquantity" class="form-control input-sm" style="width: 100px"/> <input id="edtquantity" class="form-control input-sm" style="width: 100px" type="number" min="1" required/>
<div class="invalid-feedback" style="font-size: 15px;" required>
Please Provide a Quantity.
</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">Price:</label> <label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Price:</label>
<input id="edtprice" class="form-control input-sm" style="width: 100px" type="number" min="0"/> <input id="edtprice" class="form-control input-sm" style="width: 100px" type="number" min="1" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Price.
</div>
</div> </div>
<div> <div>
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Invoice To:</label> <label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Invoice To:</label>
...@@ -118,12 +128,26 @@ ...@@ -118,12 +128,26 @@
<input id="edtponumber" class="form-control input-sm" width='50%'/> <input id="edtponumber" class="form-control input-sm" width='50%'/>
</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">Job Name:</label> <label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">QB Item:</label>
<input id="edtjobname" class="form-control input-sm" style="width: 300px"/> <select id="wcbqbitem" class='form-select' required></select>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a QB Item.
</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">QuickBooks Item:</label> <label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Job Name:</label>
<select id="wcbqbitem" class='form-select'></select> <input id="edtjobname" class="form-control input-sm" style="width: 600px"/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Job Name.
</div>
</div>
<div class="row">
<div class="col-12">
<label for="edtitemdescription" class="form-label mt-2" style="font-weight: 700; font-size: 15px;">
Item Description:
</label>
<input id="edtitemdescription" class="form-control" style="width: 100%;" />
</div>
</div> </div>
<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">Art Due:</label> <label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Art Due:</label>
......
...@@ -210,21 +210,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -210,21 +210,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
DataField = 'NAME' DataField = 'NAME'
DataSource = wdsOrder DataSource = wdsOrder
end end
object wcbQBItem: TWebDBComboBox
Left = 26
Top = 487
Width = 145
Height = 23
ElementID = 'wcbqbitem'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnChange = wcbQBItemChange
ItemIndex = -1
DataField = 'staff_fields_quickbooks_item'
DataSource = wdsOrder
ListField = 'name'
ListSource = wdsQBItem
end
object btnPDF: TWebButton object btnPDF: TWebButton
Left = 742 Left = 742
Top = 417 Top = 417
...@@ -406,6 +391,21 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -406,6 +391,21 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object wcbQBItem: TWebDBComboBox
Left = 26
Top = 491
Width = 145
Height = 23
ElementID = 'wcbqbitem'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnChange = wcbQBItemChange
ItemIndex = -1
DataField = 'staff_fields_quickbooks_item'
DataSource = wdsOrder
ListField = 'name'
ListSource = wdsQBItem
end
object wdsOrder: TWebDataSource object wdsOrder: TWebDataSource
AutoEdit = False AutoEdit = False
DataSet = xdwdsOrder DataSet = xdwdsOrder
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
</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">QB Order Number:</label> <label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">QB Order Number:</label>
<input id="edtqbordernum"type="text" class="form-control" style="width: 150px" required/> <input id="edtqbordernum"type="text" class="form-control" style="width: 150px"/>
</div> </div>
</div> </div>
<h4 class="custom-h4 mt-3">Staff Fields</h4> <h4 class="custom-h4 mt-3">Staff Fields</h4>
......
...@@ -21,14 +21,17 @@ ...@@ -21,14 +21,17 @@
<button id="btndelete" class="btn btn-danger btn-sm">Delete</button> <button id="btndelete" class="btn btn-danger btn-sm">Delete</button>
</li> </li>
<li class="nav-item pe-2"> <li class="nav-item pe-2">
<button id="btnpdf" class="btn btn-primary btn-sm">PDF</button>
</li>
<li class="nav-item pe-2">
<button id="btnconfirm" class="btn btn-success btn-sm">Save</button> <button id="btnconfirm" class="btn btn-success btn-sm">Save</button>
</li> </li>
<li class="nav-item pe-2"> <li class="nav-item pe-2">
<button id="btncancel" class="btn btn-danger btn-sm">Cancel</button> <button id="btncancel" class="btn btn-danger btn-sm">Cancel</button>
</li> </li>
<li class="nav-item pe-2">
<button id="btnpdf" class="btn btn-primary btn-sm">PDF</button>
</li>
<li class="nav-item pe-2">
<button id="btnsendtoqb" class="btn btn-primary btn-sm">Send To QB</button>
</li>
<li class="nav-item"> <li class="nav-item">
<button id="btnclose" class="btn btn-primary btn-sm">Close</button> <button id="btnclose" class="btn btn-primary btn-sm">Close</button>
</li> </li>
...@@ -54,9 +57,13 @@ ...@@ -54,9 +57,13 @@
Please Provide a Customer ID. Please Provide a Customer ID.
</div> </div>
</div> </div>
<div class="col-auto d-flex flex-column">
<label for="wdbcbinqb" class="form-label mt-2" style="font-weight: 700; font-size: 15px;">In QB?:</label>
<input id="wdbcbinqb" type="checkbox" class="form-check-input mt-1">
</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">In Quickbooks?:</label> <label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">QB Order Number:</label>
<input id="edtinquickbooks"type="text" class="form-control" style="width: 150px"/> <input id="edtqbordernum"type="text" class="form-control" style="width: 150px"/>
</div> </div>
</div> </div>
<h4 class="custom-h4 mt-3">Staff Fields</h4> <h4 class="custom-h4 mt-3">Staff Fields</h4>
...@@ -86,12 +93,18 @@ ...@@ -86,12 +93,18 @@
<input id="edtshipvia" type="text" class="form-control"/> <input id="edtshipvia" type="text" class="form-control"/>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Quantity:</label> <label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Quantity:</label>
<input id="edtquantity" class="form-control input-sm" style="width: 100px"/> <input id="edtquantity" class="form-control input-sm" style="width: 100px" type="number" min="1" required/>
<div class="invalid-feedback" style="font-size: 15px;" required>
Please Provide a Quantity.
</div>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Price:</label> <label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Price:</label>
<input id="edtprice" class="form-control input-sm" style="width: 100px" type="number" min="0"/> <input id="edtprice" class="form-control input-sm" style="width: 100px" type="number" min="1" required/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Price.
</div>
</div> </div>
<div> <div>
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Invoice To:</label> <label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Invoice To:</label>
...@@ -115,12 +128,26 @@ ...@@ -115,12 +128,26 @@
<input id="edtponumber" class="form-control input-sm" width='50%'/> <input id="edtponumber" class="form-control input-sm" width='50%'/>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Job Name:</label> <label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">QB Item:</label>
<input id="edtjobname" class="form-control input-sm" style="width: 300px"/> <select id="wcbqbitem" class='form-select' required></select>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a QB Item.
</div>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">QuickBooks Item:</label> <label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Job Name:</label>
<select id="wcbqbitem" class='form-select'></select> <input id="edtjobname" class="form-control input-sm" style="width: 600px"/>
<div class="invalid-feedback" style="font-size: 15px;">
Please Provide a Job Name.
</div>
</div>
<div class="row">
<div class="col-12">
<label for="edtitemdescription" class="form-label mt-2" style="font-weight: 700; font-size: 15px;">
Item Description:
</label>
<input id="edtitemdescription" class="form-control" style="width: 100%;" />
</div>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Art Due:</label> <label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Art Due:</label>
...@@ -231,11 +258,11 @@ ...@@ -231,11 +258,11 @@
<input id="edtcolorcontrastto" class="form-control input-sm" width='50%'/> <input id="edtcolorcontrastto" class="form-control input-sm" width='50%'/>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Color Contrast Date 1:</label> <label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Color Contract Date 1:</label>
<input class="form-control input-sm" id="dtpcolorcontrastdate1" type="date"> <input class="form-control input-sm" id="dtpcolorcontrastdate1" type="date">
</div> </div>
<div class="col-auto"> <div class="col-auto">
<label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Color Contrast Date 2:</label> <label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">Color Contract Date 2:</label>
<input class="form-control input-sm" id="dtpcolorcontrastdate2" type="date"> <input class="form-control input-sm" id="dtpcolorcontrastdate2" type="date">
</div> </div>
<div class="col-auto"> <div class="col-auto">
......
...@@ -206,7 +206,6 @@ object FSelectCustomer: TFSelectCustomer ...@@ -206,7 +206,6 @@ object FSelectCustomer: TFSelectCustomer
ScrollMode = scmItemScrolling ScrollMode = scmItemScrolling
DesignTimeSampleData = True DesignTimeSampleData = True
OnCellClick = TMSFNCGrid1CellClick OnCellClick = TMSFNCGrid1CellClick
ExplicitTop = 163
end end
object btnCancel: TWebButton object btnCancel: TWebButton
Left = 556 Left = 556
......
<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>
......
...@@ -108,14 +108,12 @@ begin ...@@ -108,14 +108,12 @@ begin
if( (Client = '') or (Secret = '') ) then if( (Client = '') or (Secret = '') ) then
begin begin
Logger.Log(1, 'Missing Client ID or Client Secret in INI File');
Exit(); Exit();
end; end;
EncodedAuth := Encoder.Encode(Client + ':' + Secret); EncodedAuth := Encoder.Encode(Client + ':' + Secret);
if RefreshToken = '' then if RefreshToken = '' then
begin begin
Logger.Log(3, 'Missing Refresh Token, Please Manually Get a New One and Store in INI File');
Exit(); Exit();
end; end;
...@@ -148,7 +146,6 @@ begin ...@@ -148,7 +146,6 @@ begin
AccessToken := JSObj.GetValue('access_token').ToString.Trim(['"']); AccessToken := JSObj.GetValue('access_token').ToString.Trim(['"']);
SaveTokens(AccessToken, RefreshToken); SaveTokens(AccessToken, RefreshToken);
Result := AccessToken; Result := AccessToken;
Logger.Log(1, 'qbAPI - Tokens Successfully Saved');
except except
on E: EIdHTTPProtocolException do on E: EIdHTTPProtocolException do
// Memo2.Lines.Add('Error: ' + E.Message + #13#10 + 'Response: ' + E.ErrorMessage); // Memo2.Lines.Add('Error: ' + E.Message + #13#10 + 'Response: ' + E.ErrorMessage);
...@@ -172,7 +169,6 @@ begin ...@@ -172,7 +169,6 @@ begin
try try
iniFile.WriteString('Quickbooks', 'RefreshToken', RefreshToken); iniFile.WriteString('Quickbooks', 'RefreshToken', RefreshToken);
LastRefresh := Now; LastRefresh := Now;
Logger.Log(1, 'Tokens Successfully Saved');
finally finally
IniFile.Free; IniFile.Free;
......
...@@ -125,14 +125,14 @@ uses ...@@ -125,14 +125,14 @@ uses
procedure TApiDatabase.DataModuleCreate(Sender: TObject); procedure TApiDatabase.DataModuleCreate(Sender: TObject);
begin begin
Logger.Log( 3, 'TApiDatabase.DataModuleCreate' ); Logger.Log( 1, 'TApiDatabase.DataModuleCreate' );
LoadDatabaseSettings( ucKG, 'kgOrdersServer.ini' ); LoadDatabaseSettings( ucKG, 'kgOrdersServer.ini' );
try try
ucKG.Connect; ucKG.Connect;
except except
on E: Exception do on E: Exception do
begin begin
Logger.Log(3, '--TApiDatabase.DataModuleCreate -Error connecting to database: ' + E.Message); Logger.Log(2, '--TApiDatabase.DataModuleCreate -Error connecting to database: ' + E.Message);
end; end;
end; end;
end; end;
......
...@@ -39,14 +39,14 @@ uses ...@@ -39,14 +39,14 @@ uses
procedure TAuthDatabase.DataModuleCreate(Sender: TObject); procedure TAuthDatabase.DataModuleCreate(Sender: TObject);
begin begin
Logger.Log( 3, 'TAuthDatabase.DataModuleCreate' ); Logger.Log( 1, 'TAuthDatabase.DataModuleCreate' );
LoadDatabaseSettings( ucKG, 'kgOrdersServer.ini' ); LoadDatabaseSettings( ucKG, 'kgOrdersServer.ini' );
try try
ucKG.Connect; ucKG.Connect;
except except
on E: Exception do on E: Exception do
begin begin
Logger.Log(3, '--TAuthDatabase.DataModuleCreate -Error connecting to database: ' + E.Message); Logger.Log(2, '--TAuthDatabase.DataModuleCreate -Error connecting to database: ' + E.Message);
end; end;
end; end;
end; end;
......
...@@ -104,7 +104,8 @@ var ...@@ -104,7 +104,8 @@ var
userState: Integer; userState: Integer;
JWT: TJWT; JWT: TJWT;
begin begin
Logger.Log(1, Format('AuthService.Login - User: "%s"', [User])); Logger.Log(3, Format( 'AuthService.Login - User: "%s"', [User]));
userState := CheckUser( user, password );
try try
userState := CheckUser(user, password); userState := CheckUser(user, password);
...@@ -117,11 +118,18 @@ begin ...@@ -117,11 +118,18 @@ begin
end; end;
if userState = 0 then if userState = 0 then
begin
raise EXDataHttpUnauthorized.Create('Invalid username or password'); raise EXDataHttpUnauthorized.Create('Invalid username or password');
if userState = 1 then logger.Log(2, 'Login Error: Invalid username or password');
end
else if userState = 1 then
begin
raise EXDataHttpUnauthorized.Create('User does not exist!'); raise EXDataHttpUnauthorized.Create('User does not exist!');
if userState = 2 then logger.Log(2, 'Login Error: User does not exist!');
end
else if userState = 2 then
raise EXDataHttpUnauthorized.Create('User not active!'); raise EXDataHttpUnauthorized.Create('User not active!');
logger.Log(2, 'Login Error: User not active!');
JWT := TJWT.Create; JWT := TJWT.Create;
try try
...@@ -148,12 +156,11 @@ function TAuthService.CheckUser(const user, password: string): Integer; ...@@ -148,12 +156,11 @@ function TAuthService.CheckUser(const user, password: string): Integer;
var var
userStr: string; userStr: string;
SQL: string; SQL: string;
date_created: string; name: string;
checkString: string; checkString: string;
begin begin
//authDB := TAuthDatabase.Create(nil);
Result := 0; Result := 0;
//Logger.Log( 3, Format('AuthService.CheckUser - User: "%s"', [user]) ); Logger.Log(1, Format('AuthService.CheckUser - User: "%s"', [user]) );
SQL := 'select * from users where USER_NAME = ' + QuotedStr(user); SQL := 'select * from users where USER_NAME = ' + QuotedStr(user);
DoQuery(authDB.uq, SQL); DoQuery(authDB.uq, SQL);
if authDB.uq.IsEmpty then if authDB.uq.IsEmpty then
...@@ -164,9 +171,9 @@ begin ...@@ -164,9 +171,9 @@ begin
Result := 2 // user is not active Result := 2 // user is not active
else else
begin begin
//date_created := authDB.uq.FieldByName('date_created').AsString; name := authDB.uq.FieldByName('NAME').AsString;
//checkString := THashSHA2.GetHashString(date_created + password, THashSHA2.TSHA2Version.SHA512).ToUpper; checkString := THashSHA2.GetHashString(name + password, THashSHA2.TSHA2Version.SHA512).ToUpper;
if password = authDB.uq.FieldByName('PASSWORD').AsString then if authDB.uq.FieldByName('PASSWORD').AsString = checkString then
begin begin
userName := user; userName := user;
userFullName:= authDB.uq.FieldByName('NAME').AsString;; userFullName:= authDB.uq.FieldByName('NAME').AsString;;
...@@ -177,8 +184,7 @@ begin ...@@ -177,8 +184,7 @@ begin
userQBID := authDB.uq.FieldByName('QB_ID').AsString; userQBID := authDB.uq.FieldByName('QB_ID').AsString;
userAccessType := authDB.uq.FieldByName('ACCESS_TYPE').AsString; userAccessType := authDB.uq.FieldByName('ACCESS_TYPE').AsString;
//Logger.Log( 3, Format('AuthDB.SetLoginAuditEntry: "%s"', [user]) ); Logger.Log(1, Format('AuthDB.SetLoginAuditEntry: "%s"', [user]) );
//AuthDB.SetLoginAuditEntry( userStr );
Result := 3; // Succcess Result := 3; // Succcess
end end
else else
......
...@@ -31,7 +31,7 @@ var ...@@ -31,7 +31,7 @@ var
implementation implementation
uses uses
Bcl.Json, System.SysUtils, System.IOUtils, Common.Logging; Bcl.Json, System.SysUtils, System.IOUtils, Common.Logging, System.StrUtils;
procedure LoadServerConfig; procedure LoadServerConfig;
var var
...@@ -58,11 +58,11 @@ begin ...@@ -58,11 +58,11 @@ begin
Logger.Log(1, '-- Config file not found.'); Logger.Log(1, '-- Config file not found.');
end; end;
Logger.Log(1, '-------------------------------------------------------------'); Logger.Log(1, '--- Server Config Values ---');
Logger.Log(1, '-- serverConfig.url: ' + serverConfig.url); Logger.Log(1, '-- url: ' + serverConfig.url + IfThen(serverConfig.url = defaultServerUrl, ' [default]', ' [from config]'));
Logger.Log(1, '-- serverConfig.adminPassword: ' + serverConfig.adminPassword); Logger.Log(1, '-- adminPassword: ' + serverConfig.adminPassword + IfThen(serverConfig.adminPassword = 'whatisthisusedfor', ' [default]', ' [from config]'));
Logger.Log(1, '-- serverConfig.jwtTokenSecret: ' + serverConfig.jwtTokenSecret); Logger.Log(1, '-- jwtTokenSecret: ' + serverConfig.jwtTokenSecret + IfThen(serverConfig.jwtTokenSecret = 'super_secret0123super_secret4567', ' [default]', ' [from config]'));
Logger.Log(1, '-- serverConfig.webAppFolder: ' + serverConfig.webAppFolder); Logger.Log(1, '-- webAppFolder: ' + serverConfig.webAppFolder + IfThen(serverConfig.webAppFolder = 'static', ' [default]', ' [from config]'));
Logger.Log(1, '-- serverConfig.reportsFolder: ' + serverConfig.reportsFolder); Logger.Log(1, '-- serverConfig.reportsFolder: ' + serverConfig.reportsFolder);
Logger.Log(1, '--LoadServerConfig - end'); Logger.Log(1, '--LoadServerConfig - end');
end; end;
......
...@@ -146,15 +146,15 @@ type ...@@ -146,15 +146,15 @@ type
data: TList<TCustomerItem>; data: TList<TCustomerItem>;
end; end;
TFullOrder = class //TODO change name to TCorrugatedOrder TCorrugatedOrder = class
Public Public
//Company //Company
ORDER_ID: integer;
COMPANY_ID: integer; COMPANY_ID: integer;
NAME: string; NAME: string;
SHORT_NAME: string; SHORT_NAME: string;
inQuickBooks: string; IN_QB: string;
ADDRESS_LIST: TList<TAddressItem>; QB_ORDER_NUM: string;
ITEMS: TItemList;
// Staff Fields: // Staff Fields:
staff_fields_order_date: string; staff_fields_order_date: string;
...@@ -174,12 +174,10 @@ type ...@@ -174,12 +174,10 @@ type
staff_fields_art_location: string; staff_fields_art_location: string;
// Supplied by Customer: // Supplied by Customer:
supplied_by_customer_b_w_copy: boolean; supplied_by_customer_color_copy: string;
supplied_by_customer_color_copy: boolean; supplied_by_customer_plates: string;
supplied_by_customer_plates: boolean; supplied_by_customer_sample_ca: string;
supplied_by_customer_sample_ca: boolean;
supplied_by_customer_dimension: string; supplied_by_customer_dimension: string;
supplied_by_customer_disk_or_cd: boolean;
supplied_by_customer_e_mail: string; supplied_by_customer_e_mail: string;
supplied_by_customer_ftp: string; supplied_by_customer_ftp: string;
supplied_by_customer_other: string; supplied_by_customer_other: string;
...@@ -198,13 +196,13 @@ type ...@@ -198,13 +196,13 @@ type
layout_accross_no: string; layout_accross_no: string;
layout_around_no: string; layout_around_no: string;
layout_cad_file: string; layout_cad_file: string;
layout_excalibur_die: boolean; layout_excalibur_die: string;
layout_rsc_style: string; layout_rsc_style: string;
// Mounting // Mounting
mounting_loose: string; mounting_loose: string;
mounting_sticky_bak: boolean; mounting_sticky_bak: string;
mounting_full_mount: boolean; mounting_full_mount: string;
mounting_strip_mount: string; mounting_strip_mount: string;
mounting_standard_setup: string; mounting_standard_setup: string;
mounting_custom_backing: string; mounting_custom_backing: string;
...@@ -223,12 +221,12 @@ type ...@@ -223,12 +221,12 @@ type
proofing_e_mail: string; proofing_e_mail: string;
proofing_e_mail_attn: string; proofing_e_mail_attn: string;
proofing_ship_to: string; proofing_ship_to: string;
proofing_full_size_panel: boolean; proofing_full_size_panel: string;
proofing_print_card: boolean; proofing_print_card: string;
proofing_wide_format: boolean; proofing_wide_format: string;
proofing_pdf_file: boolean; proofing_pdf_file: string;
proofing_other: string; proofing_other: string;
proofing_art_approved_as_is: boolean; proofing_art_approved_as_is: string;
proofing_approved_date: string; proofing_approved_date: string;
// Plates // Plates
...@@ -243,12 +241,12 @@ type ...@@ -243,12 +241,12 @@ type
TWebOrder = class TWebOrder = class
Public Public
//Company //Company
ORDER_ID: integer;
COMPANY_ID: integer; COMPANY_ID: integer;
NAME: string; NAME: string;
SHORT_NAME: string; SHORT_NAME: string;
inQuickBooks: string; IN_QB: string;
ADDRESS_LIST: TList<TAddressItem>; QB_ORDER_NUM: string;
ITEMS: TItemList;
// Staff Fields: // Staff Fields:
staff_fields_order_date: string; staff_fields_order_date: string;
...@@ -281,12 +279,12 @@ type ...@@ -281,12 +279,12 @@ type
supplied_by_customer_initials: string; supplied_by_customer_initials: string;
// Proofing // Proofing
proofing_pdf: boolean; proofing_pdf: string;
proofing_pdf_to: string; proofing_pdf_to: string;
proofing_pdf_date_1: string; proofing_pdf_date_1: string;
proofing_pdf_date_2: string; proofing_pdf_date_2: string;
proofing_pdf_date_3: string; proofing_pdf_date_3: string;
proofing_full_size_ink_jet_for: boolean; proofing_full_size_ink_jet_for: string;
proofing_ink_jet_to: string; proofing_ink_jet_to: string;
proofing_ink_jet_to_2: string; proofing_ink_jet_to_2: string;
proofing_ink_jet_date_1: string; proofing_ink_jet_date_1: string;
...@@ -479,7 +477,7 @@ type ...@@ -479,7 +477,7 @@ type
[HttpGet] function GetUsers(searchOptions: string): TUserList; [HttpGet] function GetUsers(searchOptions: string): TUserList;
[HttpGet] function GetItems(searchOptions: string): TItemList; [HttpGet] function GetItems(searchOptions: string): TItemList;
[HttpGet] function GetOrders(searchOptions: string): TOrderList; [HttpGet] function GetOrders(searchOptions: string): TOrderList;
[HttpGet] function GetOrder(orderInfo: string): TFullOrder; [HttpGet] function GetCorrugatedOrder(orderInfo: string): TCorrugatedOrder;
[HttpGet] function GetWebOrder(orderInfo: string): TWebOrder; [HttpGet] function GetWebOrder(orderInfo: string): TWebOrder;
[HttpGet] function GetCuttingDieOrder(orderInfo: string): TCuttingDie; [HttpGet] function GetCuttingDieOrder(orderInfo: string): TCuttingDie;
[HttpGet] function GetCustomers(customerInfo: string): TCustomerList; [HttpGet] function GetCustomers(customerInfo: string): TCustomerList;
......
...@@ -124,6 +124,7 @@ begin ...@@ -124,6 +124,7 @@ begin
Logger.Log( 1, 'iniFile: ' + ExtractFilePath(Application.ExeName) + 'kgOrdersServer.ini' ); Logger.Log( 1, 'iniFile: ' + ExtractFilePath(Application.ExeName) + 'kgOrdersServer.ini' );
Logger.Log( 1, 'LogLevels are displayed here. They were set in kgOrdersServer.dpr, it executes first' ); Logger.Log( 1, 'LogLevels are displayed here. They were set in kgOrdersServer.dpr, it executes first' );
Logger.Log(1, '--- Settings ---');
iniStr := iniFile.ReadString( 'Settings', 'MemoLogLevel', '' ); iniStr := iniFile.ReadString( 'Settings', 'MemoLogLevel', '' );
if iniStr.IsEmpty then if iniStr.IsEmpty then
Logger.Log( 1, '--Settings->memoLogLevel: Entry not found - default: 3' ) Logger.Log( 1, '--Settings->memoLogLevel: Entry not found - default: 3' )
...@@ -143,12 +144,13 @@ begin ...@@ -143,12 +144,13 @@ begin
else else
Logger.Log( 1, '--Settings->LogFileNum: ' + IntToStr(StrToInt(iniStr) - 1) ); Logger.Log( 1, '--Settings->LogFileNum: ' + IntToStr(StrToInt(iniStr) - 1) );
Logger.Log( 1, '' ); Logger.Log(1, '--- Database ---');
iniStr := IniFile.ReadString( 'Database', 'Server', '' ); iniStr := IniFile.ReadString( 'Database', 'Server', '' );
if iniStr.IsEmpty then if iniStr.IsEmpty then
Logger.Log( 1, '--Database->Server: Entry not found' ) Logger.Log( 1, '--Database->Server: Entry not found' )
else else
Logger.Log( 1, '--Database->Server: ' + iniStr ); Logger.Log( 1, '--Database->Server: ' + iniStr );
iniStr := iniFile.ReadString('Database', 'Database', ''); iniStr := iniFile.ReadString('Database', 'Database', '');
if iniStr.IsEmpty then if iniStr.IsEmpty then
Logger.Log( 1, '----Database->Database: Entry not found' ) Logger.Log( 1, '----Database->Database: Entry not found' )
...@@ -167,6 +169,43 @@ begin ...@@ -167,6 +169,43 @@ begin
else else
Logger.Log( 1, '----Database->Password: xxxxxxxx' ); Logger.Log( 1, '----Database->Password: xxxxxxxx' );
Logger.Log(1, '---Quickbooks---');
iniStr := IniFile.ReadString( 'Quickbooks', 'CompanyID', '' );
if iniStr.IsEmpty then
Logger.Log( 1, '--Quickbooks->CompanyID: Entry not found' )
else
Logger.Log( 1, '--Quickbooks->CompanyID: ' + 'Entry found' );
iniStr := IniFile.ReadString( 'Quickbooks', 'ClientID', '' );
if iniStr.IsEmpty then
Logger.Log( 1, '--Quickbooks->ClientID: Entry not found' )
else
Logger.Log( 1, '--Quickbooks->ClientID: ' + 'Entry found' );
iniStr := IniFile.ReadString( 'Quickbooks', 'ClientSecret', '' );
if iniStr.IsEmpty then
Logger.Log( 1, '--Quickbooks->ClientSecret: Entry not found' )
else
Logger.Log( 1, '--Quickbooks->ClientSecret: ' + 'Entry found' );
iniStr := IniFile.ReadString( 'Quickbooks', 'RefreshToken', '' );
if iniStr.IsEmpty then
Logger.Log( 1, '--Quickbooks->RefreshToken: Entry not found' )
else
Logger.Log( 1, '--Quickbooks->RefreshToken: ' + 'Entry found' );
iniStr := IniFile.ReadString( 'Quickbooks', 'AccessToken', '' );
if iniStr.IsEmpty then
Logger.Log( 1, '--Quickbooks->AccessToken: Entry not found' )
else
Logger.Log( 1, '--Quickbooks->AccessToken: ' + 'Entry found' );
iniStr := IniFile.ReadString( 'Quickbooks', 'LastRefresh', '' );
if iniStr.IsEmpty then
Logger.Log( 1, '--Quickbooks->LastRefresh: Entry not found' )
else
Logger.Log( 1, '--Quickbooks->LastRefresh: ' + iniStr );
Logger.Log( 1, '' ); Logger.Log( 1, '' );
finally finally
IniFile.Free; IniFile.Free;
......
...@@ -124,14 +124,14 @@ uses ...@@ -124,14 +124,14 @@ uses
procedure TrptOrderCorrugated.DataModuleCreate(Sender: TObject); procedure TrptOrderCorrugated.DataModuleCreate(Sender: TObject);
begin begin
Logger.Log( 3, 'TAuthDatabase.DataModuleCreate' ); Logger.Log( 1, 'TAuthDatabase.DataModuleCreate' );
LoadDatabaseSettings( ucKG, 'kgOrdersServer.ini' ); LoadDatabaseSettings( ucKG, 'kgOrdersServer.ini' );
try try
ucKG.Connect; ucKG.Connect;
except except
on E: Exception do on E: Exception do
begin begin
Logger.Log(3, '--TrptOrderList.DataModuleCreate -Error connecting to database: ' + E.Message); Logger.Log(2, '--TrptOrderList.DataModuleCreate -Error connecting to database: ' + E.Message);
end; end;
end; end;
end; end;
...@@ -146,7 +146,7 @@ var ...@@ -146,7 +146,7 @@ var
i, rowIndex: Integer; i, rowIndex: Integer;
temp: TObject; temp: TObject;
begin begin
logger.Log(1, 'Adding Color Rows'); logger.Log(5, 'Adding Color Rows');
colorsString := uqOrderCorrugated.FieldByName('colors_colors').AsString; colorsString := uqOrderCorrugated.FieldByName('colors_colors').AsString;
colorsObject := TJSONObject.ParseJSONValue(colorsString) as TJSONObject; colorsObject := TJSONObject.ParseJSONValue(colorsString) as TJSONObject;
...@@ -183,7 +183,7 @@ var ...@@ -183,7 +183,7 @@ var
colorListJSON: TJSONArray; colorListJSON: TJSONArray;
items: TJSObject; items: TJSObject;
begin begin
Logger.Log(3, 'Generated SQL for Prepare Report: ' + SQL); Logger.Log(5, 'Generated SQL for Prepare Report: ' + SQL);
doQuery(uqOrderCorrugated, SQL); doQuery(uqOrderCorrugated, SQL);
if ( string( uqOrderCorrugated.FieldByName('colors_colors').AsString ) ) <> '' then if ( string( uqOrderCorrugated.FieldByName('colors_colors').AsString ) ) <> '' then
...@@ -195,7 +195,7 @@ begin ...@@ -195,7 +195,7 @@ begin
result := GeneratePDF; result := GeneratePDF;
Logger.Log(3, 'Report preparation complete.'); Logger.Log(5, 'Report preparation complete.');
end; end;
...@@ -209,7 +209,7 @@ begin ...@@ -209,7 +209,7 @@ begin
if not DirectoryExists(ReportDir) then if not DirectoryExists(ReportDir) then
begin begin
ForceDirectories(ReportDir); ForceDirectories(ReportDir);
Logger.Log(5, 'Reports directory created: ' + ReportDir); Logger.Log(1, 'Reports directory created: ' + ReportDir);
end; end;
reportURL := 'reports/' + FormatDateTime('yyyymmdd_hhnnss', Now) + '.pdf'; reportURL := 'reports/' + FormatDateTime('yyyymmdd_hhnnss', Now) + '.pdf';
......
...@@ -47,75 +47,6 @@ object rptOrderCutting: TrptOrderCutting ...@@ -47,75 +47,6 @@ object rptOrderCutting: TrptOrderCutting
DataSetOptions = [] DataSetOptions = []
Left = 444 Left = 444
Top = 206 Top = 206
FieldDefs = <
item
FieldName = 'ORDER_ID'
end
item
FieldName = 'COMPANY_ID'
end
item
FieldName = 'USER_ID'
end
item
FieldName = 'ORDER_DATE'
FieldType = fftDateTime
end
item
FieldName = 'staff_fields_order_date'
FieldType = fftDateTime
end
item
FieldName = 'staff_fields_proof_date'
FieldType = fftDateTime
end
item
FieldName = 'staff_fields_ship_date'
FieldType = fftDateTime
end
item
FieldName = 'staff_fields_ship_via'
FieldType = fftString
Size = 45
end
item
FieldName = 'staff_fields_quantity'
FieldType = fftString
end
item
FieldName = 'staff_fields_price'
FieldType = fftString
end
item
FieldName = 'staff_fields_invoice_to'
FieldType = fftString
Size = 128
end
item
FieldName = 'staff_fields_ship_to'
FieldType = fftString
Size = 128
end
item
FieldName = 'staff_fields_po_number'
FieldType = fftString
Size = 16
end
item
FieldName = 'staff_fields_job_name'
FieldType = fftString
Size = 45
end
item
FieldName = 'staff_fields_quickbooks_item'
FieldType = fftString
Size = 45
end
item
FieldName = 'general_special_instructions'
FieldType = fftString
Size = 2048
end>
end end
object frxOrderCutting: TfrxReport object frxOrderCutting: TfrxReport
Version = '2025.1.4' Version = '2025.1.4'
......
...@@ -54,14 +54,14 @@ uses ...@@ -54,14 +54,14 @@ uses
procedure TrptOrderCutting.DataModuleCreate(Sender: TObject); procedure TrptOrderCutting.DataModuleCreate(Sender: TObject);
begin begin
Logger.Log( 3, 'TAuthDatabase.DataModuleCreate' ); Logger.Log( 1, 'TAuthDatabase.DataModuleCreate' );
LoadDatabaseSettings( ucKG, 'kgOrdersServer.ini' ); LoadDatabaseSettings( ucKG, 'kgOrdersServer.ini' );
try try
ucKG.Connect; ucKG.Connect;
except except
on E: Exception do on E: Exception do
begin begin
Logger.Log(3, '--TrptOrderList.DataModuleCreate -Error connecting to database: ' + E.Message); Logger.Log(2, '--TrptOrderList.DataModuleCreate -Error connecting to database: ' + E.Message);
end; end;
end; end;
end; end;
...@@ -91,7 +91,7 @@ begin ...@@ -91,7 +91,7 @@ begin
result := GeneratePDF; result := GeneratePDF;
Logger.Log(3, 'Report preparation complete.'); Logger.Log(5, 'Report preparation complete.');
end; end;
...@@ -105,7 +105,7 @@ begin ...@@ -105,7 +105,7 @@ begin
if not DirectoryExists(ReportDir) then if not DirectoryExists(ReportDir) then
begin begin
ForceDirectories(ReportDir); ForceDirectories(ReportDir);
Logger.Log(5, 'Reports directory created: ' + ReportDir); Logger.Log(1, 'Reports directory created: ' + ReportDir);
end; end;
reportURL := 'reports\' + FormatDateTime('yyyymmdd_hhnnss', Now) + '.pdf'; reportURL := 'reports\' + FormatDateTime('yyyymmdd_hhnnss', Now) + '.pdf';
......
...@@ -67,14 +67,14 @@ uses ...@@ -67,14 +67,14 @@ uses
procedure TrptOrderList.DataModuleCreate(Sender: TObject); procedure TrptOrderList.DataModuleCreate(Sender: TObject);
begin begin
Logger.Log( 3, 'TAuthDatabase.DataModuleCreate' ); Logger.Log( 1, 'TAuthDatabase.DataModuleCreate' );
LoadDatabaseSettings( ucKG, 'kgOrdersServer.ini' ); LoadDatabaseSettings( ucKG, 'kgOrdersServer.ini' );
try try
ucKG.Connect; ucKG.Connect;
except except
on E: Exception do on E: Exception do
begin begin
Logger.Log(3, '--TrptOrderList.DataModuleCreate -Error connecting to database: ' + E.Message); Logger.Log(2, '--TrptOrderList.DataModuleCreate -Error connecting to database: ' + E.Message);
end; end;
end; end;
end; end;
...@@ -113,7 +113,7 @@ begin ...@@ -113,7 +113,7 @@ begin
result := GeneratePDF; result := GeneratePDF;
Logger.Log(3, 'Report preparation complete.'); Logger.Log(5, 'Report preparation complete.');
end; end;
...@@ -148,10 +148,6 @@ begin ...@@ -148,10 +148,6 @@ begin
uqColors.Close; // Ensure it is closed uqColors.Close; // Ensure it is closed
end; end;
//uqOrdersORD.AsDateTime := uqOrdersORDER_DATE.AsDateTime;
//logger.Log(3, uqOrders.FieldByName('ORDER_DATE').AsString);
if uqOrdersORDER_DATE.AsString <> '' then if uqOrdersORDER_DATE.AsString <> '' then
uqOrdersNEW_ORDER_DATE.AsString := FormatDateTime('m/d/yyyy HH:nn', uqOrdersORDER_DATE.AsDateTime) uqOrdersNEW_ORDER_DATE.AsString := FormatDateTime('m/d/yyyy HH:nn', uqOrdersORDER_DATE.AsDateTime)
else else
...@@ -213,7 +209,7 @@ begin ...@@ -213,7 +209,7 @@ begin
if not DirectoryExists(ReportDir) then if not DirectoryExists(ReportDir) then
begin begin
ForceDirectories(ReportDir); ForceDirectories(ReportDir);
Logger.Log(3, 'Reports directory created: ' + ReportDir); Logger.Log(1, 'Reports directory created: ' + ReportDir);
end; end;
reportURL := 'reports/' + FormatDateTime('yyyymmdd_hhnnss', Now) + '.pdf'; reportURL := 'reports/' + FormatDateTime('yyyymmdd_hhnnss', Now) + '.pdf';
...@@ -229,7 +225,7 @@ begin ...@@ -229,7 +225,7 @@ begin
frxOrderList.Clear; // Clears the report to avoid memory bloat frxOrderList.Clear; // Clears the report to avoid memory bloat
end; end;
Logger.Log(3, 'PDF saved to: ' + ReportFileName); Logger.Log(5, 'PDF saved to: ' + ReportFileName);
result := reportURL; result := reportURL;
end; end;
......
...@@ -124,14 +124,14 @@ uses ...@@ -124,14 +124,14 @@ uses
procedure TrptOrderWeb.DataModuleCreate(Sender: TObject); procedure TrptOrderWeb.DataModuleCreate(Sender: TObject);
begin begin
Logger.Log( 3, 'TAuthDatabase.DataModuleCreate' ); Logger.Log( 1, 'TAuthDatabase.DataModuleCreate' );
LoadDatabaseSettings( ucKG, 'kgOrdersServer.ini' ); LoadDatabaseSettings( ucKG, 'kgOrdersServer.ini' );
try try
ucKG.Connect; ucKG.Connect;
except except
on E: Exception do on E: Exception do
begin begin
Logger.Log(3, '--TrptOrderList.DataModuleCreate -Error connecting to database: ' + E.Message); Logger.Log(2, '--TrptOrderList.DataModuleCreate -Error connecting to database: ' + E.Message);
end; end;
end; end;
end; end;
...@@ -146,7 +146,7 @@ var ...@@ -146,7 +146,7 @@ var
i, rowIndex: Integer; i, rowIndex: Integer;
temp: TObject; temp: TObject;
begin begin
logger.Log(1, 'Adding Color Rows'); logger.Log(5, 'Adding Color Rows');
colorsString := uqOrderWeb.FieldByName('quantity_and_colors_qty_colors').AsString; colorsString := uqOrderWeb.FieldByName('quantity_and_colors_qty_colors').AsString;
colorsObject := TJSONObject.ParseJSONValue(colorsString) as TJSONObject; colorsObject := TJSONObject.ParseJSONValue(colorsString) as TJSONObject;
...@@ -210,7 +210,7 @@ begin ...@@ -210,7 +210,7 @@ begin
if not DirectoryExists(ReportDir) then if not DirectoryExists(ReportDir) then
begin begin
ForceDirectories(ReportDir); ForceDirectories(ReportDir);
Logger.Log(5, 'Reports directory created: ' + ReportDir); Logger.Log(1, 'Reports directory created: ' + ReportDir);
end; end;
reportURL := 'reports\' + FormatDateTime('yyyymmdd_hhnnss', Now) + '.pdf'; reportURL := 'reports\' + FormatDateTime('yyyymmdd_hhnnss', Now) + '.pdf';
......
...@@ -2,11 +2,12 @@ ...@@ -2,11 +2,12 @@
MemoLogLevel=3 MemoLogLevel=3
FileLogLevel=5 FileLogLevel=5
webClientVersion=0.9.8 webClientVersion=0.9.8
LogFileNum=941 webClientVersion=0.9.7
LogFileNum=972
[Database] [Database]
--Server=192.168.159.155 Server=192.168.159.162
Server=192.168.102.130 --Server=192.168.102.130
--Server=192.168.75.133 --Server=192.168.75.133
Database=kg_order_entry Database=kg_order_entry
Username=root Username=root
...@@ -14,11 +15,9 @@ Password=emsys01 ...@@ -14,11 +15,9 @@ Password=emsys01
--Password=emsys!012 --Password=emsys!012
[Quickbooks] [Quickbooks]
CompanyID=9341454272655710 CompanyID=9341454336461805
ClientID=ABgO14uvjh8XqLud7spQ8lkb98AUpcdA7HbyMJfCAtl65sQ5yy ClientID=ABYqlDx1EsacZYXvHIJ7RDB7zmnQdwABU3fwQLIZPmBgU0VW1P
ClientSecret=bQ06TRemHeAGFzVHRaTUvUoBU9jpU9itK6MOMgqN ClientSecret=PM7OnvQWsgOqjWfDpZAnyRttDN9446Am6d85pDxr
RefreshToken=RT1-44-H0-1762010333a3v07cb5eb0luyn2rppm RefreshToken=RT1-103-H0-1763213066r9617yglhu5jm7fm11jh
AccessToken=eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwieC5vcmciOiJIMCJ9..7T78YBCSmvuJPRsZ9lGwuQ.1VJssLuNBAPKI7RAJOPluhtlA8DYgNcmXebNkWSxrHJ1949vjY4SPt5JjruuLsNOV09i_xKrQ76w9Zhjom1MiQaSyNoZHU-CZLfOtWgr9r3-gLxizdTlrTs9cEZs__8ep4_oe2r3n2u34QlM0xdVdLWxQbKYjpCl0k_58XPbS5Z_Vo2Y5qqoAuGJIRxMaTueMOH1ut-bV4Em318Ca1jN2DFCh_NYjLwFQQenWxOrCRMBaj7ZgB2yjtS5mEUxhuxsB7FAeONYqBSJ0OAy1yzWE-Ycxzt4dcZBCTHxzUCTH0-P0Mb_M6ivfmiYyKctf2gsZD8Xw91MgnF9TPwG8yXdej05fWr94VWeC3tFp0V-RYYv3_XRuim6fCvxJjWzfVEZwv9jUiZ6WByNSzu1k1W5_rQuSG7_Hs8WiDC1sBChJLfDclLO8pMoznqpSrM8ZmiNoYm4aZPQrpO6rgY8NiTokZRyeTw2adtW1YgDJsZdoEw.i2MSpKztX0v6UN0vZz5gQg AccessToken=eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwieC5vcmciOiJIMCJ9..lXW-FVFOPPAtm-tzjyrE3Q.vWV5cCaLiP03iXblbK5VbosURDrUNsJT5uaKPzzv2S3Nujulxp57ss--nKRVmFBYuwIXxz6VDwh6SqxaECJrR5yysauOcKuz7m22qjOOTPJyaeEhm0u2FLvAODSUpaHN5NDQSgHqBd6_-E-B8gEJeHqDpO3UqxDi9yxy6Px3kyZWXs7InUWYEHtROsPOR_HeJ2vFMhXA5fkifbxCb5bkJOEABoAzrBoLm2QSD6VbV5ydfdrSwfuV--oZ0nvabPS88JurJSbaJyDKCUSmOEt2bnZadhEq88dHMNcOPfqELYSU0dKrzMs-TPYgqeg5wOx_MO0cKkRnSaACCevj-LCYo2YKgxXyYoiNgFIf6Gf4TfLO5is0nh3I0IT14112DBUc7lFwaBCS5m3d_4SCv6sH41rkr01wIPs2o45vGStSgUCuzHQos1UtrEvX96S2NDFt1sYQcNXpFexiTB5Z9WCJgmEH3xuUrkW_d6wzVCD-Src.ZmSj6RCCiDipsvEli9fdLg
LastRefresh=7/23/2025 11:18:54 AM LastRefresh=8/4/2025 9:27:46 AM
--RefreshToken=RT1-10-H0-1760618473k44t73jittvqlr4wynn6
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