add.

@param \Akaunting\Money\Money $addend

@throws \InvalidArgumentException

@return \Akaunting\Money\Money
971348
public function add(self $addend)
    {
        $this->assertSameCurrency($addend);

        return new self($this->amount + $addend->amount, $this->currency);
    }
661474
public function create($amount, $currency)
    {
        $result = new Money($amount, $currency);
        $this->validator->validateMoney($result);
        return $result;
    }
292372
public function add($obj)
    {
        if (!$this->isAcceptable($obj)) {
            throw new InvalidArgumentException(
                sprintf(
                    'Must be a model, received %s',
                    (is_object($obj) ? get_class($obj) : gettype($obj))
                )
            );
        }

        $key = $this->modelKey($obj);
        $this->objects[$key] = $obj;

        return $this;
    }
1162544
public function setGiftCertificateAmount(Money $money = null): OrderInterface
    {
        $this->giftCertificateAmount = $money->getAmount();

        return $this;
    }
1051621
public function convertTo(Currency $currency)
    {
        if ($this->currency->getCode() === $currency->getCode()) {
            return $this;
        }

        $baseAmount = $this->amount;

        if ($this->currency->getCode() !== static::baseCurrency()->getCode()) {
            $baseAmount = static::localAmountToDefault($this->amount, $this->currency);
        }

        return new static(
            static::baseAmountToLocal($baseAmount, $currency), $currency
        );
    }
219566
public function getAmount($amount)
    {
        if (!is_float($amount) &&
            $this->getCurrencyDecimalPlaces() > 0 &&
            false === strpos((string) $amount, '.')) {
            throw new InvalidArgumentException(
                'Please specify amount as a string or float, '.
                'with decimal places (e.g. \'10.00\' to represent $10.00).'
            );
        }

        return $this->formatCurrency($amount);
    }
1366964
public function addOnAmount()
    {
        $totalAddOn = 0;

        foreach ($this->transaction->addOns as $addOn) {
            $totalAddOn += $addOn->amount * ($addOn->quantity ?? 1);
        }

        return (float) $totalAddOn;
    }
1151945
public function setAmount($amount)
    {
        if ($amount === null) {
            $this->amount = 0;
            return $this;
        }
        
        if (!is_int($amount)) {
            throw new InvalidArgumentException(sprintf(
                'Amount must be an integer, "%s" given',
                is_object($amount) ? get_class($amount) : gettype($amount)
            ));
        }
        
        // Overflow check is not necessary because we have an integer
        $this->amount = $amount;
        return $this;
    }
997089
protected function addInvoice($money, $options)
    {
        $this->xml->TxnDetails(null, 'Transaction')
            ->merchantreference($options['order_id'], 'TxnDetails')
            ->amount($this->amount($money), 'TxnDetails', array('currency'=> static::$default_currency));
        $captureMethod = static::METHOD_ECOMM; # For 3D Secure or No 3D Secure transactions.
        if ($options['moto']) {# MOTO transactions.
            $captureMethod = static::METHOD_MOTO;
        }
        $this->xml->capturemethod($captureMethod, 'TxnDetails');
        if ($options['installments']) {
            $this->xml->Instalments(null, 'TxnDetails');
            $this->xml->number($options['installments'], 'Installments');
        }
    }
186754
public function add(Integer $quantity)
    {
        $amount = new Integer($this->getAmount()->toNative() + $quantity->toNative());
        $result = new self($amount, $this->getCurrency());

        return $result;
    }
102721
public function append($value)
    {
        if (!$value instanceof $this->currencyClass) {
            throw new \InvalidArgumentException(sprintf('$newval must be an instance of Currency, instance of "%s" given', get_class($value)));
        }

        parent::append($value);
    }
1305616
public function setTotalPrice(Money $totalPrice = null)
    {
        $this->totalPrice = $totalPrice ? $totalPrice->getAmount() : $totalPrice;

        return $this;
    }
1136544
public function add($amount)
    {
        if ($amount instanceof FeeContract) {
            $amount = $amount->get($this);
        }

        throw_unless($amount instanceof Amount, BadMethodCallException::class);

        return new static(
            $this->amount + $amount->convertTo($this->currency())->amount,
            $this->currency()
        );
    }
1212330
public function setTotalPrice(Money $money = null): OrderInterface
    {
        $this->totalPrice = $money->getAmount();

        return $this;
    }
1056891
public function add(Money $money)
    {
        if (!$this->currency->equals($money->getCurrency())) {
            throw new CurrencyMismatchException($this.' does not match '.$money);
        }

        $amount = bcadd($this->amount, $money->getAmount(), self::BCSCALE);

        return self::valueOf($amount, $this->currency);
    }
172725
private function addInvoice($money, $options, $action)
    {
        $this->xml->OrderInfo(null, $action)
            ->OrderId($options['order_id'], 'OrderInfo')
            ->OrderDesc($options['order_id'], 'OrderInfo')
            ->OrderAmount($this->amount($money), 'OrderInfo')
            ->Currency(static::$default_currency, 'OrderInfo')
            ->PayerEmail("", 'OrderInfo');
        if (true == $options['moto']) {
            $this->xml->MOTO(1, 'OrderInfo');
        }
    }
1257108
public function setAmount($amount)
    {
      if(!is_int($amount) || $amount < 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid amount, must be a positive integer');

      $this->amount = $amount;
    }