Commit 553e411e by Cameron Hayes

Merge remote-tracking branch 'origin/cam3'

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