PHP code example of vitexsoftware / pohoda-connector
1. Go to this page and download the library: Download vitexsoftware/pohoda-connector library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
vitexsoftware / pohoda-connector example snippets
namespace mServer;
DA_URL', 'POHODA_USERNAME', 'POHODA_PASSWORD'], \dirname(__DIR__).'/.env');
$client = new \mServer\Client();
if (\Ease\Shared::cfg('APP_DEBUG')) {
$client->logBanner();
}
echo $client->isOnline() ? 'Online' : 'Offline';
namespace mServer;
DA_URL', 'POHODA_USERNAME', 'POHODA_PASSWORD'], \dirname(__DIR__).'/.env');
$addressBookRecord = [
'identity' => [
'address' => [
'company' => 'Vitex Software',
'name' => 'Vítězslav Dvořák',
'city' => 'Prague',
'street' => 'Long',
'zip' => '15800',
'ico' => '69438676',
'dic' => 'CZ7808072811',
],
],
'mobil' => '739 778 202',
'web' => 'https://www.vitexsoftware.cz',
];
$addresser = new Adressbook($addressBookRecord);
$addresser->addToPohoda();
if ($addresser->commit()) {
print_r($addresser->response->producedDetails);
}
namespace mServer;
nvoiceType' => 'issuedInvoice',
'date' => date('Y-m-d'),
'accounting' => ['ids' => '3Fv'],
'text' => 'Faktura za zboží bez adresy',
'paymentType' => 'draft',
'note' => 'Import XML.',
'intNote' => 'Tento doklad byl vytvořen importem přes XML z PHP.',
'invoiceSummary' => [
'roundingDocument' => 'math2one',
'homeCurrency' => [
'priceNone' => 3018,
'priceLow' => 60000,
'priceHighSum' => 557,
],
],
];
\Ease\Shared::init(['POHODA_URL', 'POHODA_USERNAME', 'POHODA_PASSWORD'], \dirname(__DIR__).'/.env');
$invoicer = new Invoice($invoiceRecord);
$itemRecord = [
'text' => 'Židle Z220',
'quantity' => 1.0,
'unit' => 'ks',
'payVAT' => false,
'rateVAT' => 'high',
'homeCurrency' => [
'unitPrice' => 1968,
'price' => 1968,
'priceVAT' => 413.28,
'priceSum' => 2381.28,
],
'code' => 'Z220',
'stockItemIDS' => 'Z220',
];
$invoicer->addItem($itemRecord);
$invoicer->addToPohoda();
if ($invoicer->commit()) {
print_r($invoicer->response->producedDetails);
}
Shared::init(['POHODA_URL', 'POHODA_USERNAME', 'POHODA_PASSWORD'], \dirname(__DIR__).'/.env');
$addresser = new \mServer\Addressbook();
print_r($addresser->getColumnsFromPohoda(['id', 'jmeno', 'email', 'web']));