src/FlexiPeeHP/FakturaVydana.php
public function vytvorVazbuZDD($income)
    {
        switch (get_class($income)) {
            case 'FlexiPeeHP\\Banka':
                $modul = 'banka';
                break;
            case 'FlexiPeeHP\\PokladniPohyb':
                $modul = 'pokladna';
                break;
            default :
                throw new \Ease\Exception(_('Unsupported $income parameter type'));
        }

        $incomeId = $income->getRecordID();
        $myId     = $this->getRecordID();

        $headersBackup = $this->defaultHttpHeaders;

        $this->defaultHttpHeaders['Accept'] = 'text/html';
        $this->setPostFields(http_build_query(['modul' => $modul,
            'submit' => 'OK']));
        $this->performRequest($myId.'/vytvor-vazbu-zdd/'.$incomeId, 'GET',
            'json');

        $responseArr = explode("\n", $this->lastCurlResponse);
        $result      = true;
        $message     = '';
        foreach ($responseArr as $lineNo => $responseLine) {
            if (strstr($responseLine, '<ul class = "flexibee-errors">')) {
                $message = trim($responseArr[$lineNo + 1]);
                $result  = false;
            }
            if (strstr($responseLine, '<div class = "alert alert-success">')) {
                $message = strip_tags(html_entity_decode(trim($responseArr[$lineNo
                            + 1])));
                $result  = true;
            }
        }

        if ($result === true) {
            $this->addStatusMessage(empty($message) ? $this->getDataValue('kod').'/vytvor-vazbu-zdd/'.$income->getRecordCode()
                        : $message, 'success');
        } else {
            $this->addStatusMessage($this->getDataValue('kod').'/vytvor-vazbu-zdd/'.$incomeId,
                'warning');
        }

        $this->defaultHttpHeaders = $headersBackup;

        return $result;
    }
public function vytvorVazbuZDD($income)
    {
        switch (get_class($income)) {
            case 'FlexiPeeHP\\Banka':
                $modul = 'banka';
                break;
            case 'FlexiPeeHP\\PokladniPohyb':
                $modul = 'pokladna';
                break;
            default :
                throw new \Ease\Exception(_('Unsupported $income parameter type'));
        }

        $incomeId = $income->getRecordID();
        $myId     = $this->getRecordID();

        $headersBackup = $this->defaultHttpHeaders;

        $this->defaultHttpHeaders['Accept'] = 'text/html';
        $this->setPostFields(http_build_query(['modul' => $modul,
            'submit' => 'OK']));
        $this->performRequest($myId.'/vytvor-vazbu-zdd/'.$incomeId, 'GET',
            'json');

        $responseArr = explode("\n", $this->lastCurlResponse);
        $result      = true;
        $message     = '';
        foreach ($responseArr as $lineNo => $responseLine) {
            if (strstr($responseLine, '<ul class = "flexibee-errors">')) {
                $message = trim($responseArr[$lineNo + 1]);
                $result  = false;
            }
            if (strstr($responseLine, '<div class = "alert alert-success">')) {
                $message = strip_tags(html_entity_decode(trim($responseArr[$lineNo
                            + 1])));
                $result  = true;
            }
        }

        if ($result === true) {
            $this->addStatusMessage(empty($message) ? $this->getDataValue('kod').'/vytvor-vazbu-zdd/'.$income->getRecordCode()
                        : $message, 'success');
        } else {
            $this->addStatusMessage($this->getDataValue('kod').'/vytvor-vazbu-zdd/'.$incomeId,
                'warning');
        }

        $this->defaultHttpHeaders = $headersBackup;

        return $result;
    }
public function vytvorVazbuZDD ( $ income ) { switch ( get_class ( $ income ) ) { case 'FlexiPeeHP\\Banka' : $ modul = 'banka' ; break ; case 'FlexiPeeHP\\PokladniPohyb' : $ modul = 'pokladna' ; break ; default : throw new \ Ease \ Exception ( _ ( 'Unsupported $income parameter type' ) ) ; } $ incomeId = $ income -> getRecordID ( ) ; $ myId = $ this -> getRecordID ( ) ; $ headersBackup = $ this -> defaultHttpHeaders ; $ this -> defaultHttpHeaders [ 'Accept' ] = 'text/html' ; $ this -> setPostFields ( http_build_query ( [ 'modul' => $ modul , 'submit' => 'OK' ] ) ) ; $ this -> performRequest ( $ myId . '/vytvor-vazbu-zdd/' . $ incomeId , 'GET' , 'json' ) ; $ responseArr = explode ( "\n" , $ this -> lastCurlResponse ) ; $ result = true ; $ message = '' ; foreach ( $ responseArr as $ lineNo => $ responseLine ) { if ( strstr ( $ responseLine , '<ul class = "flexibee-errors">' ) ) { $ message = trim ( $ responseArr [ $ lineNo + 1 ] ) ; $ result = false ; } if ( strstr ( $ responseLine , '<div class = "alert alert-success">' ) ) { $ message = strip_tags ( html_entity_decode ( trim ( $ responseArr [ $ lineNo + 1 ] ) ) ) ; $ result = true ; } } if ( $ result === true ) { $ this -> addStatusMessage ( empty ( $ message ) ? $ this -> getDataValue ( 'kod' ) . '/vytvor-vazbu-zdd/' . $ income -> getRecordCode ( ) : $ message , 'success' ) ; } else { $ this -> addStatusMessage ( $ this -> getDataValue ( 'kod' ) . '/vytvor-vazbu-zdd/' . $ incomeId , 'warning' ) ; } $ this -> defaultHttpHeaders = $ headersBackup ; return $ result ; }
add link to advance tax document

@param Banka|PokladniPohyb $income Income payment document

@return boolean success

@throws Exception
add link to advance tax document