amount_usdollar) && !empty($this->amount)) { $this->amount_usdollar = $this->amount; } } function fill_in_additional_detail_fields() { parent::fill_in_additional_detail_fields(); //Ensure that the amount_usdollar field is not null. if (empty($this->amount_usdollar) && !empty($this->amount)) { $this->amount_usdollar = $this->amount; } } function save($check_notify = FALSE) { //"amount_usdollar" is really amount_basecurrency. We need to save a copy of the amount in the base currency. if(isset($this->amount) && !number_empty($this->amount)){ if (!number_empty($this->currency_id)) { $currency = new Currency(); $currency->retrieve($this->currency_id); $this->amount_usdollar = $currency->convertToDollar($this->amount); } else { $this->amount_usdollar = $this->amount; } } return parent::save($check_notify); } } ?>