rapport 1

This commit is contained in:
2018-02-18 21:00:07 +01:00
parent f3b40c5bce
commit 3f2fffd1d4
6 changed files with 279 additions and 12 deletions
@@ -40,9 +40,24 @@ class Projecthour extends BaseModel {
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-10', projecthours.hours, 0)) AS oktober,
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-11', projecthours.hours, 0)) AS november,
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-12', projecthours.hours, 0)) AS december,
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-1', projecthours.hours * tarif, 0)) AS januariRevenue,
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-2', projecthours.hours * tarif, 0)) AS februariRevenue,
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-3', projecthours.hours * tarif, 0)) AS maartRevenue,
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-4', projecthours.hours * tarif, 0)) AS aprilRevenue,
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-5', projecthours.hours * tarif, 0)) AS meiRevenue,
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-6', projecthours.hours * tarif, 0)) AS juniRevenue,
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-7', projecthours.hours * tarif, 0)) AS juliRevenue,
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-8', projecthours.hours * tarif, 0)) AS augustusRevenue,
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-9', projecthours.hours * tarif, 0)) AS septemberRevenue,
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-10', projecthours.hours * tarif, 0)) AS oktoberRevenue,
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-11', projecthours.hours * tarif, 0)) AS novemberRevenue,
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-12', projecthours.hours * tarif, 0)) AS decemberRevenue,
SUM(IF(YEAR(hourdate) = {$year},projecthours.hours, 0)) AS totalyear,
SUM(IF(YEAR(hourdate) != {$year},projecthours.hours, 0)) AS totalotheryears,
SUM(IF(YEAR(hourdate) = {$year},projecthours.hours * tarif, 0)) AS totalyearRevenue,
SUM(IF(YEAR(hourdate) != {$year},projecthours.hours * tarif, 0)) AS totalotheryearsRevenue,
SUM(projecthours.hours) AS totalhours,
SUM(projecthours.hours * tarif) AS totalhoursRevenue,
PEM.tarif,
PRJ.projectname" )
->join( 'projectemployees AS PEM', 'PEM.id', '=', 'projecthours.projectemployee_id' )
@@ -41,7 +41,27 @@
<!-- ko foreach:uniqueEmployees -->
<div class="tab-pane" data-bind="css:{'active':$root.sluggy() == slug}">
<?php $this->load->view('reports/monthlyemployeehours/employee_view'); ?>
<div style="position:relative">
<div style="position:absolute;right:20px; z-index:10;">
<div class="onoffswitch" data-bind="click:$root.toggleHourView">
<input type="checkbox"
name="onoffswitch"
class="onoffswitch-checkbox"
data-bind="checked:hourView"
id="myonoffswitch">
<label class="onoffswitch-label" for="myonoffswitch">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
</div>
</div>
<!-- ko if : hourView() -->
<?php $this->load->view('reports/monthlyemployeehours/_employeehour_view'); ?>
<!-- /ko -->
<!-- ko if : ! hourView() -->
<?php $this->load->view('reports/monthlyemployeehours/_employeerevenue_view'); ?>
<!-- /ko -->
</div>
<!-- /ko -->
</div>
@@ -1,6 +1,6 @@
<div class="row">
<div class="col-md-12">
<h2>uren per project</h2>
<h2 style="margin-top:0">uren per project</h2>
<table class="table table-condensed table-bordered">
<thead>
<tr class="table-info">
@@ -119,13 +119,13 @@
<span data-bind="text:totalDecember "></span>
</th>
<th class="align-right">
<span data-bind="text:totalTotal"></span>
<span data-bind="text:totalTotal().toFixed(1)"></span>
</th>
<th class="align-right">
<span data-bind="text:totalTotalOtheryears"></span>
<span data-bind="text:totalTotalOtheryears().toFixed(1)"></span>
</th>
<th class="align-right">
<span data-bind="text:totalTotalOtheryears() + totalTotal()"></span>
<span data-bind="text:(totalTotalOtheryears() + totalTotal()).toFixed(1)"></span>
</th>
</tr>
</tfoot>
@@ -144,3 +144,5 @@
</div>
</div>
</div>
@@ -0,0 +1,146 @@
<div class="row">
<div class="col-md-12">
<h2 style="margin-top:0">omzet per project</h2>
<table class="table table-condensed table-bordered">
<thead>
<tr class="table-info">
<th>project</th>
<th class="align-right">tarief</th>
<th class="align-right">jan</th>
<th class="align-right">feb</th>
<th class="align-right">mrt</th>
<th class="align-right">apr</th>
<th class="align-right">mei</th>
<th class="align-right">juni</th>
<th class="align-right">juli</th>
<th class="align-right">aug</th>
<th class="align-right">sep</th>
<th class="align-right">okt</th>
<th class="align-right">nov</th>
<th class="align-right">dec</th>
<th class="align-right">tot jaar</th>
<th class="align-right">tot overig</th>
<th class="align-right">grand total</th>
</tr>
</thead>
<tbody data-bind="foreach:myData">
<tr>
<td>
<span data-bind="text:projectname"></span>
</td>
<td class="align-right">
<span data-bind="text:tarif"></span>
</td>
<td class="align-right">
<span data-bind="text:januariRevenue.toFixed(0)"></span>
</td>
<td class="align-right">
<span data-bind="text:februariRevenue.toFixed(0)"></span>
</td>
<td class="align-right">
<span data-bind="text:maartRevenue.toFixed(0)"></span>
</td>
<td class="align-right">
<span data-bind="text:aprilRevenue.toFixed(0)"></span>
</td>
<td class="align-right">
<span data-bind="text:meiRevenue.toFixed(0)"></span>
</td>
<td class="align-right">
<span data-bind="text:juniRevenue.toFixed(0)"></span>
</td>
<td class="align-right">
<span data-bind="text:juliRevenue.toFixed(0)"></span>
</td>
<td class="align-right">
<span data-bind="text:augustusRevenue.toFixed(0)"></span>
</td>
<td class="align-right">
<span data-bind="text:septemberRevenue.toFixed(0)"></span>
</td>
<td class="align-right">
<span data-bind="text:oktoberRevenue.toFixed(0)"></span>
</td>
<td class="align-right">
<span data-bind="text:novemberRevenue.toFixed(0)"></span>
</td>
<td class="align-right">
<span data-bind="text:decemberRevenue.toFixed(0)"></span>
</td>
<th class="align-right">
<span data-bind="text:totalyearRevenue.toFixed(0)"></span>
</th>
<th class="align-right">
<span data-bind="text:totalotheryearsRevenue.toFixed(0)"></span>
</th>
<th class="align-right">
<span data-bind="text:totalhoursRevenue.toFixed(0)"></span>
</th>
</tr>
</tbody>
<tfoot>
<tr class="table-info">
<th>totaal</th>
<th>&nbsp;</th>
<th class="align-right">
<span data-bind="text:totalJanuariRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<span data-bind="text:totalFebruariRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<span data-bind="text:totalMaartRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<span data-bind="text:totalAprilRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<span data-bind="text:totalMeiRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<span data-bind="text:totalJuniRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<span data-bind="text:totalJuliRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<span data-bind="text:totalAugustusRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<span data-bind="text:totalSeptemberRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<span data-bind="text:totalOktoberRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<span data-bind="text:totalNovemberRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<span data-bind="text:totalDecemberRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<span data-bind="text:totalTotalRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<span data-bind="text:totalTotalOtheryearsRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<span data-bind="text:(totalTotalOtheryearsRevenue() + totalTotalRevenue()).toFixed(0)"></span>
</th>
</tr>
</tfoot>
</table>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="graph-holder">
<canvas data-bind="attr:{id: 'revenue-per-month-' + slug}" height="300"></canvas>
</div>
</div>
<div class="col-md-6">
<div class="graph-holder">
<canvas data-bind="attr:{id: 'revenue-per-project-' + slug}" height="300"></canvas>
</div>
</div>
</div>