Refactor authorization and token refresh logic; update tax handling and invoice generation
- Changed variable name from `$stmt_service` to `$stmt_refreshkey` for clarity in `authorization.php` and `token_refresh.php`. - Added null coalescing operator to ensure criteria are set to an empty string if not provided in `products_software_versions.php`. - Modified SQL script to add `eu` column to `taxes` table and update tax rates based on EU membership. - Enhanced invoice generation logic in `functions.php` to include VAT notes based on customer country and VAT number. - Updated email and PDF templates to display VAT notes and percentages correctly. - Adjusted JavaScript tax calculation logic to handle VAT based on country and VAT number. - Fixed API URL in `index.php` for token refresh endpoint. - Updated countries data structure in `countries.php` to include EU membership status.
This commit is contained in:
@@ -54,7 +54,7 @@ if (!isset($_SESSION['authorization']['userkey']) ||
|
||||
|
||||
// Token missing, expired, or about to expire - get new token
|
||||
if (isset($_SESSION['authorization']['refreshkey'])) {
|
||||
$api_url = '/v2/token_refresh?refreshkey='.$_SESSION['authorization']['refreshkey'];
|
||||
$api_url = '/v2/token_refresh/refreshkey='.$_SESSION['authorization']['refreshkey'];
|
||||
$responses = ioServer($api_url, '');
|
||||
|
||||
//Decode Payload
|
||||
|
||||
Reference in New Issue
Block a user