Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Spoje-NET/pohoda-raiffeisenbank
Browse files Browse the repository at this point in the history
  • Loading branch information
Vítězslav Dvořák committed Jan 21, 2025
2 parents f0ca7f1 + 1670028 commit ea9e51f
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 15 deletions.
11 changes: 9 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
pohoda-raiffeisenbank (1.2.0) UNRELEASED; urgency=medium
pohoda-raiffeisenbank (1.2.1) jammy; urgency=medium

* foregin currency use fix

-- vitex <[email protected]> Fri, 20 Dec 2024 11:13:04 +0100

pohoda-raiffeisenbank (1.2.0) jammy; urgency=medium

[ [email protected] ]
* ACCOUNT_CURRENCY support added

-- <vitezslav.dvorak@spojenet.cz> Thu, 12 Dec 2024 19:46:43 +0100
-- vitex <info@vitexsoftware.cz> Wed, 18 Dec 2024 13:01:26 +0100

pohoda-raiffeisenbank (1.1.3) jammy; urgency=medium

Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@
"defval": "",
"required": false
},
"APP_DEBUG": {
"type": "checkbox",
"description": "Show debug messages",
"defval": "False",
"required": true
},
"RESULT_FILE": {
"type": "string",
"description": "write output json data to",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@
"defval": "bank_statement_upoad_{ACCOUNT_NUMBER}.json",
"required": false
},
"APP_DEBUG": {
"type": "checkbox",
"description": "Show debug messages",
"defval": "False",
"required": true
},
"ZABBIX_KEY": {
"type": "string",
"description": "Default name for Zabbix Item key name",
Expand Down
4 changes: 2 additions & 2 deletions src/Pohoda/RaiffeisenBank/Statementor.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ public function getStatements(): array

public function download(string $format): array
{
return $this->obtainer->download($this->statementsDir, $this->getStatements(), $format);
return $this->obtainer->download($this->statementsDir, $this->getStatements(), $format, $this->currency);
}

public function downloadOne($statement, $format)
{
return $this->obtainer->download($this->statementsDir, [$statement], $format);
return $this->obtainer->download($this->statementsDir, [$statement], $format, $this->currency);
}

/**
Expand Down
5 changes: 3 additions & 2 deletions src/pohoda-raiffeisenbank-setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
2 changes: 1 addition & 1 deletion src/pohoda-raiffeisenbank-statements.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
require_once '../vendor/autoload.php';

\define('APP_NAME', 'Pohoda RaiffeisenBank Statements');

$exitcode = 0;
/**
* Get today's Statements list.
*/
Expand Down
8 changes: 5 additions & 3 deletions src/pohoda-raiffeisenbank-transactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
8 changes: 5 additions & 3 deletions src/pohodaSQL-raiffeisenbank-statements-sharepoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@
$engine->setCurrency(Shared::cfg('ACCOUNT_CURRENCY'));
}

$engine->logBanner($engine->getAccount().' '.$engine->getCurrencyCode(), 'Scope: '.$engine->scope);
if (Shared::cfg('APP_DEBUG', false)) {
$engine->logBanner($engine->getAccount().' '.$engine->getCurrencyCode(), 'Scope: '.$engine->scope);
}

$exitcode = 0;
$fileUrls = [];
$report = [
Expand All @@ -76,7 +79,6 @@

if ($pdfStatements) {
sleep(5);

$pdfStatements = $engine->getPdfStatements();

if (Shared::cfg('OFFICE365_USERNAME', false) && Shared::cfg('OFFICE365_PASSWORD', false)) {
Expand Down Expand Up @@ -127,7 +129,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) {
Expand Down
5 changes: 4 additions & 1 deletion src/raiffeisenbank-statements-sharepoint-uploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@
$engine->setCurrency(Shared::cfg('ACCOUNT_CURRENCY'));
}

$engine->logBanner($engine->getAccount().' '.$engine->getCurrencyCode(), 'Scope: '.$engine->scope);
if (Shared::cfg('APP_DEBUG', false)) {
$engine->logBanner($engine->getAccount().' '.$engine->getCurrencyCode(), 'Scope: '.$engine->scope);
}

$exitcode = 0;
$fileUrls = [];
$report = [
Expand Down

0 comments on commit ea9e51f

Please sign in to comment.