protected function getShipmentAccountNumber(TaxRuleInterface $rule, string $origin)
    {
        foreach ($this->accounts as $account) {
            if ($account->getType() !== AccountingTypes::TYPE_SHIPPING) {
                continue;
            }

            if ($account->getTaxRule() !== $rule) {
                continue;
            }

            return $account->getNumber();
        }

        throw new LogicException(sprintf(
            "No shipment account number configured for tax rule '%s' (%s)",
            $rule->getName(),
            $origin
        ));
    }
protected function getShipmentAccountNumber(TaxRuleInterface $rule, string $origin)
    {
        foreach ($this->accounts as $account) {
            if ($account->getType() !== AccountingTypes::TYPE_SHIPPING) {
                continue;
            }

            if ($account->getTaxRule() !== $rule) {
                continue;
            }

            return $account->getNumber();
        }

        throw new LogicException(sprintf(
            "No shipment account number configured for tax rule '%s' (%s)",
            $rule->getName(),
            $origin
        ));
    }
protected function getShipmentAccountNumber ( TaxRuleInterface $ rule , string $ origin ) { foreach ( $ this -> accounts as $ account ) { if ( $ account -> getType ( ) !== AccountingTypes :: TYPE_SHIPPING ) { continue ; } if ( $ account -> getTaxRule ( ) !== $ rule ) { continue ; } return $ account -> getNumber ( ) ; } throw new LogicException ( sprintf ( "No shipment account number configured for tax rule '%s' (%s)" , $ rule -> getName ( ) , $ origin ) ) ; }
Returns the shipment account number for the given tax rule.

@param TaxRuleInterface $rule
@param string           $origin

@return string
Returns the shipment account number for the given tax rule .