/** @inheritdoc} */ public function getProfitLeader(MlmSystemProfit $instance) { $profit = $this->getProfit($instance); $profitLeader = $this->MlmSystem->getOption('profit_leader', null, 0); $profitLeader = $this->MlmSystem->Tools->getPercent($profit, $profitLeader); return $profitLeader; }
/** @inheritdoc} */ public function getInitiator(array $scriptProperties = array()) { $initiator = null; if ($order = $this->MlmSystem->getOption('order', $scriptProperties, null)) { $initiator = $order->getOne('User')->getOne('MlmSystemClient'); } return $initiator; }
public function afterSave() { if ($client = $this->modx->getObject('MlmSystemClient', array('id' => $this->object->get('id')))) { $clientStatus = $this->getProperty('status', $client->getStatusCreate()); $this->MlmSystem->Tools->changeClientStatus($client, $clientStatus); $parent = $this->getProperty('parent', $this->MlmSystem->getOption('referrer_default_client', null, 0)); if (!empty($parent)) { $this->MlmSystem->Tools->changeClientParent($client, $parent); } } return parent::afterSave(); }
/** @inheritdoc} */ public function formatOutcoming($sum = '0') { $pf = $this->modx->fromJSON($this->MlmSystem->getOption('format_outcoming', null, '[2, ".", " "]')); $noZeros = $this->MlmSystem->getOption('format_outcoming_no_zeros', null, true); return $this->sumFormat($sum, $pf, $noZeros); }