-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ParujVydaneFaktury.php
42 lines (32 loc) · 1.37 KB
/
ParujVydaneFaktury.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
declare(strict_types=1);
/**
* This file is part of the AbraFlexi Matcher package.
*
* (c) Vítězslav Dvořák <https://vitexsoftware.cz/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use AbraFlexi\Matcher\OutgoingInvoice;
use Ease\Locale;
use Ease\Shared;
\define('APP_NAME', 'AbraFlexi ParujVydaneFaktury');
require_once '../vendor/autoload.php';
$shared = Shared::singleton();
\Ease\Shared::init(['ABRAFLEXI_URL', 'ABRAFLEXI_LOGIN', 'ABRAFLEXI_PASSWORD', 'ABRAFLEXI_COMPANY'], \array_key_exists(1, $argv) ? $argv[1] : '../.env');
new Locale(Shared::cfg('MATCHER_LOCALIZE'), '../i18n', 'abraflexi-matcher');
$invoiceSteamer = new OutgoingInvoice($shared->configuration);
$invoiceSteamer->setStartDay(30);
if (Shared::cfg('APP_DEBUG')) {
$invoiceSteamer->banker->logBanner(Shared::appName());
}
if ($shared->getConfigValue('MATCHER_PULL_BANK') === true) {
$invoiceSteamer->addStatusMessage(_('pull account statements'), 'debug');
if (!$invoiceSteamer->banker->stahnoutVypisyOnline()) {
$invoiceSteamer->addStatusMessage('Banka Offline!', 'error');
}
}
$invoiceSteamer->addStatusMessage(_('Outgoing Invoice matching begin'), 'debug');
$invoiceSteamer->issuedInvoicesMatchingByBank();
$invoiceSteamer->addStatusMessage(_('Outgoing Invoice matching done'), 'debug');