Ejemplo n.º 1
0
 public function calculate()
 {
     $this->purchase_fee_rate = ParamUtils::getPurchaseFeeRate($this->purchase);
     $this->discount_rate = ParamUtils::getPurchaseFeeDiscountRate($this->purchase_type);
     $this->total_fee_rate = $this->purchase_fee_rate * (100 - $this->discount_rate) / 100;
     $this->purchase_fee_rule = ParamUtils::getPurchaseFeeRule();
     $this->purchase_fee = NumberUtils::rounds($this->purchase * $this->total_fee_rate / 100, $this->purchase_fee_rule);
     $this->real_purchase = $this->purchase - $this->purchase_fee;
     $this->found_stock_rule = ParamUtils::getFoundStockRule();
     $this->found_stock = NumberUtils::rounds(100 * ($this->real_purchase / $this->nav), $this->found_stock_rule) / 100;
     $this->investment = $this->purchase + $this->transfer_fee + $this->other_fee;
     if ($this->purchase_type == MasterValueUtils::MV_OEF_PERCHASE_TYPE_DIVIDEND) {
         $this->fin_entry_id = 0;
         $this->jar_payment_id = 0;
     }
 }