├── .circleci
└── config.yml
├── .github
├── dependabot.yml
└── workflows
│ └── php.yml
├── .php-cs-fixer.dist.php
├── .vscode
└── launch.json
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── Examples
├── AddressImporter.php
├── AttachmentSaveToFile.php
├── AttachmentUpload.php
├── AuthSessionIdUsage.php
├── AuthentizeContact.php
├── BatchOperation.php
├── CreateLabel.php
├── CreateOrder.php
├── DownloadInvoicePDF.php
├── DryRun.php
├── EnableChangelog.php
├── Error404.php
├── ErrorHandling.php
├── ExampleTemplate.php
├── ExternalID.php
├── FindOverdueInvoices.php
├── GetBankAccountForCompany.php
├── GetRecordWithRelation.php
├── InvoiceCopy.php
├── InvoiceLastChanges.php
├── InvoiceLockUnlock.php
├── LoginLogout.php
├── MovePricelistItemToAnotherCategory.php
├── NajdiDanovyDokladKzalohovemu.php
├── Naskladneni.php
├── NewInvoice.php
├── ObjectChaining.php
├── ObjectsCooperation.php
├── PerformingActions.php
├── Prevodka.php
├── ReadAddressColumns.php
├── ReadInvoiceColumns.php
├── ReportUpdater.php
├── SendReminders.php
├── SetContactAuth.php
├── ShowDocumentChanges.php
├── TestConnection.php
├── UpdateInvoice.php
├── common.php
├── config.php
├── demo.php
├── establishWebHook.php
├── flexipeehp-composer-install.png
├── flexipeehp-debian-test.png
└── sendInvoiceByMail.php
├── LICENSE
├── Makefile
├── README.md
├── Vagrantfile
├── bootstrap-centos.sh
├── bootstrap-debian.sh
├── composer.json
├── debian
├── Jenkinsfile
├── README.Debian
├── bootstrap.php
├── changelog
├── compat
├── composer.json
├── control
├── copyright
├── php-spojenet-abraflexi-dev.install
├── php-spojenet-abraflexi-doc.conf
├── php-spojenet-abraflexi-doc.install
├── php-spojenet-abraflexi.install
├── php-spojenet-abraflexi.postinst
├── php-spojenet-abraflexi.prerm
├── rules
├── source
│ └── format
└── test
│ ├── composer.json
│ ├── config.json
│ └── flexibeeping.php
├── example.env
├── php-abraflexi.spec
├── phpstan-default-baseline.neon
├── phpstan-default.neon.dist
├── project-logo.png
├── project-logo.svg
├── spoje-net_logo.gif
├── src
└── AbraFlexi
│ ├── Actions.php
│ ├── Adresar.php
│ ├── Banka.php
│ ├── Cenik.php
│ ├── Changes.php
│ ├── Company.php
│ ├── Date.php
│ ├── DateTime.php
│ ├── Document.php
│ ├── Dodavatel.php
│ ├── DodavatelskaSmlouva.php
│ ├── Evidence.php
│ ├── EvidenceList.php
│ ├── Exception.php
│ ├── FakturaPrijata.php
│ ├── FakturaVydana.php
│ ├── FakturaVydanaPolozka.php
│ ├── Formats.php
│ ├── Functions.php
│ ├── Hooks.php
│ ├── InterniDoklad.php
│ ├── Kontakt.php
│ ├── Nastaveni.php
│ ├── ObjednavkaPrijata.php
│ ├── ObjednavkaPrijataPolozka.php
│ ├── Pokladna.php
│ ├── PokladniPohyb.php
│ ├── Priloha.php
│ ├── RO.php
│ ├── RW.php
│ ├── RadaPokladniPohyb.php
│ ├── Relation.php
│ ├── Relations.php
│ ├── Report.php
│ ├── Root.php
│ ├── SkladovaKarta.php
│ ├── SkladovyPohyb.php
│ ├── SkladovyPohybPolozka.php
│ ├── SkupinaFirem.php
│ ├── Smlouva.php
│ ├── Status.php
│ ├── Stitek.php
│ ├── Strom.php
│ ├── StromCenik.php
│ ├── UcetniObdobi.php
│ ├── Udalost.php
│ ├── VyrobniCislo.php
│ ├── Zamek.php
│ ├── Zavazek.php
│ ├── Zurnal.php
│ ├── email.php
│ ├── firma.php
│ ├── getChanges.php
│ ├── kod.php
│ ├── lock.php
│ ├── stitky.php
│ ├── subItems.php
│ └── sum.php
├── static
├── Actions.json
├── EvidenceFullList.json
├── EvidenceList.json
├── Formats.json
├── Properties.adresar-bankovni-ucet.json
├── Properties.adresar.json
├── Properties.analyza-nakupu.json
├── Properties.analyza-prodeje.json
├── Properties.analyza-zakazky.json
├── Properties.atribut.json
├── Properties.autotisk.json
├── Properties.banka-polozka.json
├── Properties.banka.json
├── Properties.bankovni-ucet-pokladna.json
├── Properties.bankovni-ucet-sklad-pokladna.json
├── Properties.bankovni-ucet.json
├── Properties.castky-k-odpoctu.json
├── Properties.cenik-obal.json
├── Properties.cenik-typ-sazby-dph.json
├── Properties.cenik.json
├── Properties.cenikova-skupina.json
├── Properties.cenikovy-pohyb-nakup.json
├── Properties.cenikovy-pohyb-prodej.json
├── Properties.cenova-uroven.json
├── Properties.certifikacni-autorita.json
├── Properties.certifikat-eet.json
├── Properties.certifikat-finbricks.json
├── Properties.certifikat.json
├── Properties.changes.json
├── Properties.cinnost.json
├── Properties.ciselnik-mzdovych-slozek.json
├── Properties.cislo-baliku.json
├── Properties.cleneni-dph.json
├── Properties.cleneni-kontrolni-hlaseni.json
├── Properties.custom-button.json
├── Properties.danova-evidence.json
├── Properties.danovy-naklad.json
├── Properties.danovy-odpis.json
├── Properties.dashboard-panel.json
├── Properties.dashboard-sharing.json
├── Properties.definice-ucelu.json
├── Properties.dite.json
├── Properties.dodavatel.json
├── Properties.dodavatelska-smlouva.json
├── Properties.dodavatelsky-typ-smlouvy.json
├── Properties.doklad-k-uhrade.json
├── Properties.doklad.json
├── Properties.doporuceni.json
├── Properties.eet-komunikace.json
├── Properties.faktura-prijata-polozka.json
├── Properties.faktura-prijata.json
├── Properties.faktura-vydana-polozka.json
├── Properties.faktura-vydana.json
├── Properties.filtr.json
├── Properties.forma-dopravy.json
├── Properties.forma-uhrady-zauctovani.json
├── Properties.forma-uhrady.json
├── Properties.format-elektronickeho-bankovnictvi.json
├── Properties.format-elektronickeho-prikazu.json
├── Properties.global-store.json
├── Properties.hlavni-kniha.json
├── Properties.hodnoceni-zakazky.json
├── Properties.individualni-cenik.json
├── Properties.insight.json
├── Properties.interni-doklad-polozka.json
├── Properties.interni-doklad.json
├── Properties.intrastat-dodaci-podminky.json
├── Properties.intrastat-druh-dopravy.json
├── Properties.intrastat-kod-nomenklatury.json
├── Properties.intrastat-kraj-urceni.json
├── Properties.intrastat-kurz.json
├── Properties.intrastat-merna-jednotka.json
├── Properties.intrastat-obchodni-transakce.json
├── Properties.intrastat-zvlastni-pohyb.json
├── Properties.inventura-polozka.json
├── Properties.inventura.json
├── Properties.konst-symbol.json
├── Properties.kontakt.json
├── Properties.kurz-pro-cenotvorbu.json
├── Properties.kurz-pro-preceneni.json
├── Properties.kurz.json
├── Properties.kusovnik.json
├── Properties.leasing.json
├── Properties.majetek-udalost.json
├── Properties.majetek.json
├── Properties.mapovani-skladu.json
├── Properties.mena.json
├── Properties.merna-jednotka.json
├── Properties.misto-urceni.json
├── Properties.mzda.json
├── Properties.mzdova-slozka.json
├── Properties.mzdy-bankovni-spojeni.json
├── Properties.nabidka-prijata-polozka.json
├── Properties.nabidka-prijata.json
├── Properties.nabidka-vydana-polozka.json
├── Properties.nabidka-vydana.json
├── Properties.naklad.json
├── Properties.nastaveni.json
├── Properties.nepritomnost.json
├── Properties.objednavka-prijata-polozka.json
├── Properties.objednavka-prijata.json
├── Properties.objednavka-vydana-polozka.json
├── Properties.objednavka-vydana.json
├── Properties.obrat-polozky.json
├── Properties.obrat.json
├── Properties.obratova-predvaha.json
├── Properties.odberatel.json
├── Properties.odpisova-skupina.json
├── Properties.osoba-hlavicka.json
├── Properties.osoba.json
├── Properties.parametr.json
├── Properties.penezni-ustav.json
├── Properties.po-splatnosti.json
├── Properties.podklady-dph.json
├── Properties.podobne-zbozi.json
├── Properties.pohledavka-polozka.json
├── Properties.pohledavka.json
├── Properties.pohyb-na-uctech.json
├── Properties.pokladna.json
├── Properties.pokladni-pohyb-polozka.json
├── Properties.pokladni-pohyb.json
├── Properties.poplatek.json
├── Properties.poptavka-prijata-polozka.json
├── Properties.poptavka-prijata.json
├── Properties.poptavka-vydana-polozka.json
├── Properties.poptavka-vydana.json
├── Properties.prace-mesic.json
├── Properties.prace.json
├── Properties.pracovni-pomer-hlavicka.json
├── Properties.pracovni-pomer.json
├── Properties.pravo-viditelnosti.json
├── Properties.predpis-zauctovani.json
├── Properties.prehled-zamestnancu.json
├── Properties.preneseni-dph.json
├── Properties.pricteni-rozdilu.json
├── Properties.prikaz-k-inkasu-polozka.json
├── Properties.prikaz-k-inkasu.json
├── Properties.prikaz-k-uhrade-polozka.json
├── Properties.prikaz-k-uhrade.json
├── Properties.priloha.json
├── Properties.prislustenstvi.json
├── Properties.prodejka-platba.json
├── Properties.prodejka.json
├── Properties.psc.json
├── Properties.rada-banka.json
├── Properties.rada-faktury-prijate.json
├── Properties.rada-faktury-vydane.json
├── Properties.rada-interniho-dokladu.json
├── Properties.rada-nabidky-prijate.json
├── Properties.rada-nabidky-vydane.json
├── Properties.rada-objednavky-prijate.json
├── Properties.rada-objednavky-vydane.json
├── Properties.rada-pohledavky.json
├── Properties.rada-pokladni-pohyb.json
├── Properties.rada-poptavky-prijate.json
├── Properties.rada-poptavky-vydane.json
├── Properties.rada-skladovy-pohyb.json
├── Properties.rada-zavazku.json
├── Properties.rada.json
├── Properties.radek-priznani-dph.json
├── Properties.radek-sestavy.json
├── Properties.region.json
├── Properties.report.json
├── Properties.rezervace.json
├── Properties.rocni-rada.json
├── Properties.role.json
├── Properties.rozvaha-po-uctech.json
├── Properties.sablona-mail.json
├── Properties.sablona-upominky.json
├── Properties.sady-a-komplety.json
├── Properties.saldo-k-datu.json
├── Properties.saldo.json
├── Properties.sarze-expirace.json
├── Properties.sazba-dph.json
├── Properties.sestava.json
├── Properties.setting-store.json
├── Properties.sklad.json
├── Properties.skladova-karta.json
├── Properties.skladovy-pohyb-polozka.json
├── Properties.skladovy-pohyb.json
├── Properties.skupina-atributu.json
├── Properties.skupina-firem.json
├── Properties.skupina-osob.json
├── Properties.skupina-plneni.json
├── Properties.skupina-stitku.json
├── Properties.skupina-zbozi.json
├── Properties.smena.json
├── Properties.smlouva-polozka.json
├── Properties.smlouva-zurnal.json
├── Properties.smlouva.json
├── Properties.souhrnne-hlaseni-dph.json
├── Properties.splatkovy-kalendar.json
├── Properties.srazka.json
├── Properties.stala-mzdova-slozka.json
├── Properties.standardni-predpis.json
├── Properties.stat-dph.json
├── Properties.stat.json
├── Properties.stav-ceniku.json
├── Properties.stav-obchodniho-dokladu.json
├── Properties.stav-skladu-k-datu.json
├── Properties.stav-smlouvy.json
├── Properties.stav-uctu.json
├── Properties.stav-zakazky.json
├── Properties.stitek.json
├── Properties.stredisko.json
├── Properties.strom-cenik.json
├── Properties.strom-koren.json
├── Properties.strom.json
├── Properties.subjekt.json
├── Properties.sumace-sestavy.json
├── Properties.text.json
├── Properties.typ-aktivity.json
├── Properties.typ-atributu.json
├── Properties.typ-banka.json
├── Properties.typ-dokladu.json
├── Properties.typ-faktury-prijate.json
├── Properties.typ-faktury-vydane.json
├── Properties.typ-interniho-dokladu.json
├── Properties.typ-leasingu.json
├── Properties.typ-majetku.json
├── Properties.typ-nabidky-prijate.json
├── Properties.typ-nabidky-vydane.json
├── Properties.typ-nakladu.json
├── Properties.typ-objednavky-prijate.json
├── Properties.typ-objednavky-vydane.json
├── Properties.typ-organizace.json
├── Properties.typ-pohledavky.json
├── Properties.typ-pokladni-pohyb.json
├── Properties.typ-poptavky-prijate.json
├── Properties.typ-poptavky-vydane.json
├── Properties.typ-pracovniho-pomeru.json
├── Properties.typ-prodejky.json
├── Properties.typ-skladovy-pohyb.json
├── Properties.typ-smlouvy.json
├── Properties.typ-stavu-ceniku.json
├── Properties.typ-uzivatelske-vazby.json
├── Properties.typ-vzajemnych-zapoctu.json
├── Properties.typ-zakazky.json
├── Properties.typ-zavazku.json
├── Properties.ucel.json
├── Properties.ucet.json
├── Properties.ucetni-denik-zjednoduseny.json
├── Properties.ucetni-denik.json
├── Properties.ucetni-obdobi.json
├── Properties.ucetni-odpis.json
├── Properties.ucetni-osnova.json
├── Properties.udalost.json
├── Properties.ulozene-priznani-dph.json
├── Properties.ulozene-priznani-kon-vyk-dph.json
├── Properties.umisteni-uctu.json
├── Properties.umisteni-ve-skladu-mistnost.json
├── Properties.umisteni-ve-skladu-police.json
├── Properties.umisteni-ve-skladu-regal.json
├── Properties.umisteni-ve-skladu.json
├── Properties.umisteni.json
├── Properties.uzivatel.json
├── Properties.uzivatelska-vazba.json
├── Properties.uzivatelsky-dotaz-parametr.json
├── Properties.uzivatelsky-dotaz-vlastnost.json
├── Properties.uzivatelsky-dotaz.json
├── Properties.vazba.json
├── Properties.vazebni-doklad.json
├── Properties.vykaz-hospodareni.json
├── Properties.vyrobni-cislo.json
├── Properties.vysledovka-po-uctech.json
├── Properties.vzajemny-zapocet.json
├── Properties.xslt.json
├── Properties.zakazka.json
├── Properties.zaloha-k-odpoctu.json
├── Properties.zamek.json
├── Properties.zapujcka.json
├── Properties.zavazek-polozka.json
├── Properties.zavazek.json
├── Properties.zurnal.json
└── Relations.json
├── tests
├── ObjectForTesting.php
├── bootstrap.php
├── configuration.xml
└── src
│ └── AbraFlexi
│ ├── ActionsTest.php
│ ├── AdresarTest.php
│ ├── BankaTest.php
│ ├── CenikTest.php
│ ├── ChangesTest.php
│ ├── CompanyTest.php
│ ├── DateTest.php
│ ├── DateTimeTest.php
│ ├── DodavatelTest.php
│ ├── DodavatelskaSmlouvaTest.php
│ ├── EvidenceListTest.php
│ ├── ExceptionTest.php
│ ├── FakturaPrijataTest.php
│ ├── FakturaVydanaPolozkaTest.php
│ ├── FakturaVydanaTest.php
│ ├── FormatsTest.php
│ ├── FunctionsTest.php
│ ├── HooksTest.php
│ ├── InterniDokladTest.php
│ ├── KontaktTest.php
│ ├── NastaveniTest.php
│ ├── ObjednavkaPrijataPolozkaTest.php
│ ├── ObjednavkaPrijataTest.php
│ ├── PokladnaTest.php
│ ├── PokladniPohybTest.php
│ ├── PrilohaTest.php
│ ├── ROTest.php
│ ├── RWTest.php
│ ├── RadaPokladniPohybTest.php
│ ├── RelationTest.php
│ ├── RelationsTest.php
│ ├── ReportTest.php
│ ├── RootTest.php
│ ├── SkladovaKartaTest.php
│ ├── SkladovyPohybPolozkaTest.php
│ ├── SkladovyPohybTest.php
│ ├── SkupinaFiremTest.php
│ ├── SmlouvaTest.php
│ ├── StatusTest.php
│ ├── StitekTest.php
│ ├── StromCenikTest.php
│ ├── StromTest.php
│ ├── UcetniObdobiTest.php
│ ├── UdalostTest.php
│ ├── VyrobniCisloTest.php
│ └── ZurnalTest.php
└── tools
├── changes-properties.json
├── common.php
├── current_settings.php
├── current_version.php
├── find_undocumented_columns.php
├── force_update_all.sh
├── nastaveni-properties.json
├── time_to_update.php
├── update_actions_class.php
├── update_all.sh
├── update_evidencelist_class.php
├── update_formats_class.php
├── update_properties_class.php
└── update_relations_class.php
/.circleci/config.yml:
--------------------------------------------------------------------------------
1 | # PHP CircleCI 2.0 configuration file
2 | #
3 | # Check https://circleci.com/docs/2.0/language-php/ for more details
4 | #
5 | version: 2
6 | jobs:
7 | build:
8 | docker:
9 | # Specify the version you desire here
10 | - image: circleci/php:7.1-node-browsers
11 |
12 | # Specify service dependencies here if necessary
13 | # CircleCI maintains a library of pre-built images
14 | # documented at https://circleci.com/docs/2.0/circleci-images/
15 | # Using the RAM variation mitigates I/O contention
16 | # for database intensive operations.
17 | # - image: circleci/mysql:5.7-ram
18 | #
19 | # - image: redis:2.8.19
20 |
21 | steps:
22 | - checkout
23 |
24 | - run: sudo apt update # PHP CircleCI 2.0 Configuration File# PHP CircleCI 2.0 Configuration File sudo apt install zlib1g-dev libsqlite3-dev
25 | - run: sudo docker-php-ext-install zip
26 |
27 | # Download and cache dependencies
28 | - restore_cache:
29 | keys:
30 | # "composer.lock" can be used if it is committed to the repo
31 | - v1-dependencies-{{ checksum "composer.json" }}
32 | # fallback to using the latest cache if no exact match is found
33 | - v1-dependencies-
34 |
35 | - run: composer install -n --prefer-dist
36 |
37 | - save_cache:
38 | key: v1-dependencies-{{ checksum "composer.json" }}
39 | paths:
40 | - ./vendor
41 | - restore_cache:
42 | keys:
43 | - node-v1-{{ checksum "package.json" }}
44 | - node-v1-
45 | - run: yarn install
46 | - save_cache:
47 | key: node-v1-{{ checksum "package.json" }}
48 | paths:
49 | - node_modules
50 |
51 | # run tests with phpunit or codecept
52 | - run: ./vendor/bin/phpunit
53 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # To get started with Dependabot version updates, you'll need to specify which
2 | # package ecosystems to update and where the package manifests are located.
3 | # Please see the documentation for all configuration options:
4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5 |
6 | version: 2
7 | updates:
8 | - package-ecosystem: "composer" # See documentation for possible values
9 | directory: "/" # Location of package manifests
10 | schedule:
11 | interval: "daily"
12 |
13 |
--------------------------------------------------------------------------------
/.github/workflows/php.yml:
--------------------------------------------------------------------------------
1 | name: PHP Composer
2 |
3 | on:
4 | push:
5 | branches: [ "main" ]
6 | pull_request:
7 | branches: [ "main" ]
8 |
9 | permissions:
10 | contents: read
11 |
12 | jobs:
13 | build:
14 |
15 | runs-on: ubuntu-latest
16 |
17 | steps:
18 | - uses: actions/checkout@v4
19 |
20 | - name: Validate composer.json and composer.lock
21 | run: composer validate --strict
22 |
23 | - name: Cache Composer packages
24 | id: composer-cache
25 | uses: actions/cache@v3
26 | with:
27 | path: vendor
28 | key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
29 | restore-keys: |
30 | ${{ runner.os }}-php-
31 |
32 | - name: Install dependencies
33 | run: composer install --prefer-dist --no-progress
34 |
35 | # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
36 | # Docs: https://getcomposer.org/doc/articles/scripts.md
37 |
38 | # - name: Run test suite
39 | # run: composer run-script test
40 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | "name": "Debug DryRun example",
6 | "type": "php",
7 | "request": "launch",
8 | "program": "${workspaceFolder}/Examples/DryRun.php",
9 | "cwd": "${fileDirname}",
10 | "externalConsole": false,
11 | "port": 9003
12 | },
13 | {
14 | "name": "Launch built-in server and debug",
15 | "type": "php",
16 | "request": "launch",
17 | "runtimeArgs": [
18 | "-S",
19 | "localhost:8000",
20 | "-t",
21 | "."
22 | ],
23 | "port": 9003,
24 | "serverReadyAction": {
25 | "action": "openExternally"
26 | }
27 | },
28 | {
29 | "name": "Debug current script in console",
30 | "type": "php",
31 | "request": "launch",
32 | "program": "${file}",
33 | "cwd": "${fileDirname}",
34 | "externalConsole": false,
35 | "port": 9003
36 | },
37 | {
38 | "name": "Listen for Xdebug",
39 | "type": "php",
40 | "request": "launch",
41 | "port": 9003
42 | }
43 |
44 | ]
45 | }
46 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | Please feel free to send pull requests or clone this project.
2 |
--------------------------------------------------------------------------------
/Examples/AddressImporter.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Example\AbraFlexi;
16 |
17 | include_once './config.php';
18 |
19 | include_once '../vendor/autoload.php';
20 |
21 | $options = [];
22 |
23 | $customerData = [
24 | 'customerName' => 'Pokuston',
25 | 'email' => 'pokus@ton.sk',
26 | 'street' => 'pokusna',
27 | 'psc' => '23122',
28 | 'city' => 'Blava',
29 | 'mobil1' => '6021231564',
30 | 'ico' => '1212633',
31 | 'dic' => 'SK123133',
32 | 'bankAccount' => 'CZ9520100000002800677051',
33 | ];
34 |
35 | $data = [
36 | 'id' => 'ext:test:'.time(),
37 | 'nazev' => $customerData['customerName'],
38 | 'email' => trim($customerData['email']),
39 | 'ulice' => $customerData['street'],
40 | 'psc' => $customerData['psc'],
41 | 'mesto' => $customerData['city'],
42 | 'mobil' => $customerData['mobil1'],
43 | 'ic' => $customerData['ico'],
44 | 'dic' => $customerData['dic'],
45 | ];
46 |
47 | if ($customerData['icDph'] ?? null) {
48 | $data['vatId'] = $customerData['icDph'];
49 | $data['platceDph'] = true;
50 | }
51 |
52 | if ($customerData['phone'] ?? null) {
53 | $data['tel'] = $customerData['phone'];
54 | }
55 |
56 | echo sprintf('Inserting: %s', $data['nazev']);
57 |
58 | $adresar = new \AbraFlexi\Adresar($data);
59 |
60 | if ($customerData['bankAccount'] ?? null) {
61 | $kodBanky = substr($customerData['bankAccount'], 4, 4);
62 |
63 | $adresarBankovniUcet = new \AbraFlexi\Adresar(
64 | [
65 | 'iban' => $customerData['bankAccount'],
66 | // 'bic' => 'XXXX',
67 | 'smerKod' => 'code:0300',
68 | 'firma' => $data['id'],
69 | ],
70 | array_merge(
71 | $options,
72 | ['evidence' => 'adresar-bankovni-ucet', 'offline' => true],
73 | ),
74 | );
75 | $adresar->join($adresarBankovniUcet);
76 | }
77 |
78 | $adresar->insertToFlexiBee();
79 |
--------------------------------------------------------------------------------
/Examples/AttachmentSaveToFile.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | include_once './common.php';
23 |
24 | $invoiceID = askForFlexiBeeID();
25 |
26 | $invoice = new \AbraFlexi\FakturaVydana($invoiceID);
27 |
28 | $attachment = \AbraFlexi\Priloha::getFirstAttachment($invoice);
29 |
30 | if (isset($attachment['id'])) {
31 | if (\AbraFlexi\Priloha::saveToFile((int) $attachment['id'], '/tmp/')) {
32 | $invoice->addStatusMessage(sprintf(
33 | _('Attachment %s was saved'),
34 | $attachment['nazSoub'],
35 | ), 'success');
36 | }
37 | } else {
38 | $invoice->addStatusMessage(_('Invoice without attachment'));
39 | }
40 |
--------------------------------------------------------------------------------
/Examples/AttachmentUpload.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once './common.php';
21 |
22 | $invoiceID = askForFlexiBeeID();
23 |
24 | $invoice = new \AbraFlexi\FakturaVydana($invoiceID);
25 |
26 | $result = \AbraFlexi\Priloha::addAttachmentFromFile($invoice, '../project-logo.png');
27 |
28 | if ($result->lastResponseCode === 201) {
29 | $allAttachments = \AbraFlexi\Priloha::getAttachmentsList($invoice);
30 | $lastAttachment = end($allAttachments);
31 | $invoice->addStatusMessage(
32 | 'Attachment '.$invoice->getAbraFlexiURL().'/prilohy/'.$lastAttachment['id'].'/content OK',
33 | 'success',
34 | );
35 | } else {
36 | $invoice->addStatusMessage(
37 | 'Attachment '.$invoice->getAbraFlexiURL().' Failed',
38 | 'error',
39 | );
40 | }
41 |
--------------------------------------------------------------------------------
/Examples/AuthSessionIdUsage.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | \define(
23 | 'FLEXIBEE_AUTHSESSID',
24 | '00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff',
25 | );
26 |
27 | $invoice = new \AbraFlexi\FakturaVydana();
28 | $invoice->setDataValue('typDokl', 'FAKTURA');
29 | $invoice->insertToFlexiBee();
30 |
--------------------------------------------------------------------------------
/Examples/AuthentizeContact.php:
--------------------------------------------------------------------------------
1 | #!/ur/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | $kontakter = new \AbraFlexi\Kontakt();
23 |
24 | if ($kontakter->authenticate('login', 'heslo') === true) {
25 | $kontakter->addStatusMessage('User Authenticated', 'success');
26 | } else {
27 | $kontakter->addStatusMessage('Auth not match', 'warning');
28 | }
29 |
--------------------------------------------------------------------------------
/Examples/BatchOperation.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | $adr = new \AbraFlexi\Adresar(null, ['filter' => "nazev like 'FlexiBee Systems s.r.o.'"]);
23 | $adr->insertToFlexiBee([
24 | 'nazev' => 'ABRA Flexi s.r.o.',
25 | 'ulice' => 'Jeremiášova 1422/7b',
26 | 'mesto' => 'Praha 13 Stodůlky',
27 | 'psc' => '155 00',
28 | ]);
29 |
30 | /*
31 | {"winstrom":{"@version":"1.0","adresar":{"nazev":"ABRA Flexi s.r.o.","ulice":"Jeremi\u00e1\u0161ova 1422\/7b","mesto":"Praha 13 Stod\u016flky","psc":"155 00"},"adresar@filter":"nazev like 'FlexiBee Systems s.r.o.'"}}
32 | */
33 |
--------------------------------------------------------------------------------
/Examples/CreateLabel.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 | /**
22 | * @var \AbraFlexi\Stitek Label Object
23 | */
24 | $stitek = new \AbraFlexi\Stitek();
25 |
26 | $stitek->createNew('Without Invoice', ['pokladna']);
27 |
28 | $stitek->createNew(
29 | 'Example Label',
30 | ['faktura-vydana', 'faktura-prijata'],
31 | ['kod' => 'EXAMPLE'],
32 | );
33 |
34 | $banker = new \AbraFlexi\Banka();
35 | $stitek->createNew('Unidentified', [$banker->getEvidence()]);
36 |
37 | $labelsDefinedForBank = \AbraFlexi\Stitek::getAvailbleLabels($banker);
38 |
--------------------------------------------------------------------------------
/Examples/DownloadInvoicePDF.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | include_once './common.php';
23 |
24 | $invoiceID = askForFlexiBeeID();
25 |
26 | /*
27 | * AbraFlexi Classes accept this form of initial identifier:
28 | *
29 | * (int) 2588
30 | * (string) ext:ESHOP:oi1978
31 | * (array) ['varSym'=>'20080015']
32 | */
33 |
34 | $invoice = new \AbraFlexi\FakturaVydana($invoiceID, ['detail' => 'id']);
35 | echo 'invoice saved to: '.$invoice->downloadInFormat(
36 | 'pdf',
37 | '/tmp/',
38 | 'fakturaKB$$SUM_BEZ_QR',
39 | )."\n";
40 |
41 | echo 'post money order saved to: '.$invoice->downloadInFormat($format, '/tmp/', 'slozenkaA$$SUM')."\n";
42 |
--------------------------------------------------------------------------------
/Examples/DryRun.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | /**
21 | * Instance of AbraFlexi Invoice in dry-run mode with random code.
22 | */
23 | $invoice = new \AbraFlexi\FakturaVydana([
24 | 'kod' => 'DRY_RUN_TEST',
25 | 'typDokl' => 'code:FAKTURA',
26 | 'poznam' => 'Test '.time(),
27 | 'varSym' => time()], ['dry-run' => true]);
28 |
29 | /**
30 | * Save invoice to AbraFlexi.
31 | */
32 | try {
33 | $resultInsert = $invoice->insertToAbraFlexi();
34 | } catch (\AbraFlexi\Exception $exc) {
35 | echo $exc->getMessage();
36 | // For example we can get here: "AbraFlexi\FakturaVydana: Pole 'Variabilní symbol' musí být vyplněno. [DRY_RUN_TEST]"
37 | }
38 |
39 | /**
40 | * Save to AbraFlexi and load result.
41 | */
42 | $resultSync = $invoice->sync();
43 |
44 | echo $resultSync ? 'OK' : 'Failed';
45 |
--------------------------------------------------------------------------------
/Examples/EnableChangelog.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | $changes = new \AbraFlexi\Changes();
23 | $changesEnabled = $changes->enable();
24 | // $changesDisabled = $changes->disable();
25 |
--------------------------------------------------------------------------------
/Examples/Error404.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | $banker = new \AbraFlexi\Banka();
23 | $first = $banker->getColumnsFromFlexibee(['id'], ['limit' => 1]);
24 |
25 | $banker->ignore404(true);
26 | $response404 = $banker->performRequest('error.json');
27 | $banker->ignore404(fals);
28 |
29 | $response200X = $banker->performRequest('/banka/'.$first[0]['id']);
30 |
--------------------------------------------------------------------------------
/Examples/ExampleTemplate.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
--------------------------------------------------------------------------------
/Examples/ExternalID.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Example\AbraFlexi;
16 |
17 | include_once './config.php';
18 |
19 | include_once '../vendor/autoload.php';
20 |
21 | $save = [
22 | 'id' => [
23 | 14,
24 | 'ext:evid:2434',
25 | 'ext:another:753',
26 | ],
27 | 'eanKod' => 12233587868,
28 | ];
29 |
30 | $addr = new \AbraFlexi\Adresar($save);
31 |
32 | $addr->getExternalIDs(); // [ 0=> 'ext:evid:2434', 1 => 'ext:another:753' ]
33 | $addr->getMyKey(); // 1000
34 |
35 | $addr->addExternalID('EXTERNAL:1575454719');
36 |
--------------------------------------------------------------------------------
/Examples/GetBankAccountForCompany.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | include_once './common.php';
23 |
24 | $companyID = askForFlexiBeeID();
25 |
26 | $firma = new \AbraFlexi\Adresar($companyID);
27 |
28 | if ($firma->getMyKey()) {
29 | var_dump($firma->getBankAccountNumber());
30 |
31 | /**
32 | * array(1) {
33 | * [0] =>
34 | * array(5) {
35 | * 'id' =>
36 | * string(1) "5"
37 | * 'buc' =>
38 | * string(9) "789987987"
39 | * 'smerKod' =>
40 | * string(9) "code:0100"
41 | * 'smerKod@showAs' =>
42 | * string(4) "0100"
43 | * 'smerKod@ref' =>
44 | * string(29) "/c/flexipeehp/penezni-ustav/1"
45 | * }
46 | * }.
47 | */
48 | } else {
49 | $firma->addStatusMessage('Source Address does not exists in '.$firma->getApiURL());
50 | }
51 |
--------------------------------------------------------------------------------
/Examples/GetRecordWithRelation.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | include_once './common.php';
23 |
24 | $contact_id = askForFlexiBeeID('Contact');
25 |
26 | /*
27 | * AbraFlexi Classes accept this form of initial identifier:
28 | *
29 | * (int) 2588
30 | * (string) ext:ESHOP:oi1978
31 | * (array) ['varSym'=>'20080015']
32 | */
33 | $contact = new \AbraFlexi\Kontakt(
34 | $contact_id,
35 | ['defaultUrlParams' => ['relations' => 'adresar']],
36 | );
37 | $adresy = $contact->getDataValue('adresy');
38 |
39 | if (\count($adresy)) {
40 | foreach ($adresy as $adresa) {
41 | echo $adresa['nazev']."\n";
42 | }
43 | } else {
44 | $contact->addStatusMessage('Source Contact does not exists');
45 | }
46 |
--------------------------------------------------------------------------------
/Examples/InvoiceLastChanges.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | include_once './common.php';
23 |
24 | $invoiceID = askForFlexiBeeID();
25 |
26 | /*
27 | * AbraFlexi Classes accept this form of initial identifier:
28 | *
29 | * (int) 2588
30 | * (string) ext:ESHOP:oi1978
31 | * (array) ['varSym'=>'20080015']
32 | */
33 |
34 | $invoice = new \AbraFlexi\FakturaVydana($invoiceID);
35 |
36 | if ($invoice->getMyKey()) {
37 | $journaler = new \AbraFlexi\Zurnal();
38 | $changes = $journaler->getLastChange($invoice);
39 | } else {
40 | $invoice->addStatusMessage('Source Invoice does not exists');
41 | }
42 |
--------------------------------------------------------------------------------
/Examples/InvoiceLockUnlock.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | include_once './common.php';
23 |
24 | $invoiceID = askForFlexiBeeID();
25 |
26 | /*
27 | * AbraFlexi Classes accept this form of initial identifier:
28 | *
29 | * (int) 2588
30 | * (string) ext:ESHOP:oi1978
31 | * (array) ['varSym'=>'20080015']
32 | */
33 |
34 | $invoice = new \AbraFlexi\FakturaVydana($invoiceID);
35 | $id = $invoice->getMyKey();
36 | $zamekK = $invoice->getDataValue('zamekK');
37 | $kod = $invoice->getDataValue('kod');
38 |
39 | if ($id) {
40 | $invoice->dataReset(); // Do not send back all data
41 | $invoice->setMyKey($id);
42 | $invoice->setDataValue('kod', $kod);
43 |
44 | switch ($zamekK) {
45 | case 'zamek.zamceno':
46 | $result = $invoice->performAction('unlock', 'int');
47 |
48 | break;
49 | case 'zamek.otevreno':
50 | $result = $invoice->performAction('lock', 'int');
51 |
52 | break;
53 | }
54 |
55 | if ($result['success'] === 'true') {
56 | $invoice->addStatusMessage(sprintf(
57 | _('Invoice %s lock switched'),
58 | $invoice,
59 | ), 'success');
60 | } else {
61 | $invoice->addStatusMessage(sprintf(
62 | _('Invoice %s lock switch failed'),
63 | $invoice,
64 | ), 'error');
65 | }
66 | } else {
67 | $invoice->addStatusMessage(
68 | 'Invoice '.$invoiceID.' does not exists',
69 | 'warning',
70 | );
71 | }
72 |
--------------------------------------------------------------------------------
/Examples/LoginLogout.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | $prober = new \AbraFlexi\RO();
23 |
24 | $prober->login();
25 |
26 | echo $prober->authSessionId;
27 |
28 | $prober->logout();
29 |
--------------------------------------------------------------------------------
/Examples/MovePricelistItemToAnotherCategory.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | $products_id = 2345;
23 | $old_category_id = 23;
24 | $new_category_id = 22;
25 |
26 | $sokoban = new \AbraFlexi\StromCenik();
27 | $pricelist = new \AbraFlexi\Cenik('ext:products:'.$products_id, ['detail' => 'id']);
28 | $sokoban->deleteFromFlexiBee('ext:ptc:'.$old_category_id);
29 | $sokoban->insertToFlexiBee(['id' => 'ext:ptc:'.$new_category_id, 'idZaznamu' => $pricelist->getRecordID(), 'uzel' => 'ext:categories:'.$new_category_id]);
30 |
--------------------------------------------------------------------------------
/Examples/NajdiDanovyDokladKzalohovemu.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | include_once './common.php';
23 |
24 | $invoiceID = askForFlexiBeeID();
25 |
26 | /*
27 | * AbraFlexi Classes accept this form of initial identifier:
28 | *
29 | * (int) 2588
30 | * (string) ext:ESHOP:oi1978
31 | * (array) ['varSym'=>'20080015']
32 | */
33 |
34 | $invoice = new \AbraFlexi\FakturaVydana($invoiceID);
35 |
36 | $vazby = $invoice->reindexArrayBy($invoice->getVazby(), 'typVazbyK');
37 |
38 | $polozka = new \AbraFlexi\RO(
39 | (int) $vazby['typVazbyDokl.odpocetZALOHY']['a'],
40 | ['evidence' => 'faktura-vydana-polozka'],
41 | );
42 |
43 | $faktura = new \AbraFlexi\FakturaVydana($polozka->getDataValue('doklFak'));
44 |
--------------------------------------------------------------------------------
/Examples/Naskladneni.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | $storage = 'SKLAD';
23 | $productCode = \Ease\Sand::randomString();
24 | $serialNumbers = [
25 | \Ease\Sand::randomString(),
26 | \Ease\Sand::randomString(),
27 | \Ease\Sand::randomString(),
28 | \Ease\Sand::randomString(),
29 | ];
30 | $defaultSerialNumber = \Ease\Sand::randomString();
31 |
32 | /** Preparation * */
33 | // We need an exising item
34 | $product = new \AbraFlexi\Cenik();
35 | $product->insertToFlexiBee([
36 | 'kod' => $productCode,
37 | 'nazev' => $productCode,
38 | 'typZasobyK' => 'typZasoby.zbozi',
39 | 'evidVyrCis' => true,
40 | // 'unikVyrCis'=> fase,
41 | 'skladove' => true,
42 | ]);
43 |
44 | // with storage card for at least current accounting period
45 | $storageCard = new \AbraFlexi\SkladovaKarta();
46 | $storageCard->insertToFlexiBee([
47 | 'sklad' => \AbraFlexi\RO::code($storage),
48 | 'cenik' => \AbraFlexi\RO::code($productCode),
49 | 'ucetObdobi' => \AbraFlexi\RO::code(date('Y')),
50 | ]);
51 |
52 | /** Preparation End * */
53 | $skladovyPohyb = new \AbraFlexi\SkladovyPohyb([
54 | 'id' => 'ext:PRIJEMKA:'.time(),
55 | 'typDokl' => \AbraFlexi\RO::code('STANDARD'),
56 | 'sklad' => \AbraFlexi\RO::code($storage),
57 | 'cenik' => \AbraFlexi\RO::code($productCode),
58 | 'typPohybuK' => 'typPohybu.prijem',
59 | ], ['debug' => true]);
60 |
61 | // We Need
62 | $productModel = new \AbraFlexi\SkladovyPohybPolozka([
63 | 'sklad' => \AbraFlexi\RO::code($storage),
64 | 'cenik' => \AbraFlexi\RO::code($productCode),
65 | ], ['offline' => true]);
66 |
67 | // Add Serial numbers one by one
68 | foreach ($serialNumbers as $serialNumber) {
69 | $productModel->addSerialNumber($serialNumber);
70 | }
71 |
72 | // Also add default serial number
73 | $productModel->addSerialNumber($defaultSerialNumber, true); // Add another number - the Main one
74 | // $skladovyPohyb->addArrayToBranch([$productModel->getEvidence() => $productModel->getData()]);
75 | $skladovyPohyb->addObjectToBranch($productModel);
76 |
77 | // And Now We can save it into FlexiBee
78 | $skladovyPohyb->insertToFlexiBee();
79 |
80 | echo $skladovyPohyb->postFields;
81 | echo $skladovyPohyb->lastCurlResponse;
82 |
--------------------------------------------------------------------------------
/Examples/NewInvoice.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | use AbraFlexi\FakturaVydana;
19 | use AbraFlexi\RO;
20 |
21 | \define('EASE_LOGGER', 'syslog|console');
22 |
23 | include_once './config.php';
24 |
25 | include_once '../vendor/autoload.php';
26 |
27 | /**
28 | * Prepare Testing Invoice.
29 | *
30 | * @param array $initialData
31 | * @param mixed $dayBack
32 | * @param mixed $evidence
33 | *
34 | * @return FakturaVydana
35 | */
36 | function makeInvoice($initialData = [], $dayBack = 1, $evidence = 'vydana')
37 | {
38 | $yesterday = new \DateTime();
39 | $yesterday->modify('-'.$dayBack.' day');
40 | $testCode = 'INV_'.\Ease\Sand::randomString();
41 | $invoice = new FakturaVydana(null, ['evidence' => 'faktura-'.$evidence]);
42 | $invoice->takeData(array_merge([
43 | 'kod' => $testCode,
44 | 'varSym' => \Ease\Sand::randomNumber(1111, 9999),
45 | 'specSym' => \Ease\Sand::randomNumber(111, 999),
46 | 'bezPolozek' => true,
47 | 'popis' => 'php-abraflexi-matcher Test invoice',
48 | 'datVyst' => RO::dateToFlexiDate($yesterday),
49 | 'typDokl' => RO::code('FAKTURA'),
50 | ], $initialData));
51 |
52 | if ($invoice->sync()) {
53 | $invoice->addStatusMessage($invoice->getApiURL().' '.
54 | RO::uncode($invoice->getDataValue('typDokl')).' '.
55 | RO::uncode($invoice->getRecordIdent()).' '.
56 | RO::uncode($invoice->getDataValue('sumCelkem')).' '.
57 | RO::uncode($invoice->getDataValue('mena')), 'success');
58 | } else {
59 | $invoice->addStatusMessage(json_encode($invoice->getData()), 'debug');
60 | }
61 |
62 | return $invoice;
63 | }
64 | $invoice = makeInvoice(['id' => 'ext:example:1']);
65 |
66 | // Set due date by DateTime object
67 | $nextMonth = new \DateTime();
68 | $nextMonth->modify('+1 month');
69 | $invoice->setDataValue('datSplat', $nextMonth);
70 |
71 | $invoice->addStatusMessage(
72 | _('Invoice').': '.$invoice->getRecordIdent().' '.$invoice->getRecordCode(),
73 | $invoice->sync() ? 'success' : 'error',
74 | );
75 |
--------------------------------------------------------------------------------
/Examples/ObjectChaining.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | $adresar = new \AbraFlexi\Adresar(['id' => 'EXT:APP:100', 'nazev' => 'FirmaAB',
23 | ], ['atomic' => 'false']); // Atomic Transaction: https://www.flexibee.eu/api/dokumentace/ref/tx/
24 |
25 | $adresar2 = new \AbraFlexi\Adresar(
26 | ['id' => 'EXT:APP:200', 'nazev' => 'FirmaCD'],
27 | ['offline' => true],
28 | );
29 | $adresar3 = new \AbraFlexi\Adresar(
30 | ['id' => 'EXT:APP:300', 'nazev' => 'FirmaEF'],
31 | ['offline' => true],
32 | );
33 | $adresar4 = new \AbraFlexi\Adresar(
34 | ['id' => 'EXT:APP:400', 'nazev' => 'FirmaGH'],
35 | ['offline' => true],
36 | );
37 |
38 | $banka = new \AbraFlexi\Banka(['id' => 'EXT:APP:500', 'typDokl' => 'code:STANDARD',
39 | 'banka' => 'code:BANKOVNÍ ÚČET'], ['offline' => true]);
40 |
41 | $adresarBankovniUcet = new \AbraFlexi\Adresar(
42 | ['iban' => 'CZ9501000000001234567899',
43 | 'bic' => 'KOMBCZPP', 'firma' => 'EXT:APP:300'],
44 | ['evidence' => 'adresar-bankovni-ucet'],
45 | ['offline' => true],
46 | );
47 |
48 | $adresar->join($banka);
49 |
50 | $adresarBankovniUcet->join($adresar2);
51 |
52 | $adresar3->join($adresar4);
53 |
54 | $adresarBankovniUcet->join($adresar3);
55 |
56 | $adresar->join($adresarBankovniUcet);
57 |
58 | echo "Request Sent to FlexiBee:\n".$adresar->getJsonizedData(null, \JSON_PRETTY_PRINT);
59 |
60 | echo "\nFlexiBee Response:\n".var_export($adresar->insertToFlexiBee(), true);
61 |
62 | echo "\nResultIDs was pushed to its source objects:\n".
63 | '$banka: '.$banka->getMyKey()."\n".
64 | '$adresar: '.$adresar->getMyKey()."\n".
65 | '$adresar2: '.$adresar2->getMyKey()."\n".
66 | '$adresar3: '.$adresar3->getMyKey()."\n".
67 | '$adresar4: '.$adresar4->getMyKey()."\n".
68 | '$adresarBankovniUcet: '.$adresarBankovniUcet->getMyKey()."\n";
69 |
--------------------------------------------------------------------------------
/Examples/ObjectsCooperation.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | /**
23 | * @var \AbraFlexi\FakturaVydana With initial type code:FAKTURA, connected to
24 | * default constatnt('FLEXIBEE_URL')
25 | */
26 | $originalInvoice = new \AbraFlexi\FakturaVydana(['typDokl' => \AbraFlexi\RO::code('FAKTURA')]);
27 |
28 | /**
29 | * @var \AbraFlexi\FakturaVydana
30 | */
31 | $invoice = new \AbraFlexi\FakturaVydana(
32 | $originalInvoice->getData(),
33 | $originalInvoice->getConnectionOptions(),
34 | );
35 |
36 | /**
37 | * Save to FlexiBee a obtain processed record record with its new CODE, Number etc.
38 | */
39 | $invoice->sync();
40 |
41 | /**
42 | * Print Link to new record in FlexiBee web interface.
43 | */
44 | echo ''.$invoice.'';
45 |
--------------------------------------------------------------------------------
/Examples/PerformingActions.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | include_once './common.php';
23 |
24 | $invoiceID = askForFlexiBeeID();
25 |
26 | $invoice = new \AbraFlexi\FakturaVydana($invoiceID, ['ignore404' => true]);
27 |
28 | if ($invoice->lastResponseCode) {
29 | $invoice->performAction('storno', 'int');
30 | } else {
31 | echo 'No such invoice';
32 | }
33 |
--------------------------------------------------------------------------------
/Examples/Prevodka.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | $skladovyPohyb = new \AbraFlexi\SkladovyPohyb([
23 | 'id' => 'ext:PREVODKA:1', // Vytvoříme záznam s tímto ID
24 | 'typDokl' => 'code:PŘEVODKA',
25 | 'sklad' => 'code:SKLAD-1', // Zdrojový sklad
26 | 'typPohybuK' => 'typPohybu.vydej',
27 | 'typPohybuSkladK' => 'typPohybuSklad.vydejPrevod',
28 | 'skladCil' => 'code:SKLAD-2', // Cílový sklad
29 | ]);
30 |
31 | $skladovyPohyb->addArrayToBranch(['cenik' => 'code:A', 'mnozMj' => '3'], 'skladovePolozky');
32 | $skladovyPohyb->addArrayToBranch(['cenik' => 'code:B', 'mnozMj' => '3'], 'skladovePolozky');
33 | $skladovyPohyb->insertToFlexiBee();
34 |
35 | $skladovyPohyb->stripBody(); // Vyprázdníme objekt aby se neposílala zbytečná data
36 | $skladovyPohyb->performAction('dokoncit-prevodku'); // Vykonání akce
37 |
--------------------------------------------------------------------------------
/Examples/ReadAddressColumns.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | $adreser = new \AbraFlexi\Adresar();
23 | $addresses = $adreser->getColumnsFromFlexibee(
24 | ['id', 'nazev', 'email', 'kontakty'],
25 | ['typVztahuK' => 'typVztahu.odberatel'],
26 | 'nazev',
27 | );
28 |
29 | print_r($addresses);
30 |
--------------------------------------------------------------------------------
/Examples/ReadInvoiceColumns.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | include_once './common.php';
23 |
24 | $invoice = new \AbraFlexi\FakturaVydana();
25 | $invoices = $invoice->getColumnsFromAbraFlexi(['id', 'firma', 'lastUpdate', 'datVyst', 'datSplat'], ['limit' => 100, 'start' => 20], 'datVyst');
26 |
27 | if ($invoices) {
28 | if ($invoice->lastResponseCode === 200) {
29 | echo $invoice->getApiURL();
30 | print_r($invoices);
31 | }
32 | } else {
33 | $invoice->addStatusMessage('No Invoices found');
34 | }
35 |
--------------------------------------------------------------------------------
/Examples/ReportUpdater.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Example\AbraFlexi;
16 |
17 | include_once './config.php';
18 |
19 | include_once '../vendor/autoload.php';
20 |
21 | \define('EASE_APPNAME', 'ReportUploader');
22 | \define('EASE_LOGGER', 'syslog|console');
23 |
24 | if ($argc < 3) {
25 | echo 'usage: '.$argv[0]." \n";
26 | echo 'example: '.$argv[0]." code:PokladDen pokDenik WinstromReports/vykazAnalyzaZakazky/analyzaZakazky.jrxml \n";
27 | } else {
28 | $reportID = $argv[1];
29 |
30 | if ($argc === 3) {
31 | if (is_file($argv[2])) {
32 | $reportFile = $argv[2];
33 | } else {
34 | $formCode = $argv[2];
35 | $reportFile = $argv[3];
36 | }
37 | }
38 |
39 | if (strstr($reportFile, '.jrxml')) {
40 | system('jaspercompiler '.$reportFile); // https://github.com/VitexSoftware/jaspercompiler
41 | $reportFile = str_replace('.jrxml', '.jasper', $reportFile);
42 | }
43 |
44 | if (file_exists($reportFile)) {
45 | $reporter = new \AbraFlexi\Report($reportID);
46 | $oldReportId = (int) $reporter->getDataValue('hlavniReport');
47 | $attachment = \AbraFlexi\Priloha::addAttachmentFromFile($reporter, $reportFile);
48 |
49 | if ($reporter->sync(['hlavniReport' => $attachment->getRecordID(), 'id' => $reporter->getRecordID()])) {
50 | if ($oldReportId) {
51 | $attachment->deleteFromFlexiBee($oldReportId);
52 | }
53 |
54 | $reporter->addStatusMessage(_('Report updated'), 'success');
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/Examples/SendReminders.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | $invoicer = new \AbraFlexi\FakturaVydana();
23 |
24 | function getOverdueInvoices($invoicer)
25 | {
26 | $result = null;
27 | $invoicer->defaultUrlParams['order'] = 'datVyst@A';
28 | $invoicer->defaultUrlParams['relations'] = 'adresar,kontakt';
29 | $invoices = $invoicer->getColumnsFromFlexibee(
30 | [
31 | 'id',
32 | 'kod',
33 | 'stavUhrK',
34 | 'firma',
35 | 'buc',
36 | 'varSym',
37 | 'specSym',
38 | 'sumCelkem',
39 | 'duzpPuv',
40 | 'datVyst'],
41 | "(stavUhrK is null OR stavUhrK eq 'stavUhr.castUhr') AND storno eq false",
42 | 'id',
43 | );
44 |
45 | if ($invoicer->lastResponseCode === 200) {
46 | $result = $invoices;
47 | }
48 |
49 | return $result;
50 | }
51 | $firmer = new \AbraFlexi\Adresar();
52 |
53 | foreach (getOverdueInvoices($invoicer) as $invoice) {
54 | $invoicer->setData($invoice, true);
55 |
56 | $firmer->setMyKey($invoicer->getDataValue('firma'));
57 |
58 | $mail = new \Ease\Mailer(
59 | $firmer->getNotificationEmailAddress(),
60 | sprintf(_('Overdue invoice: %s'), $invoice['kod']),
61 | sprintf(_('Please pay %s,-'), $invoice['sumCelkem']),
62 | );
63 |
64 | $mail->addFile(
65 | $invoicer->downloadInFormat('pdf', '/tmp/'),
66 | \AbraFlexi\Formats::$formats['PDF']['content-type'],
67 | );
68 | $mail->addFile(
69 | $invoicer->downloadInFormat('isdocx', '/tmp/'),
70 | \AbraFlexi\Formats::$formats['ISDOCx']['content-type'],
71 | );
72 |
73 | $mail->send();
74 | }
75 |
--------------------------------------------------------------------------------
/Examples/SetContactAuth.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | $kontakter = new \AbraFlexi\Kontakt();
23 | $first = $kontakter->getColumnsFromFlexibee(['id'], ['limit' => 1]);
24 | $kontakter->setData([
25 | 'id' => $first[0]['id'],
26 | 'username' => 'login',
27 | 'password' => 'heslo',
28 | // 'password@hash' => 'sha256',
29 | // 'password@salt' => 'osoleno',
30 | 'email' => 'example@flexibee.eu',
31 | 'poznam' => 'auth']);
32 |
33 | $kontakter->insertToFlexiBee();
34 |
35 | if ($kontakter->lastResponseCode === 201) {
36 | $kontakter->addStatusMessage('Password set', 'success');
37 | $kontakter->loadFromAbraFlexi();
38 | } else {
39 | $kontakter->addStatusMessage('Password set failed', 'warning');
40 | }
41 |
--------------------------------------------------------------------------------
/Examples/ShowDocumentChanges.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | include_once './common.php';
23 |
24 | $invoiceID = askForFlexiBeeID();
25 |
26 | /*
27 | * AbraFlexi Classes accept this form of initial identifier:
28 | *
29 | * (int) 2588
30 | * (string) ext:ESHOP:oi1978
31 | * (array) ['varSym'=>'20080015']
32 | */
33 |
34 | $invoice = new \AbraFlexi\FakturaVydana($invoiceID);
35 |
36 | if ($invoice->getMyKey()) {
37 | print_r($invoice->getChanges());
38 | } else {
39 | $originalInvoice->addStatusMessage('Source Invoice does not exists');
40 | }
41 |
--------------------------------------------------------------------------------
/Examples/TestConnection.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | $companer = new \AbraFlexi\Company();
23 | $companies = $companer->getFlexiData();
24 |
25 | if (\array_key_exists('company', $companies) === true) {
26 | $companer->addStatusMessage('Connection OK', 'success');
27 | } else {
28 | $companer->addStatusMessage('Connection failed', 'warning');
29 | }
30 |
--------------------------------------------------------------------------------
/Examples/UpdateInvoice.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | use AbraFlexi\FakturaVydana;
19 |
20 | \define('EASE_LOGGER', 'syslog|console');
21 |
22 | include_once './config.php';
23 |
24 | include_once '../vendor/autoload.php';
25 |
26 | $invoiceId = 1;
27 |
28 | $inv = new FakturaVydana($invoiceId, ['autoload' => false]);
29 | $inv->takeData(['stavMailK' => 'stavMail.odeslano']);
30 | $inv->sync();
31 |
32 | $inv->addStatusMessage(
33 | _('Invoice').': '.$inv->getRecordIdent().' '.$inv->getRecordCode(),
34 | $inv->sync() ? 'success' : 'error',
35 | );
36 |
--------------------------------------------------------------------------------
/Examples/common.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Example\AbraFlexi;
16 |
17 | /**
18 | * Ask For Invoice ID.
19 | *
20 | * @param string $type Requested type for documents
21 | *
22 | * @return int|string id or code
23 | */
24 | function askForFlexiBeeID($type = 'invoice')
25 | {
26 | $invoiceID = null;
27 | echo "Please enter {$type} ID:";
28 | $input = fopen('php://stdin', 'rb');
29 | $invoiceID = trim(fgets($input));
30 | fclose($input);
31 |
32 | if (is_numeric($invoiceID)) {
33 | $invoiceID = (int) $invoiceID;
34 | }
35 |
36 | return $invoiceID;
37 | }
38 |
--------------------------------------------------------------------------------
/Examples/config.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | require_once '../test/bootstrap.php';
16 |
--------------------------------------------------------------------------------
/Examples/demo.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | require_once '../test/bootstrap.php';
18 |
19 | echo _('FlexiBee Connection Test')."\n\n";
20 |
21 | $statuser = new Status();
22 |
23 | echo $statuser->getApiURL()."\n\n";
24 |
25 | foreach ($statuser->getData() as $property => $value) {
26 | echo "{$property}: {$value}\n";
27 | }
28 |
29 | $company = new Company();
30 | $info = $company->getAllFromFlexibee();
31 |
32 | if (isset($info) && \count($info)) {
33 | foreach ($info as $companyInfo) {
34 | echo \constant('FLEXIBEE_URL').'/c/'.$companyInfo['dbNazev'], $companyInfo['nazev']."\n";
35 | }
36 | } else {
37 | echo \constant('FLEXIBEE_URL').' '._('Communication error')."\n";
38 | }
39 |
40 | $changer = new Changes();
41 | $changer->enable();
42 |
43 | if ($changer->getStatus()) {
44 | echo _('ChangesAPI enabled');
45 | } else {
46 | echo _('ChangesAPI disabled');
47 | }
48 |
--------------------------------------------------------------------------------
/Examples/establishWebHook.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | include_once './config.php';
17 |
18 | include_once '../vendor/autoload.php';
19 |
20 | /**
21 | * Returns the current URL. This is instead of PHP_SELF which is unsafe.
22 | *
23 | * @param bool $dropqs whether to drop the querystring or not. Default true
24 | *
25 | * @return string the current URL or NULL for php-cli
26 | */
27 | function phpSelf($dropqs = true)
28 | {
29 | $url = null;
30 |
31 | if (\PHP_SAPI !== 'cli') {
32 | $schema = 'http';
33 |
34 | if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === 'on')) {
35 | $schema .= 's';
36 | }
37 |
38 | $url = sprintf(
39 | '%s://%s%s',
40 | $schema,
41 | $_SERVER['SERVER_NAME'],
42 | $_SERVER['REQUEST_URI'],
43 | );
44 |
45 | $parts = parse_url($url);
46 |
47 | $port = $_SERVER['SERVER_PORT'];
48 | $scheme = $parts['scheme'];
49 | $host = $parts['host'];
50 |
51 | if (isset($parts['path'])) {
52 | $path = $parts['path'];
53 | } else {
54 | $path = null;
55 | }
56 |
57 | if (isset($parts['query'])) {
58 | $qs = $parts['query'];
59 | } else {
60 | $qs = null;
61 | }
62 |
63 | $port || $port = ($scheme === 'https') ? '443' : '80';
64 |
65 | if (($scheme === 'https' && $port !== '443') || ($scheme === 'http' && $port !== '80')
66 | ) {
67 | $host = "{$host}:{$port}";
68 | }
69 |
70 | $url = "{$scheme}://{$host}{$path}";
71 |
72 | if (!$dropqs) {
73 | $url = "{$url}?{$qs}";
74 | }
75 | }
76 |
77 | return $url;
78 | }
79 |
80 | $hooks = new \AbraFlexi\Hooks();
81 | $hooks->debug = true;
82 | $hooks->throwException = true;
83 | $hooks->register(str_replace(basename(__FILE__), 'webhook.php', phpSelf()));
84 |
--------------------------------------------------------------------------------
/Examples/flexipeehp-composer-install.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Spoje-NET/php-abraflexi/e75bc13ebc0efa72da4b31acc7017fe38fa39928/Examples/flexipeehp-composer-install.png
--------------------------------------------------------------------------------
/Examples/flexipeehp-debian-test.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Spoje-NET/php-abraflexi/e75bc13ebc0efa72da4b31acc7017fe38fa39928/Examples/flexipeehp-debian-test.png
--------------------------------------------------------------------------------
/Examples/sendInvoiceByMail.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php -f
2 |
10 | * (c) 2025 SpojeNetIT s.r.o.
11 | *
12 | * For the full copyright and license information, please view the LICENSE
13 | * file that was distributed with this source code.
14 | */
15 |
16 | namespace Example\AbraFlexi;
17 |
18 | include_once './config.php';
19 |
20 | include_once '../vendor/autoload.php';
21 |
22 | include_once './common.php';
23 |
24 | echo 'Please recipient email addreess:';
25 | $input = fopen('php://stdin', 'rb');
26 | $recipient = trim(fgets($input));
27 | fclose($input);
28 |
29 | $invoiceID = askForFlexiBeeID();
30 |
31 | /*
32 | * AbraFlexi Classes accept this form of initial identifier:
33 | *
34 | * (int) 2588
35 | * (string) ext:ESHOP:oi1978
36 | * (array) ['varSym'=>'20080015']
37 | */
38 |
39 | $invoice = new \AbraFlexi\FakturaVydana($invoiceID);
40 |
41 | if ($invoice->sendByMail($recipient, 'Document sent by AbraFlexi ', 'Example How to sent document')) {
42 | $invoice->addStatusMessage(_('Invoice was sent'), 'success');
43 | } else {
44 | $invoice->addStatusMessage(_('Mailer does not work'), 'warning');
45 | }
46 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2016 Spoje.Net s.r.o.
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of
4 | this software and associated documentation files (the "Software"), to deal in
5 | the Software without restriction, including without limitation the rights to
6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7 | the Software, and to permit persons to whom the Software is furnished to do so,
8 | subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | # vim: set tabstop=8 softtabstop=8 noexpandtab:
2 | .PHONY: help
3 | help: ## Displays this list of targets with descriptions
4 | @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}'
5 |
6 | .PHONY: static-code-analysis
7 | static-code-analysis: vendor ## Runs a static code analysis with phpstan/phpstan
8 | vendor/bin/phpstan analyse --configuration=phpstan-default.neon.dist --memory-limit=-1
9 |
10 | .PHONY: static-code-analysis-baseline
11 | static-code-analysis-baseline: check-symfony vendor ## Generates a baseline for static code analysis with phpstan/phpstan
12 | vendor/bin/phpstan analyze --configuration=phpstan-default.neon.dist --generate-baseline=phpstan-default-baseline.neon --memory-limit=-1
13 |
14 | .PHONY: tests
15 | tests: vendor
16 | vendor/bin/phpunit tests
17 |
18 | .PHONY: vendor
19 | vendor: composer.json composer.lock ## Installs composer dependencies
20 | composer install
21 |
22 | .PHONY: cs
23 | cs: ## Update Coding Standards
24 | vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --diff --verbose
25 |
26 | .PHONY: cssilent
27 | cssilent: ## Update Coding Standards silently
28 | vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -q
29 |
30 | fresh:
31 | git pull
32 | composer install
33 |
34 | .PHONY: static
35 | static: ## Generate Static files by api structure
36 | composer update
37 | echo rm -rf static/*
38 | echo "STATIC #######################"
39 | cd tools/ ; ./update_all.sh ; cd ..
40 | make cssilent
41 |
42 | clean:
43 | rm -rf debian/php-abraflexi
44 | rm -rf debian/flexipeehp .phpunit.result.cache debian/flexipeehp.debhelper.log
45 | rm -rf debian/flexipeehp-doc
46 | rm -rf debian/*.log
47 | rm -rf debian/*.substvars
48 | rm -rf docs/*
49 | rm -f debianTest/composer.lock
50 | rm -rf vendor/* composer.lock
51 |
52 | apigen:
53 | VERSION=`cat debian/composer.json | grep version | awk -F'"' '{print $4}'`; \
54 | apigen generate --destination=docs -- src
55 |
56 | .PHONY: phpdoc
57 | phpdoc: ## Generate dev docs
58 | phpdoc -d src
59 |
60 | pretest:
61 | composer --ansi --no-interaction update
62 | php -f tests/PrepareForTest.php
63 |
64 | deb:
65 | dpkg-buildpackage -A -us -uc
66 |
67 | rpm:
68 | rpmdev-bumpspec --comment="Build" --userstring="Vítězslav Dvořák " flexipeehp.spec
69 | rpmbuild -ba flexipeehp.spec
70 |
71 | release:
72 | echo Release v$(nextversion)
73 | dch -v $(nextversion) `git log -1 --pretty=%B | head -n 1`
74 | debuild -i -us -uc -b
75 | git commit -a -m "Release v$(nextversion)"
76 | git tag -a $(nextversion) -m "version $(nextversion)"
77 |
78 | dimage:
79 | docker build -t vitexsoftware/flexipeehp .
80 |
81 | .PHONY: all pretest clean static release verup deb
82 |
83 | .PHONY: cs
84 | vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --diff --verbose
85 |
--------------------------------------------------------------------------------
/Vagrantfile:
--------------------------------------------------------------------------------
1 | Vagrant.configure("2") do |config|
2 | # config.vm.box = "ubuntu/zesty64"
3 | config.vm.box = "ubuntu/bionic64"
4 | # config.vm.box = "centos/7"
5 | config.vm.provision :shell, path: "bootstrap-debian.sh"
6 | config.vm.provision :shell, path: "bootstrap-centos.sh"
7 | config.vm.network :forwarded_port, guest: 80, host: 8080
8 | end
9 |
--------------------------------------------------------------------------------
/bootstrap-centos.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | cd ~
3 | rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
4 | rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
5 | yum -y install fedora-packager
6 | rpmdev-setuptree
7 | make rpm
8 |
--------------------------------------------------------------------------------
/bootstrap-debian.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | export DEBIAN_FRONTEND="noninteractive"
3 | wget -O - http://v.s.cz/info@vitexsoftware.cz.gpg.key|sudo apt-key add -
4 | echo deb http://v.s.cz/ stable main | tee /etc/apt/sources.list.d/vitexsoftware.list
5 | apt-get update
6 | apt-get install -y php-cli php-curl php-pear php-intl php-zip composer dpkg-dev devscripts php-apigen-theme-default debhelper gdebi-core
7 | apt-get update
8 |
9 | cd /vagrant
10 | debuild -i -us -uc -b
11 |
12 | #mkdir -p /vagrant/deb
13 | #mv /*.deb /vagrant/deb
14 | #cd /vagrant/deb
15 | #dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
16 | #echo "deb file:/vagrant/deb ./" > /etc/apt/sources.list.d/local.list
17 | #apt-get update
18 | export DEBCONF_DEBUG="developer"
19 |
20 | #apt-get -y --allow-unauthenticated install flexipeehp
21 | gdebi -n ../flexipeehp_*_all.deb
22 |
23 | cd /usr/share/doc/FlexiPeeHP/
24 | composer update
25 | php -f /usr/share/doc/FlexiPeeHP/flexibeeping.php
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "spojenet/flexibee",
3 | "description": "Library for easy interaction with czech economic system AbraFlexi.",
4 | "license": "MIT",
5 | "authors": [
6 | {
7 | "name": "Vítězslav Dvořák",
8 | "email": "info@vitexsoftware.cz"
9 | }
10 | ],
11 | "keywords": [
12 | "AbraFlexi",
13 | "FlexiBee",
14 | "API-Client",
15 | "FinTech"
16 | ],
17 | "require": {
18 | "ext-json": "*",
19 | "ext-curl": "*",
20 | "ext-gettext": "*",
21 | "vitexsoftware/ease-core": "^1.45"
22 | },
23 | "autoload": {
24 | "psr-4": {
25 | "AbraFlexi\\": "src/AbraFlexi/"
26 | }
27 | },
28 | "autoload-dev": {
29 | "psr-4": {
30 | "Test\\Ease\\": "vendor/vitexsoftware/ease-core/tests/src/Ease",
31 | "Test\\AbraFlexi\\": "tests/src/AbraFlexi/",
32 | "Test\\": "tests/"
33 | }
34 | },
35 | "require-dev": {
36 | "ext-iconv": "*",
37 | "phing/phing": "*",
38 | "roave/security-advisories": "dev-latest",
39 | "phpunit/phpunit": "*",
40 | "phpstan/phpstan": "*",
41 | "friendsofphp/php-cs-fixer": "^3.61",
42 | "ergebnis/composer-normalize": "^2.43",
43 | "ergebnis/php-cs-fixer-config": "^6.34"
44 | },
45 | "scripts": {
46 | "post-install-cmd": [
47 | "cd tools/ ; ./update_all.sh ; cd .."
48 | ],
49 | "post-update-cmd": [
50 | "cd tools/ ; ./update_all.sh ; cd .."
51 | ]
52 | },
53 | "config": {
54 | "allow-plugins": {
55 | "ergebnis/composer-normalize": true
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/debian/bootstrap.php:
--------------------------------------------------------------------------------
1 | loadConfig('/etc/abraflexi/client.json', true);
7 | }
8 |
--------------------------------------------------------------------------------
/debian/compat:
--------------------------------------------------------------------------------
1 | 11
2 |
--------------------------------------------------------------------------------
/debian/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "deb/abraflexi",
3 | "description": "Library for easy interaction with czech accounting system AbraFlexi.",
4 | "homepage": "https://github.com/Spoje-NET/php-abraflexi",
5 | "license": "GPL-2.0+",
6 | "type": "library",
7 | "authors": [
8 | {
9 | "name": "Vítězslav Dvořák",
10 | "email": "vitex@arachne.cz"
11 | }
12 | ],
13 | "require": {
14 | "ext-json": "*",
15 | "ext-curl": "*",
16 | "deb/ease-core": "*"
17 | },
18 | "autoload": {
19 | "psr-4": {
20 | "AbraFlexi\\": "."
21 | }
22 | },
23 | "config": {
24 | "vendor-dir": "/var/lib/php-spojenet-abraflexi"
25 | },
26 | "repositories": [
27 | {
28 | "type": "path",
29 | "url": "/usr/share/php/EaseCore"
30 | }
31 | ]
32 | }
33 |
--------------------------------------------------------------------------------
/debian/control:
--------------------------------------------------------------------------------
1 | Source: php-spojenet-abraflexi
2 | Build-Depends: debhelper (>= 7.0.50~), composer, moreutils, jq, phpdocumentor, php-mbstring, php-curl, php-intl
3 | Standards-Version: 3.9.8
4 | Maintainer: Vítězslav Dvořák
5 | Uploaders: Vitex
6 | Priority: optional
7 | Homepage: https://github.com/Spoje-NET/php-abraflexi
8 |
9 | Package: php-spojenet-abraflexi
10 | Depends: ${misc:Depends}, php-curl, php-xml, php-vitexsoftware-ease-core (>=1.45), composer
11 | Provides: php-abraflexi
12 | Conflicts: flexipeehp
13 | Suggests: abraflexi-client-config,abraflexi-client,abraflexi-contract-invoices,abraflexi-dark-gui,abraflexi-digest,abraflexi-matcher,abraflexi-reminder,abraflexi-server,abraflexi-server-backup,abraflexi-tools,multi-abraflexi-setup,abraflexi-mailer,php-vitexsoftware-ease-bootstrap4-widgets-abraflexi,php-vitexsoftware-abraflexi-bricks
14 | Architecture: all
15 | Section: web
16 | Priority: optional
17 | Description: PHP Based abraflexi RestAPI/Json library
18 | Allow you read and write operations on czech accounting system abraflexi
19 |
20 | Package: php-spojenet-abraflexi-dev
21 | Depends: ${misc:Depends}, php-spojenet-abraflexi, php-vitexsoftware-ease-core-dev
22 | Architecture: all
23 | Section: web
24 | Priority: optional
25 | Description: PHP Based abraflexi RestAPI/Json library development files
26 | PHPUnit classes used for testing php-abraflexi functionality
27 |
28 | #Package: php-spojenet-abraflexi-doc
29 | #Depends: ${misc:Depends}
30 | #Architecture: all
31 | #Replaces: php-abraflexi-doc
32 | #Suggests: www-browser
33 | #Section: doc
34 | #Priority: optional
35 | #Description: PHP Based abraflexi RestAPI/Json library Documentation
36 | # PHP Based abraflexi RestAPI/Json library documentation generated by phpDocumentor.
37 |
38 |
--------------------------------------------------------------------------------
/debian/copyright:
--------------------------------------------------------------------------------
1 | Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=143
2 | Upstream-Name: PHPAbraFlexi
3 | Upstream-Source: https://github.com/Spoje-NET/php-flexibee/archive/master.zip
4 |
5 | Files: *
6 | Homepage: https://github.com/Spoje-NET/php-flexibee/
7 | Copyright:
8 | (c) 2016 Spoje.Net s.r.o. (spoje.net)
9 | License: GPL-2
10 |
11 | License: GPL-2
12 | On Debian systems the full text of the GNU General Public License can be found
13 | in the `/usr/share/common-licenses/GPL-2' file.
14 |
15 |
--------------------------------------------------------------------------------
/debian/php-spojenet-abraflexi-dev.install:
--------------------------------------------------------------------------------
1 | tests/src/AbraFlexi/*.php /usr/share/php/AbraFlexiDev
2 | debian/composer.json /usr/share/php/AbraFlexiDev
3 | debian/test/* /usr/share/doc/AbraFlexiDev
4 |
--------------------------------------------------------------------------------
/debian/php-spojenet-abraflexi-doc.conf:
--------------------------------------------------------------------------------
1 | Alias /php-abraflexi /usr/share/doc/php-spojenet-abraflexi/html
2 |
3 |
--------------------------------------------------------------------------------
/debian/php-spojenet-abraflexi-doc.install:
--------------------------------------------------------------------------------
1 | docs/classes/* usr/share/doc/php-spojenet-abraflexi/html/classes
2 | docs/css/* usr/share/doc/php-spojenet-abraflexi/html/css
3 | docs/files/* usr/share/doc/php-spojenet-abraflexi/html/files
4 | docs/graphs/* usr/share/doc/php-spojenet-abraflexi/html/graphs
5 | docs/index.html usr/share/doc/php-spojenet-abraflexi/html/
6 | docs/indices/* usr/share/doc/php-spojenet-abraflexi/html/indices
7 | docs/js/* usr/share/doc/php-spojenet-abraflexi/html/js
8 | docs/namespaces/* usr/share/doc/php-spojenet-abraflexi/html/namespaces
9 | docs/packages/* usr/share/doc/php-spojenet-abraflexi/html/packages
10 | docs/reports/* usr/share/doc/php-spojenet-abraflexi/html/reports
11 |
12 |
13 | debian/php-spojenet-abraflexi-doc.conf usr/share/doc/php-spojenet-abraflexi-doc/apache
14 | README.md usr/share/doc/php-spojenet-abraflexi
15 |
--------------------------------------------------------------------------------
/debian/php-spojenet-abraflexi.install:
--------------------------------------------------------------------------------
1 | src/AbraFlexi/*.php /usr/share/php/AbraFlexi
2 | debian/composer.json /usr/share/php/AbraFlexi
3 | static/* /usr/share/php/AbraFlexi/static
4 | tools/* /usr/share/php/AbraFlexi/tools
5 | debian/bootstrap.php /usr/share/php/AbraFlexi/tools
6 |
--------------------------------------------------------------------------------
/debian/php-spojenet-abraflexi.postinst:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | #DEBHELPER#
4 |
5 | # postinst script for php-spojenet-flexibee
6 | #
7 | # see: dh_installdeb(1)
8 |
9 | set -e
10 |
11 | . /usr/share/debconf/confmodule
12 |
13 |
14 | # summary of how this script can be called:
15 | # * `configure'
16 | # * `abort-upgrade'
17 | # * `abort-remove' `in-favour'
18 | #
19 | # * `abort-remove'
20 | # * `abort-deconfigure' `in-favour'
21 | # `removing'
22 | #
23 | # for details, see http://www.debian.org/doc/debian-policy/ or
24 | # the debian-policy package
25 |
26 |
27 | case "$1" in
28 | configure)
29 |
30 | composer-global-update deb/abraflexi
31 |
32 | ;;
33 |
34 | abort-upgrade|abort-remove|abort-deconfigure)
35 | ;;
36 |
37 | *)
38 | echo "postinst called with unknown argument \`$1'" >&2
39 | exit 1
40 | ;;
41 | esac
42 |
43 | # dh_installdeb will replace this with shell code automatically
44 | # generated by other debhelper scripts.
45 |
46 | exit 0
47 |
48 | #DEBHELPER#
49 |
--------------------------------------------------------------------------------
/debian/php-spojenet-abraflexi.prerm:
--------------------------------------------------------------------------------
1 | rm -f /usr/share/php/AbraFlexi/composer.lock
2 |
--------------------------------------------------------------------------------
/debian/rules:
--------------------------------------------------------------------------------
1 | #!/usr/bin/make -f
2 |
3 | %:
4 | dh $@
5 |
6 | override_dh_auto_test:
7 | echo tests temporarly skipped for now in rules file
8 |
9 | #override_dh_prep:
10 | # composer install --no-dev
11 | # cd tools; ./update_all.sh ; cd ..
12 | # phpdoc run -d src
13 | # mkdir -p docs ; mv .phpdoc/build/* docs
14 | # dh_prep
15 |
16 | #override_dh_auto_test:
17 | # composer update --no-ansi --no-interaction --no-progress --no-scripts --optimize-autoloader
18 | # ./vendor/bin/phpunit --bootstrap tests/Bootstrap.php
19 | # dh_auto_test
20 |
21 |
22 |
23 | override_dh_install:
24 | dh_install
25 | jq '.version = "'`dpkg-parsechangelog | sed -n 's/^Version: //p'| sed 's/~.*//' `'"' debian/composer.json |sponge debian/php-spojenet-abraflexi/usr/share/php/AbraFlexi/composer.json
26 | sed -i -e "s/\/\.\.\/\.\.\//\//g" debian/php-spojenet-abraflexi/usr/share/php/AbraFlexi/RO.php
27 | sed -i -e "s/\/\.\.\/\.\.\//\//g" debian/php-spojenet-abraflexi/usr/share/php/AbraFlexi/Functions.php
28 | sed -i -e "s/\.\.\/test\//\/usr\/share\/php\/AbraFlexi\/tools\//g" debian/php-spojenet-abraflexi/usr/share/php/AbraFlexi/tools/*.php
29 | sed -i '/git/d' debian/php-spojenet-abraflexi/usr/share/php/AbraFlexi/tools/force_update_all.sh
30 | sed -i -e "s/src\/AbraFlexi\///g" debian/php-spojenet-abraflexi/usr/share/php/AbraFlexi/tools/force_update_all.sh
31 |
--------------------------------------------------------------------------------
/debian/source/format:
--------------------------------------------------------------------------------
1 | 3.0 (native)
2 |
--------------------------------------------------------------------------------
/debian/test/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vitexsoftware/flexibeedebiantest",
3 | "description": "FlexiBeeHP debian package test",
4 | "type": "project",
5 | "authors": [
6 | {
7 | "name": "Vítězslav Dvořák",
8 | "email": "info@vitexsoftware.cz"
9 | }
10 | ],
11 | "minimum-stability": "stable",
12 | "config": {
13 | "vendor-dir": "/tmp/flexibeehpdebiantest"
14 | },
15 | "require": {
16 | "deb/flexibee": "*",
17 | "deb/ease-core": "*"
18 | },
19 | "autoload-dev": {
20 | "psr-4": {
21 | "Test\\Ease\\": "../EaseCoreTests",
22 | "Test\\FlexiPeeHP\\": "./",
23 | "Test\\": "testing/"
24 | }
25 | },
26 | "repositories": [
27 | {
28 | "type": "path",
29 | "url": "/usr/share/php/EaseCore"
30 | },
31 | {
32 | "type": "path",
33 | "url": "/usr/share/php/FlexiPeeHP"
34 | }
35 | ]
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/debian/test/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "EASE_APPNAME": "FlexiPeeHPDebianTest",
3 | "EASE_LOGGER": "syslog|console",
4 | "FLEXIBEE_URL": "https://demo.flexibee.eu",
5 | "FLEXIBEE_LOGIN": "winstrom",
6 | "FLEXIBEE_PASSWORD": "winstrom"
7 | }
--------------------------------------------------------------------------------
/debian/test/flexibeeping.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 |
8 | * @copyright 2017-2021 Spoje.Net
9 | */
10 | $autoload = '/tmp/flexipeehpdebiantest/autoload.php';
11 | if (file_exists($autoload)) {
12 | require_once $autoload;
13 | } else {
14 | echo 'composer install ???';
15 | exit(2);
16 | }
17 |
18 | if (file_exists('/usr/share/doc/AbraFlexi/config.json')) {
19 | $config = '/usr/share/doc/AbraFlexi/config.json';
20 | } else {
21 | $config = './config.json';
22 | }
23 |
24 | \Ease\Shared::instanced()->loadConfig($config, true);
25 |
26 | $tester = new \AbraFlexi\Company();
27 |
28 | $records = $tester->getAllFromFlexibee();
29 |
30 | if (isset($records) && count($records)) {
31 | foreach ($records as $companyInfo) {
32 | $tester->addStatusMessage($companyInfo['nazev'], 'success');
33 | }
34 | exit(0);
35 | } else {
36 | $tester->addStatusMessage('Error', 'danger');
37 | exit(1);
38 | }
39 |
--------------------------------------------------------------------------------
/example.env:
--------------------------------------------------------------------------------
1 | ABRAFLEXI_URL=https://demo.flexibee.eu:5434
2 | ABRAFLEXI_LOGIN=winstrom
3 | ABRAFLEXI_PASSWORD=winstrom
4 | ABRAFLEXI_COMPANY=demo
5 |
--------------------------------------------------------------------------------
/phpstan-default-baseline.neon:
--------------------------------------------------------------------------------
1 | parameters:
2 | ignoreErrors:
3 |
--------------------------------------------------------------------------------
/phpstan-default.neon.dist:
--------------------------------------------------------------------------------
1 | includes:
2 | - phpstan-default-baseline.neon
3 |
4 | parameters:
5 | inferPrivatePropertyTypeFromConstructor: true
6 | level: 6
7 | paths:
8 | - src
9 | - tests
10 |
--------------------------------------------------------------------------------
/project-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Spoje-NET/php-abraflexi/e75bc13ebc0efa72da4b31acc7017fe38fa39928/project-logo.png
--------------------------------------------------------------------------------
/spoje-net_logo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Spoje-NET/php-abraflexi/e75bc13ebc0efa72da4b31acc7017fe38fa39928/spoje-net_logo.gif
--------------------------------------------------------------------------------
/src/AbraFlexi/Banka.php:
--------------------------------------------------------------------------------
1 |
7 | * @copyright (C) 2015-2025 Spoje.Net
8 | */
9 |
10 | declare(strict_types=1);
11 |
12 | /**
13 | * This file is part of the SpojeNet\AbraFlexi package.
14 | *
15 | * (c) 2019-2024 SpojeNet s.r.o.
16 | * (c) 2025 SpojeNetIT s.r.o.
17 | *
18 | * For the full copyright and license information, please view the LICENSE
19 | * file that was distributed with this source code.
20 | */
21 |
22 | namespace AbraFlexi;
23 |
24 | /**
25 | * Banka.
26 | *
27 | * @see https://demo.flexibee.eu/c/demo/banka/properties Vlastnosti evidence
28 | */
29 | class Banka extends RW implements \AbraFlexi\Document
30 | {
31 | use stitky;
32 | use firma;
33 | use email;
34 | use subItems;
35 | use getChanges;
36 | use sum;
37 | use kod;
38 | use lock;
39 |
40 | /**
41 | * Evidence užitá objektem.
42 | */
43 | public ?string $evidence = 'banka';
44 |
45 | /**
46 | * Stáhne bankovní výpisy ( trvá delší dobu ).
47 | *
48 | * @return bool
49 | */
50 | public function stahnoutVypisyOnline()
51 | {
52 | $this->performRequest('nacteni-vypisu-online.json', 'PUT', 'txt');
53 |
54 | return $this->lastResponseCode === 200;
55 | }
56 |
57 | /**
58 | * Start invoice automatic matching process ( it takes longer time )
59 | * Spustí proces automatického párování plateb. ( trvá delší dobu ).
60 | *
61 | * @see https://demo.flexibee.eu/devdoc/parovani-plateb Interní dokumentace
62 | *
63 | * @param bool $advanced Use Advanced matching method ?
64 | * @param string $filter Filter bank records before pairing ?
65 | */
66 | public function automatickeParovani($advanced = false, $filter = null): bool
67 | {
68 | $filterUrl = $filter === null ? '' : rtrim($filter, '/').'/';
69 | $this->performRequest($filterUrl.'automaticke-parovani'.($advanced ? '-pokrocile' : ''), 'PUT');
70 |
71 | return $this->lastResponseCode === 200;
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/src/AbraFlexi/Cenik.php:
--------------------------------------------------------------------------------
1 |
8 | * @copyright (C) 2016-2024 Spoje.Net
9 | */
10 |
11 | declare(strict_types=1);
12 |
13 | /**
14 | * This file is part of the SpojeNet\AbraFlexi package.
15 | *
16 | * (c) 2019-2024 SpojeNet s.r.o.
17 | * (c) 2025 SpojeNetIT s.r.o.
18 | *
19 | * For the full copyright and license information, please view the LICENSE
20 | * file that was distributed with this source code.
21 | */
22 |
23 | namespace AbraFlexi;
24 |
25 | /**
26 | * Ceník - Pricelist.
27 | *
28 | * @see https://demo.flexibee.eu/c/demo/cenik/properties Vlastnosti evidence
29 | */
30 | class Cenik extends RW
31 | {
32 | use stitky;
33 | use subItems;
34 | use getChanges;
35 | use kod;
36 |
37 | /**
38 | * Evidence užitá objektem.
39 | */
40 | public ?string $evidence = 'cenik';
41 | }
42 |
--------------------------------------------------------------------------------
/src/AbraFlexi/Changes.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Log změn v evidencích.
19 | *
20 | * @see https://www.abraflexi.eu/api/dokumentace/ref/changes-api/ Dokumentace
21 | */
22 | class Changes extends RO
23 | {
24 | /**
25 | * Evidence užitá objektem.
26 | */
27 | public ?string $evidence = 'changes';
28 |
29 | /**
30 | * Povolí oznamování změn
31 | * Allow changes notification.
32 | */
33 | public function enable(): bool
34 | {
35 | $this->performRequest('enable.xml', 'POST', 'xml');
36 |
37 | return $this->lastResponseCode === 200;
38 | }
39 |
40 | /**
41 | * Zakáže oznamování změn
42 | * Disallow changes notification.
43 | */
44 | public function disable(): bool
45 | {
46 | $this->performRequest('disable.xml', 'POST', 'xml');
47 |
48 | return $this->lastResponseCode === 200;
49 | }
50 |
51 | /**
52 | * Vrátí stav zapnutí ChangesAPI.
53 | */
54 | public function getStatus(): bool
55 | {
56 | $status = $this->performRequest('status.xml', 'GET', 'xml');
57 |
58 | return ($this->lastResponseCode === 200) && ($status['changes'][0]['success'] === 'true');
59 | }
60 |
61 | /**
62 | * Test if given record exists in AbraFlexi .
63 | *
64 | * @param array $data
65 | *
66 | * @return bool Method is disabled for Changes
67 | */
68 | public function recordExists($data): bool
69 | {
70 | return false;
71 | }
72 |
73 | /**
74 | * Obtain actual GlobalVersion
75 | * Vrací aktuální globální verzi změn.
76 | *
77 | * @see https://www.abraflexi.eu/api/dokumentace/ref/changes-api#globalVersion Globální Verze
78 | *
79 | * @return int
80 | */
81 | public function getGlobalVersion()
82 | {
83 | $this->getColumnsFromAbraFlexi('id', ['start' => 0, 'limit' => 0]);
84 |
85 | return $this->globalVersion;
86 | }
87 |
88 | /**
89 | * Convert AbraFlexi Response XML to Array.
90 | *
91 | * @param string $rawXML
92 | *
93 | * @return array
94 | */
95 | public function rawXmlToArray($rawXML): array
96 | {
97 | return [$this->getEvidence() => parent::rawXmlToArray($rawXML)];
98 | }
99 |
100 | /**
101 | * Changes has no relations.
102 | *
103 | * @param null|mixed $id
104 | */
105 | public function getVazby($id = null): void
106 | {
107 | throw new Exception(_('Changes has no relations'), $this);
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/src/AbraFlexi/Date.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Description of Date.
19 | *
20 | * @author vitex
21 | */
22 | class Date extends \DateTime
23 | {
24 | /**
25 | * Support for Null values.
26 | */
27 | public bool $isNull = false;
28 |
29 | /**
30 | * AbraFlexi date to PHP DateTime conversion.
31 | *
32 | * @param string $flexidate 2017-05-26 or 2017-05-26Z or 2017-05-26+02:00 or "NOW"
33 | *
34 | * @return \DateTime|false
35 | */
36 | public function __construct(string $flexidate = 'NOW')
37 | {
38 | $this->isNull = empty($flexidate);
39 | $format = '';
40 |
41 | if (strstr($flexidate, '+')) {
42 | $format = Functions::$DateFormat.'T';
43 | } elseif (strstr($flexidate, 'Z')) {
44 | $format = Functions::$DateFormat.'Z';
45 | } elseif (!empty($flexidate) && ($flexidate !== 'NOW')) {
46 | $format = Functions::$DateFormat;
47 |
48 | if (strstr($flexidate, ':')) {
49 | $format .= '-i:s';
50 | }
51 | }
52 |
53 | if (empty($format)) {
54 | parent::__construct();
55 | } else {
56 | parent::__construct(\DateTime::createFromFormat($format, $flexidate)
57 | ->setTime(0, 0)->format(\DateTimeInterface::ATOM));
58 | }
59 | }
60 |
61 | /**
62 | * Render Object as AbraFlexi::$DateFormat.
63 | */
64 | public function __toString(): string
65 | {
66 | return $this->isNull ? '' : $this->format(Functions::$DateFormat);
67 | }
68 |
69 | /**
70 | * Convert Timestamp to AbraFlexi Date format.
71 | *
72 | * @param int $timpestamp
73 | *
74 | * @return \AbraFlexi\Date or NULL
75 | */
76 | public static function timestampToFlexiDate($timpestamp = null): self
77 | {
78 | $flexiDate = new self();
79 |
80 | if (null !== $timpestamp) {
81 | $flexiDate->setTimestamp($timpestamp);
82 | }
83 |
84 | return $flexiDate;
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/src/AbraFlexi/DateTime.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Description of DateTime.
19 | *
20 | * @author vitex
21 | */
22 | class DateTime extends \DateTime
23 | {
24 | /**
25 | * Support for Null values.
26 | */
27 | /* bool */
28 | public bool $isNull = false;
29 |
30 | /**
31 | * Default output format.
32 | */
33 | public static string $format = 'Y-m-d\TH:i:s.u+P';
34 |
35 | /**
36 | * AbraFlexi dateTime to PHP DateTime conversion.
37 | *
38 | * @param string $flexidatetime 2017-09-26T10:00:53.755+02:00 or older 2017-05-19T00:00:00+02:00
39 | *
40 | * @return \DateTime|false
41 | */
42 | public function __construct(string $flexidatetime = 'NOW')
43 | {
44 | $this->isNull = empty($flexidatetime);
45 | $format = '';
46 |
47 | if (strstr($flexidatetime, '.')) { // NewFormat
48 | $format = self::$format;
49 | } elseif (!empty($flexidatetime) && ($flexidatetime !== 'NOW')) { // Old format
50 | $format = 'Y-m-d\TH:i:s+P';
51 | }
52 |
53 | if (empty($format)) {
54 | parent::__construct();
55 | } else {
56 | parent::__construct(\DateTime::createFromFormat($format, $flexidatetime)->format(\DateTimeInterface::ATOM));
57 | }
58 | }
59 |
60 | /**
61 | * Render Object as AbraFlexi::$DateTimeFormat.
62 | */
63 | public function __toString(): string
64 | {
65 | return $this->isNull ? '' : $this->format(self::$format);
66 | }
67 |
68 | /**
69 | * Convert Timestamp to Flexi DateTime format.
70 | *
71 | * @param int $timpestamp
72 | *
73 | * @return string AbraFlexi DateTime or NULL
74 | */
75 | public static function timestampToFlexiDateTime($timpestamp = null)
76 | {
77 | $flexiDateTime = null;
78 |
79 | if (null !== $timpestamp) {
80 | $date = new \DateTime();
81 | $date->setTimestamp($timpestamp);
82 | $flexiDateTime = $date->format('Y-m-dTH:i:s');
83 | }
84 |
85 | return $flexiDateTime;
86 | }
87 |
88 | /**
89 | * Easy way how to force format DateTime used.
90 | *
91 | * @return \DateTime|false
92 | */
93 | public function setFormat(string $format)
94 | {
95 | self::$format = $format;
96 |
97 | return $this;
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/src/AbraFlexi/Document.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * @author vitex
19 | */
20 | interface Document
21 | {
22 | /**
23 | * Get all labels for current record.
24 | *
25 | * @return array
26 | */
27 | public function getLabels();
28 |
29 | /**
30 | * Set one of available Labels for current record.
31 | *
32 | * @param string $label
33 | *
34 | * @return bool Operation success
35 | */
36 | public function setLabel($label);
37 |
38 | /**
39 | * UnSet Label for Current Object record.
40 | *
41 | * @param array|string $labelsToRemove Label name
42 | *
43 | * @return bool success result ?
44 | */
45 | public function unsetLabel($labelsToRemove);
46 |
47 | /**
48 | * UnSet all Labels for Current Object record.
49 | *
50 | * @return bool success result ?
51 | */
52 | public function unsetLabels();
53 |
54 | /**
55 | * Instance of Adresar( $this->getDataValue('firma') ).
56 | *
57 | * @param array $options for new Object
58 | *
59 | * @return Adresar
60 | */
61 | public function getFirmaObject($options = ['details' => 'id']);
62 |
63 | /**
64 | * Vrací z AbraFlexi sumaci i podle podmínek.
65 | *
66 | * @param array $conditions pole podmínek nebo ID záznamu
67 | *
68 | * @return array
69 | */
70 | public function getSumFromAbraFlexi($conditions = []);
71 |
72 | /**
73 | * Subitems - ex. items of invoice.
74 | *
75 | * @return array of document items or null
76 | */
77 | public function getSubItems();
78 |
79 | /**
80 | * @return bool
81 | */
82 | public function setSubitems(array $subitems);
83 |
84 | /**
85 | * @return string
86 | */
87 | public function getSubMenuName();
88 |
89 | /**
90 | * Array of SubItem objects.
91 | *
92 | * @return array
93 | */
94 | public function getSubObjects();
95 |
96 | /**
97 | * Get recipient for document.
98 | *
99 | * 1. try Document's "kontaktEmail" field
100 | * 2. try Document's company email
101 | * 3. try Document's primary contact mail
102 | * 4. try Document's any contact mail
103 | *
104 | * @return string
105 | */
106 | public function getEmail();
107 |
108 | /**
109 | * Obtain Chaneges from Journal.
110 | */
111 | public function getChanges();
112 | }
113 |
--------------------------------------------------------------------------------
/src/AbraFlexi/Dodavatel.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Description of Dodavatel.
19 | *
20 | * @author vitex
21 | */
22 | class Dodavatel extends RW
23 | {
24 | use stitky;
25 | use firma;
26 |
27 | /**
28 | * The agenda used by the object.
29 | */
30 | public ?string $evidence = 'dodavatel';
31 | }
32 |
--------------------------------------------------------------------------------
/src/AbraFlexi/DodavatelskaSmlouva.php:
--------------------------------------------------------------------------------
1 |
7 | * @copyright (C) 2015-2023 Spoje.Net
8 | */
9 |
10 | declare(strict_types=1);
11 |
12 | /**
13 | * This file is part of the SpojeNet\AbraFlexi package.
14 | *
15 | * (c) 2019-2024 SpojeNet s.r.o.
16 | * (c) 2025 SpojeNetIT s.r.o.
17 | *
18 | * For the full copyright and license information, please view the LICENSE
19 | * file that was distributed with this source code.
20 | */
21 |
22 | namespace AbraFlexi;
23 |
24 | /**
25 | * Dodavatelská smlouva.
26 | *
27 | * @see https://demo.flexibee.eu/c/demo/dodavatelska-smlouva/properties
28 | */
29 | class DodavatelskaSmlouva extends RW
30 | {
31 | use stitky;
32 | use subItems;
33 | use firma;
34 |
35 | /**
36 | * Evidence užitá objektem.
37 | */
38 | public ?string $evidence = 'dodavatelska-smlouva';
39 |
40 | /**
41 | * Generate invoices from contracts.
42 | * Vygeneruje faktury ze smluv.
43 | *
44 | * @return bool operation success
45 | */
46 | public function generateInvoices()
47 | {
48 | $this->performRequest('dodavatelska-smlouva/generovani-faktur.xml', 'PUT', 'xml');
49 |
50 | return $this->lastResponseCode === 200;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/AbraFlexi/Evidence.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | use Ease\Sand;
18 |
19 | /**
20 | * Helper class for work with multiplete documents.
21 | *
22 | * @author Vítězslav Dvořák
23 | */
24 | class Evidence extends Sand
25 | {
26 | public RO $engine;
27 |
28 | /**
29 | * Conditions for data selection.
30 | *
31 | * @var array
32 | */
33 | public array $conditions = [];
34 |
35 | /**
36 | * Evidence helper.
37 | *
38 | * @param array $conditions
39 | */
40 | public function __construct(RO $engine, array $conditions = [])
41 | {
42 | $this->engine = $engine;
43 | $this->conditions = $conditions;
44 | }
45 |
46 | /**
47 | * Array of objects in evidence.
48 | *
49 | * @return array
50 | */
51 | public function getEvidenceData()
52 | {
53 | return $this->engine->getColumnsFromAbraFlexi(\array_key_exists(
54 | 'detail',
55 | $this->conditions,
56 | ) ? $this->conditions['detail'] : 'full', $this->conditions);
57 | }
58 |
59 | /**
60 | * Array of objects in evidence.
61 | *
62 | * @return array
63 | */
64 | public function getEvidenceObjects()
65 | {
66 | $contents = [];
67 |
68 | foreach (
69 | $this->engine->getColumnsFromAbraFlexi(
70 | \array_key_exists(
71 | 'detail',
72 | $this->conditions,
73 | ) ? $this->conditions['detail'] : 'full',
74 | $this->conditions,
75 | ) as $pos => $recordData
76 | ) {
77 | $contents[$pos] = clone $this->engine;
78 | $contents[$pos]->setData($recordData, true);
79 | }
80 |
81 | return $contents;
82 | }
83 |
84 | /**
85 | * get used evidence name.
86 | *
87 | * @return string
88 | */
89 | public function getEvidence()
90 | {
91 | return $this->engine->getEvidence();
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/src/AbraFlexi/Exception.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Description of Exception.
19 | *
20 | * @author vitex
21 | */
22 | class Exception extends \Ease\Exception
23 | {
24 | /**
25 | * Original server response.
26 | */
27 | private string $serverResponse = '';
28 |
29 | /**
30 | * Error messages sit here.
31 | *
32 | * @var array
33 | */
34 | private array $errorMessages = [];
35 |
36 | /**
37 | * AbraFlexi response as Exception.
38 | *
39 | * @param string $message good to know
40 | * @param RO $caller AbraFlexi Object
41 | */
42 | public function __construct($message, RO $caller, ?\Ease\Exception $previous = null)
43 | {
44 | $this->errorMessages = $caller->getErrors();
45 | $this->serverResponse = $caller->lastCurlResponse;
46 | parent::__construct(\get_class($caller).': '.$message, $caller->lastResponseCode, $previous);
47 | }
48 |
49 | /**
50 | * Get (first) error message.
51 | *
52 | * @param int $index which message
53 | *
54 | * @return string
55 | */
56 | public function getErrorMessage($index = 0)
57 | {
58 | return $this->errorMessages[$index];
59 | }
60 |
61 | /**
62 | * All stored Error messages.
63 | *
64 | * @return array
65 | */
66 | public function getErrorMessages()
67 | {
68 | return $this->errorMessages;
69 | }
70 |
71 | /**
72 | * Raw API Response.
73 | *
74 | * @return string
75 | */
76 | public function getServerResponse()
77 | {
78 | return $this->serverResponse;
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/src/AbraFlexi/FakturaPrijata.php:
--------------------------------------------------------------------------------
1 |
7 | * @copyright (C) 2015-2024 Spoje.Net
8 | */
9 |
10 | declare(strict_types=1);
11 |
12 | /**
13 | * This file is part of the SpojeNet\AbraFlexi package.
14 | *
15 | * (c) 2019-2024 SpojeNet s.r.o.
16 | * (c) 2025 SpojeNetIT s.r.o.
17 | *
18 | * For the full copyright and license information, please view the LICENSE
19 | * file that was distributed with this source code.
20 | */
21 |
22 | namespace AbraFlexi;
23 |
24 | /**
25 | * Incoming invoice.
26 | *
27 | * @see https://demo.flexibee.eu/c/demo/faktura-prijata/properties
28 | */
29 | class FakturaPrijata extends RW implements Document
30 | {
31 | use stitky;
32 | use firma;
33 | use sum;
34 | use subItems;
35 | use email;
36 | use getChanges;
37 | use kod;
38 | use lock;
39 |
40 | /**
41 | * Evidence použitá třídou.
42 | */
43 | public ?string $evidence = 'faktura-prijata';
44 | }
45 |
--------------------------------------------------------------------------------
/src/AbraFlexi/FakturaVydanaPolozka.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Polozka Faktury vydané.
19 | *
20 | * @see https://demo.flexibee.eu/c/demo/faktura-vydana-polozka/properties položky evidence
21 | */
22 | class FakturaVydanaPolozka extends RW
23 | {
24 | use stitky;
25 |
26 | /**
27 | * Evidence užitá objektem.
28 | */
29 | public ?string $evidence = 'faktura-vydana-polozka';
30 | }
31 |
--------------------------------------------------------------------------------
/src/AbraFlexi/Hooks.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Hooky pro ChangesAPI.
19 | *
20 | * @note Tato položka nemá dostupné položky evidence
21 | */
22 | class Hooks extends RW
23 | {
24 | /**
25 | * Evidence užitá objektem.
26 | */
27 | public ?string $evidence = 'hooks';
28 |
29 | /**
30 | * Zaregistruje WebHook.
31 | *
32 | * @param string $url URL skript přímající WebHook
33 | * @param string $format json|xml formát přenášených dat
34 | *
35 | * @return bool výsledek požadavku
36 | */
37 | public function register($url, $format = 'json')
38 | {
39 | $this->setDataValue('url', $url);
40 | $this->setDataValue('format', strtoupper($format));
41 |
42 | $hooks = $this->getAllFromAbraFlexi();
43 |
44 | if (\is_array($hooks) && \count($hooks)) {
45 | foreach ($hooks as $hook) {
46 | if (\is_array($hook) && \array_key_exists('url', $hook)) {
47 | if ($hook['url'] === $url) {
48 | $this->addStatusMessage(sprintf(_('Url %s allready registered'), $url), 'debug');
49 |
50 | return false;
51 | }
52 | }
53 | }
54 | }
55 |
56 | $this->performRequest('?'.http_build_query($this->getData()), 'PUT');
57 |
58 | return $this->lastResponseCode === 200;
59 | }
60 |
61 | /**
62 | * Aktualizuje WebHook (penalty = 0).
63 | *
64 | * @param int $id
65 | */
66 | public function refreshWebHook($id)
67 | {
68 | $this->performRequest($id.'/retry', 'PUT');
69 |
70 | return $this->lastResponseCode === 200;
71 | }
72 |
73 | /**
74 | * Odregistruje webhook.
75 | *
76 | * @param int $id číslo záznamu
77 | */
78 | public function unregister($id)
79 | {
80 | return $this->deleteFromAbraFlexi($id);
81 | }
82 |
83 | /**
84 | * Test if given record exists in AbraFlexi.
85 | *
86 | * @param array $data
87 | *
88 | * @return bool Unsupported evidence
89 | */
90 | public function recordExists($data): bool
91 | {
92 | return false;
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/src/AbraFlexi/InterniDoklad.php:
--------------------------------------------------------------------------------
1 |
7 | * @copyright (C) 2015-2023 Spoje.Net
8 | */
9 |
10 | declare(strict_types=1);
11 |
12 | /**
13 | * This file is part of the SpojeNet\AbraFlexi package.
14 | *
15 | * (c) 2019-2024 SpojeNet s.r.o.
16 | * (c) 2025 SpojeNetIT s.r.o.
17 | *
18 | * For the full copyright and license information, please view the LICENSE
19 | * file that was distributed with this source code.
20 | */
21 |
22 | namespace AbraFlexi;
23 |
24 | /**
25 | * Internal Document.
26 | *
27 | * @see https://demo.flexibee.eu/c/demo/interni-doklad/properties
28 | */
29 | class InterniDoklad extends RW implements \AbraFlexi\Document
30 | {
31 | use stitky;
32 | use firma;
33 | use sum;
34 | use subItems;
35 | use email;
36 | use getChanges;
37 | use lock;
38 |
39 | /**
40 | * Evidence použitá třídou.
41 | */
42 | public ?string $evidence = 'interni-doklad';
43 | }
44 |
--------------------------------------------------------------------------------
/src/AbraFlexi/Kontakt.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Kontakt adresáře.
19 | *
20 | * @see https://demo.flexibee.eu/c/demo/kontakt/properties
21 | */
22 | class Kontakt extends RW
23 | {
24 | use stitky;
25 | use firma;
26 |
27 | /**
28 | * Evidence užitá objektem.
29 | */
30 | public ?string $evidence = 'kontakt';
31 |
32 | /**
33 | * Authenticate by contact.
34 | *
35 | * @see https://www.abraflexi.eu/api/dokumentace/ref/autentizace-kontaktu/ Contact Auth
36 | *
37 | * @param string $login
38 | * @param string $password
39 | */
40 | public function authenticate($login, $password): bool
41 | {
42 | $defaultHttpHeaders = $this->defaultHttpHeaders;
43 | $this->defaultHttpHeaders['Content-Type'] = 'application/x-www-form-urlencoded';
44 | $this->setPostFields(http_build_query(['username' => $login, 'password' => $password]));
45 | $result = $this->performRequest(
46 | 'authenticate',
47 | 'POST',
48 | 'xml',
49 | );
50 | $this->defaultHttpHeaders = $defaultHttpHeaders;
51 |
52 | if (!empty($result['message'])) {
53 | $this->addStatusMessage($result['message'], $result['success'] === 'true' ? 'success' : 'warning');
54 |
55 | if ($this->throwException === true && $result['success'] !== 'true') {
56 | throw new Exception($result['message'], $this);
57 | }
58 | }
59 |
60 | return \array_key_exists('success', $result) && $result['success'] === 'true';
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/AbraFlexi/Nastaveni.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Nastavení firmy.
19 | *
20 | * @note Tato položka nemá dostupné položky evidence
21 | * @note Tato evidence není veřejně dostupná na demo.abraflexi.eu
22 | */
23 | class Nastaveni extends RO
24 | {
25 | /**
26 | * Evidence užitá objektem.
27 | */
28 | public ?string $evidence = 'nastaveni';
29 | }
30 |
--------------------------------------------------------------------------------
/src/AbraFlexi/ObjednavkaPrijata.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Incoming order.
19 | *
20 | * @see https://demo.flexibee.eu/c/demo/objednavka-prijata/properties
21 | */
22 | class ObjednavkaPrijata extends RW implements \AbraFlexi\Document
23 | {
24 | use stitky;
25 | use firma;
26 | use sum;
27 | use subItems;
28 | use email;
29 | use getChanges;
30 | use lock;
31 |
32 | /**
33 | * Evidence použitá třídou.
34 | */
35 | public ?string $evidence = 'objednavka-prijata';
36 | }
37 |
--------------------------------------------------------------------------------
/src/AbraFlexi/ObjednavkaPrijataPolozka.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Položka skladového pohybu.
19 | *
20 | * @see https://demo.flexibee.eu/c/demo/objednavka-prijata-polozka/properties
21 | */
22 | class ObjednavkaPrijataPolozka extends RW
23 | {
24 | use stitky;
25 |
26 | /**
27 | * Evidence užitá objektem.
28 | */
29 | public ?string $evidence = 'objednavka-prijata-polozka';
30 | }
31 |
--------------------------------------------------------------------------------
/src/AbraFlexi/Pokladna.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Pokladna.
19 | *
20 | * @see https://demo.flexibee.eu/c/demo/pokladna/properties
21 | */
22 | class Pokladna extends RW
23 | {
24 | use stitky;
25 | use getChanges;
26 | use kod;
27 |
28 | /**
29 | * Evidence užitá objektem.
30 | */
31 | public ?string $evidence = 'pokladna';
32 |
33 | /**
34 | * Add Data to invoice subItem.
35 | *
36 | * @see Relations
37 | *
38 | * @param array $data pole dat
39 | * @param string $relationPath path evidence (relation) pro vkládaná data
40 | * @param bool $removeAll
41 | *
42 | * @return bool Operation success
43 | */
44 | public function addArrayToBranch(
45 | $data,
46 | $relationPath = 'polozkyIntDokladu',
47 | $removeAll = false
48 | ) {
49 | return parent::addArrayToBranch($data, $relationPath, $removeAll);
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/AbraFlexi/PokladniPohyb.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Pokladní pohyb.
19 | *
20 | * @see https://demo.flexibee.eu/c/demo/pokladni-pohyb/properties položky evidence
21 | */
22 | class PokladniPohyb extends RW implements \AbraFlexi\Document
23 | {
24 | use stitky;
25 | use firma;
26 | use sum;
27 | use subItems;
28 | use email;
29 | use getChanges;
30 | use lock;
31 |
32 | /**
33 | * Evidence AbraFlexi.
34 | */
35 | public ?string $evidence = 'pokladni-pohyb';
36 | }
37 |
--------------------------------------------------------------------------------
/src/AbraFlexi/RadaPokladniPohyb.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Číselná řada pokladního pohybu.
19 | */
20 | class RadaPokladniPohyb extends RW
21 | {
22 | /**
23 | * Evidence užitá objektem.
24 | */
25 | public ?string $evidence = 'rada-pokladni-pohyb';
26 |
27 | /**
28 | * Obtain code for new Record.
29 | *
30 | * @param string $code
31 | *
32 | * @return string
33 | */
34 | public function getNextRecordCode($code = null)
35 | {
36 | if (null === $code) {
37 | $code = $this->getMyKey();
38 | }
39 |
40 | $crID = null;
41 |
42 | if (\is_string($code)) {
43 | $sro = $this->performRequest($this->evidence.'/(kod=\''.$code.'\').json');
44 |
45 | if (\count($sro[$this->evidence])) {
46 | $crID = current(current($sro[$this->evidence]));
47 | }
48 | } else {
49 | $crID = $code;
50 | }
51 |
52 | $cr = $this->performRequest($this->evidence.'/'.$crID.'.json');
53 | $radaPokladniPohyb = current($cr[$this->evidence]);
54 | $crInfo = end($radaPokladniPohyb['polozkyRady']);
55 |
56 | $cislo = $crInfo['cisAkt'] + 1;
57 |
58 | if ($crInfo['zobrazNuly'] === 'true') {
59 | return $crInfo['prefix'].sprintf(
60 | '%\'.0'.$crInfo['cisDelka'].'d',
61 | $cislo,
62 | ).'/'.date('y');
63 | }
64 |
65 | return $crInfo['prefix'].$cislo.'/'.date('y');
66 | }
67 |
68 | /**
69 | * Zvedne číslo dokladu.
70 | *
71 | * @param string $code
72 | *
73 | * @return int číslo nového dokladu
74 | */
75 | public function incrementNextRecordCode($code = null)
76 | {
77 | if (null === $code) {
78 | $code = $this->getMyKey();
79 | }
80 |
81 | if (\is_string($code)) {
82 | $sro = $this->performRequest($this->evidence.'/(kod=\''.$code.'\').json');
83 | $crID = current(current($sro[$this->evidence]));
84 | } else {
85 | $crID = $code;
86 | }
87 |
88 | $cr = $this->performRequest($this->evidence.'/'.$crID.'.json');
89 | $radaPokladniPohyb = current($cr[$this->evidence]);
90 | $crInfo = end($radaPokladniPohyb['polozkyRady']);
91 |
92 | return $crInfo['cisAkt'] + 1;
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/src/AbraFlexi/Relation.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Description of Relation.
19 | *
20 | * @author vitex
21 | */
22 | class Relation
23 | {
24 | /**
25 | * Item in target evidence.
26 | *
27 | * @var array|string
28 | */
29 | public $value;
30 |
31 | /**
32 | * Target evidence name.
33 | */
34 | public string $target;
35 | public ?string $ref;
36 | public ?string $showAs;
37 |
38 | /**
39 | * Relation.
40 | *
41 | * @param array|string $item Record identifier
42 | * @param string $evidence Record's evidence
43 | * @param string $ref Reference path
44 | * @param string $showAs Item caption
45 | */
46 | public function __construct($item, string $evidence, $ref = null, $showAs = null)
47 | {
48 | $this->value = $item;
49 | $this->target = $evidence;
50 | $this->ref = $ref;
51 | $this->showAs = $showAs;
52 | }
53 |
54 | /**
55 | * Render value as string.
56 | */
57 | public function __toString(): string
58 | {
59 | return \is_array($this->value) ? (\is_array(current($this->value)) ? current($this->value)['kod'] : current($this->value)) : $this->value;
60 | }
61 |
62 | /**
63 | * Obtain Relation target as Object.
64 | *
65 | * @return \AbraFlexi\RO
66 | */
67 | public function getRelationTarget()
68 | {
69 | $engineClass = Functions::evidenceToClassName($this->target);
70 |
71 | if (class_exists($engineClass)) {
72 | $relation = new $engineClass($this->value);
73 | } else {
74 | if (EvidenceList::$evidences[$this->target]['importStatus'] === 'SUPPORTED') {
75 | $relation = new RW($this->value);
76 | } else {
77 | $relation = new RO($this->value);
78 | }
79 | }
80 |
81 | return $relation;
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/src/AbraFlexi/Report.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Description of Report.
19 | *
20 | * @author vitex
21 | */
22 | class Report extends RW
23 | {
24 | /**
25 | * Evidence užitá objektem.
26 | * Evidence used by object.
27 | */
28 | public ?string $evidence = 'report';
29 |
30 | /**
31 | * Načte záznam z AbraFlexi a uloží v sobě jeho data
32 | * Read AbraFlexi record and store it inside od object.
33 | *
34 | * @param int|string $id ID or conditions
35 | *
36 | * @return int počet načtených položek
37 | */
38 | public function loadFromAbraFlexi($id = null): int
39 | {
40 | if (\is_string($id) && strstr($id, 'code:')) { // Dirty Hack ⚠ Error 400: Entita 'Report' neobsahuje kód nebo ho nelze použít jako ID (není unikátní)
41 | $kod = \AbraFlexi\Functions::uncode((string) $id);
42 | $candidates = $this->getColumnsFromAbraFlexi(['id', 'kod'], ['kod' => $kod], 'kod');
43 |
44 | if (\array_key_exists($kod, $candidates)) {
45 | $id = (int) $candidates[\AbraFlexi\Functions::uncode((string) $id)]['id'];
46 | } else {
47 | $this->lastResponseCode = 404;
48 | }
49 | }
50 |
51 | return is_numeric($id) ? parent::loadFromAbraFlexi($id) : 0;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/src/AbraFlexi/Root.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Description of Common.
19 | *
20 | * @author vitex
21 | */
22 | class Root extends RW
23 | {
24 | /**
25 | * Update HTTPS certificate.
26 | *
27 | * @param string $pem
28 | */
29 | public function uploadCertificate($pem): bool
30 | {
31 | $this->postFields = $pem;
32 | $this->performRequest('/certificate', 'PUT');
33 |
34 | return $this->lastResponseCode === 201;
35 | }
36 |
37 | /**
38 | * Get available companies listing.
39 | *
40 | * @param array $conditions applay to listing
41 | *
42 | * @return array
43 | */
44 | public function companies($conditions = [])
45 | {
46 | return $this->getFlexiData('/c', $conditions);
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/src/AbraFlexi/SkladovaKarta.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Skladová Karta
19 | * Storage Card.
20 | *
21 | * @see https://demo.flexibee.eu/c/demo/skladova-karta/properties položky evidence
22 | */
23 | class SkladovaKarta extends RW
24 | {
25 | /**
26 | * Evidence used by object.
27 | */
28 | public ?string $evidence = 'skladova-karta';
29 | }
30 |
--------------------------------------------------------------------------------
/src/AbraFlexi/SkladovyPohyb.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Skladového pohyb.
19 | *
20 | * @see https://demo.flexibee.eu/c/demo/skladovy-pohyb/properties
21 | */
22 | class SkladovyPohyb extends RW
23 | {
24 | use stitky;
25 | use firma;
26 | use sum;
27 | use email;
28 | use lock;
29 |
30 | /**
31 | * Evidence užitá objektem.
32 | */
33 | public ?string $evidence = 'skladovy-pohyb';
34 | }
35 |
--------------------------------------------------------------------------------
/src/AbraFlexi/SkladovyPohybPolozka.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Položka skladového pohybu.
19 | *
20 | * @see https://demo.flexibee.eu/c/demo/skladovy-pohyb-polozka/properties
21 | */
22 | class SkladovyPohybPolozka extends RW
23 | {
24 | use stitky;
25 |
26 | /**
27 | * Evidence užitá objektem.
28 | */
29 | public ?string $evidence = 'skladovy-pohyb-polozka';
30 |
31 | /**
32 | * Add Items Serial Number.
33 | *
34 | * @param string $number serial number
35 | * @param bool $isMain main number
36 | *
37 | * @return bool Success
38 | */
39 | public function addSerialNumber($number, $isMain = false)
40 | {
41 | $numberBranch['kod'] = $number;
42 | $crrentSerialNumbers = $this->getDataValue('vyrobniCislaPrijata');
43 |
44 | if ($isMain) {
45 | if (!empty($crrentSerialNumbers)) {
46 | foreach (array_keys($crrentSerialNumbers) as $serialNumberID) {
47 | unset($this->data['vyrobniCislaPrijata'][$serialNumberID]['vyrobnicislohlav']);
48 | }
49 | }
50 |
51 | $numberBranch['vyrobnicislohlav'] = 1;
52 | }
53 |
54 | $this->setDataValue('mnozMj', empty($crrentSerialNumbers) ? 0 : \count($crrentSerialNumbers) + 1);
55 |
56 | return $this->addArrayToBranch($numberBranch, 'vyrobniCislaPrijata');
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/AbraFlexi/SkupinaFirem.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Skupina Firem.
19 | *
20 | * @see https://demo.flexibee.eu/c/demo/skupina-firem/properties
21 | */
22 | class SkupinaFirem extends RW
23 | {
24 | /**
25 | * Evidence užitá objektem.
26 | */
27 | public ?string $evidence = 'skupina-firem';
28 | }
29 |
--------------------------------------------------------------------------------
/src/AbraFlexi/Smlouva.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Smlouva.
19 | *
20 | * @see https://demo.flexibee.eu/c/demo/smlouva/properties Vlastnosti evidence
21 | */
22 | class Smlouva extends RW
23 | {
24 | use stitky;
25 | use firma;
26 |
27 | /**
28 | * Evidence užitá objektem.
29 | */
30 | public ?string $evidence = 'smlouva';
31 |
32 | /**
33 | * Generuje faktury ze smluv. Pokud je nastaven sloupec id generují se pouze z této smlouvy.
34 | *
35 | * @see https://www.abraflexi.eu/api/dokumentace/ref/generovani-faktur/ Interní dokumentace
36 | */
37 | public function generovaniFaktur(): bool
38 | {
39 | $this->performRequest(
40 | ($this->getMyKey() ? $this->getMyKey().'/' : '').'generovani-faktur',
41 | 'PUT',
42 | );
43 |
44 | return $this->lastResponseCode === 200;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/AbraFlexi/Status.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Description of Status.
19 | *
20 | * @author vitex
21 | */
22 | class Status extends RO
23 | {
24 | /**
25 | * Evidence užitá objektem.
26 | * Evidence used by object.
27 | *
28 | * @see https://demo.flexibee.eu/c/demo/evidence-list Přehled evidencí
29 | */
30 | public ?string $evidence = 'status';
31 |
32 | /**
33 | * @see https://demo.flexibee.eu/devdoc/company-identifier Identifikátor firmy
34 | */
35 | public ?string $company = '';
36 |
37 | /**
38 | * Default Line Prefix.
39 | */
40 | public string $prefix = '';
41 |
42 | /**
43 | * AbraFlexi status.
44 | *
45 | * @param mixed $init mostly ignored
46 | * @param array $options not used at all
47 | */
48 | public function __construct($init = null, $options = [])
49 | {
50 | parent::__construct($init, $options);
51 | $this->takeData($this->getFlexiData('/'.$this->evidence));
52 | }
53 |
54 | /**
55 | * Return the same response format for one and multiplete results.
56 | *
57 | * @param array $responseRaw
58 | */
59 | public function unifyResponseFormat($responseRaw): array
60 | {
61 | if (\array_key_exists('status', $responseRaw)) {
62 | $response = $responseRaw['status'];
63 | } else {
64 | $response = $responseRaw;
65 | }
66 |
67 | return $response;
68 | }
69 |
70 | /**
71 | * Status has no relations.
72 | *
73 | * @param null|mixed $id
74 | */
75 | public function getVazby($id = null): void
76 | {
77 | throw new \Exception(_('Status has no relations'));
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/src/AbraFlexi/Strom.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Obecný Strom.
19 | *
20 | * @see https://demo.flexibee.eu/c/demo/strom/properties vlastnosti evidence
21 | */
22 | class Strom extends RW
23 | {
24 | /**
25 | * Evidence užitá objektem.
26 | */
27 | public ?string $evidence = 'strom';
28 |
29 | /**
30 | * Sloupeček se jménem záznamu.
31 | */
32 | public string $nameColumn = 'nazev';
33 | }
34 |
--------------------------------------------------------------------------------
/src/AbraFlexi/StromCenik.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Strom Položek ceníku.
19 | *
20 | * @see https://demo.flexibee.eu/c/demo/strom-cenik/properties Vlastnosti evidence
21 | */
22 | class StromCenik extends RW
23 | {
24 | /**
25 | * Evidence užitá objektem.
26 | */
27 | public ?string $evidence = 'strom-cenik';
28 | }
29 |
--------------------------------------------------------------------------------
/src/AbraFlexi/UcetniObdobi.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Class for Accounting period handling.
19 | *
20 | * @see https://demo.flexibee.eu/c/demo/ucetni-obdobi/properties Položky evidence
21 | *
22 | * @author vitex
23 | */
24 | class UcetniObdobi extends RW
25 | {
26 | /**
27 | * Evidence AbraFlexi.
28 | */
29 | public ?string $evidence = 'ucetni-obdobi';
30 | }
31 |
--------------------------------------------------------------------------------
/src/AbraFlexi/Udalost.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * @see https://demo.abraflexi.eu/c/demo/udalost/properties api udalost evidence
19 | */
20 | class Udalost extends RW
21 | {
22 | use stitky;
23 | use firma;
24 |
25 | /**
26 | * Evidence užitá objektem.
27 | */
28 | public ?string $evidence = 'udalost';
29 | }
30 |
--------------------------------------------------------------------------------
/src/AbraFlexi/VyrobniCislo.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Výrobní číslo.
19 | *
20 | * @see https://demo.flexibee.eu/c/demo/vyrobni-cislo/properties položky evidence
21 | */
22 | class VyrobniCislo extends RW
23 | {
24 | /**
25 | * Evidence užitá objektem.
26 | */
27 | public ?string $evidence = 'vyrobni-cislo';
28 | }
29 |
--------------------------------------------------------------------------------
/src/AbraFlexi/Zamek.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Description of Zamek.
19 | *
20 | * @author Vitex
21 | */
22 | class Zamek extends RW
23 | {
24 | /**
25 | * Evidence used by object.
26 | */
27 | public ?string $evidence = 'skladova-karta';
28 | }
29 |
--------------------------------------------------------------------------------
/src/AbraFlexi/Zavazek.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Description of Zavazek.
19 | *
20 | * @author Vítězslav Dvořák
21 | */
22 | class Zavazek extends \AbraFlexi\RW
23 | {
24 | use stitky;
25 | use firma;
26 | use sum;
27 | use email;
28 | use lock;
29 | public ?string $evidence = 'zavazek';
30 | }
31 |
--------------------------------------------------------------------------------
/src/AbraFlexi/firma.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Add for Objects use with "firma" data column.
19 | *
20 | * @author Vítězslav Dvořák
21 | */
22 | trait firma
23 | {
24 | /**
25 | * Here Customer's or Provider's comany object live.
26 | */
27 | public ?\AbraFlexi\Adresar $firma = null;
28 |
29 | /**
30 | * Instance of Adresar( $this->getDataValue('firma') ).
31 | *
32 | * @param array $options for new Object
33 | *
34 | * @return Adresar
35 | */
36 | public function getFirmaObject($options = ['details' => 'id'])
37 | {
38 | if (null === $this->firma) {
39 | $this->firma = new Adresar($this->getDataValue('firma'), $options);
40 | }
41 |
42 | return $this->firma;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/AbraFlexi/getChanges.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | /*
16 | * Supported evidences:
17 |
18 | ✔ Faktury vydané, faktury přijaté
19 | ✔ Banka, pokladna a interní doklady
20 | ✔ Přijaté objednávky
21 | ✘ Vydané objednávky
22 | ✘ Příjemky/výdejky
23 | ✔ Adresář
24 | ✔ Ceník
25 | ✘ Majetek
26 | ✘ Cenové úrovně
27 | ✘ Zakázky
28 | ✘ Typy dokladů
29 | */
30 |
31 | namespace AbraFlexi;
32 |
33 | /**
34 | * Obtain record changes.
35 | *
36 | * @author vitex
37 | *
38 | * @see http://podpora.flexibee.eu/cs/articles/5784862-prehled-zmen-zaznamu-v-rest-api
39 | */
40 | trait getChanges
41 | {
42 | /**
43 | * Obtain Chaneges from Journal.
44 | *
45 | * @return array Changes obtained
46 | */
47 | public function getChanges()
48 | {
49 | $changesRaw = $this->performRequest($this->addDefaultUrlParams($this->getApiURL().'/zmeny.json'));
50 |
51 | if ($changesRaw) {
52 | $changes = $changesRaw['zmeny'];
53 | }
54 |
55 | return \is_array($changesRaw) && \array_key_exists('zmeny', $changesRaw) ? $changesRaw['zmeny'] : [];
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/AbraFlexi/kod.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Add for evidences with code: identifier.
19 | *
20 | * @author Vítězslav Dvořák
21 | */
22 | trait kod
23 | {
24 | /**
25 | * Obtain record/object identificator code:
26 | * Vrací identifikátor objektu code:
27 | *
28 | * @see https://demo.flexibee.eu/devdoc/identifiers Identifikátory záznamů
29 | *
30 | * @return string record code identifier
31 | */
32 | public function _getRecordCode()
33 | {
34 | return empty($this->getDataValue('kod')) ? null : self::code($this->getDataValue('kod'));
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/AbraFlexi/lock.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Add for evidences with Summary support.
19 | *
20 | * @author Vítězslav Dvořák
21 | */
22 | trait lock
23 | {
24 | /**
25 | * Check if record is locked.
26 | *
27 | * @throws \InvalidArgumentException if zamekK is not set
28 | */
29 | public function locked(): bool
30 | {
31 | $lockValue = $this->getDataValue('zamekK');
32 |
33 | if (null === $lockValue) {
34 | throw new \InvalidArgumentException('unset zamekK', 1);
35 | }
36 |
37 | return $lockValue !== 'zamek.otevreno';
38 | }
39 |
40 | /**
41 | * Get lock type. Value of zamekK without "zamek."
42 | * Most common values are "otevreno" and "uzamceno".
43 | *
44 | * @throws \InvalidArgumentException if zamekK is not set
45 | */
46 | public function getLockType(): string
47 | {
48 | $lockValue = $this->getDataValue('zamekK');
49 |
50 | if (null === $lockValue) {
51 | throw new \InvalidArgumentException('unset zamekK', 1);
52 | }
53 |
54 | return str_replace('zamek.', '', $lockValue);
55 | }
56 |
57 | /**
58 | * Locks the current record.
59 | *
60 | * @return bool true on success, false on failure
61 | */
62 | public function lock(): bool
63 | {
64 | return $this->performAction('lock');
65 | }
66 |
67 | /**
68 | * Unlocks the current record.
69 | *
70 | * @return bool true on success, false on failure
71 | */
72 | public function unlock(): bool
73 | {
74 | return $this->performAction('unlock');
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/src/AbraFlexi/stitky.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Add for Objects use with "firma" data column.
19 | *
20 | * @author Vítězslav Dvořák
21 | */
22 | trait stitky
23 | {
24 | /**
25 | * Get all labels for current record.
26 | *
27 | * @return array
28 | */
29 | public function getLabels()
30 | {
31 | return Stitek::listToArray($this->getDataValue('stitky'));
32 | }
33 |
34 | /**
35 | * Set one of available Labels for current record.
36 | *
37 | * @param string $label
38 | *
39 | * @return bool Operation success
40 | */
41 | public function setLabel($label)
42 | {
43 | $this->insertToAbraFlexi(['id' => $this->getRecordIdent(), 'stitky' => $label]);
44 |
45 | return $this->lastResponseCode === 201;
46 | }
47 |
48 | /**
49 | * UnSet Label for Current Object record.
50 | *
51 | * @param array|string $labelsToRemove Label/Labels
52 | *
53 | * @return bool success result ?
54 | */
55 | public function unsetLabel($labelsToRemove)
56 | {
57 | $this->insertToAbraFlexi(['id' => $this->getRecordIdent(), 'stitky@removeAll' => 'true',
58 | 'stitky' => array_diff_key(
59 | $this->getLabels(),
60 | Stitek::listToArray($labelsToRemove),
61 | )]);
62 |
63 | return $this->lastResponseCode === 201;
64 | }
65 |
66 | /**
67 | * UnSet all Labels for Current Object record.
68 | *
69 | * @return bool success result ?
70 | */
71 | public function unsetLabels()
72 | {
73 | $this->insertToAbraFlexi(['id' => $this->getRecordIdent(), 'stitky@removeAll' => 'true']);
74 |
75 | return $this->lastResponseCode === 201;
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/src/AbraFlexi/subItems.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Document SubItems functions.
19 | *
20 | * @author vitex
21 | */
22 | trait subItems
23 | {
24 | /**
25 | * Subitems - ex. items of invoice.
26 | *
27 | * @return array of document items or null
28 | */
29 | public function getSubItems()
30 | {
31 | return $this->getDataValue($this->getSubmenuName());
32 | }
33 |
34 | /**
35 | * @return bool
36 | */
37 | public function setSubitems(array $subitems)
38 | {
39 | return $this->setDataValue($this->getSubmenuName(), $subitems);
40 | }
41 |
42 | /**
43 | * Name for SubItem branch.
44 | *
45 | * @return string
46 | */
47 | public function getSubMenuName()
48 | {
49 | return \array_key_exists('polozkyFaktury', $this->getData()) ? 'polozkyFaktury'
50 | : (\array_key_exists('polozkyDokladu', $this->getData()) ? 'polozkyDokladu'
51 | : null);
52 | }
53 |
54 | /**
55 | * SubItem object.
56 | *
57 | * @return array
58 | */
59 | public function getSubObjects()
60 | {
61 | $subEvidence = $this->getEvidence().'-polozka';
62 | $subClass = str_replace(
63 | ' ',
64 | '',
65 | ucwords(str_replace('-', ' ', $subEvidence)),
66 | );
67 |
68 | if (class_exists($subClass) === false) {
69 | $subClass = 'RW';
70 | }
71 |
72 | $subObjects = [];
73 |
74 | foreach ($this->getSubItems() as $subItemData) {
75 | $subObjects[$subItemData['id']] = new $subClass(
76 | $subItemData,
77 | ['evidence' => $subEvidence],
78 | );
79 | }
80 |
81 | return $subObjects;
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/src/AbraFlexi/sum.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace AbraFlexi;
16 |
17 | /**
18 | * Add for evidences with Summary support.
19 | *
20 | * @author Vítězslav Dvořák
21 | */
22 | trait sum
23 | {
24 | /**
25 | * Vrací z AbraFlexi sumaci i podle podmínek.
26 | *
27 | * @param array $conditions pole podmínek nebo ID záznamu
28 | *
29 | * @return array
30 | */
31 | public function getSumFromAbraFlexi($conditions = [])
32 | {
33 | $flexiData = $this->getFlexiData('$sum', $conditions);
34 |
35 | return empty($flexiData) ? null : $flexiData['sum'];
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/static/Properties.changes.json:
--------------------------------------------------------------------------------
1 | {"id":{"showToUser":"false","propertyName":"id","name":"ID","title":"ID","type":"integer","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","mandatory":"false","isWritable":"false","isOverWritable":"false","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"external-ids":{"showToUser":"false","propertyName":"external-ids","fkEvidencePath":"external-ids","dbName":"extid","name":"external-ids","title":"extIDs","type":"relation","isVisible":"true","isSortable":"false","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null}}
--------------------------------------------------------------------------------
/static/Properties.dashboard-sharing.json:
--------------------------------------------------------------------------------
1 | {"id":{"showToUser":"false","propertyName":"id","dbName":"Idwdashboardsharing","name":"ID","title":"ID","type":"integer","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"false","isOverWritable":"false","hasBusinessLogic":"true","isUpperCase":"false","isLowerCase":"false","links":null},"hidden":{"showToUser":"true","propertyName":"hidden","dbName":"Hidden","name":"Skryt\u00fd","title":"Skryt\u00fd","type":"logic","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"priority":{"showToUser":"true","propertyName":"priority","dbName":"Priority","name":"Po\u0159ad\u00ed","title":"Po\u0159ad\u00ed","type":"integer","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"user":{"showToUser":"true","propertyName":"user","dbName":"Iduser","name":"U\u017eivatel","title":"U\u017eivatel","type":"relation","fkName":"U\u017eivatel\u00e9 ve firm\u011b 20024","fkEvidencePath":"uzivatel","fkEvidenceType":"UZIVATELE","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"true","maxLength":"254","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"true","url":"http:\/\/demo.flexibee.eu\/c\/demo\/uzivatel","links":null},"dashboardpanel":{"showToUser":"true","propertyName":"dashboardpanel","dbName":"Iddashboardpanel","name":"Dashboard panel","title":"Dashboard panel","type":"relation","fkName":"Spr\u00e1va p\u0159ehled\u016f 30033","fkEvidencePath":"dashboard-panel","fkEvidenceType":"DASHBOARD_PANEL","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"true","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","url":"http:\/\/demo.flexibee.eu\/c\/demo\/dashboard-panel","links":null},"external-ids":{"showToUser":"false","propertyName":"external-ids","fkEvidencePath":"external-ids","dbName":"extid","name":"external-ids","title":"extIDs","type":"relation","isVisible":"true","isSortable":"false","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null}}
--------------------------------------------------------------------------------
/static/Properties.global-store.json:
--------------------------------------------------------------------------------
1 | {"id":{"showToUser":"false","propertyName":"id","dbName":"IdSetting","name":"ID","title":"ID","type":"integer","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"false","isOverWritable":"false","hasBusinessLogic":"true","isUpperCase":"false","isLowerCase":"false","links":null},"klic":{"showToUser":"true","propertyName":"klic","dbName":"Klic","name":"Kl\u00ed\u010d","title":"Kl\u00ed\u010d","type":"string","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","maxLength":"255","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"hodnota":{"showToUser":"true","propertyName":"hodnota","dbName":"Hodnota","name":"Hodnota","title":"Hodnota","type":"string","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"external-ids":{"showToUser":"false","propertyName":"external-ids","fkEvidencePath":"external-ids","dbName":"extid","name":"external-ids","title":"extIDs","type":"relation","isVisible":"true","isSortable":"false","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null}}
--------------------------------------------------------------------------------
/static/Properties.po-splatnosti.json:
--------------------------------------------------------------------------------
1 | {"fakturovano":{"showToUser":"true","propertyName":"fakturovano","name":"","title":"","type":"numeric","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"sumCelkemAkt":{"showToUser":"true","propertyName":"sumCelkemAkt","name":"","title":"","type":"numeric","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"uhrazeno":{"showToUser":"true","propertyName":"uhrazeno","name":"","title":"","type":"numeric","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"symbolSplatnostiK":{"showToUser":"true","propertyName":"symbolSplatnostiK","name":"","title":"","type":"select","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"firma":{"showToUser":"true","propertyName":"firma","name":"Zkratka firmy","title":"Zkratka firmy","type":"relation","fkName":"Adresy firem 4002","fkEvidencePath":"adresar","fkEvidenceType":"ADRESAR","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","maxLength":"20","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"true","isLowerCase":"false","url":"http:\/\/demo.flexibee.eu\/c\/demo\/adresar","links":null},"external-ids":{"showToUser":"false","propertyName":"external-ids","fkEvidencePath":"external-ids","dbName":"extid","name":"external-ids","title":"extIDs","type":"relation","isVisible":"true","isSortable":"false","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null}}
--------------------------------------------------------------------------------
/static/Properties.podobne-zbozi.json:
--------------------------------------------------------------------------------
1 | {"id":{"showToUser":"false","propertyName":"id","dbName":"IdPodobne","name":"ID","title":"ID","type":"integer","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"false","isOverWritable":"false","hasBusinessLogic":"true","isUpperCase":"false","isLowerCase":"false","links":null},"lastUpdate":{"showToUser":"false","propertyName":"lastUpdate","dbName":"lastUpdate","name":"Posledn\u00ed zm\u011bna","title":"Posledn\u00ed zm\u011bna","type":"datetime","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"false","isOverWritable":"false","hasBusinessLogic":"true","isUpperCase":"false","isLowerCase":"false","links":null},"poznam":{"showToUser":"true","propertyName":"poznam","dbName":"Poznam","name":"Pozn\u00e1mka","title":"Pozn\u00e1mka","type":"string","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"cenikOtec":{"showToUser":"true","propertyName":"cenikOtec","dbName":"IdCenikOtec","name":"Cen\u00edkov\u00e1 polo\u017eka","title":"Cen\u00edkov\u00e1 polo\u017eka","type":"relation","fkName":"Cen\u00edk 6003","fkEvidencePath":"cenik","fkEvidenceType":"CENIK","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"true","maxLength":"64","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"true","isLowerCase":"false","url":"http:\/\/demo.flexibee.eu\/c\/demo\/cenik","links":null},"cenik":{"showToUser":"true","propertyName":"cenik","dbName":"IdCenik","name":"Podobn\u00e9","title":"Podobn\u00e9","type":"relation","fkName":"Cen\u00edk 6003","fkEvidencePath":"cenik","fkEvidenceType":"CENIK","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"true","maxLength":"64","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"true","isLowerCase":"false","url":"http:\/\/demo.flexibee.eu\/c\/demo\/cenik","links":null},"external-ids":{"showToUser":"false","propertyName":"external-ids","fkEvidencePath":"external-ids","dbName":"extid","name":"external-ids","title":"extIDs","type":"relation","isVisible":"true","isSortable":"false","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null}}
--------------------------------------------------------------------------------
/static/Properties.pravo-viditelnosti.json:
--------------------------------------------------------------------------------
1 | {"id":{"showToUser":"false","propertyName":"id","dbName":"IdDataPrava","name":"ID","title":"ID","type":"integer","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"false","isOverWritable":"false","hasBusinessLogic":"true","isUpperCase":"false","isLowerCase":"false","links":null},"idUzivatel":{"showToUser":"true","propertyName":"idUzivatel","dbName":"IdUzivatel","name":"u\u017eivatel","title":"u\u017eivatel","type":"integer","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"typDatK":{"showToUser":"true","propertyName":"typDatK","dbName":"TypDatK","name":"typ dat","title":"typ dat","type":"select","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","maxLength":"50","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"modulK":{"showToUser":"true","propertyName":"modulK","dbName":"ModulK","name":"modul","title":"modul","type":"select","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","maxLength":"50","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"idObjektu":{"showToUser":"true","propertyName":"idObjektu","dbName":"IdObjektu","name":"objekt","title":"objekt","type":"integer","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"editovat":{"showToUser":"true","propertyName":"editovat","dbName":"Editovat","name":"editovat","title":"editovat","type":"logic","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"external-ids":{"showToUser":"false","propertyName":"external-ids","fkEvidencePath":"external-ids","dbName":"extid","name":"external-ids","title":"extIDs","type":"relation","isVisible":"true","isSortable":"false","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null}}
--------------------------------------------------------------------------------
/static/Properties.pricteni-rozdilu.json:
--------------------------------------------------------------------------------
1 | {"external-ids":{"showToUser":"false","propertyName":"external-ids","fkEvidencePath":"external-ids","dbName":"extid","name":"external-ids","title":"extIDs","type":"relation","isVisible":"true","isSortable":"false","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null}}
--------------------------------------------------------------------------------
/static/Properties.prislustenstvi.json:
--------------------------------------------------------------------------------
1 | {"id":{"showToUser":"false","propertyName":"id","dbName":"IdPrislusenstvi","name":"ID","title":"ID","type":"integer","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"false","isOverWritable":"false","hasBusinessLogic":"true","isUpperCase":"false","isLowerCase":"false","links":null},"lastUpdate":{"showToUser":"false","propertyName":"lastUpdate","dbName":"lastUpdate","name":"Posledn\u00ed zm\u011bna","title":"Posledn\u00ed zm\u011bna","type":"datetime","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"false","isOverWritable":"false","hasBusinessLogic":"true","isUpperCase":"false","isLowerCase":"false","links":null},"poznam":{"showToUser":"true","propertyName":"poznam","dbName":"Poznam","name":"Pozn\u00e1mka","title":"Pozn\u00e1mka","type":"string","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"cenikOtec":{"showToUser":"true","propertyName":"cenikOtec","dbName":"IdCenikOtec","name":"Cen\u00edkov\u00e1 polo\u017eka","title":"Cen\u00edkov\u00e1 polo\u017eka","type":"relation","fkName":"Cen\u00edk 6003","fkEvidencePath":"cenik","fkEvidenceType":"CENIK","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"true","maxLength":"64","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"true","isLowerCase":"false","url":"http:\/\/demo.flexibee.eu\/c\/demo\/cenik","links":null},"cenik":{"showToUser":"true","propertyName":"cenik","dbName":"IdCenik","name":"P\u0159\u00edslu\u0161enstv\u00ed","title":"P\u0159\u00edslu\u0161enstv\u00ed","type":"relation","fkName":"Cen\u00edk 6003","fkEvidencePath":"cenik","fkEvidenceType":"CENIK","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"true","maxLength":"64","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"true","isLowerCase":"false","url":"http:\/\/demo.flexibee.eu\/c\/demo\/cenik","links":null},"external-ids":{"showToUser":"false","propertyName":"external-ids","fkEvidencePath":"external-ids","dbName":"extid","name":"external-ids","title":"extIDs","type":"relation","isVisible":"true","isSortable":"false","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null}}
--------------------------------------------------------------------------------
/static/Properties.setting-store.json:
--------------------------------------------------------------------------------
1 | {"id":{"showToUser":"false","propertyName":"id","dbName":"IdSetting","name":"ID","title":"ID","type":"integer","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"false","isOverWritable":"false","hasBusinessLogic":"true","isUpperCase":"false","isLowerCase":"false","links":null},"klic":{"showToUser":"true","propertyName":"klic","dbName":"Klic","name":"Kl\u00ed\u010d","title":"Kl\u00ed\u010d","type":"string","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","maxLength":"255","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"hodnota":{"showToUser":"true","propertyName":"hodnota","dbName":"Hodnota","name":"Hodnota","title":"Hodnota","type":"string","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"uzivatelId":{"showToUser":"true","propertyName":"uzivatelId","dbName":"IdUzivatel","name":"U\u017eivatel","title":"U\u017eivatel","type":"integer","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"false","isOverWritable":"false","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"external-ids":{"showToUser":"false","propertyName":"external-ids","fkEvidencePath":"external-ids","dbName":"extid","name":"external-ids","title":"extIDs","type":"relation","isVisible":"true","isSortable":"false","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null}}
--------------------------------------------------------------------------------
/static/Properties.strom-cenik.json:
--------------------------------------------------------------------------------
1 | {"id":{"showToUser":"false","propertyName":"id","dbName":"Idvazuzel","name":"ID","title":"ID","type":"integer","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"false","isOverWritable":"false","hasBusinessLogic":"true","isUpperCase":"false","isLowerCase":"false","links":null},"lastUpdate":{"showToUser":"false","propertyName":"lastUpdate","dbName":"lastUpdate","name":"Posledn\u00ed zm\u011bna","title":"Posledn\u00ed zm\u011bna","type":"datetime","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"false","isOverWritable":"false","hasBusinessLogic":"true","isUpperCase":"false","isLowerCase":"false","links":null},"idZaznamu":{"showToUser":"true","propertyName":"idZaznamu","dbName":"Idzaznamu","name":"ID Z\u00e1znamu","title":"ID Z\u00e1znamu","type":"integer","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"true","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"uzel":{"showToUser":"true","propertyName":"uzel","dbName":"Iduzlu","name":"Strom","title":"Strom","type":"relation","fkName":"Uzel stromu 30013","fkEvidencePath":"strom","fkEvidenceType":"STROM","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"true","maxLength":"20","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"true","isLowerCase":"false","url":"http:\/\/demo.flexibee.eu\/c\/demo\/strom","links":null},"external-ids":{"showToUser":"false","propertyName":"external-ids","fkEvidencePath":"external-ids","dbName":"extid","name":"external-ids","title":"extIDs","type":"relation","isVisible":"true","isSortable":"false","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null}}
--------------------------------------------------------------------------------
/static/Properties.sumace-sestavy.json:
--------------------------------------------------------------------------------
1 | {"id":{"showToUser":"false","propertyName":"id","dbName":"IdSesSumace","name":"ID","title":"ID","type":"integer","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"false","isOverWritable":"false","hasBusinessLogic":"true","isUpperCase":"false","isLowerCase":"false","links":null},"lastUpdate":{"showToUser":"false","propertyName":"lastUpdate","dbName":"lastUpdate","name":"Posledn\u00ed zm\u011bna","title":"Posledn\u00ed zm\u011bna","type":"datetime","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"false","isOverWritable":"false","hasBusinessLogic":"true","isUpperCase":"false","isLowerCase":"false","links":null},"prevratZnam":{"showToUser":"true","propertyName":"prevratZnam","dbName":"PrevratZnam","name":"P\u0159evr\u00e1tit znam\u00e9nko","title":"P\u0159evr\u00e1tit znam\u00e9nko","type":"logic","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"radek":{"showToUser":"true","propertyName":"radek","dbName":"IdSesRadky","name":"\u0158\u00e1dek","title":"\u0158\u00e1dek","type":"relation","fkName":"\u0158\u00e1dek sestavy 3103","fkEvidencePath":"radek-sestavy","fkEvidenceType":"RADEK_SESTAVY","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","maxLength":"20","isWritable":"false","isOverWritable":"false","hasBusinessLogic":"false","isUpperCase":"true","isLowerCase":"false","url":"http:\/\/demo.flexibee.eu\/c\/demo\/radek-sestavy","links":null},"radekSum":{"showToUser":"true","propertyName":"radekSum","dbName":"IdSesRadkySum","name":"P\u0159i\u010d\u00edst \u0159\u00e1dek","title":"P\u0159i\u010d\u00edst \u0159\u00e1dek","type":"relation","fkName":"\u0158\u00e1dek sestavy 3103","fkEvidencePath":"radek-sestavy","fkEvidenceType":"RADEK_SESTAVY","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"true","maxLength":"20","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"true","isLowerCase":"false","url":"http:\/\/demo.flexibee.eu\/c\/demo\/radek-sestavy","links":null},"external-ids":{"showToUser":"false","propertyName":"external-ids","fkEvidencePath":"external-ids","dbName":"extid","name":"external-ids","title":"extIDs","type":"relation","isVisible":"true","isSortable":"false","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null}}
--------------------------------------------------------------------------------
/static/Properties.umisteni-uctu.json:
--------------------------------------------------------------------------------
1 | {"ucet":{"showToUser":"true","propertyName":"ucet","name":"\u00da\u010det","title":"\u00da\u010det","type":"relation","fkName":"\u00da\u010dtov\u00fd rozvrh 2001","fkEvidencePath":"ucet","fkEvidenceType":"UCET","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"true","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","url":"http:\/\/demo.flexibee.eu\/c\/demo\/ucet","links":null},"vybranyRadek":{"showToUser":"true","propertyName":"vybranyRadek","name":"Vybran\u00fd \u0159\u00e1dek","title":"Vybran\u00fd \u0159\u00e1dek","type":"relation","fkName":"\u0158\u00e1dek sestavy 3103","fkEvidencePath":"radek-sestavy","fkEvidenceType":"RADEK_SESTAVY","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","url":"http:\/\/demo.flexibee.eu\/c\/demo\/radek-sestavy","links":null},"external-ids":{"showToUser":"false","propertyName":"external-ids","fkEvidencePath":"external-ids","dbName":"extid","name":"external-ids","title":"extIDs","type":"relation","isVisible":"true","isSortable":"false","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null}}
--------------------------------------------------------------------------------
/static/Properties.uzivatel.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/tests/ObjectForTesting.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Test;
16 |
17 | /**
18 | * Class used to test Object To Array Conversion.
19 | */
20 | class ObjectForTesting extends \stdClass
21 | {
22 | /**
23 | * Simple Item.
24 | */
25 | public int $item = 1;
26 |
27 | /**
28 | * Array item.
29 | *
30 | * @var array
31 | */
32 | public array $arrItem = ['a', 'b' => 'c'];
33 |
34 | /**
35 | * Simple method.
36 | *
37 | * @return bool
38 | */
39 | public function method()
40 | {
41 | return true;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/tests/bootstrap.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | include_once file_exists('../vendor/autoload.php') ? '../vendor/autoload.php' : 'vendor/autoload.php';
16 |
17 | /**
18 | * Write logs as:
19 | */
20 | if (!\defined('EASE_APPNAME')) {
21 | \define('EASE_APPNAME', 'AbraFlexiTest');
22 | }
23 |
24 | if (!\defined('EASE_LOGGER')) {
25 | \define('EASE_LOGGER', 'syslog');
26 | }
27 |
28 | if (\Ease\Shared::init(['ABRAFLEXI_URL', 'ABRAFLEXI_LOGIN', 'ABRAFLEXI_PASSWORD', 'ABRAFLEXI_COMPANY'], file_exists('../.env') ? '../.env' : '.env', false) === false) { // FallBack to Abra
29 | /*
30 | * URL AbraFlexi API
31 | */
32 | \define('ABRAFLEXI_URL', 'https://demo.flexibee.eu');
33 | /*
34 | * Uživatel AbraFlexi API
35 | */
36 | \define('ABRAFLEXI_LOGIN', 'winstrom');
37 | /*
38 | * Heslo AbraFlexi API
39 | */
40 | \define('ABRAFLEXI_PASSWORD', 'winstrom');
41 | /*
42 | * Společnost v AbraFlexi
43 | */
44 | \define('ABRAFLEXI_COMPANY', 'demo');
45 | }
46 |
47 | $adresser = new AbraFlexi\Adresar('code:TEST', ['ignore404' => true]);
48 |
49 | if ($adresser->lastResponseCode === 404) {
50 | $addressTester = \Test\AbraFlexi\AdresarTest::makeTestAddress(['kod' => 'TEST', 'email' => 'main@test.cz']);
51 | \Test\AbraFlexi\KontaktTest::makeTestContact(['firma' => $addressTester, 'email' => 'fakturace@test.cz', 'jmeno' => 'fakturant', 'prijmeni' => 'Novak', 'odesilatFak' => true]);
52 | \Test\AbraFlexi\KontaktTest::makeTestContact(['firma' => $addressTester, 'email' => 'kancelar@test.cz', 'jmeno' => 'Obchodnik', 'prijmeni' => 'Novy', 'odesilatFak' => true, 'odesilatPpt' => true]);
53 | }
54 |
55 | $invoicer = new AbraFlexi\Adresar('code:TEST', ['ignore404' => true]);
56 |
57 | if ($invoicer->lastResponseCode === 404) {
58 | \Test\AbraFlexi\FakturaVydana::makeTestInvoice('code:TEST', ['ignore404' => true]);
59 | }
60 |
--------------------------------------------------------------------------------
/tests/configuration.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 | .
22 | src
23 |
24 |
25 |
26 |
39 |
40 |
--------------------------------------------------------------------------------
/tests/src/AbraFlexi/ActionsTest.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Test\AbraFlexi;
16 |
17 | use AbraFlexi\Actions;
18 |
19 | /**
20 | * Generated by PHPUnit_SkeletonGenerator on 2024-10-02 at 10:07:03.
21 | */
22 | class ActionsTest extends \PHPUnit\Framework\TestCase
23 | {
24 | protected Actions $object;
25 |
26 | /**
27 | * Sets up the fixture, for example, opens a network connection.
28 | * This method is called before a test is executed.
29 | */
30 | protected function setUp(): void
31 | {
32 | $this->object = new Actions();
33 | }
34 |
35 | /**
36 | * Tears down the fixture, for example, closes a network connection.
37 | * This method is called after a test is executed.
38 | */
39 | protected function tearDown(): void
40 | {
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/tests/src/AbraFlexi/DateTest.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Test\AbraFlexi;
16 |
17 | use AbraFlexi\Date;
18 |
19 | /**
20 | * Generated by PHPUnit_SkeletonGenerator on 2024-10-02 at 10:07:33.
21 | */
22 | class DateTest extends \PHPUnit\Framework\TestCase
23 | {
24 | protected Date $object;
25 |
26 | /**
27 | * Sets up the fixture, for example, opens a network connection.
28 | * This method is called before a test is executed.
29 | */
30 | protected function setUp(): void
31 | {
32 | $this->object = new Date();
33 | }
34 |
35 | /**
36 | * Tears down the fixture, for example, closes a network connection.
37 | * This method is called after a test is executed.
38 | */
39 | protected function tearDown(): void
40 | {
41 | }
42 |
43 | /**
44 | * @covers \AbraFlexi\Date::__toString
45 | */
46 | public function testToString(): void
47 | {
48 | $this->assertEquals(date('Y-m-d'), $this->object->__toString());
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/tests/src/AbraFlexi/DateTimeTest.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Test\AbraFlexi;
16 |
17 | use AbraFlexi\DateTime;
18 |
19 | /**
20 | * Generated by PHPUnit_SkeletonGenerator on 2024-10-02 at 10:07:39.
21 | */
22 | class DateTimeTest extends \PHPUnit\Framework\TestCase
23 | {
24 | protected DateTime $object;
25 |
26 | /**
27 | * Sets up the fixture, for example, opens a network connection.
28 | * This method is called before a test is executed.
29 | */
30 | protected function setUp(): void
31 | {
32 | $this->object = new DateTime();
33 | }
34 |
35 | /**
36 | * Tears down the fixture, for example, closes a network connection.
37 | * This method is called after a test is executed.
38 | */
39 | protected function tearDown(): void
40 | {
41 | }
42 |
43 | /**
44 | * @covers \AbraFlexi\DateTime::__toString
45 | */
46 | public function testToString(): void
47 | {
48 | $this->assertIsString($this->object->__toString());
49 | }
50 |
51 | /**
52 | * @covers \AbraFlexi\DateTime::setFormat
53 | */
54 | public function testsetFormat(): void
55 | {
56 | $this->object->setDate(2323, 2, 3)->setTime(2, 3, 2, 3);
57 | $this->assertEquals('2323-02-03T02:03:02.000003++00:00', $this->object->__toString());
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/tests/src/AbraFlexi/EvidenceListTest.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Test\AbraFlexi;
16 |
17 | use AbraFlexi\EvidenceList;
18 |
19 | /**
20 | * Generated by PHPUnit_SkeletonGenerator on 2024-10-02 at 10:07:00.
21 | */
22 | class EvidenceListTest extends \PHPUnit\Framework\TestCase
23 | {
24 | protected EvidenceList $object;
25 |
26 | /**
27 | * Sets up the fixture, for example, opens a network connection.
28 | * This method is called before a test is executed.
29 | */
30 | protected function setUp(): void
31 | {
32 | $this->object = new EvidenceList();
33 | }
34 |
35 | /**
36 | * Tears down the fixture, for example, closes a network connection.
37 | * This method is called after a test is executed.
38 | */
39 | protected function tearDown(): void
40 | {
41 | }
42 |
43 | /**
44 | * @covers \AbraFlexi\EvidenceList::getRecordID
45 | *
46 | * @todo Implement testgetRecordID().
47 | */
48 | public function testgetRecordID(): void
49 | {
50 | $this->assertEquals('', $this->object->getRecordID());
51 | // Remove the following lines when you implement this test.
52 | $this->markTestIncomplete('This test has not been implemented yet.');
53 | }
54 |
55 | /**
56 | * @covers \AbraFlexi\EvidenceList::getRecordCode
57 | *
58 | * @todo Implement testgetRecordCode().
59 | */
60 | public function testgetRecordCode(): void
61 | {
62 | $this->assertEquals('', $this->object->getRecordCode());
63 | // Remove the following lines when you implement this test.
64 | $this->markTestIncomplete('This test has not been implemented yet.');
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/tests/src/AbraFlexi/ExceptionTest.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Test\AbraFlexi;
16 |
17 | use AbraFlexi\Exception;
18 |
19 | /**
20 | * Generated by PHPUnit_SkeletonGenerator on 2024-10-02 at 10:07:41.
21 | */
22 | class ExceptionTest extends \PHPUnit\Framework\TestCase
23 | {
24 | protected Exception $object;
25 |
26 | /**
27 | * Sets up the fixture, for example, opens a network connection.
28 | * This method is called before a test is executed.
29 | */
30 | protected function setUp(): void
31 | {
32 | $this->object = new Exception();
33 | }
34 |
35 | /**
36 | * Tears down the fixture, for example, closes a network connection.
37 | * This method is called after a test is executed.
38 | */
39 | protected function tearDown(): void
40 | {
41 | }
42 |
43 | // /**
44 | // * @covers \AbraFlexi\Exception::getErrorMessage
45 | // *
46 | // * @todo Implement testgetErrorMessage().
47 | // */
48 | // public function testgetErrorMessage(): void
49 | // {
50 | // $this->assertEquals('', $this->object->getErrorMessage());
51 | // // Remove the following lines when you implement this test.
52 | // $this->markTestIncomplete('This test has not been implemented yet.');
53 | // }
54 | //
55 | // /**
56 | // * @covers \AbraFlexi\Exception::getErrorMessages
57 | // *
58 | // * @todo Implement testgetErrorMessages().
59 | // */
60 | // public function testgetErrorMessages(): void
61 | // {
62 | // $this->assertEquals('', $this->object->getErrorMessages());
63 | // // Remove the following lines when you implement this test.
64 | // $this->markTestIncomplete('This test has not been implemented yet.');
65 | // }
66 | //
67 | // /**
68 | // * @covers \AbraFlexi\Exception::getServerResponse
69 | // *
70 | // * @todo Implement testgetServerResponse().
71 | // */
72 | // public function testgetServerResponse(): void
73 | // {
74 | // $this->assertEquals('', $this->object->getServerResponse());
75 | // // Remove the following lines when you implement this test.
76 | // $this->markTestIncomplete('This test has not been implemented yet.');
77 | // }
78 | }
79 |
--------------------------------------------------------------------------------
/tests/src/AbraFlexi/HooksTest.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Test\AbraFlexi;
16 |
17 | use AbraFlexi\Hooks;
18 |
19 | /**
20 | * Generated by PHPUnit_SkeletonGenerator on 2024-10-02 at 10:07:36.
21 | */
22 | class HooksTest extends \PHPUnit\Framework\TestCase
23 | {
24 | protected Hooks $object;
25 |
26 | /**
27 | * Sets up the fixture, for example, opens a network connection.
28 | * This method is called before a test is executed.
29 | */
30 | protected function setUp(): void
31 | {
32 | $this->object = new Hooks();
33 | }
34 |
35 | /**
36 | * Tears down the fixture, for example, closes a network connection.
37 | * This method is called after a test is executed.
38 | */
39 | protected function tearDown(): void
40 | {
41 | }
42 |
43 | // /**
44 | // * @covers \AbraFlexi\Hooks::register
45 | // *
46 | // * @todo Implement testregister().
47 | // */
48 | // public function testregister(): void
49 | // {
50 | // $this->assertEquals('', $this->object->register());
51 | // // Remove the following lines when you implement this test.
52 | // $this->markTestIncomplete('This test has not been implemented yet.');
53 | // }
54 | //
55 | // /**
56 | // * @covers \AbraFlexi\Hooks::refreshWebHook
57 | // *
58 | // * @todo Implement testrefreshWebHook().
59 | // */
60 | // public function testrefreshWebHook(): void
61 | // {
62 | // $this->assertEquals('', $this->object->refreshWebHook());
63 | // // Remove the following lines when you implement this test.
64 | // $this->markTestIncomplete('This test has not been implemented yet.');
65 | // }
66 | //
67 | // /**
68 | // * @covers \AbraFlexi\Hooks::unregister
69 | // *
70 | // * @todo Implement testunregister().
71 | // */
72 | // public function testunregister(): void
73 | // {
74 | // $this->assertEquals('', $this->object->unregister());
75 | // // Remove the following lines when you implement this test.
76 | // $this->markTestIncomplete('This test has not been implemented yet.');
77 | // }
78 | //
79 | // /**
80 | // * @covers \AbraFlexi\Hooks::recordExists
81 | // *
82 | // * @todo Implement testrecordExists().
83 | // */
84 | // public function testrecordExists(): void
85 | // {
86 | // $this->assertEquals('', $this->object->recordExists());
87 | // // Remove the following lines when you implement this test.
88 | // $this->markTestIncomplete('This test has not been implemented yet.');
89 | // }
90 | }
91 |
--------------------------------------------------------------------------------
/tests/src/AbraFlexi/NastaveniTest.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Test\AbraFlexi;
16 |
17 | use AbraFlexi\Nastaveni;
18 |
19 | /**
20 | * Generated by PHPUnit_SkeletonGenerator on 2024-10-02 at 10:07:17.
21 | */
22 | class NastaveniTest extends \PHPUnit\Framework\TestCase
23 | {
24 | protected Nastaveni $object;
25 |
26 | /**
27 | * Sets up the fixture, for example, opens a network connection.
28 | * This method is called before a test is executed.
29 | */
30 | protected function setUp(): void
31 | {
32 | $this->object = new Nastaveni();
33 | }
34 |
35 | /**
36 | * Tears down the fixture, for example, closes a network connection.
37 | * This method is called after a test is executed.
38 | */
39 | protected function tearDown(): void
40 | {
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/tests/src/AbraFlexi/RadaPokladniPohybTest.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Test\AbraFlexi;
16 |
17 | use AbraFlexi\RadaPokladniPohyb;
18 |
19 | /**
20 | * Generated by PHPUnit_SkeletonGenerator on 2024-10-02 at 10:07:08.
21 | */
22 | class RadaPokladniPohybTest extends \PHPUnit\Framework\TestCase
23 | {
24 | protected RadaPokladniPohyb $object;
25 |
26 | /**
27 | * Sets up the fixture, for example, opens a network connection.
28 | * This method is called before a test is executed.
29 | */
30 | protected function setUp(): void
31 | {
32 | $this->object = new RadaPokladniPohyb();
33 | }
34 |
35 | /**
36 | * Tears down the fixture, for example, closes a network connection.
37 | * This method is called after a test is executed.
38 | */
39 | protected function tearDown(): void
40 | {
41 | }
42 |
43 | // /**
44 | // * @covers \AbraFlexi\RadaPokladniPohyb::getNextRecordCode
45 | // *
46 | // * @todo Implement testgetNextRecordCode().
47 | // */
48 | // public function testgetNextRecordCode(): void
49 | // {
50 | // $this->assertEquals('', $this->object->getNextRecordCode());
51 | // // Remove the following lines when you implement this test.
52 | // $this->markTestIncomplete('This test has not been implemented yet.');
53 | // }
54 | //
55 | // /**
56 | // * @covers \AbraFlexi\RadaPokladniPohyb::incrementNextRecordCode
57 | // *
58 | // * @todo Implement testincrementNextRecordCode().
59 | // */
60 | // public function testincrementNextRecordCode(): void
61 | // {
62 | // $this->assertEquals('', $this->object->incrementNextRecordCode());
63 | // // Remove the following lines when you implement this test.
64 | // $this->markTestIncomplete('This test has not been implemented yet.');
65 | // }
66 | }
67 |
--------------------------------------------------------------------------------
/tests/src/AbraFlexi/RelationTest.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Test\AbraFlexi;
16 |
17 | use AbraFlexi\Relation;
18 |
19 | /**
20 | * Generated by PHPUnit_SkeletonGenerator on 2024-10-02 at 10:07:01.
21 | */
22 | class RelationTest extends \PHPUnit\Framework\TestCase
23 | {
24 | protected Relation $object;
25 |
26 | /**
27 | * Sets up the fixture, for example, opens a network connection.
28 | * This method is called before a test is executed.
29 | */
30 | protected function setUp(): void
31 | {
32 | $this->object = new Relation();
33 | }
34 |
35 | /**
36 | * Tears down the fixture, for example, closes a network connection.
37 | * This method is called after a test is executed.
38 | */
39 | protected function tearDown(): void
40 | {
41 | }
42 |
43 | // /**
44 | // * @covers \AbraFlexi\Relation::__toString
45 | // *
46 | // * @todo Implement test__toString().
47 | // */
48 | // public function testToString(): void
49 | // {
50 | // $this->assertEquals('', $this->object->__toString());
51 | // // Remove the following lines when you implement this test.
52 | // $this->markTestIncomplete('This test has not been implemented yet.');
53 | // }
54 | //
55 | // /**
56 | // * @covers \AbraFlexi\Relation::getRelationTarget
57 | // *
58 | // * @todo Implement testgetRelationTarget().
59 | // */
60 | // public function testgetRelationTarget(): void
61 | // {
62 | // $this->assertEquals('', $this->object->getRelationTarget());
63 | // // Remove the following lines when you implement this test.
64 | // $this->markTestIncomplete('This test has not been implemented yet.');
65 | // }
66 | }
67 |
--------------------------------------------------------------------------------
/tests/src/AbraFlexi/RelationsTest.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Test\AbraFlexi;
16 |
17 | use AbraFlexi\Relations;
18 |
19 | /**
20 | * Generated by PHPUnit_SkeletonGenerator on 2024-10-02 at 10:07:35.
21 | */
22 | class RelationsTest extends \PHPUnit\Framework\TestCase
23 | {
24 | protected Relations $object;
25 |
26 | /**
27 | * Sets up the fixture, for example, opens a network connection.
28 | * This method is called before a test is executed.
29 | */
30 | protected function setUp(): void
31 | {
32 | $this->object = new Relations();
33 | }
34 |
35 | /**
36 | * Tears down the fixture, for example, closes a network connection.
37 | * This method is called after a test is executed.
38 | */
39 | protected function tearDown(): void
40 | {
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/tests/src/AbraFlexi/ReportTest.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Test\AbraFlexi;
16 |
17 | use AbraFlexi\Report;
18 |
19 | /**
20 | * Generated by PHPUnit_SkeletonGenerator on 2024-10-02 at 10:07:13.
21 | */
22 | class ReportTest extends \PHPUnit\Framework\TestCase
23 | {
24 | protected Report $object;
25 |
26 | /**
27 | * Sets up the fixture, for example, opens a network connection.
28 | * This method is called before a test is executed.
29 | */
30 | protected function setUp(): void
31 | {
32 | $this->object = new Report();
33 | }
34 |
35 | /**
36 | * Tears down the fixture, for example, closes a network connection.
37 | * This method is called after a test is executed.
38 | */
39 | protected function tearDown(): void
40 | {
41 | }
42 |
43 | // /**
44 | // * @covers \AbraFlexi\Report::loadFromAbraFlexi
45 | // *
46 | // * @todo Implement testloadFromAbraFlexi().
47 | // */
48 | // public function testloadFromAbraFlexi(): void
49 | // {
50 | // $this->assertEquals('', $this->object->loadFromAbraFlexi());
51 | // // Remove the following lines when you implement this test.
52 | // $this->markTestIncomplete('This test has not been implemented yet.');
53 | // }
54 | }
55 |
--------------------------------------------------------------------------------
/tests/src/AbraFlexi/RootTest.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Test\AbraFlexi;
16 |
17 | use AbraFlexi\Root;
18 |
19 | /**
20 | * Generated by PHPUnit_SkeletonGenerator on 2024-10-02 at 10:07:17.
21 | */
22 | class RootTest extends \PHPUnit\Framework\TestCase
23 | {
24 | protected Root $object;
25 |
26 | /**
27 | * Sets up the fixture, for example, opens a network connection.
28 | * This method is called before a test is executed.
29 | */
30 | protected function setUp(): void
31 | {
32 | $this->object = new Root();
33 | }
34 |
35 | /**
36 | * Tears down the fixture, for example, closes a network connection.
37 | * This method is called after a test is executed.
38 | */
39 | protected function tearDown(): void
40 | {
41 | }
42 |
43 | // /**
44 | // * @covers \AbraFlexi\Root::uploadCertificate
45 | // *
46 | // * @todo Implement testuploadCertificate().
47 | // */
48 | // public function testuploadCertificate(): void
49 | // {
50 | // $this->assertEquals('', $this->object->uploadCertificate());
51 | // // Remove the following lines when you implement this test.
52 | // $this->markTestIncomplete('This test has not been implemented yet.');
53 | // }
54 | //
55 | // /**
56 | // * @covers \AbraFlexi\Root::companies
57 | // *
58 | // * @todo Implement testcompanies().
59 | // */
60 | // public function testcompanies(): void
61 | // {
62 | // $this->assertEquals('', $this->object->companies());
63 | // // Remove the following lines when you implement this test.
64 | // $this->markTestIncomplete('This test has not been implemented yet.');
65 | // }
66 | }
67 |
--------------------------------------------------------------------------------
/tests/src/AbraFlexi/SkladovaKartaTest.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Test\AbraFlexi;
16 |
17 | use AbraFlexi\SkladovaKarta;
18 |
19 | /**
20 | * Generated by PHPUnit_SkeletonGenerator on 2024-10-02 at 10:07:40.
21 | */
22 | class SkladovaKartaTest extends \PHPUnit\Framework\TestCase
23 | {
24 | protected SkladovaKarta $object;
25 |
26 | /**
27 | * Sets up the fixture, for example, opens a network connection.
28 | * This method is called before a test is executed.
29 | */
30 | protected function setUp(): void
31 | {
32 | $this->object = new SkladovaKarta();
33 | }
34 |
35 | /**
36 | * Tears down the fixture, for example, closes a network connection.
37 | * This method is called after a test is executed.
38 | */
39 | protected function tearDown(): void
40 | {
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/tests/src/AbraFlexi/SkupinaFiremTest.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Test\AbraFlexi;
16 |
17 | use AbraFlexi\SkupinaFirem;
18 |
19 | /**
20 | * Generated by PHPUnit_SkeletonGenerator on 2024-10-02 at 10:07:06.
21 | */
22 | class SkupinaFiremTest extends \PHPUnit\Framework\TestCase
23 | {
24 | protected SkupinaFirem $object;
25 |
26 | /**
27 | * Sets up the fixture, for example, opens a network connection.
28 | * This method is called before a test is executed.
29 | */
30 | protected function setUp(): void
31 | {
32 | $this->object = new SkupinaFirem();
33 | }
34 |
35 | /**
36 | * Tears down the fixture, for example, closes a network connection.
37 | * This method is called after a test is executed.
38 | */
39 | protected function tearDown(): void
40 | {
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/tests/src/AbraFlexi/StatusTest.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Test\AbraFlexi;
16 |
17 | use AbraFlexi\Status;
18 |
19 | /**
20 | * Generated by PHPUnit_SkeletonGenerator on 2024-10-02 at 10:07:27.
21 | */
22 | class StatusTest extends \PHPUnit\Framework\TestCase
23 | {
24 | protected Status $object;
25 |
26 | /**
27 | * Sets up the fixture, for example, opens a network connection.
28 | * This method is called before a test is executed.
29 | */
30 | protected function setUp(): void
31 | {
32 | $this->object = new Status();
33 | }
34 |
35 | /**
36 | * Tears down the fixture, for example, closes a network connection.
37 | * This method is called after a test is executed.
38 | */
39 | protected function tearDown(): void
40 | {
41 | }
42 |
43 | // /**
44 | // * @covers \AbraFlexi\Status::unifyResponseFormat
45 | // *
46 | // * @todo Implement testunifyResponseFormat().
47 | // */
48 | // public function testunifyResponseFormat(): void
49 | // {
50 | // $this->assertEquals('', $this->object->unifyResponseFormat());
51 | // // Remove the following lines when you implement this test.
52 | // $this->markTestIncomplete('This test has not been implemented yet.');
53 | // }
54 | //
55 | // /**
56 | // * @covers \AbraFlexi\Status::getVazby
57 | // *
58 | // * @todo Implement testgetVazby().
59 | // */
60 | // public function testgetVazby(): void
61 | // {
62 | // $this->assertEquals('', $this->object->getVazby());
63 | // // Remove the following lines when you implement this test.
64 | // $this->markTestIncomplete('This test has not been implemented yet.');
65 | // }
66 | }
67 |
--------------------------------------------------------------------------------
/tests/src/AbraFlexi/StromCenikTest.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Test\AbraFlexi;
16 |
17 | use AbraFlexi\StromCenik;
18 |
19 | /**
20 | * Generated by PHPUnit_SkeletonGenerator on 2024-10-02 at 10:07:09.
21 | */
22 | class StromCenikTest extends \PHPUnit\Framework\TestCase
23 | {
24 | protected StromCenik $object;
25 |
26 | /**
27 | * Sets up the fixture, for example, opens a network connection.
28 | * This method is called before a test is executed.
29 | */
30 | protected function setUp(): void
31 | {
32 | $this->object = new StromCenik();
33 | }
34 |
35 | /**
36 | * Tears down the fixture, for example, closes a network connection.
37 | * This method is called after a test is executed.
38 | */
39 | protected function tearDown(): void
40 | {
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/tests/src/AbraFlexi/StromTest.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Test\AbraFlexi;
16 |
17 | use AbraFlexi\Strom;
18 |
19 | /**
20 | * Generated by PHPUnit_SkeletonGenerator on 2024-10-02 at 10:07:26.
21 | */
22 | class StromTest extends \PHPUnit\Framework\TestCase
23 | {
24 | protected Strom $object;
25 |
26 | /**
27 | * Sets up the fixture, for example, opens a network connection.
28 | * This method is called before a test is executed.
29 | */
30 | protected function setUp(): void
31 | {
32 | $this->object = new Strom();
33 | }
34 |
35 | /**
36 | * Tears down the fixture, for example, closes a network connection.
37 | * This method is called after a test is executed.
38 | */
39 | protected function tearDown(): void
40 | {
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/tests/src/AbraFlexi/UcetniObdobiTest.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Test\AbraFlexi;
16 |
17 | use AbraFlexi\UcetniObdobi;
18 |
19 | /**
20 | * Generated by PHPUnit_SkeletonGenerator on 2024-10-02 at 10:07:09.
21 | */
22 | class UcetniObdobiTest extends \PHPUnit\Framework\TestCase
23 | {
24 | protected UcetniObdobi $object;
25 |
26 | /**
27 | * Sets up the fixture, for example, opens a network connection.
28 | * This method is called before a test is executed.
29 | */
30 | protected function setUp(): void
31 | {
32 | $this->object = new UcetniObdobi();
33 | }
34 |
35 | /**
36 | * Tears down the fixture, for example, closes a network connection.
37 | * This method is called after a test is executed.
38 | */
39 | protected function tearDown(): void
40 | {
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/tests/src/AbraFlexi/VyrobniCisloTest.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Test\AbraFlexi;
16 |
17 | use AbraFlexi\VyrobniCislo;
18 |
19 | /**
20 | * Generated by PHPUnit_SkeletonGenerator on 2024-10-02 at 10:07:14.
21 | */
22 | class VyrobniCisloTest extends \PHPUnit\Framework\TestCase
23 | {
24 | protected VyrobniCislo $object;
25 |
26 | /**
27 | * Sets up the fixture, for example, opens a network connection.
28 | * This method is called before a test is executed.
29 | */
30 | protected function setUp(): void
31 | {
32 | $this->object = new VyrobniCislo();
33 | }
34 |
35 | /**
36 | * Tears down the fixture, for example, closes a network connection.
37 | * This method is called after a test is executed.
38 | */
39 | protected function tearDown(): void
40 | {
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/tests/src/AbraFlexi/ZurnalTest.php:
--------------------------------------------------------------------------------
1 |
9 | * (c) 2025 SpojeNetIT s.r.o.
10 | *
11 | * For the full copyright and license information, please view the LICENSE
12 | * file that was distributed with this source code.
13 | */
14 |
15 | namespace Test\AbraFlexi;
16 |
17 | use AbraFlexi\Zurnal;
18 |
19 | /**
20 | * Generated by PHPUnit_SkeletonGenerator on 2024-10-02 at 10:07:37.
21 | */
22 | class ZurnalTest extends \PHPUnit\Framework\TestCase
23 | {
24 | protected Zurnal $object;
25 |
26 | /**
27 | * Sets up the fixture, for example, opens a network connection.
28 | * This method is called before a test is executed.
29 | */
30 | protected function setUp(): void
31 | {
32 | $this->object = new Zurnal();
33 | }
34 |
35 | /**
36 | * Tears down the fixture, for example, closes a network connection.
37 | * This method is called after a test is executed.
38 | */
39 | protected function tearDown(): void
40 | {
41 | }
42 |
43 | // /**
44 | // * @covers \AbraFlexi\Zurnal::getAllChanges
45 | // *
46 | // * @todo Implement testgetAllChanges().
47 | // */
48 | // public function testgetAllChanges(): void
49 | // {
50 | // $this->assertEquals('', $this->object->getAllChanges());
51 | // // Remove the following lines when you implement this test.
52 | // $this->markTestIncomplete('This test has not been implemented yet.');
53 | // }
54 | //
55 | // /**
56 | // * @covers \AbraFlexi\Zurnal::getLastChange
57 | // *
58 | // * @todo Implement testgetLastChange().
59 | // */
60 | // public function testgetLastChange(): void
61 | // {
62 | // $this->assertEquals('', $this->object->getLastChange());
63 | // // Remove the following lines when you implement this test.
64 | // $this->markTestIncomplete('This test has not been implemented yet.');
65 | // }
66 | }
67 |
--------------------------------------------------------------------------------
/tools/changes-properties.json:
--------------------------------------------------------------------------------
1 | {
2 | "properties": {
3 | "@version": "1.0",
4 | "evidenceName": "Změny",
5 | "tagName": "changes",
6 | "property": [{
7 | "showToUser": "false",
8 | "propertyName": "id",
9 | "name": "ID",
10 | "title": "ID",
11 | "type": "integer",
12 | "isVisible": "true",
13 | "isSortable": "true",
14 | "isHighlight": "false",
15 | "inId": "true",
16 | "inSummary": "true",
17 | "inDetail": "true",
18 | "mandatory": "false",
19 | "isWritable": "false",
20 | "isOverWritable": "false",
21 | "hasBusinessLogic": "false",
22 | "isUpperCase": "false",
23 | "isLowerCase": "false",
24 | "links": null
25 | }]
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/tools/common.php:
--------------------------------------------------------------------------------
1 |
7 | * @copyright (C) 2015-2021 Spoje.Net
8 | */
9 |
10 | /**
11 | * Convert var_export to short array syntac
12 | *
13 | * @param string $expression
14 | *
15 | * @return string
16 | */
17 | function varexport($expression) {
18 | $export = var_export($expression, TRUE);
19 | $patterns = [
20 | "/array \(/" => '[',
21 | "/^([ ]*)\)(,?)$/m" => '$1]$2',
22 | "/=>[ ]?\n[ ]+\[/" => '=> [',
23 | "/([ ]*)(\'[^\']+\') => ([\[\'])/" => '$1$2 => $3',
24 | ];
25 | $export = preg_replace(array_keys($patterns), array_values($patterns), $export);
26 | return $export;
27 | }
28 |
--------------------------------------------------------------------------------
/tools/current_settings.php:
--------------------------------------------------------------------------------
1 | logBanner('AbraFlexi Structure Static Generator');
11 |
12 |
--------------------------------------------------------------------------------
/tools/current_version.php:
--------------------------------------------------------------------------------
1 | getDataValue('version');
9 |
--------------------------------------------------------------------------------
/tools/find_undocumented_columns.php:
--------------------------------------------------------------------------------
1 | performRequest($evidence . '/properties.json');
17 | if (count($flexinfo) && array_key_exists('properties', $flexinfo)) {
18 | foreach ($flexinfo['properties']['property'] as $evidenceProperty) {
19 | $key = $evidenceProperty['propertyName'];
20 | $useKeywords[$key] = $evidenceProperty;
21 | $useKeywords[$key]['name'] = $evidenceProperty['name'];
22 | $useKeywords[$key]['type'] = $evidenceProperty['type'];
23 | }
24 | }
25 | return $useKeywords;
26 | }
27 |
28 | function controlData($data, $fbColumns, $fbRelations) {
29 | $controlResult = [];
30 | if (count($fbColumns)) {
31 | foreach ($data as $key => $value) {
32 | if ($key == 'external-ids') {
33 | continue;
34 | }
35 |
36 | if (strstr($key, '@')) {
37 | $baseKey = substr($key, 0, strrpos($key, '@'));
38 | if (!array_key_exists($baseKey, $fbColumns)) {
39 | $controlResult[$key][] = sprintf('unknown column property %s',
40 | $key);
41 | }
42 | continue;
43 | }
44 |
45 | if (!array_key_exists($key, $fbColumns)) {
46 | if (is_array($fbRelations) && !array_key_exists($key,
47 | $fbRelations)) {
48 | $controlResult[$key][] = sprintf('unknown column %s', $key);
49 | }
50 | }
51 | }
52 | }
53 | return $controlResult;
54 | }
55 |
56 | $syncer = new EvidenceList();
57 |
58 | $evidencies = $syncer->getColumnsFromFlexibee(['evidencePath', 'evidenceName']);
59 |
60 | $controlResult = [];
61 | foreach ($evidencies['evidences']['evidence'] as $evidenceID => $evidence) {
62 | $evlist[$evidence['evidencePath']] = $evidence['evidenceName'];
63 |
64 | $syncer->setEvidence($evidence['evidencePath']);
65 | $firstRecord = $syncer->getFlexiData(null, ['limit' => 1]);
66 | if (count($firstRecord) && isset($firstRecord[0]) && count($firstRecord[0])) {
67 | $controlled = controlData($firstRecord[0], $syncer->getColumnsInfo(),
68 | $syncer->getRelationsInfo());
69 | if (count($controlled)) {
70 | $controlResult[$evidence['evidencePath']] = $controlled;
71 | }
72 | }
73 | }
74 |
75 | echo json_encode($controlResult, JSON_PRETTY_PRINT);
76 |
77 |
--------------------------------------------------------------------------------
/tools/force_update_all.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | mkdir -p ../static
3 | CURRENT=`php -qf current_version.php`
4 | php -qf update_evidencelist_class.php
5 | mv -f EvidenceList.php ../src/AbraFlexi/EvidenceList.php
6 | php -qf update_properties_class.php
7 | php -qf update_actions_class.php
8 | mv Actions.php ../src/AbraFlexi/Actions.php
9 | php -qf update_relations_class.php
10 | mv Relations.php ../src/AbraFlexi/Relations.php
11 | php -qf update_formats_class.php
12 | mv Formats.php ../src/AbraFlexi/Formats.php
13 | mv -f Actions.json EvidenceFullList.json EvidenceList.json Formats.json Properties*.json Relations.json ../static/
14 | git add ../static
15 | echo git commit ../src ../static -m \"Update for AbraFlexi ${CURRENT}\"
16 | echo git commit ./src ./static -m \"Update for AbraFlexi ${CURRENT}\"
17 |
--------------------------------------------------------------------------------
/tools/time_to_update.php:
--------------------------------------------------------------------------------
1 | getDataValue('version') === \AbraFlexi\EvidenceList::$version) {
8 | echo 'false';
9 | } else {
10 | echo 'true';
11 | }
12 |
--------------------------------------------------------------------------------
/tools/update_all.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | php -qf current_settings.php
4 | CURRENT=`php -qf current_version.php`
5 | if [ `php -qf time_to_update.php` = "true" ]
6 | then
7 | echo updating for $CURRENT
8 | ./force_update_all.sh
9 | else
10 | echo $CURRENT still fresh
11 | fi
12 |
--------------------------------------------------------------------------------