diff --git a/composer.json b/composer.json index f1f79bb..c9ff160 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "vgrem/php-spo": "^3", "vitexsoftware/pohoda-connector": "^0.5", "vitexsoftware/rbczpremiumapi": "dev-main", - "spojenet/pohoda-sql": "dev-main" + "spojenet/pohoda-sql": "^0.1" }, "autoload": { "psr-4": { diff --git a/debian/control b/debian/control index 51ab028..bbbd03f 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,7 @@ Homepage: https://github.com/Spoje-NET/pohoda-raiffeisenbank Package: pohoda-raiffeisenbank Architecture: all Multi-Arch: foreign -Depends: ${misc:Depends}, ${shlibs:Depends}, php-vitexsoftware-rbczpremiumapi, php-spojenet-pohoda-sql, php-vitexsoftware-pohoda-connector (>= 0.5.0) +Depends: ${misc:Depends}, ${shlibs:Depends}, php-vitexsoftware-rbczpremiumapi (>=1.2.3), php-spojenet-pohoda-sql (>= 0.2), php-vitexsoftware-pohoda-connector (>= 0.5.0) Description: Import Raiffeisenbank statements into Pohoda See your Bank Account Statements in Pohoda diff --git a/src/pohoda-raiffeisenbank-setup.php b/src/pohoda-raiffeisenbank-setup.php index 201a2c9..f24c817 100644 --- a/src/pohoda-raiffeisenbank-setup.php +++ b/src/pohoda-raiffeisenbank-setup.php @@ -15,12 +15,13 @@ namespace Pohoda\RaiffeisenBank; +use Ease\Shared; + require_once '../vendor/autoload.php'; /** * Get List of bank accounts and import it into Pohoda. */ -\Ease\Shared::init(['POHODA_URL', 'POHODA_USERNAME', 'POHODA_PASSWORD', 'POHODA_ICO', 'CERT_FILE', 'CERT_PASS', 'XIBMCLIENTID'], $argv[1] ?? '../.env'); +Shared::init(['POHODA_URL', 'POHODA_USERNAME', 'POHODA_PASSWORD', 'POHODA_ICO', 'CERT_FILE', 'CERT_PASS', 'XIBMCLIENTID'], $argv[1] ?? '../.env'); $apiInstance = new \VitexSoftware\Raiffeisenbank\PremiumAPI\GetAccountsApi(); -$x_request_id = time(); // string | Unique request id provided by consumer application for reference and auditing. PohodaBankClient::checkCertificate(Shared::cfg('CERT_FILE'), Shared::cfg('CERT_PASS')); diff --git a/src/pohoda-raiffeisenbank-statements.php b/src/pohoda-raiffeisenbank-statements.php index 69680ae..295cebe 100644 --- a/src/pohoda-raiffeisenbank-statements.php +++ b/src/pohoda-raiffeisenbank-statements.php @@ -20,7 +20,7 @@ require_once '../vendor/autoload.php'; \define('APP_NAME', 'Pohoda RaiffeisenBank Statements'); - +$exitcode = 0; /** * Get today's Statements list. */ diff --git a/src/pohoda-raiffeisenbank-transactions.php b/src/pohoda-raiffeisenbank-transactions.php index 096fd1e..d49f6c5 100644 --- a/src/pohoda-raiffeisenbank-transactions.php +++ b/src/pohoda-raiffeisenbank-transactions.php @@ -15,14 +15,16 @@ namespace Pohoda\RaiffeisenBank; +use Ease\Shared; + \define('APP_NAME', 'PohodaRBTransactions'); require_once '../vendor/autoload.php'; /** * Get today's transactions list. */ -\Ease\Shared::init(['POHODA_URL', 'POHODA_USERNAME', 'POHODA_PASSWORD', 'POHODA_ICO', 'CERT_FILE', 'CERT_PASS', 'XIBMCLIENTID', 'ACCOUNT_NUMBER'], $argv[1] ?? '../.env'); +Shared::init(['POHODA_URL', 'POHODA_USERNAME', 'POHODA_PASSWORD', 'POHODA_ICO', 'CERT_FILE', 'CERT_PASS', 'XIBMCLIENTID', 'ACCOUNT_NUMBER'], $argv[1] ?? '../.env'); PohodaBankClient::checkCertificate(Shared::cfg('CERT_FILE'), Shared::cfg('CERT_PASS')); -$engine = new Transactor(\Ease\Shared::cfg('ACCOUNT_NUMBER')); -$engine->setScope(\Ease\Shared::cfg('IMPORT_SCOPE', 'yesterday')); +$engine = new Transactor(Shared::cfg('ACCOUNT_NUMBER')); +$engine->setScope(Shared::cfg('IMPORT_SCOPE', 'yesterday')); $engine->import(); diff --git a/src/pohodaSQL-raiffeisenbank-statements-sharepoint.php b/src/pohodaSQL-raiffeisenbank-statements-sharepoint.php index 192bae3..cefb3bb 100644 --- a/src/pohodaSQL-raiffeisenbank-statements-sharepoint.php +++ b/src/pohodaSQL-raiffeisenbank-statements-sharepoint.php @@ -108,7 +108,7 @@ } } } else { - if (null === $pdfStatements) { + if (is_null($pdfStatements) ) { $engine->addStatusMessage(_('Error obtaining PDF statements'), 'error'); $exitcode = 2; } else { @@ -127,7 +127,7 @@ } if ($xmlStatements) { - $inserted = $engine->import(\Ease\Shared::cfg('POHODA_BANK_IDS', '')); + $inserted = $engine->import(Shared::cfg('POHODA_BANK_IDS', '')); $report['pohoda'] = $inserted; if ($inserted) { diff --git a/src/raiffeisenbank-statements-sharepoint-uploader.php b/src/raiffeisenbank-statements-sharepoint-uploader.php index 905c674..5f58a7b 100644 --- a/src/raiffeisenbank-statements-sharepoint-uploader.php +++ b/src/raiffeisenbank-statements-sharepoint-uploader.php @@ -45,9 +45,10 @@ $engine->setCurrency(Shared::cfg('ACCOUNT_CURRENCY')); } -if(Shared::cfg('APP_DEBUG', false)){ +if (Shared::cfg('APP_DEBUG', false)) { $engine->logBanner($engine->getAccount().' '.$engine->getCurrencyCode(), 'Scope: '.$engine->scope); } + $exitcode = 0; $fileUrls = []; $report = [