/** * Display the view * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void */ public function display($tpl = null) { //$this->state = $this->get('State'); $this->item = $this->get('Item'); //$this->form = $this->get('Form'); $comquick2cartHelper = new comquick2cartHelper(); $getPayoutFormData = $this->get('PayoutFormData'); $this->getPayoutFormData = $getPayoutFormData; //print_r($this->getPayoutFormData);die; $payee_options = array(); $payee_options[] = JHtml::_('select.option', '0', JText::_('COM_QUICK2CART_SELECT_PAYEE')); if (!empty($getPayoutFormData)) { foreach ($getPayoutFormData as $payout) { $amt = round($payout->total_amount); if ($amt > 0) { $username = $comquick2cartHelper->getUserName($payout->user_id); $payee_options[] = JHtml::_('select.option', $payout->user_id, $username); } } } $this->payee_options = $payee_options; // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } $this->addToolbar(); parent::display($tpl); }
function display($tpl = null) { global $mainframe, $option; $mainframe = JFactory::getApplication(); $jinput = $mainframe->input; $option = $jinput->get('option'); //default layout is default $layout = $jinput->get('layout', 'payouts', 'STRING'); $this->setLayout($layout); //set toolbar $this->_setToolBar(); $filter_order_Dir = $mainframe->getUserStateFromRequest('com_quick2cart.filter_order_Dir', 'filter_order_Dir', 'desc', 'word'); $filter_type = $mainframe->getUserStateFromRequest('com_quick2cart.filter_order', 'filter_order', 'id', 'int'); if ($layout == 'payouts') { $payouts = $this->get('Payouts'); $this->payouts = $payouts; $total = $this->get('Total'); // use for pagination $this->total = $total; $pagination = $this->get('Pagination'); $this->pagination = $pagination; } if ($layout == 'edit_payout') { $comquick2cartHelper = new comquick2cartHelper(); $getPayoutFormData = $this->get('PayoutFormData'); $this->getPayoutFormData = $getPayoutFormData; $payee_options = array(); $payee_options[] = JHtml::_('select.option', '0', JText::_('Select payee')); if (!empty($getPayoutFormData)) { foreach ($getPayoutFormData as $payout) { $amt = round($payout->total_amount); if ($amt > 0) { $username = $comquick2cartHelper->getUserName($payout->user_id); $payee_options[] = JHtml::_('select.option', $payout->user_id, $username); } } } $this->payee_options = $payee_options; $task = $jinput->get('task'); $this->task = 'reports.' . $task; $payout_data = array(); if ($task == 'edit_pay') { $payout_data = $this->get('SinglePayoutData'); } $this->assignRef('payout_data', $payout_data); } $payee_name = $mainframe->getUserStateFromRequest('com_quick2cart', 'payee_name', '', 'string'); // $lists['payee_name']=$payee_name; $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_type; $this->lists = $lists; // FOR DISPLAY SIDE FILTER if (JVERSION >= 3.0) { $this->sidebar = JHtmlSidebar::render(); } parent::display($tpl); }
/** * $res is an object * */ function addPayoutEntry($order_id, $txnid, $status, $pg_plugin) { // GET BUSINESS EMAIL $plugin = JPluginHelper::getPlugin('payment', $pg_plugin); $pluginParams = json_decode($plugin->params); $businessPayEmial = ""; if (property_exists($pluginParams, 'business')) { $businessPayEmial = trim($pluginParams->business); } else { return array(); } $params = JComponentHelper::getParams('com_quick2cart'); $send_payments_to_owner = $params->get('send_payments_to_owner', 0); if ($pg_plugin == 'adaptive_paypal') { $comquick2cartHelper = new comquick2cartHelper(); $storeHelper = new storeHelper(); $adaptiveDetails = $storeHelper->getorderItemsStoreInfo($order_id); $Quick2cartModelReports = $comquick2cartHelper->loadqtcClass(JPATH_SITE . "/components/com_quick2cart/models/reports.php", 'Quick2cartModelReports'); $reportStatus = $status == 'C' ? 1 : 0; foreach ($adaptiveDetails as $userReport) { $Quick2cartModelpayment = new Quick2cartModelpayment(); $payDetail = $Quick2cartModelpayment->getPayoutId($txnid, $userReport['owner']); if (!empty($payDetail) && $payDetail['status'] == $reportStatus) { // payout already present mean $payDetail will not empty AND STATUS is same then dont process. // for new payout,thisl will not process break; } $post = array(); $post['id'] = empty($payDetail['id']) ? '' : $payDetail['id']; $post['user_id'] = $userReport['owner']; $post['payee_name'] = $comquick2cartHelper->getUserName($post['user_id']); $post['paypal_email'] = $userReport['store_email']; $post['transaction_id'] = $txnid; $post['payment_amount'] = $userReport['commissonCutPrice']; $post['payout_date'] = date('Y-m-d'); $post['status'] = $reportStatus; $post['payment_comment'] = "adaptive pay"; $Quick2cartModelReports->savePayout($post); } } }
echo JText::_('QTC_NAME'); ?> </th> <th><?php echo JText::_('QTC_REMAINING_AMOUNT'); ?> </th> </thead> <tbody> <?php $count = 1; foreach ($this->getpendingPayouts as $pay) { ?> <tr> <?php $uname = $comquick2cartHelper->getUserName($pay->user_id); $amt = (double) $pay->total_amount - $pay->fee; ?> <td><?php echo $uname; ?> </td> <td><?php echo $comquick2cartHelper->getFromattedPrice($amt); ?> </td> </tr> <?php if ($count >= 5) { break; }