src/WooCommerce/Shop/InvoiceStatusOverviewForm.php
private function getFields1Source(Source $source, $localEntryInfo)
    {
        $this->resetStatus();
        // Get invoice status field and other invoice status related info.
        $statusInfo = $this->getInvoiceStatusInfo($localEntryInfo);

        $this->setStatus($statusInfo['severity'], $statusInfo['severity-message']);
        /** @var string $invoiceStatus */
        $invoiceStatus = $statusInfo['status'];
        /** @var string $statusText */
        $statusText = $statusInfo['text'];
        /** @var string $statusDescription */
        $statusDescription = $statusInfo['description'];
        /** @var Result|null $result */
        $result = $statusInfo['result'];
        /** @var array $entry */
        $entry = $statusInfo['entry'];

        // Create and add additional fields based on invoice status.
        switch ($invoiceStatus) {
            case static::Invoice_NotSent:
                $additionalFields = $this->getNotSentFields($source);
                break;
            case static::Invoice_SentConcept:
                $additionalFields = $this->getConceptFields($source);
                break;
            case static::Invoice_CommunicationError:
                /** @noinspection PhpUndefinedVariableInspection */
                $additionalFields = $this->getCommunicationErrorFields($result);
                break;
            case static::Invoice_NonExisting:
                $additionalFields = $this->getNonExistingFields($source);
                break;
            case static::Invoice_Deleted:
                $additionalFields = $this->getDeletedFields($source);
                break;
            case static::Invoice_Sent:
                $additionalFields = $this->getEntryFields($source, $localEntryInfo, $entry);
                break;
            default:
                $additionalFields = array(
                    'unknown' => array(
                        'type' => 'markup',
                        'value' => sprintf($this->t('invoice_status_unknown'), $invoiceStatus),
                    )
                );
                break;
        }

        // Create main status field after we have the other fields, so we can
        // use the results in rendering the overall status.
        $fields = array(
            'status' => array(
                'type' => 'markup',
                'label' => $this->getStatusIcon($this->status),
                'attributes' => array(
                    'class' => str_replace('_', '-', $invoiceStatus),
                    'label' => $this->getStatusLabelAttributes($this->status, $this->statusMessage),
                ),
                'value' => $statusText,
                'description' => $statusDescription,
            ),
        ) + $additionalFields;
        return $fields;
    }
private function getFields1Source(Source $source, $localEntryInfo)
    {
        $this->resetStatus();
        // Get invoice status field and other invoice status related info.
        $statusInfo = $this->getInvoiceStatusInfo($localEntryInfo);

        $this->setStatus($statusInfo['severity'], $statusInfo['severity-message']);
        /** @var string $invoiceStatus */
        $invoiceStatus = $statusInfo['status'];
        /** @var string $statusText */
        $statusText = $statusInfo['text'];
        /** @var string $statusDescription */
        $statusDescription = $statusInfo['description'];
        /** @var Result|null $result */
        $result = $statusInfo['result'];
        /** @var array $entry */
        $entry = $statusInfo['entry'];

        // Create and add additional fields based on invoice status.
        switch ($invoiceStatus) {
            case static::Invoice_NotSent:
                $additionalFields = $this->getNotSentFields($source);
                break;
            case static::Invoice_SentConcept:
                $additionalFields = $this->getConceptFields($source);
                break;
            case static::Invoice_CommunicationError:
                /** @noinspection PhpUndefinedVariableInspection */
                $additionalFields = $this->getCommunicationErrorFields($result);
                break;
            case static::Invoice_NonExisting:
                $additionalFields = $this->getNonExistingFields($source);
                break;
            case static::Invoice_Deleted:
                $additionalFields = $this->getDeletedFields($source);
                break;
            case static::Invoice_Sent:
                $additionalFields = $this->getEntryFields($source, $localEntryInfo, $entry);
                break;
            default:
                $additionalFields = array(
                    'unknown' => array(
                        'type' => 'markup',
                        'value' => sprintf($this->t('invoice_status_unknown'), $invoiceStatus),
                    )
                );
                break;
        }

        // Create main status field after we have the other fields, so we can
        // use the results in rendering the overall status.
        $fields = array(
            'status' => array(
                'type' => 'markup',
                'label' => $this->getStatusIcon($this->status),
                'attributes' => array(
                    'class' => str_replace('_', '-', $invoiceStatus),
                    'label' => $this->getStatusLabelAttributes($this->status, $this->statusMessage),
                ),
                'value' => $statusText,
                'description' => $statusDescription,
            ),
        ) + $additionalFields;
        return $fields;
    }
private function getFields1Source ( Source $ source , $ localEntryInfo ) { $ this -> resetStatus ( ) ; // Get invoice status field and other invoice status related info. $ statusInfo = $ this -> getInvoiceStatusInfo ( $ localEntryInfo ) ; $ this -> setStatus ( $ statusInfo [ 'severity' ] , $ statusInfo [ 'severity-message' ] ) ; /** @var string $invoiceStatus */ $ invoiceStatus = $ statusInfo [ 'status' ] ; /** @var string $statusText */ $ statusText = $ statusInfo [ 'text' ] ; /** @var string $statusDescription */ $ statusDescription = $ statusInfo [ 'description' ] ; /** @var Result|null $result */ $ result = $ statusInfo [ 'result' ] ; /** @var array $entry */ $ entry = $ statusInfo [ 'entry' ] ; // Create and add additional fields based on invoice status. switch ( $ invoiceStatus ) { case static :: Invoice_NotSent : $ additionalFields = $ this -> getNotSentFields ( $ source ) ; break ; case static :: Invoice_SentConcept : $ additionalFields = $ this -> getConceptFields ( $ source ) ; break ; case static :: Invoice_CommunicationError : /** @noinspection PhpUndefinedVariableInspection */ $ additionalFields = $ this -> getCommunicationErrorFields ( $ result ) ; break ; case static :: Invoice_NonExisting : $ additionalFields = $ this -> getNonExistingFields ( $ source ) ; break ; case static :: Invoice_Deleted : $ additionalFields = $ this -> getDeletedFields ( $ source ) ; break ; case static :: Invoice_Sent : $ additionalFields = $ this -> getEntryFields ( $ source , $ localEntryInfo , $ entry ) ; break ; default : $ additionalFields = array ( 'unknown' => array ( 'type' => 'markup' , 'value' => sprintf ( $ this -> t ( 'invoice_status_unknown' ) , $ invoiceStatus ) , ) ) ; break ; } // Create main status field after we have the other fields, so we can // use the results in rendering the overall status. $ fields = array ( 'status' => array ( 'type' => 'markup' , 'label' => $ this -> getStatusIcon ( $ this -> status ) , 'attributes' => array ( 'class' => str_replace ( '_' , '-' , $ invoiceStatus ) , 'label' => $ this -> getStatusLabelAttributes ( $ this -> status , $ this -> statusMessage ) , ) , 'value' => $ statusText , 'description' => $ statusDescription , ) , ) + $ additionalFields ; return $ fields ; }
Returns the overview for 1 source.

@param \Siel\Acumulus\Invoice\Source $source
@param \Siel\Acumulus\Shop\AcumulusEntry|null $localEntryInfo

@return array[]
The fields that describe the status for 1 source.
Returns the overview for 1 source .