src/WooCommerce/Shop/InvoiceStatusOverviewForm.php
private function getAmountFields(Source $source, array $entry)
    {
        $fields = array();
        if (!empty($entry['totalvalue']) && !empty($entry['totalvalueexclvat'])) {
            // Get Acumulus amounts.
            $amountExAcumulus = $entry['totalvalueexclvat'];
            $amountIncAcumulus = $entry['totalvalue'];
            $amountVatAcumulus = $amountIncAcumulus - $amountExAcumulus;

            // Get local amounts.
            $localTotals = $source->getTotals();

            // Compare.
            $amountExStatus = $this->getAmountStatus($amountExAcumulus, $localTotals[Meta::InvoiceAmount]);
            $amountIncStatus = $this->getAmountStatus($amountIncAcumulus, $localTotals[Meta::InvoiceAmountInc]);
            $amountVatStatus = $this->getAmountStatus($amountVatAcumulus, $localTotals[Meta::InvoiceVatAmount]);

            $amountEx = $this->getFormattedAmount($amountExAcumulus, $amountExStatus);
            $amountInc = $this->getFormattedAmount($amountIncAcumulus, $amountIncStatus);
            $amountVat = $this->getFormattedAmount($amountVatAcumulus, $amountVatStatus);

            $fields['invoice_amount'] = array(
                'type' => 'markup',
                'label' => $this->t('invoice_amount'),
                'value' => sprintf('<div class="acumulus-amount">%1$s%2$s %4$s%3$s</div>', $amountEx, $amountVat, $amountInc, $this->t('vat')),
            );
        }
        return $fields;
    }
private function getAmountFields(Source $source, array $entry)
    {
        $fields = array();
        if (!empty($entry['totalvalue']) && !empty($entry['totalvalueexclvat'])) {
            // Get Acumulus amounts.
            $amountExAcumulus = $entry['totalvalueexclvat'];
            $amountIncAcumulus = $entry['totalvalue'];
            $amountVatAcumulus = $amountIncAcumulus - $amountExAcumulus;

            // Get local amounts.
            $localTotals = $source->getTotals();

            // Compare.
            $amountExStatus = $this->getAmountStatus($amountExAcumulus, $localTotals[Meta::InvoiceAmount]);
            $amountIncStatus = $this->getAmountStatus($amountIncAcumulus, $localTotals[Meta::InvoiceAmountInc]);
            $amountVatStatus = $this->getAmountStatus($amountVatAcumulus, $localTotals[Meta::InvoiceVatAmount]);

            $amountEx = $this->getFormattedAmount($amountExAcumulus, $amountExStatus);
            $amountInc = $this->getFormattedAmount($amountIncAcumulus, $amountIncStatus);
            $amountVat = $this->getFormattedAmount($amountVatAcumulus, $amountVatStatus);

            $fields['invoice_amount'] = array(
                'type' => 'markup',
                'label' => $this->t('invoice_amount'),
                'value' => sprintf('<div class="acumulus-amount">%1$s%2$s %4$s%3$s</div>', $amountEx, $amountVat, $amountInc, $this->t('vat')),
            );
        }
        return $fields;
    }
private function getAmountFields ( Source $ source , array $ entry ) { $ fields = array ( ) ; if ( ! empty ( $ entry [ 'totalvalue' ] ) && ! empty ( $ entry [ 'totalvalueexclvat' ] ) ) { // Get Acumulus amounts. $ amountExAcumulus = $ entry [ 'totalvalueexclvat' ] ; $ amountIncAcumulus = $ entry [ 'totalvalue' ] ; $ amountVatAcumulus = $ amountIncAcumulus - $ amountExAcumulus ; // Get local amounts. $ localTotals = $ source -> getTotals ( ) ; // Compare. $ amountExStatus = $ this -> getAmountStatus ( $ amountExAcumulus , $ localTotals [ Meta :: InvoiceAmount ] ) ; $ amountIncStatus = $ this -> getAmountStatus ( $ amountIncAcumulus , $ localTotals [ Meta :: InvoiceAmountInc ] ) ; $ amountVatStatus = $ this -> getAmountStatus ( $ amountVatAcumulus , $ localTotals [ Meta :: InvoiceVatAmount ] ) ; $ amountEx = $ this -> getFormattedAmount ( $ amountExAcumulus , $ amountExStatus ) ; $ amountInc = $ this -> getFormattedAmount ( $ amountIncAcumulus , $ amountIncStatus ) ; $ amountVat = $ this -> getFormattedAmount ( $ amountVatAcumulus , $ amountVatStatus ) ; $ fields [ 'invoice_amount' ] = array ( 'type' => 'markup' , 'label' => $ this -> t ( 'invoice_amount' ) , 'value' => sprintf ( '<div class="acumulus-amount">%1$s%2$s %4$s%3$s</div>' , $ amountEx , $ amountVat , $ amountInc , $ this -> t ( 'vat' ) ) , ) ; } return $ fields ; }
Returns the amounts of this invoice.

@param \Siel\Acumulus\Invoice\Source $source
@param array $entry

@return array[]
Array with form fields with the payment status and date (if paid) of
the invoice.
Returns the amounts of this invoice .