Initializes the amount properties.

to be able to calculate the amounts, at least 2 of the 3 meta amounts
meta-invoice-vatamount, meta-invoice-amountinc, or meta-invoice-amount must
be known.
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];
                }
            }
        }
    }
991236
def _initialize(self, funs_to_tally, length):
        """"""

        dir = os.path.join(self._directory, CHAIN_NAME % self.chains)
        os.mkdir(dir)

        base.Database._initialize(self, funs_to_tally, length)
162242
def _init_metadata(self, **kwargs):
        """"""
        osid_objects.OsidRelationshipForm._init_metadata(self, **kwargs)
        self._completion_default = self._mdata['completion']['default_decimal_values'][0]
        self._level_default = self._mdata['level']['default_id_values'][0]
992965
protected function initMeta(): void
    {
        // cache for reflection data
        $cacheKey = "meta.{$this->module}.{$this->controller}";

        if (!$meta = Cache::get($cacheKey)) {
            $meta = new Meta($this->getFile());
            $meta->process();

            Cache::set(
                $cacheKey,
                $meta,
                Cache::TTL_NO_EXPIRY,
                ['system', 'meta']
            );
        }
        $this->meta = $meta;
    }
45389
public void initConstants()
    {
        if (NUMBERS != null)
            return;

        if (((BaseField)this.getField()).getRecord().getRecordOwner() != null)
        {
            org.jbundle.model.Task task = ((BaseField)this.getField()).getRecord().getRecordOwner().getTask();
            ResourceBundle resources = ((BaseApplication)task.getApplication()).getResources(ResourceConstants.AMOUNT_RESOURCE, true);
            NUMBERS = new String[10];
            for (int i = 0; i < 10; i++)
            {
                NUMBERS[i] = resources.getString(Integer.toString(i));
            }

            TEENS = new String[10];
            for (int i = 10; i < 20; i++)
            {
                TEENS[i - 10] = resources.getString(Integer.toString(i));
            }

            TENS = new String[10];
            for (int i = 2; i < 10; i++)
            {
                TENS[i] = resources.getString(Integer.toString(i * 10));
            }

            HUNDRED = resources.getString("100");
            THOUSAND = resources.getString("1000");
            MILLION = resources.getString("1000000");
            BILLION = resources.getString("1000000000");
            AND = resources.getString("&");
        }
        else
        {
            NUMBERS[0] = "Zero";NUMBERS[1] = "One";NUMBERS[2] = "Two";NUMBERS[3] = "Three";NUMBERS[4] = "Four";
            NUMBERS[5] = "Five";NUMBERS[6] = "Six";NUMBERS[7] = "Seven";NUMBERS[8] = "Eight";NUMBERS[9] = "Nine";
            TEENS[0] = "ten";TEENS[1] = "Eleven";TEENS[2] = "Twelve";TEENS[3] = "Thirteen";TEENS[4] = "Fourteen";
            TEENS[5] = "Fifteen";TEENS[6] = "Sixteen";TEENS[7] = "Seventeen";TEENS[8] = "Eighteen";TEENS[9] = "Nineteen";
            TENS[0] = Constants.BLANK;TENS[1] = Constants.BLANK;TENS[2] = "Twenty";TENS[3] = "Thirty";TENS[4] = "Forty";
            TENS[5] = "Fifty";TENS[6] = "Sixty";TENS[7] = "Seventy";TENS[8] = "Eighty";TENS[9] = "Ninety";
            HUNDRED = "Hundred";
            THOUSAND = "Thousand";
            MILLION = "Million";
            BILLION = "Billion";
            AND = "and";
        }
    }
517206
protected function initCounters()
    {
        $pos = 0;
        while ($pos < strlen($this->pattern)) {
            $char = $this->pattern[$pos];
            if ($char == "{") {
                $this->uriVars++;
                $pos++;
            } else if ($char == "*") {
                if (($pos + 1) < strlen($this->pattern) && $this->pattern[$pos + 1] == "*") {
                    $this->doubleWildcards++;
                    $pos += 2;
                } else if (!substr($this->pattern, $pos - 1) == ".*") {
                    $this->singleWildcards++;
                    $pos++;
                } else {
                    $pos++;
                }
            } else {
                $pos++;
            }
        }
    }
736306
protected function _initialize($idealPaymentAttribs)
    {
        // set the attributes
        $this->_attributes = $idealPaymentAttribs;

        $ibanBankAccount = isset($idealPaymentAttribs['ibanBankAccount']) ?
            IbanBankAccount::factory($idealPaymentAttribs['ibanBankAccount']) :
            null;
        $this->_set('ibanBankAccount', $ibanBankAccount);
    }
345587
private function _initialize()
    {
        if ($this->getInitialized()) {
            return;
        }

        $params = $this->getParameters();
        if ($params !== null) {
            foreach ($params as $param) {
                if ('in' == $param->getName()) {
                    $this->setInputEncoding($param->getValue());
                } else {
                    if ('out' == $param->getName()) {
                        $this->setOutputEncoding($param->getValue());
                    }
                }
            }
        }

        $this->setInitialized(true);
    }
1254242
private void initVariables() {
        if (this.currentChunk == null) {
            this.currentChunk = new Instances(this.getModelContext());
        }

        if (this.classDistributions == null) {
            this.classDistributions = new long[this.getModelContext().classAttribute().numValues()];

            for (int i = 0; i < this.classDistributions.length; i++) {
                this.classDistributions[i] = 0;
            }
        }
    }
740131
def _init_metadata(self):
        """"""
        ItemTextsFormRecord._init_metadata(self)
        ItemFilesFormRecord._init_metadata(self)
        edXBaseFormRecord._init_metadata(self)
        IRTItemFormRecord._init_metadata(self)
        TimeValueFormRecord._init_metadata(self)
        ProvenanceFormRecord._init_metadata(self)
        super(edXItemFormRecord, self)._init_metadata()
949336
private static function initializeResources()
    {
        if (self::$initialized) {
            return;
        }

        Resource::init();

        Resources\User::init();
        Resources\Application::init();
        Resources\Identity::init();
        Resources\Processor::init();
        Resources\Merchant::init();
        Resources\PaymentInstrument::init();
        Resources\PaymentCard::init();
        Resources\BankAccount::init();
        Resources\Authorization::init();
        Resources\Transfer::init();
        Resources\Reversal::init();
        Resources\Dispute::init();
        Resources\Webhook::init();
        Resources\Settlement::init();
        Resources\Verification::init();
        Resources\Evidence::init();
        Resources\Token::init();
        Resources\InstrumentUpdate::init();

        self::$initialized = true;
    }
1342413
def initialize_fields(self):
        
        for field in dir(self):
            obj = getattr(self, field)
            if isinstance(obj, Field):
                self._meta.fields[field] = obj
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);
        }
    }
640402
private function _initialize()
    {
        $params = $this->getParameters();
        if ($params !== null) {
            for ($i = 0, $paramsCount = count($params); $i < $paramsCount; $i++) {
                if (self::REGEXP_KEY === $params[$i]->getType()) {
                    $pattern = $params[$i]->getValue();
                    $regexp = new RegularExpression();
                    $regexp->setPattern($pattern);
                    $this->_regexps[] = $regexp;
                } elseif (self::NEGATE_KEY === $params[$i]->getType()) {
                    $this->setNegate(Project::toBoolean($params[$i]->getValue()));
                } elseif (self::CS_KEY === $params[$i]->getType()) {
                    $this->setCaseSensitive(Project::toBoolean($params[$i]->getValue()));
                }
            }
        }
    }
1214995
private function _initialize()
    {
        $params = $this->getParameters();
        if ($params !== null) {
            for ($i = 0, $_i = count($params); $i < $_i; $i++) {
                if ($params[$i]->getType() === null) {
                    if ($params[$i]->getName() === "style") {
                        $this->setStyle($params[$i]->getValue());
                    }
                } elseif ($params[$i]->getType() == "param") {
                    $xp = new XsltParam();
                    $xp->setName($params[$i]->getName());
                    $xp->setExpression($params[$i]->getValue());
                    $this->xsltParams[] = $xp;
                }
            }
        }
    }
1021016
protected function initialize()
    {
        $this->data = new stdClass();
        $this->data->amount = new stdClass();
        $this->data->details = new stdClass();
        $this->data->parentPayments = new stdClass();
    }
726966
private void initParameters() {
        this.minX = envelope.getMinX();
        this.minY = envelope.getMinY();
        double cellWidth = envelope.getWidth();
        double cellHeight = envelope.getHeight();
        this.maxI = (int) Math.ceil(cellWidth
                / deltaX);
        this.maxJ = (int) Math.ceil(cellHeight
                / deltaY);
    }