|
@@ -235,6 +235,7 @@ class reportsController extends Staple_Controller
|
|
$date->setTime(0,0,0);
|
|
$date->setTime(0,0,0);
|
|
|
|
|
|
$year = $date->format('Y');
|
|
$year = $date->format('Y');
|
|
|
|
+
|
|
$this->view->year = $year;
|
|
$this->view->year = $year;
|
|
|
|
|
|
$nextYear = $date->modify('+1 year')->format('Y');
|
|
$nextYear = $date->modify('+1 year')->format('Y');
|
|
@@ -256,7 +257,6 @@ class reportsController extends Staple_Controller
|
|
$date->setTime(0,0,0);
|
|
$date->setTime(0,0,0);
|
|
|
|
|
|
$newDate = new DateTime();
|
|
$newDate = new DateTime();
|
|
-
|
|
|
|
switch($month)
|
|
switch($month)
|
|
{
|
|
{
|
|
case 1:
|
|
case 1:
|
|
@@ -271,6 +271,7 @@ class reportsController extends Staple_Controller
|
|
$date2 = new DateTime();
|
|
$date2 = new DateTime();
|
|
$date2->setDate($year,$month,25);
|
|
$date2->setDate($year,$month,25);
|
|
$date2->setTime(24,00,00);
|
|
$date2->setTime(24,00,00);
|
|
|
|
+
|
|
$interval = date_diff($newDate,$date2);
|
|
$interval = date_diff($newDate,$date2);
|
|
|
|
|
|
$span = $interval->days;
|
|
$span = $interval->days;
|
|
@@ -278,6 +279,11 @@ class reportsController extends Staple_Controller
|
|
|
|
|
|
$this->view->date = $date->format("F Y");
|
|
$this->view->date = $date->format("F Y");
|
|
|
|
|
|
|
|
+ $date = new dateTime();
|
|
|
|
+ $date->setDate($year, $month, 25);
|
|
|
|
+ $this->view->currentDate = $date->format('Y-m-d');
|
|
|
|
+ $this->view->previousDate = $date->modify('-1 month +1 day')->format('Y-m-d');
|
|
|
|
+
|
|
$reports = new reportModel($year, $month);
|
|
$reports = new reportModel($year, $month);
|
|
$this->view->report = $reports->payPeriodTotals($year, $month);
|
|
$this->view->report = $reports->payPeriodTotals($year, $month);
|
|
}
|
|
}
|
|
@@ -364,6 +370,11 @@ class reportsController extends Staple_Controller
|
|
$date->modify("+$days days");
|
|
$date->modify("+$days days");
|
|
$this->view->endDate = $date->format("F jS Y");
|
|
$this->view->endDate = $date->format("F jS Y");
|
|
|
|
|
|
|
|
+ $date = new dateTime();
|
|
|
|
+ $date->setDate($year, $month, 25);
|
|
|
|
+ $this->view->currentDate = $date->format('Y-m-d');
|
|
|
|
+ $this->view->previousDate = $date->modify('-1 month +1 day')->format('Y-m-d');
|
|
|
|
+
|
|
$codes = new codeModel();
|
|
$codes = new codeModel();
|
|
$this->view->codes = $codes->allCodes();
|
|
$this->view->codes = $codes->allCodes();
|
|
|
|
|
|
@@ -418,21 +429,25 @@ class reportsController extends Staple_Controller
|
|
{
|
|
{
|
|
if ($year == null)
|
|
if ($year == null)
|
|
{
|
|
{
|
|
- $date = new DateTime('first day of this month');
|
|
|
|
|
|
+ $date = new DateTime();
|
|
|
|
+
|
|
if($date->format('d') >= 26)
|
|
if($date->format('d') >= 26)
|
|
{
|
|
{
|
|
$date->modify('+1 month');
|
|
$date->modify('+1 month');
|
|
}
|
|
}
|
|
|
|
+
|
|
$year = $date->format('Y');
|
|
$year = $date->format('Y');
|
|
}
|
|
}
|
|
|
|
|
|
if ($month == null)
|
|
if ($month == null)
|
|
{
|
|
{
|
|
- $date = new DateTime('first day of this month');
|
|
|
|
|
|
+ $date = new DateTime();
|
|
|
|
+
|
|
if($date->format('d') >= 26)
|
|
if($date->format('d') >= 26)
|
|
{
|
|
{
|
|
$date->modify('+1 month');
|
|
$date->modify('+1 month');
|
|
}
|
|
}
|
|
|
|
+
|
|
$month = $date->format('m');
|
|
$month = $date->format('m');
|
|
}
|
|
}
|
|
|
|
|
|
@@ -441,7 +456,6 @@ class reportsController extends Staple_Controller
|
|
$date->setTime(0,0,0);
|
|
$date->setTime(0,0,0);
|
|
|
|
|
|
$this->view->year = $date->format('Y');
|
|
$this->view->year = $date->format('Y');
|
|
-
|
|
|
|
$this->view->date = $date->format("F Y");
|
|
$this->view->date = $date->format("F Y");
|
|
|
|
|
|
$date->modify('+1 year');
|
|
$date->modify('+1 year');
|
|
@@ -466,6 +480,11 @@ class reportsController extends Staple_Controller
|
|
$this->view->accountLevel = $this->authLevel;
|
|
$this->view->accountLevel = $this->authLevel;
|
|
|
|
|
|
$date = new DateTime();
|
|
$date = new DateTime();
|
|
|
|
+ if($date->format('d') >= 26)
|
|
|
|
+ {
|
|
|
|
+ $date->modify('+1 month');
|
|
|
|
+ }
|
|
|
|
+
|
|
$date->setDate($year, $month, 1);
|
|
$date->setDate($year, $month, 1);
|
|
$this->view->monthName = $date->format('F');
|
|
$this->view->monthName = $date->format('F');
|
|
|
|
|
|
@@ -479,7 +498,7 @@ class reportsController extends Staple_Controller
|
|
$data = $printInactiveTimeSheetForm->exportFormData();
|
|
$data = $printInactiveTimeSheetForm->exportFormData();
|
|
|
|
|
|
$this->layout->addScriptBlock("
|
|
$this->layout->addScriptBlock("
|
|
- window.open('".$this->_link(array("reports","printpreview",$year,$month,$data['account']))."');
|
|
|
|
|
|
+ window.open('".$this->_link(array("reports","inactive","printpreview",$year,$month,$data['account']))."');
|
|
");
|
|
");
|
|
$this->view->printTimeSheetForm = $printInactiveTimeSheetForm;
|
|
$this->view->printTimeSheetForm = $printInactiveTimeSheetForm;
|
|
}
|
|
}
|