src/WooCommerce/Shop/InvoiceStatusOverviewForm.php
private function getInvoiceStatusInfo($localEntryInfo)
    {
        $result = null;
        $entry = null;
        $arg1 = null;
        $arg2 = null;
        $description = '';
        $statusMessage = null;
        if ($localEntryInfo === null) {
            $invoiceStatus = static::Invoice_NotSent;
            $statusSeverity = static::Status_Info;
        } else {
            $arg1 = $this->getDate($localEntryInfo->getUpdated());
            if ($localEntryInfo->getEntryId() === null) {
                $invoiceStatus = static::Invoice_SentConcept;
                $description = 'concept_description';
                $statusSeverity = static::Status_Warning;
            } else {
                $result = $this->service->getEntry($localEntryInfo->getEntryId());
                $entry = $this->sanitizeEntry($result->getResponse());
                if ($result->hasCodeTag('XGYBSN000')) {
                    $invoiceStatus = static::Invoice_NonExisting;
                    $statusSeverity = static::Status_Error;
                    // To prevent this error in the future, we delete the local
                    // entry.
                    $this->acumulusEntryManager->delete($localEntryInfo);
                } elseif (empty($entry)) {
                    $invoiceStatus = static::Invoice_CommunicationError;
                    $statusSeverity = static::Status_Error;
                } elseif (!empty($entry['deleted'])) {
                    $invoiceStatus = static::Invoice_Deleted;
                    $statusSeverity = static::Status_Warning;
                    $arg2 = $entry['deleted'];
                } else {
                    $invoiceStatus = static::Invoice_Sent;
                    $arg1 = $entry['invoicenumber'];
                    $arg2 = $entry['entrydate'];
                    $statusSeverity = static::Status_Success;
                    $statusMessage = $this->t('invoice_status_ok');
                }
            }
        }

        return array(
            'severity' => $statusSeverity,
            'severity-message' => $statusMessage,
            'status' => $invoiceStatus,
            'result' => $result,
            'entry' => $entry,
            'text' => sprintf($this->t($invoiceStatus), $arg1, $arg2),
            'description' => $this->t($description),
        );
    }
private function getInvoiceStatusInfo($localEntryInfo)
    {
        $result = null;
        $entry = null;
        $arg1 = null;
        $arg2 = null;
        $description = '';
        $statusMessage = null;
        if ($localEntryInfo === null) {
            $invoiceStatus = static::Invoice_NotSent;
            $statusSeverity = static::Status_Info;
        } else {
            $arg1 = $this->getDate($localEntryInfo->getUpdated());
            if ($localEntryInfo->getEntryId() === null) {
                $invoiceStatus = static::Invoice_SentConcept;
                $description = 'concept_description';
                $statusSeverity = static::Status_Warning;
            } else {
                $result = $this->service->getEntry($localEntryInfo->getEntryId());
                $entry = $this->sanitizeEntry($result->getResponse());
                if ($result->hasCodeTag('XGYBSN000')) {
                    $invoiceStatus = static::Invoice_NonExisting;
                    $statusSeverity = static::Status_Error;
                    // To prevent this error in the future, we delete the local
                    // entry.
                    $this->acumulusEntryManager->delete($localEntryInfo);
                } elseif (empty($entry)) {
                    $invoiceStatus = static::Invoice_CommunicationError;
                    $statusSeverity = static::Status_Error;
                } elseif (!empty($entry['deleted'])) {
                    $invoiceStatus = static::Invoice_Deleted;
                    $statusSeverity = static::Status_Warning;
                    $arg2 = $entry['deleted'];
                } else {
                    $invoiceStatus = static::Invoice_Sent;
                    $arg1 = $entry['invoicenumber'];
                    $arg2 = $entry['entrydate'];
                    $statusSeverity = static::Status_Success;
                    $statusMessage = $this->t('invoice_status_ok');
                }
            }
        }

        return array(
            'severity' => $statusSeverity,
            'severity-message' => $statusMessage,
            'status' => $invoiceStatus,
            'result' => $result,
            'entry' => $entry,
            'text' => sprintf($this->t($invoiceStatus), $arg1, $arg2),
            'description' => $this->t($description),
        );
    }
private function getInvoiceStatusInfo ( $ localEntryInfo ) { $ result = null ; $ entry = null ; $ arg1 = null ; $ arg2 = null ; $ description = '' ; $ statusMessage = null ; if ( $ localEntryInfo === null ) { $ invoiceStatus = static :: Invoice_NotSent ; $ statusSeverity = static :: Status_Info ; } else { $ arg1 = $ this -> getDate ( $ localEntryInfo -> getUpdated ( ) ) ; if ( $ localEntryInfo -> getEntryId ( ) === null ) { $ invoiceStatus = static :: Invoice_SentConcept ; $ description = 'concept_description' ; $ statusSeverity = static :: Status_Warning ; } else { $ result = $ this -> service -> getEntry ( $ localEntryInfo -> getEntryId ( ) ) ; $ entry = $ this -> sanitizeEntry ( $ result -> getResponse ( ) ) ; if ( $ result -> hasCodeTag ( 'XGYBSN000' ) ) { $ invoiceStatus = static :: Invoice_NonExisting ; $ statusSeverity = static :: Status_Error ; // To prevent this error in the future, we delete the local // entry. $ this -> acumulusEntryManager -> delete ( $ localEntryInfo ) ; } elseif ( empty ( $ entry ) ) { $ invoiceStatus = static :: Invoice_CommunicationError ; $ statusSeverity = static :: Status_Error ; } elseif ( ! empty ( $ entry [ 'deleted' ] ) ) { $ invoiceStatus = static :: Invoice_Deleted ; $ statusSeverity = static :: Status_Warning ; $ arg2 = $ entry [ 'deleted' ] ; } else { $ invoiceStatus = static :: Invoice_Sent ; $ arg1 = $ entry [ 'invoicenumber' ] ; $ arg2 = $ entry [ 'entrydate' ] ; $ statusSeverity = static :: Status_Success ; $ statusMessage = $ this -> t ( 'invoice_status_ok' ) ; } } } return array ( 'severity' => $ statusSeverity , 'severity-message' => $ statusMessage , 'status' => $ invoiceStatus , 'result' => $ result , 'entry' => $ entry , 'text' => sprintf ( $ this -> t ( $ invoiceStatus ) , $ arg1 , $ arg2 ) , 'description' => $ this -> t ( $ description ) , ) ; }
Returns status related information.

@param \Siel\Acumulus\Shop\AcumulusEntry|null $localEntryInfo

@return array
Keyed array with keys:
- status (string): 1 of the ShopOrderOverviewForm::Status_ constants.
- send-status (string): 1 of the ShopOrderOverviewForm::Invoice_ constants.
- result (\Siel\Acumulus\Web\Result?): result of the getEntry API call.
- entry (array|null): the <entry> part of the getEntry API call.
- statusField (array): a form field array representing the status.
Returns status related information .