Example #1
0
 function display($tpl = null)
 {
     TOOLBAR_enmasse::_SMENU();
     TOOLBAR_enmasse::_REPORT();
     $task = JRequest::getVar('task');
     $dealList = JModel::getInstance('deal', 'enmasseModel')->listConfirmed();
     $this->assignRef('dealList', $dealList);
     $filter = JRequest::getVar('filter');
     $this->assignRef('filter', $filter);
     $dealId = $filter['deal_id'];
     if (!empty($dealId)) {
         $deal = JModel::getInstance('deal', 'enmasseModel')->getById($dealId);
         $this->assignRef('deal', $deal);
         $orderItemList = JModel::getInstance('orderItem', 'enmasseModel')->listByPdtIdAndStatus($dealId, "Delivered");
         for ($count = 0; $count < count($orderItemList); $count++) {
             $orderItemList[$count]->invtyList = JModel::getInstance('invty', 'enmasseModel')->listByOrderItemId($orderItemList[$count]->id);
             $orderItemList[$count]->order = JModel::getInstance('order', 'enmasseModel')->getById($orderItemList[$count]->order_id);
         }
         $this->assignRef('orderItemList', $orderItemList);
     } else {
         $orderItemList = array();
         $this->assignRef('orderItemList', $orderItemList);
     }
     /// load pagination
     $pagination = JModel::getInstance('orderItem', 'enmasseModel')->getPagination();
     $this->assignRef('pagination', $pagination);
     parent::display($tpl);
 }
Example #2
0
 public function display($tpl = null)
 {
     TOOLBAR_enmasse::_SMENU();
     $task = JRequest::getWord('task');
     switch ($task) {
         case 'show':
             TOOLBAR_enmasse::_BILLTEMPLATE();
             $this->arBillTmpl = JModel::getInstance('billTemplate', 'enmasseModel')->listAll();
             break;
         case 'edit':
             TOOLBAR_enmasse::_BILLTEMPLATE_EDIT();
             $cid = JRequest::getVar('cid', array(), 'method', 'array');
             if (!empty($cid)) {
                 $this->oBillTmpl = JModel::getInstance('billTemplate', 'enmasseModel')->getById($cid[0]);
                 if (!$this->oBillTmpl->id) {
                     $link = JRoute::_('index.php?option=com_enmasse&controller=billTemplate&task=show');
                     $msg = JText::_('BILL_TEMPLATE_INVALID_TEMPLATE_MSG');
                     JFactory::getApplication()->redirect($link, $msg, 'error');
                 }
             } else {
                 $link = JRoute::_('index.php?option=com_enmasse&controller=billTemplate&task=show');
                 $msg = JText::_('BILL_TEMPLATE_INVALID_TEMPLATE_MSG');
                 JFactory::getApplication()->redirect($link, $msg, 'error');
             }
             break;
     }
     parent::display($tpl);
 }
Example #3
0
 public function display($tpl = null)
 {
     $task = JRequest::getWord('task');
     TOOLBAR_enmasse::_SMENU();
     TOOLBAR_enmasse::_PARTIAL_ORDER();
     $filter = JRequest::getVar('filter', array());
     // Weird that only this will caused warning...
     if (!isset($filter['deal_name'])) {
         $filter['deal_name'] = "";
     }
     if (!isset($filter['deal_code'])) {
         $filter['deal_code'] = "";
     }
     if (!isset($filter['status'])) {
         $filter['status'] = "";
     }
     if (!isset($filter['year'])) {
         $filter['year'] = "";
     }
     if (!isset($filter['month'])) {
         $filter['month'] = "";
     }
     //filter partial order
     $filter['partial'] = true;
     JRequest::setVar('filter', $filter);
     $oOrderModel = JModel::getInstance('order', 'enmasseModel');
     $orderList = $oOrderModel->search($filter['status'], $filter['deal_code'], $filter['deal_name'], "created_at", "DESC", true);
     $pagination = $oOrderModel->getPagination();
     $this->statusList = EnmasseHelper::$ORDER_STATUS_LIST;
     $this->filter = $filter;
     $this->orderList = $orderList;
     $this->pagination = $pagination;
     $this->deliveryPersons = EnmasseHelper::getDeliveryPersons();
     parent::display($tpl);
 }
Example #4
0
 function display($tpl = null)
 {
     $task = JRequest::getWord('task');
     if ($task == 'edit') {
         $cid = JRequest::getVar('cid', array(0), '', 'array');
         TOOLBAR_enmasse::_CATEGORY_NEW();
         $category = JModel::getInstance('category', 'enmasseModel')->getById($cid[0]);
         $this->assignRef('category', $category);
     } elseif ($task == 'add') {
         TOOLBAR_enmasse::_CATEGORY_NEW();
     } else {
         TOOLBAR_enmasse::_SMENU();
         $nNumberOfCategories = JModel::getInstance('category', 'enmasseModel')->countAll();
         if ($nNumberOfCategories == 0) {
             TOOLBAR_enmasse::_CATEGORY_EMPTY();
         } else {
             TOOLBAR_enmasse::_CATEGORY();
         }
         /// load pagination
         $pagination = $this->get('Pagination');
         $state = $this->get('state');
         // get order values
         $order['order_dir'] = $state->get('filter_order_dir');
         $order['order'] = $state->get('filter_order');
         $categoryList = JModel::getInstance('category', 'enmasseModel')->search();
         $this->assignRef('categoryList', $categoryList);
         $this->assignRef('pagination', $pagination);
         $this->assignRef('order', $order);
     }
     parent::display($tpl);
 }
Example #5
0
 function display($tpl = null)
 {
     TOOLBAR_enmasse::_SMENU();
     TOOLBAR_enmasse::_EHELP();
     //$this->addToolBar();
     parent::display($tpl);
 }
Example #6
0
 function display($tpl = null)
 {
     $cid = JRequest::getVar('cid', array(0), '', 'array');
     TOOLBAR_enmasse::_SMENU();
     TOOLBAR_enmasse::_SETTING();
     $setting = JModel::getInstance('setting', 'enmasseModel')->getSetting($cid[0]);
     $countryJOptList = JModel::getInstance('setting', 'enmasseModel')->listCountryJOpt('country', $setting->country, true);
     $taxList = JModel::getInstance('tax', 'enmasseModel')->listAllPublished();
     $this->assignRef('setting', $setting);
     $this->assignRef('countryJOptList', $countryJOptList);
     $this->assignRef('taxList', $taxList);
     $this->userGroupList = EnmasseHelper::getJoomlaUserGroups();
     parent::display($tpl);
 }
Example #7
0
 function display($tpl = null)
 {
     $task = JRequest::getWord('task');
     if ($task == 'edit' || $task == 'add') {
         TOOLBAR_enmasse::_TAXES_NEW();
         $cid = JRequest::getVar('cid', array(0), '', 'array');
         $row = JModel::getInstance('tax', 'enmasseModel')->getById($cid[0]);
         $this->assignRef('tax', $row);
     } else {
         TOOLBAR_enmasse::_SMENU();
         TOOLBAR_enmasse::_TAXES();
         $taxList = JModel::getInstance('tax', 'enmasseModel')->listAll();
         $this->assignRef('taxList', $taxList);
     }
     parent::display($tpl);
 }
Example #8
0
 function display($tpl = null)
 {
     $task = JRequest::getWord('task');
     if ($task == 'edit' || $task == 'add') {
         $cid = JRequest::getVar('cid', array(0), '', 'array');
         TOOLBAR_enmasse::_EMAILTEMPLATE_NEW();
         $emailTemplate = JModel::getInstance('emailTemplate', 'enmasseModel')->getById($cid[0]);
         $this->assignRef('emailTemplate', $emailTemplate);
     } else {
         TOOLBAR_enmasse::_SMENU();
         TOOLBAR_enmasse::_EMAILTEMPLATE();
         $emailTemplateList = JModel::getInstance('emailTemplate', 'enmasseModel')->listAll();
         $this->assignRef('emailTemplateList', $emailTemplateList);
     }
     parent::display($tpl);
 }
Example #9
0
 function display($tpl = null)
 {
     $task = JRequest::getWord('task');
     if ($task == 'edit' || $task == 'add') {
         JRequest::setVar('hidemainmenu', true);
         TOOLBAR_enmasse::_MERCHANT_NEW();
         $cid = JRequest::getVar('cid', array(0), '', 'array');
         $merchant = JTable::getInstance('merchant', 'Table');
         if (!$merchant->load($cid['0'])) {
             JError::raiseError(500, $merchant->getError());
             return;
         }
         //populate pre-value was save in session if the data exist
         $data = JFactory::getApplication()->getUserState('merchant.add.data');
         $merchant->bind($data);
         $this->merchant = $merchant;
         $salesPersonList = JModel::getInstance('salesPerson', 'enmasseModel')->listAllPublished();
         $this->salesPersonList = $salesPersonList;
     } else {
         TOOLBAR_enmasse::_SMENU();
         $nNumberOfMerchants = JModel::getInstance('merchant', 'enmasseModel')->countAll();
         if ($nNumberOfMerchants == 0) {
             TOOLBAR_enmasse::_MERCHANT_EMPTY();
         } else {
             TOOLBAR_enmasse::_MERCHANT();
         }
         $filter = JRequest::getVar('filter');
         $merchantList = JModel::getInstance('merchant', 'enmasseModel')->search($filter['name']);
         /// load pagination
         $pagination = $this->get('pagination');
         $state = $this->get('state');
         // get order values
         $order['order_dir'] = $state->get('filter_order_dir');
         $order['order'] = $state->get('filter_order');
         for ($count = 0; $count < count($merchantList); $count++) {
             $salesPerson = JModel::getInstance('salesPerson', 'enmasseModel')->getById($merchantList[$count]->sales_person_id);
             $merchantList[$count]->sales_person_name = $salesPerson->name;
         }
         $this->assignRef('filter', $filter);
         $this->assignRef('merchantList', $merchantList);
         $this->assignRef('pagination', $pagination);
         $this->assignRef('order', $order);
     }
     parent::display($tpl);
 }
Example #10
0
 function display($tpl = null)
 {
     $task = JRequest::getWord('task');
     if ($task == 'editElement' || $task == 'addElement') {
         $id = JRequest::getVar('elementId');
         TOOLBAR_enmasse::_COUPONELEMENT_NEW();
         $element = JModel::getInstance('couponElement', 'enmasseModel')->getById($id);
         $this->assignRef('element', $element);
     } else {
         TOOLBAR_enmasse::_SMENU();
         TOOLBAR_enmasse::_COUPON();
         $couponBgUrl = JModel::getInstance('coupon', 'enmasseModel')->getCouponBgUrl();
         $couponElementList = JModel::getInstance('couponElement', 'enmasseModel')->listAll();
         $this->assignRef('couponBgUrl', $couponBgUrl);
         $this->assignRef('couponElementList', $couponElementList);
     }
     parent::display($tpl);
 }
Example #11
0
 function display($tpl = null)
 {
     TOOLBAR_enmasse::_SMENU();
     $nNumberOfSpammers = JModel::getInstance('commentSpammer', 'EnmasseModel')->countAll();
     if ($nNumberOfSpammers == 0) {
         TOOLBAR_enmasse::_COMMENT_SPAMMER_EMPTY();
     } else {
         TOOLBAR_enmasse::_COMMENT_SPAMMER();
     }
     /// load pagination
     $pagination = $this->get('Pagination');
     $state = $this->get('state');
     // get order values
     $order['order_dir'] = $state->get('filter_order_dir');
     $order['order'] = $state->get('filter_order');
     $spammerList = JModel::getInstance('CommentSpammer', 'EnmasseModel')->search();
     $this->assignRef('spammerList', $spammerList);
     $this->assignRef('pagination', $pagination);
     $this->assignRef('order', $order);
     parent::display($tpl);
 }
Example #12
0
 # Websites: http://www.matamko.com
 # Technical Support:  Visit our forum at www.matamko.com
 -------------------------------------------------------------------------*/
defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.view');
require_once JPATH_ADMINISTRATOR . DS . "components" . DS . "com_enmasse" . DS . "toolbar.enmasse.html.php";
class EnmasseViewSalesPerson extends JView
{
    function display($tpl = null)
    {
        $task = JRequest::getWord('task');
        if ($task == 'edit' || $task == 'add') {
            JRequest::setVar('hidemainmenu', true);
            TOOLBAR_enmasse::_SALESPERSON_NEW();
            $cid = JRequest::getVar('cid', array(0), '', 'array');
            $oSale = JTable::getInstance('salesPerson', 'Table');
            if (!$oSale->load($cid[0])) {
                JError::raiseError(500, $oSale->getError());
                return;
            }
            //ovveride the object with data was saved in the session
            $data = JFactory::getApplication()->getUserState('salesperson.add.data');
            $oSale->bind($data);
            $this->salesPerson = $oSale;
        } else {
            TOOLBAR_enmasse::_SMENU();
            $nNumberOfSales = JModel::getInstance('salesPerson', 'enmasseModel')->countAll();
            if ($nNumberOfSales == 0) {
                TOOLBAR_enmasse::_SALESPERSON_EMPTY();
            } else {
                TOOLBAR_enmasse::_SALESPERSON();
            }
            $filter = JRequest::getVar('filter');
            $salesPersonList = JModel::getInstance('salesPerson', 'enmasseModel')->search($filter['name']);
            // load pagination
            $pagination = JModel::getInstance('salesPerson', 'enmasseModel')->getPagination($filter['name']);
            $state = $this->get('state');
            // get order values
            $order['order_dir'] = $state->get('filter_order_dir');
Example #13
0
 function display($tpl = null)
 {
     $task = JRequest::getWord('task');
     if ($task == 'edit') {
         TOOLBAR_enmasse::_LOCATION_NEW();
         $cid = JRequest::getVar('cid', array(0), '', 'array');
         $row = JModel::getInstance('location', 'enmasseModel')->getById($cid[0]);
         $this->assignRef('location', $row);
     } elseif ($task == 'add') {
         TOOLBAR_enmasse::_LOCATION_NEW();
     } else {
         /// load pagination
         $pagination =& $this->get('Pagination');
         $state =& $this->get('state');
         // get order values
         $order['order_dir'] = $state->get('filter_order_dir');
         $order['order'] = $state->get('filter_order');
         TOOLBAR_enmasse::_SMENU();
         $nNumberOfLocations = JModel::getInstance('location', 'enmasseModel')->countAll();
         if ($nNumberOfLocations == 0) {
             TOOLBAR_enmasse::_LOCATION_EMPTY();
         } else {
             //------------------------
             //gemerate integration class
             $integrateFileName = EnmasseHelper::getSubscriptionClassFromSetting() . '.class.php';
             $integrationClass = EnmasseHelper::getSubscriptionClassFromSetting();
             require_once JPATH_SITE . DS . "components" . DS . "com_enmasse" . DS . "helpers" . DS . "subscription" . DS . $integrationClass . DS . $integrateFileName;
             $integrationObject = new $integrationClass();
             $integrationObject->addMenu();
             TOOLBAR_enmasse::_LOCATION();
         }
         $locationList = JModel::getInstance('location', 'enmasseModel')->search();
         $this->assignRef('locationList', $locationList);
         $this->assignRef('pagination', $pagination);
         $this->assignRef('order', $order);
     }
     parent::display($tpl);
 }
Example #14
0
 function display($tpl = null)
 {
     $task = JRequest::getWord('task');
     $model = JModel::getInstance('payGty', 'enmasseModel');
     if ($task == 'edit') {
         TOOLBAR_enmasse::_PAY_GTY_NEW();
         $cid = JRequest::getVar('cid', array(0), '', 'array');
         $row = JModel::getInstance('payGty', 'enmasseModel')->getById($cid[0]);
         $this->assignRef('payGty', $row);
     } elseif ($task == 'add') {
         TOOLBAR_enmasse::_PAY_GTY_NEW();
     } else {
         TOOLBAR_enmasse::_SMENU();
         $nNumberOfPayGtys = JModel::getInstance('payGty', 'enmasseModel')->countAll();
         if ($nNumberOfPayGtys == 0) {
             TOOLBAR_enmasse::_PAY_GTY_EMPTY();
         } else {
             TOOLBAR_enmasse::_PAY_GTY();
         }
         $payGtyList = JModel::getInstance('payGty', 'enmasseModel')->listAll();
         $this->assignRef('payGtyList', $payGtyList);
     }
     parent::display($tpl);
 }
Example #15
0
 function display($tpl = null)
 {
     $task = JRequest::getWord('task');
     TOOLBAR_enmasse::_SMENU();
     $nNumberOfDeals = JModel::getInstance('deal', 'enmasseModel')->countAll();
     if ($nNumberOfDeals == 0) {
         TOOLBAR_enmasse::_DEAL_EMPTY();
     } else {
         TOOLBAR_enmasse::_SALE_REPORTS();
     }
     $filter = JRequest::getVar('filter');
     $filter['code'] = isset($filter['code']) ? $filter['code'] : '';
     $filter['name'] = isset($filter['name']) ? $filter['name'] : '';
     $filter['saleperson_id'] = isset($filter['saleperson_id']) ? $filter['saleperson_id'] : '';
     $filter['merchant_id'] = isset($filter['merchant_id']) ? $filter['merchant_id'] : '';
     $filter['fromdate'] = isset($filter['fromdate']) ? $filter['fromdate'] : '';
     $filter['todate'] = isset($filter['todate']) ? $filter['todate'] : '';
     $currency_prefix = JModel::getInstance('setting', 'enmasseModel')->getCurrencyPrefix();
     $dealList = JModel::getInstance('salereports', 'enmasseModel')->search($filter['code'], $filter['name'], $filter['saleperson_id'], $filter['merchant_id'], $filter['fromdate'], $filter['todate']);
     /// load pagination
     $pagination = JModel::getInstance('salereports', 'enmasseModel')->getPagination($filter['code'], $filter['name'], $filter['saleperson_id'], $filter['merchant_id'], $filter['fromdate'], $filter['todate']);
     $state = $this->get('state');
     for ($i = 0; $i < count($dealList); $i++) {
         $dealCategoryIdList = JModel::getInstance('dealcategory', 'enmasseModel')->getCategoryByDealId($dealList[$i]->id);
         $dealLocationIdList = JModel::getInstance('deallocation', 'enmasseModel')->getLocationByDealId($dealList[$i]->id);
         //----------------------------------------------
         // get list of category name
         if (count($dealCategoryIdList) != 0) {
             $categoryList = JModel::getInstance('category', 'enmasseModel')->getCategoryListInArrId($dealCategoryIdList);
         } else {
             $categoryList = null;
         }
         //----------------------------------------------
         // get list of location name
         if (count($dealLocationIdList) != 0) {
             $locationList = JModel::getInstance('location', 'enmasseModel')->getLocationListInArrId($dealLocationIdList);
         } else {
             $locationList = null;
         }
         if (count($locationList) != 0 && $locationList != null) {
             $dealList[$i]->location_name = $locationList;
         } else {
             $dealList[$i]->location_name = null;
         }
         if (count($categoryList) != 0 && $categoryList != null) {
             $dealList[$i]->category_name = $categoryList;
         } else {
             $dealList[$i]->category_name = null;
         }
         $dealList[$i]->sales_person_name = JModel::getInstance('salesPerson', 'enmasseModel')->retrieveName($dealList[$i]->sales_person_id);
         $dealList[$i]->merchant_name = JModel::getInstance('merchant', 'enmasseModel')->retrieveName($dealList[$i]->merchant_id);
     }
     $this->assignRef('filter', $filter);
     $this->statusList = EnmasseHelper::$DEAL_STATUS_LIST;
     $this->salePersonList = JModel::getInstance('salesPerson', 'enmasseModel')->listAllPublished();
     $this->merchantList = JModel::getInstance('merchant', 'enmasseModel')->listAllPublished();
     $this->assignRef('dealList', $dealList);
     $this->assignRef('pagination', $pagination);
     $this->assignRef('order', $order);
     $this->assignRef('currency_prefix', $currency_prefix);
     parent::display($tpl);
 }
Example #16
0
 function display($tpl = null)
 {
     TOOLBAR_enmasse::_DEFAULT();
     parent::display($tpl);
 }
Example #17
0
 function display($tpl = null)
 {
     $task = JRequest::getWord('task');
     if ($task == 'edit' || $task == 'add') {
         $cid = JRequest::getVar('cid', array(0), '', 'array');
         $row = JModel::getInstance('deal', 'enmasseModel')->getById($cid[0]);
         if (!empty($row->id)) {
             TOOLBAR_enmasse::_DEAL_DETAIL($row->status);
         } else {
             TOOLBAR_enmasse::_DEAL_NEW();
         }
         $this->deal = $row;
         $this->currencyPrefix = JModel::getInstance('setting', 'enmasseModel')->getCurrencyPrefix();
         $this->currencyPostfix = JModel::getInstance('setting', 'enmasseModel')->getCurrencyPostfix();
         $this->statusList = EnmasseHelper::$DEAL_STATUS_LIST;
         $this->locationList = JModel::getInstance('location', 'enmasseModel')->listAllPublished();
         $this->categoryList = JModel::getInstance('category', 'enmasseModel')->listAllPublished();
         $this->salesPersonList = JModel::getInstance('salesPerson', 'enmasseModel')->listAllPublished();
         $this->merchantList = JModel::getInstance('merchant', 'enmasseModel')->listAllPublished();
         if ($row->id) {
             $dealCategoryIdList = JModel::getInstance('dealcategory', 'enmasseModel')->getCategoryByDealId($row->id);
             //------------------------------
             // get category list of deal
             if (count($dealCategoryIdList) != 0) {
                 $dealCategoryList = JModel::getInstance('category', 'enmasseModel')->getCategoryListInArrId($dealCategoryIdList);
             } else {
                 $dealCategoryList = array();
             }
             // assign category list to template
             $this->assignRef('dealCategoryList', $dealCategoryList);
             $dealLocationIdList = JModel::getInstance('deallocation', 'enmasseModel')->getLocationByDealId($row->id);
             //------------------------------
             // get location list of deal
             if (count($dealLocationIdList) != 0) {
                 $dealLocationList = JModel::getInstance('location', 'enmasseModel')->getLocationListInArrId($dealLocationIdList);
             } else {
                 $dealLocationList = array();
             }
             $this->assignRef('dealLocationList', $dealLocationList);
             // Set a flag for the template to recognize we are creating a new deal
             $this->bNewDeal = false;
         } else {
             $dealCategoryList = array();
             $this->assignRef('dealCategoryList', $dealCategoryList);
             $dealLocationList = array();
             $this->assignRef('dealLocationList', $dealLocationList);
             $this->bNewDeal = true;
         }
     } else {
         TOOLBAR_enmasse::_SMENU();
         $nNumberOfDeals = JModel::getInstance('deal', 'enmasseModel')->countAll();
         if ($nNumberOfDeals == 0) {
             TOOLBAR_enmasse::_DEAL_EMPTY();
         } else {
             TOOLBAR_enmasse::_DEAL();
         }
         $filter = JRequest::getVar('filter');
         $filter['code'] = isset($filter['code']) ? $filter['code'] : '';
         $filter['location_id'] = isset($filter['location_id']) ? $filter['location_id'] : '';
         $filter['category_id'] = isset($filter['category_id']) ? $filter['category_id'] : '';
         $filter['name'] = isset($filter['name']) ? $filter['name'] : '';
         $filter['published'] = isset($filter['published']) ? $filter['published'] : '';
         $filter['status'] = isset($filter['status']) ? $filter['status'] : '';
         $dealFromLocation = null;
         $dealFromCategory = null;
         if (!empty($filter['location_id']) && trim($filter['location_id']) != '') {
             $dealFromLocation = JModel::getInstance('dealLocation', 'enmasseModel')->getDealByLocationId($filter['location_id']);
         }
         if (!empty($filter['location_id']) && trim($filter['location_id']) != '') {
             $dealFromCategory = JModel::getInstance('dealCategory', 'enmasseModel')->getDealByCategoryId($filter['location_id']);
         }
         $dealList = JModel::getInstance('deal', 'enmasseModel')->search($filter['code'], $filter['name'], $dealFromLocation, $dealFromCategory, $filter['published'], $filter['status']);
         /// load pagination
         $pagination = JModel::getInstance('deal', 'enmasseModel')->getPagination($filter['code'], $filter['name'], $dealFromLocation, $dealFromCategory, $filter['published'], $filter['status']);
         $state = $this->get('state');
         // get order values
         $order['order_dir'] = $state->get('filter_order_dir');
         $order['order'] = $state->get('filter_order');
         for ($i = 0; $i < count($dealList); $i++) {
             $dealCategoryIdList = JModel::getInstance('dealcategory', 'enmasseModel')->getCategoryByDealId($dealList[$i]->id);
             $dealLocationIdList = JModel::getInstance('deallocation', 'enmasseModel')->getLocationByDealId($dealList[$i]->id);
             //----------------------------------------------
             // get list of category name
             if (count($dealCategoryIdList) != 0) {
                 $categoryList = JModel::getInstance('category', 'enmasseModel')->getCategoryListInArrId($dealCategoryIdList);
             } else {
                 $categoryList = null;
             }
             //----------------------------------------------
             // get list of location name
             if (count($dealLocationIdList) != 0) {
                 $locationList = JModel::getInstance('location', 'enmasseModel')->getLocationListInArrId($dealLocationIdList);
             } else {
                 $locationList = null;
             }
             if (count($locationList) != 0 && $locationList != null) {
                 $dealList[$i]->location_name = $locationList;
             } else {
                 $dealList[$i]->location_name = null;
             }
             if (count($categoryList) != 0 && $categoryList != null) {
                 $dealList[$i]->category_name = $categoryList;
             } else {
                 $dealList[$i]->category_name = null;
             }
             $dealList[$i]->sales_person_name = JModel::getInstance('salesPerson', 'enmasseModel')->retrieveName($dealList[$i]->sales_person_id);
         }
         $this->assignRef('filter', $filter);
         $this->statusList = EnmasseHelper::$DEAL_STATUS_LIST;
         $this->locationList = JModel::getInstance('location', 'enmasseModel')->listAllPublished();
         $this->categoryList = JModel::getInstance('category', 'enmasseModel')->listAllPublished();
         $this->assignRef('dealList', $dealList);
         $this->assignRef('pagination', $pagination);
         $this->assignRef('order', $order);
     }
     parent::display($tpl);
 }