public function prepareRules()
    {
        switch (self::baseClassName($this->input)) {
            case 'FakturaVydana':
            case 'Banka':
                switch (self::baseClassName($this->output)) {
                    case 'FakturaVydana':
                        // Banka['typPohybuK' => 'typPohybu.prijem'] -> FakturaVydana['typDokl' => 'ZDD']
//                        $this->output->setDataValue('firma',  \FlexiPeeHP\FlexiBeeRO::code( $this->input->getDataValue('firma')));
                        $this->rules = array_combine($this->commonItems(),
                            $this->commonItems());
                        unset($this->rules['stavUhrK']);
                        unset($this->rules['datUcto']);
                        unset($this->rules['datUcto']);

                        foreach (array_keys($this->output->getData()) as $colname) {
                            unset($this->rules[$colname]);
                        }

                        if ($this->input->getDataValue('typDokl') != $this->output->getDataValue('typDokl')) {
                            unset($this->rules['rada']);
                        }

                        foreach ($this->rules as $rule) {
                            if (preg_match('/^sum/', $rule)) {
                                unset($this->rules[$rule]);
                            }
                        }


                        $polozkyDokladu                = new \FlexiPeeHP\FakturaVydanaPolozka();
                        $itemColnames                  = array_keys($polozkyDokladu->getColumnsInfo());
                        $this->rules['polozkyFaktury'] = self::removeRoColumns(array_combine($itemColnames,
                                    $itemColnames), $polozkyDokladu);

                        break;
                    default :
                        throw new \Ease\Exception(sprintf(_('Unsupported Source document type %s'),
                                get_class($this->output)));
                        break;
                }
                break;
            default:
                throw new \Ease\Exception(sprintf(_('Unsupported Source document type %s'),
                        get_class($this->input)));
                break;
        }
    }
public function prepareRules()
    {
        switch (self::baseClassName($this->input)) {
            case 'FakturaVydana':
            case 'Banka':
                switch (self::baseClassName($this->output)) {
                    case 'FakturaVydana':
                        // Banka['typPohybuK' => 'typPohybu.prijem'] -> FakturaVydana['typDokl' => 'ZDD']
//                        $this->output->setDataValue('firma',  \FlexiPeeHP\FlexiBeeRO::code( $this->input->getDataValue('firma')));
                        $this->rules = array_combine($this->commonItems(),
                            $this->commonItems());
                        unset($this->rules['stavUhrK']);
                        unset($this->rules['datUcto']);
                        unset($this->rules['datUcto']);

                        foreach (array_keys($this->output->getData()) as $colname) {
                            unset($this->rules[$colname]);
                        }

                        if ($this->input->getDataValue('typDokl') != $this->output->getDataValue('typDokl')) {
                            unset($this->rules['rada']);
                        }

                        foreach ($this->rules as $rule) {
                            if (preg_match('/^sum/', $rule)) {
                                unset($this->rules[$rule]);
                            }
                        }


                        $polozkyDokladu                = new \FlexiPeeHP\FakturaVydanaPolozka();
                        $itemColnames                  = array_keys($polozkyDokladu->getColumnsInfo());
                        $this->rules['polozkyFaktury'] = self::removeRoColumns(array_combine($itemColnames,
                                    $itemColnames), $polozkyDokladu);

                        break;
                    default :
                        throw new \Ease\Exception(sprintf(_('Unsupported Source document type %s'),
                                get_class($this->output)));
                        break;
                }
                break;
            default:
                throw new \Ease\Exception(sprintf(_('Unsupported Source document type %s'),
                        get_class($this->input)));
                break;
        }
    }
public function prepareRules ( ) { switch ( self :: baseClassName ( $ this -> input ) ) { case 'FakturaVydana' : case 'Banka' : switch ( self :: baseClassName ( $ this -> output ) ) { case 'FakturaVydana' : // Banka['typPohybuK' => 'typPohybu.prijem'] -> FakturaVydana['typDokl' => 'ZDD'] //                        $this->output->setDataValue('firma',  \FlexiPeeHP\FlexiBeeRO::code( $this->input->getDataValue('firma'))); $ this -> rules = array_combine ( $ this -> commonItems ( ) , $ this -> commonItems ( ) ) ; unset ( $ this -> rules [ 'stavUhrK' ] ) ; unset ( $ this -> rules [ 'datUcto' ] ) ; unset ( $ this -> rules [ 'datUcto' ] ) ; foreach ( array_keys ( $ this -> output -> getData ( ) ) as $ colname ) { unset ( $ this -> rules [ $ colname ] ) ; } if ( $ this -> input -> getDataValue ( 'typDokl' ) != $ this -> output -> getDataValue ( 'typDokl' ) ) { unset ( $ this -> rules [ 'rada' ] ) ; } foreach ( $ this -> rules as $ rule ) { if ( preg_match ( '/^sum/' , $ rule ) ) { unset ( $ this -> rules [ $ rule ] ) ; } } $ polozkyDokladu = new \ FlexiPeeHP \ FakturaVydanaPolozka ( ) ; $ itemColnames = array_keys ( $ polozkyDokladu -> getColumnsInfo ( ) ) ; $ this -> rules [ 'polozkyFaktury' ] = self :: removeRoColumns ( array_combine ( $ itemColnames , $ itemColnames ) , $ polozkyDokladu ) ; break ; default : throw new \ Ease \ Exception ( sprintf ( _ ( 'Unsupported Source document type %s' ) , get_class ( $ this -> output ) ) ) ; break ; } break ; default : throw new \ Ease \ Exception ( sprintf ( _ ( 'Unsupported Source document type %s' ) , get_class ( $ this -> input ) ) ) ; break ; } }
Prepare conversion rules

@throws \Ease\Exception
Prepare conversion rules