Make credit adjustment

@param   integer  $amount  Amount to credit
@return  void
333080
public function credit_adjustment($amount)
	{
		$amount = intval($amount);

		$this->credit = ($amount > 0 ? $amount : 0);

		$this->_saveBalance('update');
	}
401204
public function setAmountDue($amountDue)
    {
        $this->amount_due = $amountDue;

        // If we have no amount_due, we can consider this Invoice to be settled
        if (!$this->getAmountDue()) {
            $this->setSettledAt(new \DateTime());
        }

        return $this;
    }
3357
public function makeBackendFilterChargeAmount($amount)
    {
        $defMin = $this['limits']['charge_amount']['min'];
        $defMax = $this['limits']['charge_amount']['max'];
        return function ($backend) use ($amount, $defMin, $defMax) {
            // temporary hack for now to correct min value for instalments to 500000
            if ($backend->type == 'installment') {
                $min = 500000;
            } else {
                $min = empty($backend->amount['min']) ? $defMin : $backend->amount['min'];
            }
            $max = empty($backend->amount['max']) ? $defMax : $backend->amount['max'];
            return $amount >= $min && $amount <= $max;
        };
    }
710800
public void setAdjustment(String name, String amount)
    {
        HashMap<String, String> adjustment = new HashMap<String, String>();
        adjustment.put("name", name);
        adjustment.put("amount", amount);
        this.adjustments.add(adjustment);
    }
895685
public function take_damage($amount)
    {
        if ($this->is_bound()) {
            $this->unbind();
        }
        if ($this->health()) {
            $this->health -= $amount;
            $this->say(sprintf(
                __('takes %1$s damage, %2$s health power left'),
                $amount,
                $this->health()
            ));
            if ($this->health() <= 0) {
                $this->position = null;
                $this->say(__("dies"));
            }
        }
    }
737309
protected function setAmountsPrecision($array)
    {
        $amounts = explode(',', str_replace(' ', '', $array['amounts']));
        unset($array['amounts']);
        $temp = [];

        try {
            foreach ($amounts as $amount) {
                $temp[] = bcadd($amount, '0', 8);
            }

            return array_merge(
                        ['amounts' => implode(',', array_values($temp))],
                        $array
                    );
        } catch (Exception $e) {
            $e->getMessage();
        }
    }
965117
public function setColumns(int $amount)
    {
        if (!$amount) {
            throw new InvalidArgumentException('Columns amount must be set');
        }

        if ($this->columns === $amount) {
            return $this;
        }

        foreach ($this->structure as &$v) {
            if ($this->columns < $amount) {
                // Add rows
                $v += $amount ? array_fill(0, $amount, $this->cell_example) : [];
            } else {
                // Remove rows from the end
                $v = \array_slice($v, 0, $amount);
            }
        }
        unset($v);

        $this->columns = $amount;

        return $this;
    }
1308437
public function authorize($amount = null)
    {
        if (is_null($amount)) {
            $amount = $this->getAmount()->total;
        }
        $path = sprintf('/%s/%s?payment_id=%s&amount=%s', self::SIMULATOR_PATH, 'authorize', $this->getId(), $amount);
        $response = $this->httpRequest($path, Requests::GET);

        if (empty($response)) {
            return true;
        }

        return false;
    }
1303816
public function random($amount = 1)
		{
			if ($this->isEmpty()) return;

			$keys = array_rand($this->items, $amount);

			return is_array($keys) ? array_intersect_key($this->items, array_flip($keys)) : $this->items[$keys];
		}
1298763
private function adjustAmountByStackQty($amount)
    {
        $qty = $this->getStackQty();

        if ($qty > 1) {
            $amount = $amount / $qty;
        }

        return $amount;
    }
599356
private static function roundHalfUp($amount)
    {
        $result = self::roundToNearestIntegerIgnoringTies($amount);

        if (null == $result) {
            $result = self::roundToNearestIntegerIgnoringTies(bcadd($amount, '0.1', self::BCSCALE));
        }

        return $result;
    }
108993
public function changeAmount($class, $id, $amount)
    {
        $this->loadFromCookies();
        if (
            !isset($this->items[$class]) ||
            !isset($this->items[$class][$id])
        )
        {
            return;
        }

        if ($amount < 1)
        {
            $this->removeItem($class, $id);
        }
        else
        {
            $this->items[$class][$id]['count'] = $amount;
        }
        $this->saveToCookies();
    }
547263
private static function roundHalfDown($amount)
    {
        $result = self::roundToNearestIntegerIgnoringTies($amount);

        if (null == $result) {
            $result = self::roundToNearestIntegerIgnoringTies(bcsub($amount, '0.1', self::BCSCALE));
        }

        return $result;
    }
615739
public function transpose($amount) {
		$func = function($n) use ($amount) {return \ianring\PMTObject::_truemod(($n + $amount), 12);};
		$this->tones = array_map($func, $this->tones);
	}
446677
protected function exchangeRateCalculate($rate, $amount)
    {
        // code
        $conv = $amount * $rate;
        $resque = round($conv, 2);
        return $resque;
    }
331278
public function incrementMajor($amount = 1)
    {
        $this->major += $amount;
        $this->minor = 0;
        $this->patch = 0;

        return $this;
    }
482566
public function set($amount, $currency)
    {
        if ($this->isAvailable($currency)) {
            $this->base = $amount * $this->rates[$currency];
        } else {
            throw new RuntimeException(sprintf(
                'Can not set main rate "%s" that do not belong to initial collection of rates', $currency
            ));
        }
    }