/** * @param $row * @return DataRow or null */ public function filterRow(Gpf_Data_Row $row) { // optimized for speed if ($this->isBannerPreviewRequired) { $row->add('bannerpreview', $this->createBannerPreview($row)); } return $row; }
public function filterRow(Gpf_Data_Row $row) { $row->add('commissionsexist', Gpf::NO); if ($this->commissionsTable->findCampaignInCommExistsRecords($row->get("id"), $this->commissions)) { $row->set('commissionsexist', Gpf::YES); } $row->add('commissionsdetails', $this->commissionsTable->getCommissionsDescription($row->get("id"), $this->commissions, $this->getCommissionGroupId($row))); $row->set('name', $this->_localize($row->get('name'))); return parent::filterRow($row); }
private function processValues(Gpf_Data_Row $row) { $this->approvedCommissions += $row->get(Pap_Db_Table_Transactions::COMMISSION); $this->pendingCommissions += $row->get('pendingAmount'); $this->declinedCommissions += $row->get('declinedAmount'); if (!$row->contains('amounttopay')) { $row->add('amounttopay', $row->get(Pap_Db_Table_Transactions::COMMISSION)); } $this->amountToPay += $row->get('amounttopay'); $row->set(Pap_Db_Table_Transactions::COMMISSION, $this->round($row->get(Pap_Db_Table_Transactions::COMMISSION))); $row->set('pendingAmount', $this->round($row->get('pendingAmount'))); $row->set('declinedAmount', $this->round($row->get('declinedAmount'))); $row->set('amounttopay', $this->round($row->get('amounttopay'))); }
/** * @param $row * @return DataRow or null */ public function filterRow(Gpf_Data_Row $row) { if ($this->isColumnRequired('psales') || $this->isColumnRequired('pcommissions')) { $row->add('psales', $this->computePercentageValue($row->get('salesCount'), $this->subAffSaleCount)); $row->add('pcommissions', $this->computePercentageValue($row->get('commissions'), $this->subAffCommissions)); } return $row; }
/** * @param Gpf_Data_Row $row */ private function addVATData(Gpf_Data_Row $row) { try { $user = new Pap_Common_User(); $user->setId($row->get('userid')); $user->load(); } catch (Gpf_Exception $e) { $row->add('vat', $this->_('N/A')); $row->add('amounttopay', $this->_('N/A')); return; } $currency = Pap_Common_Utils_CurrencyUtils::getDefaultCurrency(); $payout = new Pap_Common_Payout($user, $currency, $row->get(Pap_Db_Table_Transactions::COMMISSION), null); if (!$payout->getApplyVat()) { $row->add('vat', $this->_('N/A')); $row->add('amounttopay', $row->get(Pap_Db_Table_Transactions::COMMISSION)); return; } $row->add('vat', $payout->getVatPercentage() . ' %'); $row->add('amounttopay', $payout->getAmountWithVat()); }
public function filterRow(Gpf_Data_Row $row) { $row->add('isdefault', Gpf::NO); if ($row->get('id') == Gpf_Settings::get(Pap_Settings::DEFAULT_MERCHANT_ID)) { $row->set('isdefault', Gpf::YES); } return $row; }