PHPackages                             alex-kalanis/pohoda - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. alex-kalanis/pohoda

ActiveLibrary[API Development](/categories/api)

alex-kalanis/pohoda
===================

Pohoda XML communication

v10.0.0(5mo ago)0111MITPHPPHP &gt;=8.1CI passing

Since Dec 22Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/alex-kalanis/pohoda)[ Packagist](https://packagist.org/packages/alex-kalanis/pohoda)[ Docs](https://github.com/alex-kalanis/pohoda)[ RSS](/packages/alex-kalanis-pohoda/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (9)Versions (15)Used By (0)

Pohoda XML
==========

[](#pohoda-xml)

[![Build Status](https://github.com/alex-kalanis/pohoda/actions/workflows/test.yml/badge.svg)](https://github.com/alex-kalanis/pohoda/actions/workflows/test.yml/badge.svg)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/8868ba5fb34a87a4e3ad8736d7b181c9654ee296e22301db1ab049ac6cb7ddd7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616c65782d6b616c616e69732f706f686f64612f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/alex-kalanis/pohoda/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/8cf6441b821dab59cf5a6c0b6828a4ee584bbe0c6226f5ea3e170267a2b227e2/68747470733a2f2f706f7365722e707567782e6f72672f616c65782d6b616c616e69732f706f686f64612f762f737461626c652e7376673f763d31)](https://packagist.org/packages/alex-kalanis/pohoda)[![Minimum PHP Version](https://camo.githubusercontent.com/183804d09fec16ca7b6209b007250b7d8db1b915042feb093a9f20e6e1f25359/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e312d3838393242462e737667)](https://php.net/)[![Total Downloads](https://camo.githubusercontent.com/2af4b30d2ea43192402582ae5a4f8c6393d61cbf7144cdb28d04c706488d3598/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c65782d6b616c616e69732f706f686f64612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/alex-kalanis/pohoda)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Code Coverage](https://camo.githubusercontent.com/710aea5128e7319ffb982aeb85158a9ef05c22d36da01514772d82ff19635c1c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616c65782d6b616c616e69732f706f686f64612f6261646765732f636f7665726167652e706e673f623d6d617374657226763d31)](https://scrutinizer-ci.com/g/alex-kalanis/pohoda/?branch=master)

Library for manipulation with data, which came as XML from Pohoda mServer.

Pohoda is an accounting software for the Czech Republic, Slovakia and probably few other countries.

#### What is different:

[](#what-is-different)

Usage of phpunit, extended tests, phpstan 1.12, deeper type checking

Installation
------------

[](#installation)

Add to *composer.json*:

```
composer.phar require alex-kalanis/pohoda
```

Example of order imports
------------------------

[](#example-of-order-imports)

Examples of importing each type - more in *spec* folder.

```
use kalanis\Pohoda;

$pohoda = new Pohoda('ICO');

// create file
$pohoda->open($filename, 'i_obj1', 'Import orders');

$partnerIdentityAddress = new Pohoda\Type\Dtos\AddressTypeDto();
$partnerIdentityAddress->name = $billing_name;
$partnerIdentityAddress->street => $billing_street;
$partnerIdentityAddress->city => $billing_city;
$partnerIdentityAddress->zip => $billing_zip;
$partnerIdentityAddress->email => $email;
$partnerIdentityAddress->phone => $phone;

$partnerShipAddress = new Pohoda\Type\Dtos\ShipToAddressDto();
$partnerShipAddress->name = $shipping_name;
$partnerShipAddress->street => $shipping_street;
$partnerShipAddress->city => $shipping_city;
$partnerShipAddress->zip => $shipping_zip;
$partnerShipAddress->email => $email;
$partnerShipAddress->phone => $phone;

$partnerIdentity = new Pohoda\Type\Dtos\AddressDto();
$partnerIdentity->address = $partnerIdentityAddress;
$partnerIdentity->shipToAddress = $partnerShipAddress;

$orderHeaderDto = new Pohoda\Order\HeaderDto();
$orderHeaderDto->numberOrder = $order_number;
$orderHeaderDto->isReserved = true;
$orderHeaderDto->date = $created;
$orderHeaderDto->text = '...';
$orderHeaderDto->partnerIdentity = $partnerIdentity;

$orderDto = new Pohoda\Order\OrderDto();
$orderDto->header = $orderHeaderDto;

// create order
$order = $pohoda->createOrder($orderDto);

// add items
foreach ($items as $item) {

    $homeCurrency = new Pohoda\Type\Dtos\CurrencyItemDto();
    $homeCurrency->unitPrice = $item->unit_price;

    $stockItem = new Pohoda\Type\Dtos\StockItemDto();
    $stockItem->stockItem = [
        'id' => $item->pohoda_id
    ];

    $itemDto = new Pohoda\Order\ItemDto();
    $itemDto->code => $item->code;
    $itemDto->text => $item->text;
    $itemDto->quantity => $item->quantity;
    $itemDto->payVAT => false;
    $itemDto->rateVAT => $item->rate;
    $itemDto->homeCurrency = $homeCurrency;
    $itemDto->stockItem = $stockItem;

    $order->addItem($itemDto);
}

// add summary
$summaryDto = new Riesenia\Pohoda\Order\SummaryDto();
$summaryDto->roundingDocument = 'none';
$order->addSummary($summaryDto);

// add order to import (identified by $order_number)
$pohoda->addItem($order_number, $order);

// finish import file
$pohoda->close();
```

Exporting stored goods
----------------------

[](#exporting-stored-goods)

The creation of request to export goods is realized by creating *ListRequest*.

```
use kalanis\Pohoda;

$pohoda = new Pohoda('ICO');

// create request for export
$pohoda->open($filename, 'e_zas1', 'Export stock');

$requestDto = new Pohoda\ListRequest\ListRequestDto();
$requestDto->type = 'Stock';

$request = $pohoda->createListRequest($requestDto);

// optional filter
$request->addUserFilterName(
    Pohoda\ListRequest\UserFilterNameDto::init('MyFilter')
);
$pohoda->addItem('Export 001', $request);

$pohoda->close();
```

The rest of the processing itself is simple - just call `next` and got *SimpleXMLElement* with entity.

```
// load file
$pohoda->loadStock($filename);

while ($stock = $pohoda->next()) {
    // access header
    $header = $stock->children('stk', true)->stockHeader;

    // ...
}
```

Example of deleting stock
-------------------------

[](#example-of-deleting-stock)

When you delete stock you need to create an agenda with empty data and set them *delete* actionType.

```
use kalanis\Pohoda;

$pohoda = new Pohoda('ICO');

// create request for deletion
$pohoda->open($filename, 'd_zas1', 'Delete stock');

$stock = $pohoda->createStock(null);

$stock->addActionType('delete', [
    'code' => $code
]);

$pohoda->addItem($code, $stock);

$pohoda->close();
```

Using *ValueTransformer* for value update
-----------------------------------------

[](#using-valuetransformer-for-value-update)

With interface *ValueTransformer* you can implement the transformation, which changes all the values. Example for change all values to uppercase:

```
use kalanis\Pohoda;

class Capitalizer implements \Riesenia\Pohoda\ValueTransformer\ValueTransformerInterface
{
    public function transform(string $value): string
    {
        return \strtoupper($value);
    }
}

$pohoda = new Pohoda('ICO');

// Register the capitalizer to be used to capitalize values
$pohoda->getTransformerListing()->addTransformer(new Capitalizer());

...
```

Sources
-------

[](#sources)

- [XML Import](https://www.stormware.cz/pohoda/xml/dokladyimport/)
- [XML Export](https://www.stormware.cz/pohoda/xml/dokladyexport/)
- [Schemas](https://www.stormware.cz/pohoda/xml/seznamschemat/)
- [Checker](https://www.stormware.cz/pohoda/xml/xmlvalidator/) - Win 32bit

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance78

Regular maintenance activity

Popularity6

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~26 days

Recently: every ~16 days

Total

14

Last Release

162d ago

Major Versions

v2.2.1 → v3.0.02025-09-15

v3.5.0 → v4.0.02025-09-30

v4.0.0 → v5.0.02025-11-01

v5.0.0 → v10.0.02025-12-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/499b0a541b787cdb31412f578c7b94c9790bcbee7de12c65b6101c6ce45ef6f0?d=identicon)[alex-kalanis](/maintainers/alex-kalanis)

---

Top Contributors

[![segy](https://avatars.githubusercontent.com/u/1355459?v=4)](https://github.com/segy "segy (149 commits)")[![alex-kalanis](https://avatars.githubusercontent.com/u/59184183?v=4)](https://github.com/alex-kalanis "alex-kalanis (109 commits)")[![Mapiiik](https://avatars.githubusercontent.com/u/45870742?v=4)](https://github.com/Mapiiik "Mapiiik (21 commits)")[![stancl](https://avatars.githubusercontent.com/u/33033094?v=4)](https://github.com/stancl "stancl (9 commits)")[![Ciki](https://avatars.githubusercontent.com/u/342730?v=4)](https://github.com/Ciki "Ciki (9 commits)")[![janco-naninails](https://avatars.githubusercontent.com/u/83635317?v=4)](https://github.com/janco-naninails "janco-naninails (9 commits)")[![XeLiatH](https://avatars.githubusercontent.com/u/14196085?v=4)](https://github.com/XeLiatH "XeLiatH (3 commits)")[![QuakyCZ](https://avatars.githubusercontent.com/u/47119570?v=4)](https://github.com/QuakyCZ "QuakyCZ (3 commits)")[![Brezak](https://avatars.githubusercontent.com/u/59848927?v=4)](https://github.com/Brezak "Brezak (2 commits)")[![rasstislav](https://avatars.githubusercontent.com/u/9253113?v=4)](https://github.com/rasstislav "rasstislav (1 commits)")[![phodoval](https://avatars.githubusercontent.com/u/9001218?v=4)](https://github.com/phodoval "phodoval (1 commits)")[![thomasdv](https://avatars.githubusercontent.com/u/3307649?v=4)](https://github.com/thomasdv "thomasdv (1 commits)")[![andrewvaca](https://avatars.githubusercontent.com/u/7955240?v=4)](https://github.com/andrewvaca "andrewvaca (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/alex-kalanis-pohoda/health.svg)

```
[![Health](https://phpackages.com/badges/alex-kalanis-pohoda/health.svg)](https://phpackages.com/packages/alex-kalanis-pohoda)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[irazasyed/telegram-bot-sdk

The Unofficial Telegram Bot API PHP SDK

3.3k4.5M84](/packages/irazasyed-telegram-bot-sdk)[thecodingmachine/graphqlite

Write your GraphQL queries in simple to write controllers (using webonyx/graphql-php).

5723.1M30](/packages/thecodingmachine-graphqlite)[m4tthumphrey/php-gitlab-api

GitLab API v4 client for PHP

9485.4M64](/packages/m4tthumphrey-php-gitlab-api)[team-reflex/discord-php

An unofficial API to interact with the voice and text service Discord.

1.1k379.4k24](/packages/team-reflex-discord-php)[scriptfusion/porter

Scalable and durable data import for publishing and consuming APIs.

613138.9k14](/packages/scriptfusion-porter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
