public function getReport(DataParam $dataParam, array $years)
 {
     try {
         $asJson = $this->asJson;
         $this->asJson = false;
         $values = $this->getValues($dataParam, $years);
         $this->asJson = $asJson;
         return $this->report->getReport($values, $years, $this->grouper);
     } catch (LoginException $exception) {
         return $this->loginExceptionMessage($exception);
     }
 }
Exemplo n.º 2
0
<?php

require 'Config/common.php';
require MODEL_PATH . 'Report.php';
$report = new Report();
//getting filter list
$date_filter_list = $report->getDateFilter();
$client_filter_list = $report->getClientFilter();
$product_filter_list = $report->getProductFilter();
//getting invoice list
$invoice_list = $report->getReport();
include VIEW_PATH . 'dashboard.php';
Exemplo n.º 3
0
 /**
  * Get data for standart report and assign with xt
  * @param &Array _options	 
  */
 public function setStandartData(&$_options)
 {
     include_once getabspath('classes/reportlib.php');
     $whereComponents = $this->getWhereComponents();
     $sqlArray = $this->getReportSQLData();
     $rb = new Report($sqlArray, $this->pSet->GetTableData(".orderindexes"), $this->connection, $this->pageSize, $_options, $whereComponents["searchWhere"], $whereComponents["searchHaving"], $this);
     $this->arrReport = $rb->getReport($this->pagestart);
     $this->setDetailLinks();
     $this->buildPagination();
     $this->standardReportCommonAssign();
 }
Exemplo n.º 4
0
 /**
  * Get data for standart report and assign with xt
  * @param &Array _options
  */
 public function setStandartData(&$_options)
 {
     include_once getabspath('classes/reportlib.php');
     if (!$_SESSION[$this->sessionPrefix . "_pagesize"]) {
         $_SESSION[$this->sessionPrefix . "_pagesize"] = -1;
     }
     // a temporary fix
     if (!$_SESSION[$this->sessionPrefix . "_pagenumber"]) {
         $_SESSION[$this->sessionPrefix . "_pagenumber"] = 1;
     }
     if (isset($_REQUEST["all"]) && $_REQUEST["all"]) {
         $PageSize = -1;
         $pagestart = 0;
         $this->jsSettings['tableSettings'][$this->tName]['reportPrintMode'] = 1;
     } else {
         $PageSize = $_SESSION[$this->sessionPrefix . "_pagesize"];
         $pagestart = ($_SESSION[$this->sessionPrefix . "_pagenumber"] - 1) * $PageSize;
     }
     $whereComponents = $this->getWhereComponents();
     $sqlArray = $this->getReportSQLData();
     $rb = new Report($sqlArray, $this->pSet->GetTableData(".orderindexes"), $this->connection, $PageSize, $_options, $whereComponents["searchWhere"], $whereComponents["searchHaving"], $this);
     $this->arrReport = $rb->getReport($pagestart);
     $this->standardReportCommonAssign();
 }
Exemplo n.º 5
0
        } elseif ($date_type == 'last_year') {
            $str = date('Y-m-d', strtotime('-1 year ' . date('Y-m-d')));
            list($y, $m, $d) = explode('-', $str);
            $start_date = "{$y}-01-01";
            $end_date = "{$y}-12-31";
            $condition .= " and inv.invoice_date>='{$start_date}' and inv.invoice_date<='{$end_date}'";
        }
    }
    if ($client_id != '') {
        $condition .= " and c.client_id='{$client_id}'";
    }
    if ($product_id != '') {
        $condition .= " and p.product_id='{$product_id}'";
    }
}
$invoice_list = $report->getReport($condition);
if (!$invoice_list) {
    $html .= '<tr><td colspan="6" align="center">No data found for selected filter </td><tr>';
} else {
    foreach ($invoice_list as $key => $value) {
        $html .= '
		<tr>
		<td>' . $value['invoice_num'] . '</td>
		<td>' . date('d/m/Y', strtotime($value['invoice_date'])) . '</td>
		<td>' . $value['product_description'] . '</td>
		<td>' . $value['qty'] . '</td>
		<td>' . $value['price'] . '</td>
		<td>' . round($value['price'] * $value['qty'], 2) . '</td>
		<tr>';
    }
}