/** * Get transfer screen steps configuration object by client account * * @param ClientAccount $account * @return TransferStepsConfigurationInterface * @throws \InvalidArgumentException */ private function getStepsConfiguration(ClientAccount $account) { $type = $account->getSystemType(); switch ($type) { case SystemAccount::TYPE_PERSONAL_INVESTMENT: $stepsConfiguration = new PersonalAccountConfiguration($this->adm, $account); break; case SystemAccount::TYPE_JOINT_INVESTMENT: $stepsConfiguration = new JointAccountConfiguration($this->adm, $account); break; case SystemAccount::TYPE_TRADITIONAL_IRA: $stepsConfiguration = new TraditionalIraAccountConfiguration($this->adm, $account); break; case SystemAccount::TYPE_ROTH_IRA: $stepsConfiguration = new RothIraAccountConfiguration($this->adm, $account); break; case SystemAccount::TYPE_RETIREMENT: $stepsConfiguration = new RetirementAccountConfiguration($this->adm, $account); break; default: throw new \InvalidArgumentException(sprintf('Invalid value of account system_type: $s.', $type)); break; } return $stepsConfiguration; }
public function getBeneficiariesShareForAccount(ClientAccount $account, $type) { $dql = "SELECT SUM(b.share) as percent\n FROM WealthbotClientBundle:Beneficiary b\n WHERE b.account_id = :account_id AND b.type = :type GROUP BY b.account_id"; $query = $this->getEntityManager()->createQuery($dql); $query->setMaxResults(1)->setParameters(array('account_id' => $account->getId(), 'type' => $type)); $result = $query->getOneOrNullResult(2); return round($result['percent'], 2); }
/** * Get previous transfer screen step by current step * * @param string $currentStep * @return string * @throws \InvalidArgumentException */ public function getPreviousStep($currentStep) { switch ($currentStep) { case ClientAccount::STEP_ACTION_CREDENTIALS: $prevStep = ''; break; case ClientAccount::STEP_ACTION_FINISHED: $prevStep = ClientAccount::STEP_ACTION_CREDENTIALS; break; default: throw new \InvalidArgumentException(sprintf('Invalid value of step: "%s" for account with system_type: "%s"', $this->account->getSystemTypeAsString(), $currentStep)); break; } return $prevStep; }
/** * Is account has funding section * * @return bool */ private function hasFundingSection() { if ($this->account->hasFunding() || $this->account->hasDistributing() || $this->account->hasGroup(AccountGroup::GROUP_DEPOSIT_MONEY) || $this->adm->hasElectronicallySignError($this->account)) { return true; } return false; }
private function getAccountTypeTabValue() { $systemType = $this->account->getSystemType(); $type = $this->account->getTypeName(); $result = ''; switch ($systemType) { case SystemAccount::TYPE_PERSONAL_INVESTMENT: $result = 'individual'; break; case SystemAccount::TYPE_JOINT_INVESTMENT: $result = 'joint'; break; case SystemAccount::TYPE_ROTH_IRA: $result = 'roth_ira'; break; case SystemAccount::TYPE_TRADITIONAL_IRA: if ($type == 'SEP IRA') { $result = 'sep_ira'; } elseif ($type == 'SIMPLE IRA') { $result = 'simple_ira'; } else { $result = 'traditional_or_rollover_ira'; } break; case SystemAccount::TYPE_RETIREMENT: $result = 'qualified_retirement_plan'; break; } return $result; }
/** * Generate collection of tabs * * @return TabCollection */ public function generate() { $client = $this->account->getClient(); $ria = $client->getRia(); $companyInfo = $ria->getRiaCompanyInformation(); $primaryApplicant = $this->account->getPrimaryApplicant(); $tabs = array(); $advisorCode = new TextTab(); $advisorCode->setTabLabel('advisor#')->setValue($this->getAdvisorCode($companyInfo)); $tabs[] = $advisorCode; $accountNumber = new TextTab(); $accountNumber->setTabLabel('account#')->setValue($this->account->getAccountNumber()); $tabs[] = $accountNumber; $firmName = new TextTab(); $firmName->setTabLabel('firm_name')->setValue($companyInfo->getName()); $tabs[] = $firmName; $primaryContact = new TextTab(); $primaryContact->setTabLabel('primary_contact')->setValue($companyInfo->getPrimaryFirstName() . ' ' . $companyInfo->getPrimaryLastName()); $tabs[] = $primaryContact; $accountTypeTab = new RadioGroupTab(); $accountTypeTab->setGroupName('account_type')->setValue('cash')->setSelected(true); $tabs[] = $accountTypeTab; $ownerTabs = $this->getOwnerInformationTabs($primaryApplicant); $type = new RadioGroupTab(); $type->setGroupName('type')->setSelected(true); if ($this->account->isJointType()) { $type->setValue('joint'); } else { $type->setValue('individual'); } $tabs[] = $type; $tabs = array_merge($tabs, $ownerTabs); if ($this->account->isJointType()) { $jointOwnerTabs = $this->getOwnerInformationTabs($this->account->getSecondaryApplicant(), true); $tabs = array_merge($tabs, $jointOwnerTabs); } $cashSweepTab = new RadioGroupTab(); $cashSweepTab->setGroupName('cash_sweep_vehicle')->setValue('td_ameritrade_fdic')->setSelected(true); $tabs[] = $cashSweepTab; return new TabCollection($tabs); }
/** * Get type of account tab value * * @param ClientAccount $account * @return string */ private function getAccountTypeTabValue(ClientAccount $account) { $systemType = $account->getSystemType(); $type = $account->getTypeName(); switch ($systemType) { case SystemAccount::TYPE_ROTH_IRA: $result = 'roth_ira'; break; case SystemAccount::TYPE_TRADITIONAL_IRA: if ($type == 'SEP IRA') { $result = 'sep_ira'; } elseif ($type == 'SIMPLE IRA') { $result = 'simple_ira'; } else { $result = 'traditional_ira'; } break; default: $result = ''; break; } return $result; }
/** * Get accountOwners * * @return \Doctrine\Common\Collections\Collection */ public function getAccountOwners() { return parent::getAccountOwners(); }
/** * Find account application workflow * * @param ClientAccount $account * @return Workflow|null */ public function findAccountApplicationWorkflow(ClientAccount $account) { $messageCodes = array(Workflow::MESSAGE_CODE_PAPERWORK_NEW_ACCOUNT, Workflow::MESSAGE_CODE_PAPERWORK_TRANSFER, Workflow::MESSAGE_CODE_PAPERWORK_ROLLOVER); $qb = $this->createQueryBuilder('w'); $qb->where('w.client = :client')->andWhere('w.object_id = :account_id')->andWhere($qb->expr()->in('w.message_code', $messageCodes))->setMaxResults(1)->setParameters(array('client' => $account->getClient(), 'account_id' => $account->getId())); return $qb->getQuery()->getOneOrNullResult(); }
/** * Returns true if transfer account cannot use electronically signing * and ria does not allow non electronically signing * * @param ClientAccount $account * @return bool */ public function hasElectronicallySignError(ClientAccount $account) { if ($account->hasGroup(AccountGroup::GROUP_FINANCIAL_INSTITUTION) && !$this->isUsedDocusign($account->getId())) { $ria = $account->getClient()->getRia(); $riaCompanyInfo = $ria->getRiaCompanyInformation(); if ($riaCompanyInfo && !$riaCompanyInfo->getAllowNonElectronicallySigning()) { return true; } } return false; }
/** * Is account owner sign all document signatures for application * * @param AccountOwnerInterface $accountOwner * @param ClientAccount $account * @return bool */ public function isOwnerSignApplication(AccountOwnerInterface $accountOwner, ClientAccount $account) { $signatures = $this->findSignaturesByAccountConsolidatorId($account->getId()); foreach ($signatures as $signature) { if (!$this->isOwnerSignatureCompleted($accountOwner, $signature)) { return false; } } return true; }
/** * Update account and account owners signatures * * @param ClientAccount $account * @param string $type * @return \Wealthbot\SignatureBundle\Entity\DocumentSignature */ public function updateAccountSignatureStatusByAccountAndType(ClientAccount $account, $type) { $signature = $this->signatureManager->findActiveDocumentSignatureBySourceIdAndType($account->getId(), $type); if ($signature) { $this->updateDocumentSignaturesStatusByEnvelopeId($signature->getDocusignEnvelopeId(), array($signature)); } return $signature; }