|
@@ -241,4 +241,41 @@ class reportsController extends Staple_Controller
|
|
header("location:".$this->_link(array('reports','payperiod'))."");
|
|
header("location:".$this->_link(array('reports','payperiod'))."");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public function payroll($year = null, $month = null)
|
|
|
|
+ {
|
|
|
|
+ if($year == null)
|
|
|
|
+ {
|
|
|
|
+ $year = date('Y');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if($month == null)
|
|
|
|
+ {
|
|
|
|
+ $month = date('m');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $this->view->year = $year;
|
|
|
|
+
|
|
|
|
+ $date = new DateTime();
|
|
|
|
+ $date->setDate($year,$month,26);
|
|
|
|
+ $date->setTime(0,0,0);
|
|
|
|
+ $this->view->month = $date->format('m');
|
|
|
|
+ $date->modify('-1 month');
|
|
|
|
+ $this->view->previousMonth = $date->format('m');
|
|
|
|
+
|
|
|
|
+ $date2 = new DateTime();
|
|
|
|
+ $date2->setDate($year,$month,25);
|
|
|
|
+ $date2->setTime(24,0,0);
|
|
|
|
+
|
|
|
|
+ $interval = date_diff($date,$date2);
|
|
|
|
+
|
|
|
|
+ $this->view->span = $interval->days;
|
|
|
|
+
|
|
|
|
+ $reports = new reportModel($year, $month);
|
|
|
|
+ $this->view->report = $reports->payroll($year, $month);
|
|
|
|
+ $this->view->startDate = $date->format("F jS Y");
|
|
|
|
+ $days = $interval->days - 1;
|
|
|
|
+ $date->modify("+$days days");
|
|
|
|
+ $this->view->endDate = $date->format("F jS Y");
|
|
|
|
+ }
|
|
}
|
|
}
|