Skip to content

Commit

Permalink
v1.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitexus committed Nov 27, 2024
1 parent a1d5c11 commit b5c24a0
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 135 deletions.
10 changes: 8 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
pohoda-raiffeisenbank (0.4.0) UNRELEASED; urgency=medium
pohoda-raiffeisenbank (1.0.0) UNRELEASED; urgency=medium

* v1.0.0 release

-- vitex <[email protected]> Wed, 27 Nov 2024 09:43:27 +0100

pohoda-raiffeisenbank (0.4.0) jammy; urgency=medium

* now produce json report

-- vitex <[email protected]> Tue, 26 Nov 2024 11:07:58 +0100
-- vitex <[email protected]> Wed, 27 Nov 2024 09:43:12 +0100

pohoda-raiffeisenbank (0.3.1) jammy; urgency=medium

Expand Down
10 changes: 5 additions & 5 deletions src/Pohoda/RaiffeisenBank/PohodaBankClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ abstract class PohodaBankClient extends \mServer\Bank
/**
* Transaction Handler.
*
* @param string $bankAccount Account Number
* @param array $options
* @param string $bankAccount Account Number
* @param array<string,string> $options
*/
public function __construct($bankAccount, $options = [])
public function __construct(string $bankAccount, $options = [])
{
parent::__construct();
parent::__construct(null, $options);
$this->setDataValue('account', $bankAccount);
// $this->constantor = new \Pohoda\RW(null, ['evidence' => 'konst-symbol']);
// $this->constSymbols = $this->constantor->getColumnsFromPohoda(['kod'], ['limit' => 0], 'kod');
Expand Down Expand Up @@ -379,7 +379,7 @@ public function generateAutomaticLiquidationXML($producedNumber)
return $xml->asXML();
}

public function getCompanyId()
public function getCompanyId(): string
{
return \Ease\Shared::cfg('POHODA_ICO');
}
Expand Down
39 changes: 0 additions & 39 deletions src/pohoda-raiffeisenbank-setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,42 +24,3 @@
$x_request_id = time(); // string | Unique request id provided by consumer application for reference and auditing.

Transactor::checkCertificatePresence(\Ease\Shared::cfg('CERT_FILE'));

exit(0); // TODO

try {
$result = $apiInstance->getAccounts($x_request_id);

if (\array_key_exists('accounts', $result)) {
$banker = new \SpojeNet\PohodaSQL\DOC();

if (\Ease\Shared::cfg('APP_DEBUG')) {
$banker->logBanner($apiInstance->getConfig()->getUserAgent());
}

$currentAccounts = $banker->getColumnsFromPohoda(['id', 'kod', 'nazev', 'iban', 'bic', 'nazBanky', 'poznam'], ['limit' => 0], 'iban');

foreach ($result['accounts'] as $account) {
if (\array_key_exists($account->iban, $currentAccounts)) {
$banker->addStatusMessage(sprintf('Account %s already exists in pohoda as %s', $account->friendlyName, $currentAccounts[$account->iban]['kod']));
} else {
$banker->dataReset();
$banker->setDataValue('kod', 'RB'.$account->accountId);
$banker->setDataValue('nazev', $account->accountName);
$banker->setDataValue('buc', $account->accountNumber);
$banker->setDataValue('nazBanky', 'Raiffeisenbank');
$banker->setDataValue('popis', $account->friendlyName);
$banker->setDataValue('iban', $account->iban);
$banker->setDataValue('smerKod', \Pohoda\RO::code($account->bankCode));
$banker->setDataValue('bic', $account->bankBicCode);
$saved = $banker->sync();
$banker->addStatusMessage(
sprintf('Account %s registered in flexibee as %s', $account->friendlyName, $banker->getRecordCode()),
$saved ? 'success' : 'error',
);
}
}
}
} catch (Exception $e) {
echo 'Exception when calling GetAccountsApi->getAccounts: ', $e->getMessage(), \PHP_EOL;
}
85 changes: 0 additions & 85 deletions src/pohoda-raiffeisenbank-xml-statement.php

This file was deleted.

8 changes: 4 additions & 4 deletions src/pohodaSQL-raiffeisenbank-statements-sharepoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,20 @@
$uploaded = $ctx->getBaseUrl().'/_layouts/15/download.aspx?SourceUrl='.urlencode($uploadFile->getServerRelativeUrl());
$engine->addStatusMessage(_('Uploaded').': '.$uploaded, 'success');
$report['sharepoint'][basename($filename)] = $uploaded;
$fileUrls[basename($filename)] = $uploaded;
} catch (\Exception $exc) {
fwrite(fopen('php://stderr', 'wb'), $exc->getMessage().\PHP_EOL);

$exitcode =1;
}

$fileUrls[basename($filename)] = $uploaded;
}
} else {
if (\is_array($pdfStatements)) {
$engine->addStatusMessage(_('No PDF statements obtained'), 'info');
} else {
if (is_null($pdfStatements)) {
$engine->addStatusMessage(_('Error obtaining PDF statements'), 'error');
$exitcode = 2;
} else {
$engine->addStatusMessage(_('No PDF statements obtained'), 'info');
}
}

Expand Down

0 comments on commit b5c24a0

Please sign in to comment.