src/FlexiPeeHP/RadaPokladniPohyb.php
public function getNextRecordCode($code = null)
    {
        if (is_null($code)) {
            $code = $this->getMyKey();
        }
        $crID = null;
        if (is_string($code)) {
            $sro = $this->performRequest($this->evidence.'/(kod=\''.$code.'\').json');
            if (count($sro[$this->evidence])) {
                $crID = current(current($sro[$this->evidence]));
            }
        } else {
            $crID = $code;
        }

        $cr                = $this->performRequest($this->evidence.'/'.$crID.'.json');
        $radaPokladniPohyb = current($cr[$this->evidence]);
        $crInfo            = end($radaPokladniPohyb['polozkyRady']);

        $cislo = $crInfo['cisAkt'] + 1;
        if ($crInfo['zobrazNuly'] == 'true') {
            return $crInfo['prefix'].sprintf('%\'.0'.$crInfo['cisDelka'].'d',
                    $cislo).'/'.date('y');
        } else {
            return $crInfo['prefix'].$cislo.'/'.date('y');
        }
    }
public function getNextRecordCode($code = null)
    {
        if (is_null($code)) {
            $code = $this->getMyKey();
        }
        $crID = null;
        if (is_string($code)) {
            $sro = $this->performRequest($this->evidence.'/(kod=\''.$code.'\').json');
            if (count($sro[$this->evidence])) {
                $crID = current(current($sro[$this->evidence]));
            }
        } else {
            $crID = $code;
        }

        $cr                = $this->performRequest($this->evidence.'/'.$crID.'.json');
        $radaPokladniPohyb = current($cr[$this->evidence]);
        $crInfo            = end($radaPokladniPohyb['polozkyRady']);

        $cislo = $crInfo['cisAkt'] + 1;
        if ($crInfo['zobrazNuly'] == 'true') {
            return $crInfo['prefix'].sprintf('%\'.0'.$crInfo['cisDelka'].'d',
                    $cislo).'/'.date('y');
        } else {
            return $crInfo['prefix'].$cislo.'/'.date('y');
        }
    }
public function getNextRecordCode ( $ code = null ) { if ( is_null ( $ code ) ) { $ code = $ this -> getMyKey ( ) ; } $ crID = null ; if ( is_string ( $ code ) ) { $ sro = $ this -> performRequest ( $ this -> evidence . '/(kod=\'' . $ code . '\').json' ) ; if ( count ( $ sro [ $ this -> evidence ] ) ) { $ crID = current ( current ( $ sro [ $ this -> evidence ] ) ) ; } } else { $ crID = $ code ; } $ cr = $ this -> performRequest ( $ this -> evidence . '/' . $ crID . '.json' ) ; $ radaPokladniPohyb = current ( $ cr [ $ this -> evidence ] ) ; $ crInfo = end ( $ radaPokladniPohyb [ 'polozkyRady' ] ) ; $ cislo = $ crInfo [ 'cisAkt' ] + 1 ; if ( $ crInfo [ 'zobrazNuly' ] == 'true' ) { return $ crInfo [ 'prefix' ] . sprintf ( '%\'.0' . $ crInfo [ 'cisDelka' ] . 'd' , $ cislo ) . '/' . date ( 'y' ) ; } else { return $ crInfo [ 'prefix' ] . $ cislo . '/' . date ( 'y' ) ; } }
Obtain code for new Record

@param string $code
@return string
Obtain code for new Record