/** * Update invoice state value * Method set text label instead id value * @return void */ private function setStateValue() { $value = $this->getData(self::$stateAttributeCode); /** @var \Magento\Framework\Phrase $state */ $state = Invoice::getStates()[$value]; $this->setCustomAttribute(self::$stateAttributeCode, $state->getText()); }