Skip to content

Commit

Permalink
use inetrnal note instead of main note
Browse files Browse the repository at this point in the history
use MULTIFLEXI_JOB_ID (with JOB_ID fallback) in internal note
  • Loading branch information
Vitexus committed Nov 25, 2024
1 parent 309bded commit 4e517f0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
10 changes: 9 additions & 1 deletion src/Pohoda/RaiffeisenBank/PohodaBankClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,17 +210,20 @@ public function getCurrencyCode()
/**
* Is Record with current remoteNumber already present in Pohoda ?
*
* @todo Implement using Pohoda API UserList
*
* @return bool
*/
public function checkForTransactionPresence()
{
$this->addStatusMessage('Checking for transaction presence - Not yet implemented', 'debug');
return false; // !empty($this->getColumnsFromPohoda('id', ['cisDosle' => $this->getDataValue('cisDosle')])); TODO
}

/**
* @param string $conSym
*/
public function ensureKSExists($conSym): void
public function ensureKSExists(string $conSym): void
{
if (!\array_key_exists($conSym, $this->constSymbols)) {
$this->constantor->insertToPohoda(['kod' => $conSym, 'poznam' => 'Created by Raiffeisen Bank importer', 'nazev' => '?!?!? '.$conSym]);
Expand All @@ -229,6 +232,11 @@ public function ensureKSExists($conSym): void
}
}

/**
* Insert Transaction to Pohoda.
*
* @return array<int, array<string,string>> Imported Transactions
*/
public function insertTransactionToPohoda(): array
{
$producedId = '';
Expand Down
10 changes: 5 additions & 5 deletions src/Pohoda/RaiffeisenBank/Statementor.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ class Statementor extends PohodaBankClient
/**
* Downloaded XML statements.
*
* @var array<string>
* @var array<string,string>
*/
private array $statementsXML = [];

/**
* Downloaded PDF statements.
*
* @var array<string>
* @var array<string,string>
*/
private array $statementsPDF = [];

Expand Down Expand Up @@ -101,7 +101,7 @@ public function importOnline()
/**
* Import Raiffeisen bank XML statement into Pohoda.
*
* @return array<string, array>
* @return list<array<string, string>>
*/
public function import(): array
{
Expand Down Expand Up @@ -144,8 +144,8 @@ public function import(): array
public function entryToPohoda($entry): array
{
$data['symPar'] = current((array) $entry->NtryRef);
$data['intNote'] = 'Import Job '.\Ease\Shared::cfg('JOB_ID', 'n/a');
$data['note'] = 'Imported by '.\Ease\Shared::AppName().' '.\Ease\Shared::AppVersion();
$data['intNote'] = 'Imported by '.\Ease\Shared::AppName().' '.\Ease\Shared::AppVersion(). ' Import Job '.\Ease\Shared::cfg('MULTIFLEXI_JOB_ID', \Ease\Shared::cfg('JOB_ID', 'n/a'));
$data['note'] = '';
$data['datePayment'] = current((array) $entry->BookgDt->DtTm); // current((array) $entry->ValDt->DtTm);
$data['dateStatement'] = current((array) $entry->BookgDt->DtTm);
$moveTrans = ['DBIT' => 'expense', 'CRDT' => 'receipt'];
Expand Down
2 changes: 1 addition & 1 deletion src/pohodaSQL-raiffeisenbank-statements-sharepoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
try {
$result = $doc->urlAttachment((int) $id, $sharepointUri, basename($filename));
$doc->addStatusMessage($importInfo['number'].' '.$sharepointUri, $result ? 'success' : 'error');
} catch (Exception $ex) {
} catch (\Exception $ex) {
$engine->addStatusMessage(_('Cannot Update PohodaSQL to attach statements in sharepoint links to invoice'), 'error');

$exitcode = 4;
Expand Down

0 comments on commit 4e517f0

Please sign in to comment.