diff --git a/admin/dashboard/index.php b/admin/dashboard/index.php index 3addd491..5f520875 100644 --- a/admin/dashboard/index.php +++ b/admin/dashboard/index.php @@ -26,19 +26,24 @@ define('MODULE_PATH',dirname(__FILE__)); include APP_BASE_PATH.'header.php'; include APP_BASE_PATH.'modulejslibs.inc.php'; -$billingActionManager = new \Billing\Admin\Api\BillingActionManager(); - -$invoices = $billingActionManager->getInvoices(null)->getData(); -if(!empty($invoices)){ - $invoices = json_decode(json_encode($invoices)); -} +$invoices = []; $numOfUnpaidInvoices = 0; -foreach($invoices as $inv){ - if($inv->status == "Sent"){ - $numOfUnpaidInvoices++; +if (class_exists('\\Billing\\Admin\\Api\\BillingActionManager')) { + $billingActionManager = new \Billing\Admin\Api\BillingActionManager(); + + $invoices = $billingActionManager->getInvoices(null)->getData(); + if(!empty($invoices)){ + $invoices = json_decode(json_encode($invoices)); + } + + foreach($invoices as $inv){ + if($inv->status == "Sent"){ + $numOfUnpaidInvoices++; + } } } + ?>
';
var deleteButton = '
';
var cloneButton = '
';
@@ -2387,13 +2400,13 @@ IceHRMBase.method('getActionButtonsHtml', function(id,data) {
}else{
html = html.replace('_delete_','');
}
-
+
if(this.showEdit){
html = html.replace('_edit_',editButton);
}else{
html = html.replace('_edit_','');
}
-
+
html = html.replace(/_id_/g,id);
html = html.replace(/_BASE_/g,this.baseUrl);
return html;
@@ -2423,20 +2436,20 @@ IceHRMBase.method('checkFileType', function (elementName, fileTypes) {
if (fileElement.value.lastIndexOf(".") > 0) {
fileExtension = fileElement.value.substring(fileElement.value.lastIndexOf(".") + 1, fileElement.value.length);
}
-
+
fileExtension = fileExtension.toLowerCase();
-
+
var allowed = fileTypes.split(",");
-
+
if (allowed.indexOf(fileExtension) < 0) {
fileElement.value = "";
this.showMessage("File Type Error",'Selected file type is not supported');
this.clearFileElement(elementName);
return false;
}
-
+
return true;
-
+
});
IceHRMBase.method('clearFileElement', function (elementName) {
@@ -2463,15 +2476,15 @@ IceHRMBase.method('getClientDate', function (date) {
});
IceHRMBase.method('getClientGMTOffset', function () {
-
+
var rightNow = new Date();
var jan1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0);
var temp = jan1.toGMTString();
var jan2 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
var std_time_offset = (jan1 - jan2) / (1000 * 60 * 60);
-
+
return std_time_offset;
-
+
});
/**
diff --git a/include.common.php b/include.common.php
index af0a1a30..df61b791 100644
--- a/include.common.php
+++ b/include.common.php
@@ -3,10 +3,10 @@ ini_set('display_errors', false);
error_reporting(E_ERROR);
require dirname(__FILE__).'/lib/composer/vendor/autoload.php';
-$whoops = new \Whoops\Run;
-$whoops->pushHandler(new \Whoops\Handler\PlainTextHandler);
-$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
-$whoops->register();
+//$whoops = new \Whoops\Run;
+//$whoops->pushHandler(new \Whoops\Handler\PlainTextHandler);
+//$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
+//$whoops->register();
function t($text)
{
@@ -18,9 +18,9 @@ $jsVersion = defined('CACHE_VALUE')?CACHE_VALUE:"v".VERSION;
$cssVersion = defined('CACHE_VALUE')?CACHE_VALUE:"v".VERSION;
if(!isset($_REQUEST['content']) || $_REQUEST['content'] != 'HTML'){
- $_REQUEST = \Utils\InputCleaner::cleanParameters($_REQUEST);
- $_GET = \Utils\InputCleaner::cleanParameters($_GET);
- $_POST = \Utils\InputCleaner::cleanParameters($_POST);
+ $_REQUEST = \Utils\InputCleaner::cleanParameters($_REQUEST);
+ $_GET = \Utils\InputCleaner::cleanParameters($_GET);
+ $_POST = \Utils\InputCleaner::cleanParameters($_POST);
}
date_default_timezone_set('Asia/Colombo');
diff --git a/src/Employees/Common/Model/Employee.php b/src/Employees/Common/Model/Employee.php
index 33ca915a..cc56ca02 100644
--- a/src/Employees/Common/Model/Employee.php
+++ b/src/Employees/Common/Model/Employee.php
@@ -98,7 +98,7 @@ class Employee extends BaseModel
continue;
}
- if (empty($obj->$k) && ($oldObjOrig->$k = '0000-00-00' || empty($oldObjOrig->$k))) {
+ if (empty($obj->$k) && $oldObjOrig->$k == '0000-00-00') {
continue;
}
diff --git a/src/Reports/Admin/Reports/ActiveEmployeeReport.php b/src/Reports/Admin/Reports/ActiveEmployeeReport.php
index c96abec9..7c7456e0 100644
--- a/src/Reports/Admin/Reports/ActiveEmployeeReport.php
+++ b/src/Reports/Admin/Reports/ActiveEmployeeReport.php
@@ -8,7 +8,7 @@ use Utils\LogManager;
class ActiveEmployeeReport extends CSVReportBuilder implements CSVReportBuilderInterface
{
-
+
public function getMainQuery()
{
$query = "Select id, employee_id as 'Employee ID',
@@ -41,15 +41,15 @@ confirmation_date as 'Confirmation Date',
(SELECT title from CompanyStructures where id = department) as 'Department',
(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`,' [Employee ID:',`employee_id`,']') from Employees e1 where e1.id = e.supervisor) as 'Supervisor', notes as 'Notes'
FROM Employees e";
-
+
return $query;
}
-
+
public function getWhereQuery($request)
{
$query = "";
$params = array();
-
+
if (empty($request['department']) || $request['department'] == "NULL") {
$params = array();
$query = "where ((termination_date is NULL or termination_date = '0001-01-01 00:00:00' or termination_date = '0000-00-00 00:00:00') and joined_date < NOW()) or (termination_date > NOW() and joined_date < NOW())";
@@ -57,11 +57,11 @@ FROM Employees e";
$depts = $this->getChildCompanyStuctures($request['department']);
$query = "where department in (".implode(",", $depts).") and (((termination_date is NULL or termination_date = '0001-01-01 00:00:00' or termination_date = '0000-00-00 00:00:00') and joined_date < NOW()) or (termination_date > NOW() and joined_date < NOW()))";
}
-
-
+
+
return array($query, $params);
}
-
+
public function getChildCompanyStuctures($companyStructId)
{
$childIds = array();
@@ -86,7 +86,7 @@ FROM Employees e";
$nodeIdsAtLastLevel[] = $item->id;
}
} while (count($list) > 0 && $count < 10);
-
+
return $childIds;
}
}