Monthly hours and revenues per employee report

This commit is contained in:
2018-03-01 10:43:58 +01:00
parent f52b3539ba
commit 50cd8d8f08
13 changed files with 138 additions and 84 deletions
@@ -12,8 +12,10 @@ class Recapprojects {
private $index;
private $project;
private $projects;
private $employeeHours;
private $invoicedYears = [];
private $projectTotals;
private $employeeBudget;
private $uniqueEmployee;
private $uniqueEmployees;
private $projectEmployeeDetail;
@@ -95,6 +97,10 @@ class Recapprojects {
{
$this->setProjectEmployeeDetail();
$this->setEmployeeBudget();
$this->setEmployeeHours();
$this->setEmployeeDetails();
$this->setProjectTotals();
@@ -111,17 +117,27 @@ class Recapprojects {
$this->projectEmployeeDetail = FALSE;
}
private function setEmployeeBudget()
{
$this->employeeBudget =
is_null( $this->projectEmployeeDetail['budget'] ) ? 0 : $this->projectEmployeeDetail['budget'];
}
private function setEmployeeHours()
{
$this->employeeHours =
$this->projectEmployeeDetail ? $this->projectEmployeeDetail->hours : 0;
}
private function setEmployeeDetails()
{
$budget = is_null( $this->projectEmployeeDetail['budget'] ) ? 0 : $this->projectEmployeeDetail['budget'];
$hours = $this->projectEmployeeDetail ? $this->projectEmployeeDetail->hours : 0;
$this->projects[ $this->index ]['employees'][] = [
'id' => $this->uniqueEmployee->id,
'fullname' => $this->uniqueEmployee->fullname,
'hours' => $hours,
'hours' => $this->employeeHours,
'revenues' => $this->projectEmployeeDetail ? $this->projectEmployeeDetail->revenues : 0,
'budget' => $budget,
'availableHours' => $budget - $hours
'budget' => $this->employeeBudget,
'availableHours' => $this->employeeBudget - $this->employeeHours
];
}
@@ -131,11 +147,15 @@ class Recapprojects {
$this->projects[ $this->index ]['projectHours'] = 0;
if ( ! isset( $this->projects[ $this->index ]['projectEuros'] ) )
$this->projects[ $this->index ]['projectEuros'] = 0;
if ( ! isset( $this->projects[ $this->index ]['hoursAvailable'] ) )
$this->projects[ $this->index ]['hoursAvailable'] = 0;
$this->projects[ $this->index ]['projectHours'] +=
$this->projectEmployeeDetail ? $this->projectEmployeeDetail->hours : 0;
$this->projects[ $this->index ]['projectEuros'] +=
$this->projectEmployeeDetail ? $this->projectEmployeeDetail->revenues : 0;
$this->projects[ $this->index ]['hoursAvailable'] +=
$this->employeeBudget - $this->employeeHours;
}
private function setBudget()
@@ -198,6 +218,9 @@ class Recapprojects {
$this->projects[ $this->index ]['projectEuros'] +
$this->projects[ $this->index ]['projectcosts'] -
$this->projects[ $this->index ]['totalInvoiced'];
if( $this->projects[ $this->index ]['workInProgress'] < 0 )
$this->projects[ $this->index ]['workInProgress'] = 0;
}
private function setInvoicedYears()
+1 -1
View File
@@ -2,7 +2,7 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">toevoegen / wijzigen externe</h5>
<h5 class="modal-title">toevoegen / wijzigen onderaannemer</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
+2 -2
View File
@@ -149,7 +149,7 @@
event:{keyup:validateNumber}">
</div>
<small>
eigen omzet
eigen omzet (excl btw)
</small>
</div>
<div class="col-xl-4">
@@ -164,7 +164,7 @@
event:{keyup:validateNumber}">
</div>
<small>
overige omzet
overige omzet (excl btw)
</small>
</div>
</div>
+23 -29
View File
@@ -15,19 +15,13 @@
factuurdatum
</th>
<th class="table-cyanish-header align-right">
bedrag (excl)
bedrag (excl btw)
</th>
<th class="table-cyanish-header align-right">
bedrag (incl)
bedrag (incl btw)
</th>
<th class="table-cyanish-header align-right">
openstaand
</th>
<th class="table-cyanish-header align-right">
prognose(excl)
</th>
<th class="table-cyanish-header align-right">
prognose datum
openstaand( incl btw)
</th>
<th class="table-cyanish-header align-right">
btw tarief
@@ -78,26 +72,26 @@
<i class="icon fa-euro"></i>
<span data-bind="text:dbo.helpers.numberWithPoints(outstanding())"></span>
</td>
<td class="align-right">
<span data-bind=" visible: ! inEdit()">
<i class="icon fa-euro"></i>
<span data-bind="text:dbo.helpers.numberWithPoints(forecastamount())"></span>
</span>
<input type="text"
class="form-control form-control-sm align-right"
paceholder="bedrag"
data-bind="textInput:forecastamount, visible:inEdit,
event:{change:$root.saveInvoice,keyup:$root.validateNumber.bind($data, 'forecastamount')}"/>
</td>
<td class="align-right">
<span data-bind="text:forecastdate, visible:! inEdit()"></span>
<input type="text"
class="form-control form-control-sm"
placeholder="datum"
data-bind="datepicker:{dateFormat: 'dd-mm-yy' },
value:forecastdate, visible:inEdit,
event:{change:$root.saveInvoice}"/>
</td>
<!-- <td class="align-right">-->
<!-- <span data-bind=" visible: ! inEdit()">-->
<!-- <i class="icon fa-euro"></i>-->
<!-- <span data-bind="text:dbo.helpers.numberWithPoints(forecastamount())"></span>-->
<!-- </span>-->
<!-- <input type="text"-->
<!-- class="form-control form-control-sm align-right"-->
<!-- paceholder="bedrag"-->
<!-- data-bind="textInput:forecastamount, visible:inEdit,-->
<!-- event:{change:$root.saveInvoice,keyup:$root.validateNumber.bind($data, 'forecastamount')}"/>-->
<!-- </td>-->
<!-- <td class="align-right">-->
<!-- <span data-bind="text:forecastdate, visible:! inEdit()"></span>-->
<!-- <input type="text"-->
<!-- class="form-control form-control-sm"-->
<!-- placeholder="datum"-->
<!-- data-bind="datepicker:{dateFormat: 'dd-mm-yy' },-->
<!-- value:forecastdate, visible:inEdit,-->
<!-- event:{change:$root.saveInvoice}"/>-->
<!-- </td>-->
<td class="align-right">
<span data-bind="visible:! inEdit()">
<span data-bind="text:dbo.helpers.findArrayElement('id', 'vatrate', vat_id(), $root.vats())"></span>
@@ -1,14 +1,14 @@
<div class="panel panel-bordered panel-primary panel-line">
<div class="panel-heading panel-heading-project">
<h3 class="">
inkomende facturen
inkomende facturen (bedragen incl btw)
</h3>
</div>
<div class="panel-body panel-body-project">
<table class="table table-sm">
<thead>
<th class="table-cyanish-header">
externe
onderaannemer
</th>
<th class="table-cyanish-header">
omschrijving
@@ -14,10 +14,10 @@
start
</th>
<th class="table-cyanish-header align-right">
eigen omzet
eigen omzet (excl btw)
</th>
<th class="table-cyanish-header align-right">
overig omzet
overig omzet (excl btw)
</th>
<th class="table-cyanish-header">
&nbsp;
+1 -1
View File
@@ -2,7 +2,7 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">toevoegen / wijzigen gebruiker</h5>
<h5 class="modal-title">toevoegen / wijzigen medewerker</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
+1 -1
View File
@@ -40,7 +40,7 @@
<tr>
<td colspan="4" class="">
<button class="btn btn-primary btn-round btn-sm" data-bind="click:newExternal">
nieuwe externe
nieuwe onderaannemer
</button>
</td>
<td colspan="2" class="">
@@ -55,8 +55,29 @@
</td>
<!-- /ko -->
<td class="align-right">
<span data-bind=""></span>
<span data-bind="text:hoursAvailable"></span>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<th class="align-right" colspan="5">totaal</th>
<!-- ko foreach: totalPerEmployee -->
<th class="align-right">
<span data-bind="text:totalHours"></span>
</th>
<!-- /ko -->
<th class="align-right">
<span data-bind="text:totalEmployeeHours"></span>
</th>
<!-- ko foreach: totalPerEmployee -->
<th class="align-right">
<span data-bind="text:totalAvailableHours"></span>
</th>
<!-- /ko -->
<th class="align-right">
<span data-bind="text:totalEmployeeAvailableHours"></span>
</th>
</tr>
</tfoot>
</table>