-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update for current ease framework and debian buster + ENV based confi…
…guration support
- Loading branch information
Showing
20 changed files
with
116 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
FROM php:7.2.7-cli-stretch | ||
MAINTAINER Vítězslav Dvořák <[email protected]> | ||
FROM php:7.2.7-cli-buster | ||
LABEL maintainer="Vítězslav Dvořák <[email protected]>" | ||
|
||
RUN apt update && apt-get install -my wget gnupg | ||
|
||
|
@@ -13,3 +13,26 @@ RUN echo "deb [trusted=yes] file:///repo/ ./" > /etc/apt/sources.list.d/local.li | |
|
||
RUN apt update ; RUN DEBIAN_FRONTEND=noninteractive apt-get -y install flexibee-matcher | ||
|
||
|
||
|
||
FROM debian:latest | ||
LABEL maintainer="[email protected]" | ||
ENV TERM xterm | ||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
RUN apt update ; apt -y install lsb-release wget dialog apt-utils cron msmtp | ||
RUN echo "deb http://repo.vitexsoftware.cz $(lsb_release -sc) main paid" | tee /etc/apt/sources.list.d/vitexsoftware.list | ||
RUN wget -O /etc/apt/trusted.gpg.d/vitexsoftware.gpg http://repo.vitexsoftware.cz/keyring.gpg | ||
|
||
COPY flexibee-dev.spoje.conf /etc/flexibee/client.conf | ||
|
||
RUN apt update ; apt -y install flexibee-reminder-sms | ||
|
||
COPY msmtprc /etc/msmtprc | ||
COPY mail.ini /etc/php/7.3/mods-available | ||
RUN phpenmod mail | ||
|
||
#EXPOSE 80 | ||
|
||
CMD ["cron", "-f"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/bash | ||
php -f /usr/lib/php-flexibee-matcher/ParujPrijateFaktury.php | ||
php -f /usr/lib/php-flexibee-matcher/ParujVydaneFaktury.php | ||
php -f /usr/lib/flexibee-matcher/ParujPrijateFaktury.php | ||
php -f /usr/lib/flexibee-matcher/ParujVydaneFaktury.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/bin/bash | ||
php -f /usr/lib/php-flexibee-matcher/ParujPrijateFaktury.php | ||
php -f /usr/lib/flexibee-matcher/ParujPrijateFaktury.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/bash | ||
php -f /usr/lib/php-flexibee-matcher/ParujFakturyNew2Old.php | ||
php -f /usr/lib/flexibee-matcher/ParujFakturyNew2Old.php | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/bash | ||
php -f /usr/lib/php-flexibee-matcher/ParujVydaneFaktury.php | ||
php -f /usr/lib/flexibee-matcher/ParujVydaneFaktury.php | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/bin/bash | ||
php -f /usr/lib/php-flexibee-matcher/StahniBanku.php | ||
php -f /usr/lib/flexibee-matcher/StahniBanku.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
flexibee-matcher (0.7.10) UNRELEASED; urgency=medium | ||
flexibee-matcher (0.8) UNRELEASED; urgency=medium | ||
|
||
[ vitex ] | ||
* Rename Composer Package in Debian to be Composer 2.0 valid | ||
* Configuration is get from Enviroment if /etc/flexibee/cliet.json does not exist. | ||
|
||
[ Vítězslav Dvořák ] | ||
* | ||
|
||
-- vitex <[email protected]> Wed, 13 Mar 2019 11:25:46 +0100 | ||
-- CyberVitexus <[email protected]> Wed, 29 Apr 2020 00:10:31 +0200 | ||
|
||
flexibee-matcher (0.7.6) experimental; urgency=medium | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,6 @@ set -e | |
|
||
. /usr/share/debconf/confmodule | ||
|
||
php-flexibee-checker | ||
|
||
fi | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,51 @@ | ||
<?php | ||
|
||
/** | ||
* php-flexibee-matecher | ||
* | ||
* @copyright (c) 2018, Vítězslav Dvořák | ||
* @copyright (c) 2018-2020, Vítězslav Dvořák | ||
*/ | ||
$autoloader = require_once '../vendor/autoload.php'; | ||
$shared = new Ease\Shared(); | ||
$shared->loadConfig('../client.json',true); | ||
$shared->loadConfig('../matcher.json',true); | ||
$shared = new Ease\Shared(); | ||
if (file_exists('../client.json')) { | ||
$shared->loadConfig('../client.json', true); | ||
} | ||
$shared->loadConfig('../matcher.json', true); | ||
|
||
$labeler = new FlexiPeeHP\Stitek(); | ||
$labeler->logBanner('EasePHP Bricks v? '.constant('EASE_APPNAME')); | ||
$labeler->logBanner('EasePHP Bricks v? ' . constant('EASE_APPNAME')); | ||
$labeler->addStatusMessage(_('checking labels'), 'debug'); | ||
|
||
$updateCfg = false; | ||
foreach (['PREPLATEK', 'CHYBIFAKTURA', 'NEIDENTIFIKOVANO'] as $label) { | ||
if (is_null($shared->getConfigValue('LABEL_'.$label))) { | ||
$shared->setConfigValue('LABEL_'.$label, $label); | ||
if (is_null($shared->getConfigValue('LABEL_' . $label))) { | ||
$shared->setConfigValue('LABEL_' . $label, $label); | ||
$labeler->addStatusMessage(sprintf(_('Cannot find LABEL_%s in config file matcher.json. Using default value: %s'), | ||
$label, $label), 'warning'); | ||
$label, $label), 'warning'); | ||
$updateCfg = true; | ||
} | ||
if ($labeler->recordExists(['kod' => $shared->getConfigValue('LABEL_'.$label)]) | ||
=== false) { | ||
$labeler->createNew($shared->getConfigValue('LABEL_'.$label), ['banka']); | ||
if ($labeler->recordExists(['kod' => $shared->getConfigValue('LABEL_' . $label)]) === false) { | ||
$labeler->createNew($shared->getConfigValue('LABEL_' . $label), ['banka']); | ||
$labeler->addStatusMessage(sprintf(_('LABEL_%s: %s was created in FlexiBee'), | ||
$label, $shared->getConfigValue('LABEL_'.$label)), 'success'); | ||
$label, $shared->getConfigValue('LABEL_' . $label)), 'success'); | ||
} else { | ||
$labeler->addStatusMessage(sprintf(_('LABEL_%s: %s exists in FlexiBee'), | ||
$label, $shared->getConfigValue('LABEL_'.$label))); | ||
$label, $shared->getConfigValue('LABEL_' . $label))); | ||
} | ||
} | ||
|
||
if ($updateCfg === true) { | ||
foreach ([ | ||
"EASE_APPNAME", "EASE_MAILTO", "EASE_LOGGER", "LOCALIZE", "PULL_BANK", | ||
"DAYS_BACK", "LABEL_PREPLATEK", "LABEL_CHYBIFAKTURA", "LABEL_NEIDENTIFIKOVANO"] as $cfg) { | ||
"EASE_APPNAME", "EASE_MAILTO", "EASE_LOGGER", "LOCALIZE", "PULL_BANK", | ||
"DAYS_BACK", "LABEL_PREPLATEK", "LABEL_CHYBIFAKTURA", "LABEL_NEIDENTIFIKOVANO"] as $cfg) { | ||
$cfg2save[$cfg] = $shared->getConfigValue($cfg); | ||
} | ||
if (file_put_contents('../matcher.json', | ||
json_encode($cfg2save, JSON_PRETTY_PRINT))) { | ||
json_encode($cfg2save, JSON_PRETTY_PRINT))) { | ||
$labeler->addStatusMessage(_('../matcher.json was updated'), 'success'); | ||
} else { | ||
$labeler->addStatusMessage(_('../matcher.json was not updated', 'error'), | ||
'success'); | ||
'success'); | ||
} | ||
} | ||
$labeler->addStatusMessage(_('labels check done'), 'debug'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,32 @@ | ||
<?php | ||
|
||
/** | ||
* Párování fakrur | ||
* Invoice Matching | ||
* | ||
* @author Vítězslav Dvořák <[email protected]> | ||
* @copyright (c) 2018, Vítězslav Dvořák | ||
* @copyright (c) 2018-2020, Vítězslav Dvořák | ||
*/ | ||
define('EASE_APPNAME', 'ParujFakturyNewToOld'); | ||
|
||
require_once '../vendor/autoload.php'; | ||
|
||
$shared = new Ease\Shared(); | ||
$shared->loadConfig('../client.json', true); | ||
if (file_exists('../client.json')) { | ||
$shared->loadConfig('../client.json', true); | ||
} | ||
$shared->loadConfig('../matcher.json', true); | ||
//new \Ease\Locale($shared->getConfigValue('LOCALIZE'), '../i18n', | ||
// 'flexibee-matcher'); | ||
|
||
$odden = 0; | ||
$date1 = new \DateTime(); | ||
$date2 = new \DateTime(); | ||
$date2->modify('-'.$shared->getConfigValue('DAYS_BACK').' days'); | ||
$date2->modify('-' . $shared->getConfigValue('DAYS_BACK') . ' days'); | ||
|
||
$doden = $date2->diff($date1)->format("%a"); | ||
|
||
$invoiceSteamer = new FlexiPeeHP\Matcher\OutcomingInvoice($shared->configuration); | ||
$invoiceSteamer->banker->logBanner(constant('EASE_APPNAME') ); | ||
$invoiceSteamer->banker->logBanner(constant('EASE_APPNAME')); | ||
|
||
if ($shared->getConfigValue('PULL_BANK') === true) { | ||
$invoiceSteamer->addStatusMessage(_('pull account statements')); | ||
|
@@ -32,7 +35,7 @@ | |
} | ||
} | ||
|
||
$invoiceSteamer->addStatusMessage(_('Matching program started'),'debug'); | ||
$invoiceSteamer->addStatusMessage(_('Matching program started'), 'debug'); | ||
while ($odden < $doden) { | ||
$invoiceSteamer->setStartDay($odden++); | ||
$invoiceSteamer->outInvoicesMatchingByBank(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.