
| Filename | |
| Version | 0.2.0.11~bookworm |
| Age in days | 313 |
| Release date | 2025 12. 29. |
| Size | 22.2 KB |
| id | 3091 |
| Name | php-spojenet-pohoda-sql |
| Package | |
| Appname | |
| Essential | |
| Vendor | |
| License | |
| Distribution | bookworm |
| Suite | main |
| Source | |
| Architecture | binary-amd64 |
| MultiArch | foreign |
| Maintainer | Vítězslav Dvořák |
| InstalledSize | 209 |
| Depends | php-vitexsoftware-ease-fluentpdo , composer |
| PreDepends | |
| Breaks | |
| Enhances | |
| Section | unknown |
| Priority | optional |
| Description | PHP Library for Pohoda SQL Tables access |
| LongDescription | Set Of Classes for Pohoda SQL |
| AutoBuiltPackage | |
| Filename | pool/main/p/php-spojenet-pohoda-sql/php-spojenet-pohoda-sql_0.2.0.11~bookworm_amd64.deb |
| MD5sum | 5da171af1e1414d8f52041647185d3f8 |
| SHA1 | d1478fa1fd151e6b5e5cb2cc13449f49a21c0309 |
| SHA256 | f8b592e8b9c9dc438f472af9edce1f60913f6526696628f5e2f985319b55c44b |
| SHA512 | d94890be92c72aa617ea36070df7dc7d508f3cb6cf2b835dedf71f29bf0b2622f0dc917405b0f3ab33c58f62d5eaa5f2716dcf67a93715c7b2c377b4c8d21728 |
| Size | 22736 |
| Auto-Built-Package | |
| Homepage | https://github.com/Spoje-NET/PohodaSQL |
| Provides | |
| Suggests | php-sql-server , php-vitexsoftware-pohoda-connector |
| Existing | |
| fileMtime | 2025-12-29 01:46:56 |
| created | 2024-11-28 12:48:40 |
| updated | 2025-12-29 01:46:56 |

This is a PHP Library for direct access to Pohoda SQL database tables.
Struct definitions are kept in sync with a live Pohoda SQL database (StwPh_12345678_2026 on SQL Server Express).
Use at your own risk!
| Class | Table | Description |
|---|---|---|
| Adresar | AD | Address book |
| BankovniVypis | BV | Bank statement |
| BankovniVypisPol | BVpol | Bank statement line item |
| CasoveRozliseni | CasRoz | Time resolution |
| CasoveRozliseniPol | CasRozPol | Time resolution line item |
| CiselnaRada | sCRady | Number series |
| DOC | DOC | Document attachments |
| Faktura | FA | Issued/received invoices |
| FakturaPolozka | FApol | Invoice line items |
| HotovostniOperace | HO | Cash document |
| HotovostniOperacePol | HOpol | Cash document line item |
| Majetek | IM | Fixed assets |
| MajetkoveOperace | IMpohyb | Asset movements |
| Nabidka | NAB | Offer |
| NabidkaPol | NABpol | Offer line item |
| ObjednavkaPrijata | OBJ | Received order |
| ObjednavkaPrijataPol | OBJpol | Received order line item |
| Odpis | IModpis | Yearly depreciation breakdown of a fixed asset |
| OdpisMesicni | IModpisM | Monthly depreciation breakdown of a fixed asset |
| OdpisovyPlan | sIMO | Depreciation plans |
| Pokladna | PH | Cash register document |
| PokladnaPol | PHpol | Cash register line item |
| Predkontace | pPK | Pre-accounting |
| Predmet | IMpredm | Asset subjects |
| Uhrada | Uhrady | Payment |
| UplatnenyOdpis | IMuodpis | Monthly applied depreciation tied to a depreciation plan |
| Zamestnanec | ZAM | Employee |
| Zasilka | Zasilky | Shipment |
| ZasilkaPol | ZasilkyPol | Shipment line item |
composer require spojenet/pohoda-sql
Please set up this constants or environment variables:
DB_TYPE We use sqlsrvDB_HOST IP or Hostname machine with SQL ServerDB_PORT default is 1433DB_DATABASE something like StwPh_01234567_2019DB_USERNAME sqlserver loginDB_PASSWORD sqlserver passDB_SETTINGS eg. encrypt=false$fa = new Faktura(null, [/* sqlsrv options */]);
$changed = $fa->idsChangedSince('2026-09-20T10:00:00'); // list of [id, changed_at]
$max = $fa->maxChangedAt(); // seed watermark without full export
$addr = new Adresar(234);
echo $addr->getDataValue('Firma'); // company name
$addr = new Adresar(['ICO' => '69438676']);
echo $addr->getDataValue('Email');
$addr = new Adresar(234, ['database' => 'StwPh_01234567_2020']);
$invoice = new Faktura(1001);
echo $invoice->getDataValue('Cislo'); // document number
echo $invoice->getDataValue('KcCelkem'); // total amount
$lines = new FakturaPolozka();
$rows = $lines->getColumnsFromSQL(['Nazev', 'Mnozstvi', 'KcCena'], ['RefAg' => 1001]);
foreach ($rows as $row) {
echo $row['Nazev'] . ' × ' . $row['Mnozstvi'] . ' = ' . $row['KcCena'] . PHP_EOL;
}
$addr = new Adresar();
$rows = $addr->getColumnsFromSQL(['Cislo', 'Firma', 'ADKreditMax'], ['ADKreditMax>' => 0]);
foreach ($rows as $row) {
printf("%s %s (limit: %s)\n", $row['Cislo'], $row['Firma'], $row['ADKreditMax']);
}
$bv = new BankovniVypis(['Cislo' => 'BV2024001']);
$pol = new BankovniVypisPol();
$items = $pol->getColumnsFromSQL(['KcCastka', 'VS', 'Datum'], ['RefBV' => $bv->getMyKey()]);
$zasilky = new Zasilka();
$list = $zasilky->getColumnsFromSQL(['ID', 'Cislo', 'RefAD', 'DatOdeslani']);
foreach ($list as $z) {
echo $z['Cislo'] . ' – ' . $z['DatOdeslani'] . PHP_EOL;
}
$zam = new Zamestnanec(['RodCisl' => '8001011234']);
echo $zam->getDataValue('Prijmeni') . ' ' . $zam->getDataValue('Jmeno');
The DOC table stores document attachments for every agenda. Use urlAttachment() to link
an external URL (e.g. a SharePoint file, a web invoice, a tracking page) to an existing record.
The second argument is the Pohoda internal document ID; the agenda type is identified by one of
the Agenda::* constants.
use SpojeNet\PohodaSQL\Agenda;
use SpojeNet\PohodaSQL\DOC;
// Attach a SharePoint link to a bank statement (agenda = Agenda::BANK = 28)
$doc = new DOC();
$doc->setDataValue('RelAgID', Agenda::BANK);
$doc->urlAttachment(
pohodaId: 303, // DOC.RelID – internal Pohoda record ID
url: 'https://sharepoint.example.com/statements/BV2024001.pdf',
name: 'BV2024001.pdf', // display name shown in Pohoda
);
// Attach a link to an issued invoice (agenda = Agenda::ISSUED_INVOICES = 2)
$doc = new DOC();
$doc->setDataValue('RelAgID', Agenda::ISSUED_INVOICES);
$doc->urlAttachment(1001, 'https://portal.example.com/invoice/1001', 'Invoice PDF');
Available Agenda::* constants mirror the RelCrAg values from sCRady:
| Constant | Value | Agenda |
|---|---|---|
| Agenda::ISSUED_INVOICES | 2 | Issued invoices |
| Agenda::RECEIVED_INVOICES | 3 | Received invoices |
| Agenda::ORDERS_RECEIVED | 11 | Received orders |
| Agenda::CASH_REGISTER | 27 | Cash register |
| Agenda::BANK | 28 | Bank statements |
See https://github.com/VitexSoftware/php-ease-fluentpdo for more information.
also package for debian/ubuntu is availble:
wget -qO- https://repo.vitexsoftware.com/KEY.gpg | sudo tee /etc/apt/trusted.gpg.d/vitexsoftware.gpg
echo "deb [signed-by=/etc/apt/trusted.gpg.d/vitexsoftware.gpg] https://repo.vitexsoftware.com $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/vitexsoftware.list
sudo apt update
sudo apt install php-spojenet-pohoda-sql
>