Beispiel #1
0
 public function subtract(Utils_CurrencyField_Value $other, $report_error = true)
 {
     if ($this->get_currency_id() == $other->get_currency_id()) {
         $this->subtract_amount($other->get_amount());
     } elseif ($report_error) {
         $msg = "Can't subtract two values of different currencies.";
         throw new Utils_CurrencyField_CurrencyMismatchException($msg);
     }
 }
Beispiel #2
0
 public function add(Utils_CurrencyField_Value $value)
 {
     $sum = $this->get_currency_sum($value->get_currency_id());
     $sum->add($value);
 }