WIP: TEMU

This commit is contained in:
2025-10-29 08:12:07 +00:00
parent 351e9af67d
commit b60ac8e2c0
2 changed files with 106 additions and 56 deletions

View File

@@ -3,7 +3,6 @@
//error_reporting(LC_ALL);
//ini_set('display_errors', 1);
// ?XDEBUG_SESSION_START=PHPSTORM
//importInvoices();
function apilo_importInvoices()
{
$apilo_config = apilo_loadConfiguration();
@@ -14,7 +13,8 @@ function apilo_importInvoices()
$offset = intval($db->fetchByAssoc($dbRes)['last_id']);
$invoices = apilo_loadInvoices($apilo_config['token'], $offset);
if (isset($invoices->error)) {
brecho($apilo_config);
if (isset($invoices->errors)) {
if (apilo_refreshToken($apilo_config['refreshToken'], $apilo_config['clientId'], $apilo_config['clientSecret']) == true) {
//$apilo_config = apilo_loadConfiguration();
//$invoices = apilo_loadInvoices($apilo_config['token'], $offset);
@@ -23,6 +23,8 @@ function apilo_importInvoices()
}
}
brecho($invoices);
$GLOBALS['log']->bimit('----- Importing invoices from Apilo, documents count', count($invoices->documents));
$platforms = apilo_loadPlatformsList($apilo_config['token']);