src/Invoice/Creator.php
protected function addNature(array &$line)
    {
        if (empty($line[Tag::Nature])) {
            $shopSettings = $this->config->getShopSettings();
            switch ($shopSettings['nature_shop']) {
                case PluginConfig::Nature_Products:
                    $line[Tag::Nature] = Api::Nature_Product;
                    break;
                case PluginConfig::Nature_Services:
                    $line[Tag::Nature] = Api::Nature_Service;
                    break;
                default:
                    $invoiceSettings = $this->config->getInvoiceSettings();
                    $this->addTokenDefault($line, Tag::Nature, $invoiceSettings['nature']);
                    break;
            }
        }
    }
protected function addNature(array &$line)
    {
        if (empty($line[Tag::Nature])) {
            $shopSettings = $this->config->getShopSettings();
            switch ($shopSettings['nature_shop']) {
                case PluginConfig::Nature_Products:
                    $line[Tag::Nature] = Api::Nature_Product;
                    break;
                case PluginConfig::Nature_Services:
                    $line[Tag::Nature] = Api::Nature_Service;
                    break;
                default:
                    $invoiceSettings = $this->config->getInvoiceSettings();
                    $this->addTokenDefault($line, Tag::Nature, $invoiceSettings['nature']);
                    break;
            }
        }
    }
protected function addNature ( array & $ line ) { if ( empty ( $ line [ Tag :: Nature ] ) ) { $ shopSettings = $ this -> config -> getShopSettings ( ) ; switch ( $ shopSettings [ 'nature_shop' ] ) { case PluginConfig :: Nature_Products : $ line [ Tag :: Nature ] = Api :: Nature_Product ; break ; case PluginConfig :: Nature_Services : $ line [ Tag :: Nature ] = Api :: Nature_Service ; break ; default : $ invoiceSettings = $ this -> config -> getInvoiceSettings ( ) ; $ this -> addTokenDefault ( $ line , Tag :: Nature , $ invoiceSettings [ 'nature' ] ) ; break ; } } }
Adds the nature tag to the line.

The nature tag indicates the nature of the article for which the line is
being constructed. It can be Product or Service.

The nature can come from the:
- Shop settings: the nature_shop setting.
- Invoice settings: The nature field reference.

@param array $line
Adds the nature tag to the line .