Пример #1
0
 /**
  * @param string $date
  */
 protected function calculateClientPortfolioValue($date)
 {
     $clientAccountValues = $this->clientAccountValueRepo->getAllSumByDate($date);
     foreach ($clientAccountValues as $clientAccountValue) {
         $model = new ClientPortfolioValueModel();
         $model->setClientPortfolioId($clientAccountValue->getClientPortfolioId());
         $model->setTotalValue($clientAccountValue->getTotalValue());
         $model->setTotalInSecurities($clientAccountValue->getTotalInSecurities());
         $model->setTotalCashInAccounts($clientAccountValue->getTotalCashInAccount());
         $model->setTotalCashInMoneyMarket($clientAccountValue->getTotalCashInMoneyMarket());
         $model->setSasCash($clientAccountValue->getSasCash());
         $model->setCashBuffer($clientAccountValue->getCashBuffer());
         $model->setBillingCash($clientAccountValue->getBillingCash());
         $model->setDate($date);
         // Save client portfolio value
         $this->clientPortfolioValueRepo->save($model);
     }
 }