Initialize partial payment related totals (if exist).

@return $this
342248
public function initTotals()
    {
        /** @var \Magento\Sales\Block\Adminhtml\Order\Creditmemo\Totals $parent */
        $parent = $this->getParentBlock();
        /** @var \Magento\Sales\Model\Order\Creditmemo $creditmemo */
        $creditmemo = $this->getCreditmemo();
        $partialBase = $creditmemo->getData(Cfg::CODE_TOTAL_PARTIAL_AMOUNT_BASE);
        if ($partialBase) {
            /* get partial payment data from creditmemo */
            $partial = $creditmemo->getData(Cfg::CODE_TOTAL_PARTIAL_AMOUNT);
        } else {
            /* or check sales registry in repo */
            /** @var \Magento\Sales\Model\Order $order */
            $order = $parent->getOrder();
            $orderId = $order->getId();
            $found = $this->daoPartialSale->getById($orderId);
            if ($found) {
                $partialBase = $found->getBasePartialAmount();
                $partial = $found->getBasePartialAmount();
            }
        }
        if ($partialBase) {
            /* add partial to parent totals */
            $this->zTotalPartial->addTotalWallet($parent, $partialBase, $partial);
        }
        return $this;
    }
1016250
public function updateTotals()
    {
        if (is_array($this->totals)) {
            foreach ($this->totals as $key => $val) {
                if (is_object($this->current_row[$key])) {
                    continue;
                }
                $this->totals[$key] = $val + $this->current_row[$key];
            }
        }
    }
868328
public static function init()
    {

        self::$_createCustomerSignature = [
            self::$_transparentRedirectKeys,
            ['customer' => CustomerGateway::createSignature()],
            ];
        self::$_updateCustomerSignature = [
            self::$_transparentRedirectKeys,
            'customerId',
            ['customer' => CustomerGateway::updateSignature()],
            ];
        self::$_transactionSignature = [
            self::$_transparentRedirectKeys,
            ['transaction' => TransactionGateway::createSignature()],
            ];
        self::$_createCreditCardSignature = [
            self::$_transparentRedirectKeys,
            ['creditCard' => CreditCardGateway::createSignature()],
            ];
        self::$_updateCreditCardSignature = [
            self::$_transparentRedirectKeys,
            'paymentMethodToken',
            ['creditCard' => CreditCardGateway::updateSignature()],
            ];
    }
294763
public function init()
    {
        $digest = $this->getDigest();
        $this->digestParts = $this->parseDigest((string) $digest);
    }
1075437
protected function onInit()
    {
        $this->limit = Utility::get($this->params, 0, 10);
        $this->offset = Utility::get($this->params, 1, 0);
    }
1090093
public function setTotal($value)
    {
        if (StaticValidator::validates('number', $value)) {
            $this->total = StaticFilter::filter('number',$value);
            $this->pages = ceil($this->total / $this->rowsPerPage);
        }
        return $this;
    }
721146
protected function _initTotals()
    {
        parent::_initTotals();

        if (((float)$this->getSource()->getPaymentFeeAmount()) != 0) {
            $this->addTotal(
                new Varien_Object(
                    array(
                        'code' => 'payment_fee',
                        'strong' => false,
                        'value' => $this->getSource()->getPaymentFeeAmount(),
                        'base_value' => $this->getSource()->getBasePaymentFeeAmount(),
                        'label' => $this->helper('adyen')->__('Payment Fee'),
                        'area' => '',
                    )
                ),
                'subtotal'
            );
        }

        if (((float)$this->getSource()->getPaymentPercentageFee()) != 0) {
            $this->addTotal(
                new Varien_Object(
                    array(
                        'code' => 'payment_percentage_fee',
                        'strong' => false,
                        'value' => $this->getSource()->getPaymentPercentageFee(),
                        'base_value' => $this->getSource()->getBasePaymentPercentageFee(),
                        'label' => $this->helper('adyen')->__('Payment Percentage Fee'),
                        'area' => '',
                    )
                ),
                'subtotal'
            );
        }

        if (((float)$this->getSource()->getPaymentInstallmentFeeAmount()) != 0) {
            $this->addTotal(
                new Varien_Object(
                    array(
                        'code' => 'payment_installment_fee',
                        'strong' => false,
                        'value' => $this->getSource()->getPaymentInstallmentFeeAmount(),
                        'base_value' => $this->getSource()->getBasePaymentInstallmentFeeAmount(),
                        'label' => $this->helper('adyen')->__('Payment Fee Installments'),
                        'area' => '',
                    )
                ),
                'subtotal'
            );
        }

        return $this;
    }
440806
protected function init() {
        $this->data['crud'] = 'd';
        $this->data['edulevel'] = self::LEVEL_OTHER;
        $this->data['objecttable'] = plan::TABLE;
    }
1128849
public function beginTransaction()
    {
        $this->_connect();
        $q = $this->_profiler->queryStart('begin', Zend_Db_Profiler::TRANSACTION);
        $this->_beginTransaction();
        $this->_profiler->queryEnd($q);
        return $this;
    }
1202922
protected function setDataTemplatesCheckoutComplete()
    {
        $templates = array(
            'payment' => $this->getPaymentMethodTemplate('complete', $this->data_order, $this->payment),
            'shipping' => $this->getShippingMethodTemplate('complete', $this->data_order, $this->shipping)
        );

        $this->setData('rendered', $templates);
    }
107135
public function initTotals()
    {
        $parent = $this->getParentBlock();
        $this->_source = $parent->getSource();
        $total = new Varien_Object(
            array(
                'code' => 'adjust_adyen_fee_payment_fee',
                'block_name' => $this->getNameInLayout()
            )
        );

        // remove totals because you only want to show editable field
        $parent->removeTotal('payment_fee_excl');
        $parent->removeTotal('payment_fee_incl');

        $parent->addTotalBefore($total, 'agjustments'); // Yes, misspelled in Magento Core
        return $this;
    }
772404
public function calculateAdjustmentsTotal()
    {
        $this->adjustmentsTotal = 0;

        foreach ($this->adjustments as $adjustment) {
            if (!$adjustment->isNeutral()) {
                $this->adjustmentsTotal += $adjustment->getAmount();
            }
        }

        return $this;
    }
892044
protected function _initItems()
    {
        $data = $this->_getItemsData();
        $items = [];
        foreach ($data as $itemData) {
            $item = $this->_createItem($itemData['label'], $itemData['value'], $itemData['count']);
            $items[] = $item;

            if ($this->useUrlRewrites() === true) {
                $item->setUrlRewrite($itemData['url']);
            }
        }
        $this->_items = $items;

        return $this;
    }
507595
protected function initAmounts()
    {
        $invoicePart = &$this->invoice[Tag::Customer][Tag::Invoice];
        $this->vatAmount = isset($invoicePart[Meta::InvoiceVatAmount]) ? $invoicePart[Meta::InvoiceVatAmount] : $invoicePart[Meta::InvoiceAmountInc] - $invoicePart[Meta::InvoiceAmount];
        $this->invoiceAmount = isset($invoicePart[Meta::InvoiceAmount]) ? $invoicePart[Meta::InvoiceAmount] : $invoicePart[Meta::InvoiceAmountInc] - $invoicePart[Meta::InvoiceVatAmount];

        // The vat amount to divide over the non completed lines is the total vat
        // amount of the invoice minus all known vat amounts per line.
        $this->vat2Divide = (float) $this->vatAmount;
        foreach ($invoicePart[Tag::Line] as $line) {
            if ($line[Meta::VatRateSource] !== Creator::VatRateSource_Strategy) {
                // Deduct the vat amount from this line: if set, deduct it directly,
                // otherwise calculate the vat amount using the vat rate and unit price.
                if (isset($line[Meta::VatAmount])) {
                    $this->vat2Divide -= $line[Meta::VatAmount] * $line[Tag::Quantity];
                } else {
                    $this->vat2Divide -= ($line[Tag::VatRate] / 100.0) * $line[Tag::UnitPrice] * $line[Tag::Quantity];
                }
            }
        }
    }
1234712
public function calculate()
    {
        $this->init();

        foreach ($this->getPaymentList() as $payment) {
            $status = $payment->getStatus();
            $action = $payment->getAction();
            $amount = $payment->getAmount();

            $this->aggregateAmounts($action, $status, $amount);
        }
    }
926334
public function initialize()
    {
        parent::initialize();

        $this->data->installmentCount = 1;
        $this->data->fundingInstrument = new stdClass();
        $this->data->fundingInstrument->method = self::METHOD_CREDIT_CARD;
    }
1050217
protected function setPagerListReportPayment()
    {
        $pager = array(
            'query' => $this->query_filter,
            'total' => (int) $this->getListReportPayment(true)
        );

        return $this->data_limit = $this->setPager($pager);
    }