Monthly hours and revenues per employee report
This commit is contained in:
@@ -12,8 +12,10 @@ class Recapprojects {
|
|||||||
private $index;
|
private $index;
|
||||||
private $project;
|
private $project;
|
||||||
private $projects;
|
private $projects;
|
||||||
|
private $employeeHours;
|
||||||
private $invoicedYears = [];
|
private $invoicedYears = [];
|
||||||
private $projectTotals;
|
private $projectTotals;
|
||||||
|
private $employeeBudget;
|
||||||
private $uniqueEmployee;
|
private $uniqueEmployee;
|
||||||
private $uniqueEmployees;
|
private $uniqueEmployees;
|
||||||
private $projectEmployeeDetail;
|
private $projectEmployeeDetail;
|
||||||
@@ -95,6 +97,10 @@ class Recapprojects {
|
|||||||
{
|
{
|
||||||
$this->setProjectEmployeeDetail();
|
$this->setProjectEmployeeDetail();
|
||||||
|
|
||||||
|
$this->setEmployeeBudget();
|
||||||
|
|
||||||
|
$this->setEmployeeHours();
|
||||||
|
|
||||||
$this->setEmployeeDetails();
|
$this->setEmployeeDetails();
|
||||||
|
|
||||||
$this->setProjectTotals();
|
$this->setProjectTotals();
|
||||||
@@ -111,17 +117,27 @@ class Recapprojects {
|
|||||||
$this->projectEmployeeDetail = FALSE;
|
$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()
|
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'][] = [
|
$this->projects[ $this->index ]['employees'][] = [
|
||||||
'id' => $this->uniqueEmployee->id,
|
'id' => $this->uniqueEmployee->id,
|
||||||
'fullname' => $this->uniqueEmployee->fullname,
|
'fullname' => $this->uniqueEmployee->fullname,
|
||||||
'hours' => $hours,
|
'hours' => $this->employeeHours,
|
||||||
'revenues' => $this->projectEmployeeDetail ? $this->projectEmployeeDetail->revenues : 0,
|
'revenues' => $this->projectEmployeeDetail ? $this->projectEmployeeDetail->revenues : 0,
|
||||||
'budget' => $budget,
|
'budget' => $this->employeeBudget,
|
||||||
'availableHours' => $budget - $hours
|
'availableHours' => $this->employeeBudget - $this->employeeHours
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,11 +147,15 @@ class Recapprojects {
|
|||||||
$this->projects[ $this->index ]['projectHours'] = 0;
|
$this->projects[ $this->index ]['projectHours'] = 0;
|
||||||
if ( ! isset( $this->projects[ $this->index ]['projectEuros'] ) )
|
if ( ! isset( $this->projects[ $this->index ]['projectEuros'] ) )
|
||||||
$this->projects[ $this->index ]['projectEuros'] = 0;
|
$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->projects[ $this->index ]['projectHours'] +=
|
||||||
$this->projectEmployeeDetail ? $this->projectEmployeeDetail->hours : 0;
|
$this->projectEmployeeDetail ? $this->projectEmployeeDetail->hours : 0;
|
||||||
$this->projects[ $this->index ]['projectEuros'] +=
|
$this->projects[ $this->index ]['projectEuros'] +=
|
||||||
$this->projectEmployeeDetail ? $this->projectEmployeeDetail->revenues : 0;
|
$this->projectEmployeeDetail ? $this->projectEmployeeDetail->revenues : 0;
|
||||||
|
$this->projects[ $this->index ]['hoursAvailable'] +=
|
||||||
|
$this->employeeBudget - $this->employeeHours;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function setBudget()
|
private function setBudget()
|
||||||
@@ -198,6 +218,9 @@ class Recapprojects {
|
|||||||
$this->projects[ $this->index ]['projectEuros'] +
|
$this->projects[ $this->index ]['projectEuros'] +
|
||||||
$this->projects[ $this->index ]['projectcosts'] -
|
$this->projects[ $this->index ]['projectcosts'] -
|
||||||
$this->projects[ $this->index ]['totalInvoiced'];
|
$this->projects[ $this->index ]['totalInvoiced'];
|
||||||
|
|
||||||
|
if( $this->projects[ $this->index ]['workInProgress'] < 0 )
|
||||||
|
$this->projects[ $this->index ]['workInProgress'] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function setInvoicedYears()
|
private function setInvoicedYears()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<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">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -149,7 +149,7 @@
|
|||||||
event:{keyup:validateNumber}">
|
event:{keyup:validateNumber}">
|
||||||
</div>
|
</div>
|
||||||
<small>
|
<small>
|
||||||
eigen omzet
|
eigen omzet (excl btw)
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xl-4">
|
<div class="col-xl-4">
|
||||||
@@ -164,7 +164,7 @@
|
|||||||
event:{keyup:validateNumber}">
|
event:{keyup:validateNumber}">
|
||||||
</div>
|
</div>
|
||||||
<small>
|
<small>
|
||||||
overige omzet
|
overige omzet (excl btw)
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -15,19 +15,13 @@
|
|||||||
factuurdatum
|
factuurdatum
|
||||||
</th>
|
</th>
|
||||||
<th class="table-cyanish-header align-right">
|
<th class="table-cyanish-header align-right">
|
||||||
bedrag (excl)
|
bedrag (excl btw)
|
||||||
</th>
|
</th>
|
||||||
<th class="table-cyanish-header align-right">
|
<th class="table-cyanish-header align-right">
|
||||||
bedrag (incl)
|
bedrag (incl btw)
|
||||||
</th>
|
</th>
|
||||||
<th class="table-cyanish-header align-right">
|
<th class="table-cyanish-header align-right">
|
||||||
openstaand
|
openstaand( incl btw)
|
||||||
</th>
|
|
||||||
<th class="table-cyanish-header align-right">
|
|
||||||
prognose(excl)
|
|
||||||
</th>
|
|
||||||
<th class="table-cyanish-header align-right">
|
|
||||||
prognose datum
|
|
||||||
</th>
|
</th>
|
||||||
<th class="table-cyanish-header align-right">
|
<th class="table-cyanish-header align-right">
|
||||||
btw tarief
|
btw tarief
|
||||||
@@ -78,26 +72,26 @@
|
|||||||
<i class="icon fa-euro"></i>
|
<i class="icon fa-euro"></i>
|
||||||
<span data-bind="text:dbo.helpers.numberWithPoints(outstanding())"></span>
|
<span data-bind="text:dbo.helpers.numberWithPoints(outstanding())"></span>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-right">
|
<!-- <td class="align-right">-->
|
||||||
<span data-bind=" visible: ! inEdit()">
|
<!-- <span data-bind=" visible: ! inEdit()">-->
|
||||||
<i class="icon fa-euro"></i>
|
<!-- <i class="icon fa-euro"></i>-->
|
||||||
<span data-bind="text:dbo.helpers.numberWithPoints(forecastamount())"></span>
|
<!-- <span data-bind="text:dbo.helpers.numberWithPoints(forecastamount())"></span>-->
|
||||||
</span>
|
<!-- </span>-->
|
||||||
<input type="text"
|
<!-- <input type="text"-->
|
||||||
class="form-control form-control-sm align-right"
|
<!-- class="form-control form-control-sm align-right"-->
|
||||||
paceholder="bedrag"
|
<!-- paceholder="bedrag"-->
|
||||||
data-bind="textInput:forecastamount, visible:inEdit,
|
<!-- data-bind="textInput:forecastamount, visible:inEdit,-->
|
||||||
event:{change:$root.saveInvoice,keyup:$root.validateNumber.bind($data, 'forecastamount')}"/>
|
<!-- event:{change:$root.saveInvoice,keyup:$root.validateNumber.bind($data, 'forecastamount')}"/>-->
|
||||||
</td>
|
<!-- </td>-->
|
||||||
<td class="align-right">
|
<!-- <td class="align-right">-->
|
||||||
<span data-bind="text:forecastdate, visible:! inEdit()"></span>
|
<!-- <span data-bind="text:forecastdate, visible:! inEdit()"></span>-->
|
||||||
<input type="text"
|
<!-- <input type="text"-->
|
||||||
class="form-control form-control-sm"
|
<!-- class="form-control form-control-sm"-->
|
||||||
placeholder="datum"
|
<!-- placeholder="datum"-->
|
||||||
data-bind="datepicker:{dateFormat: 'dd-mm-yy' },
|
<!-- data-bind="datepicker:{dateFormat: 'dd-mm-yy' },-->
|
||||||
value:forecastdate, visible:inEdit,
|
<!-- value:forecastdate, visible:inEdit,-->
|
||||||
event:{change:$root.saveInvoice}"/>
|
<!-- event:{change:$root.saveInvoice}"/>-->
|
||||||
</td>
|
<!-- </td>-->
|
||||||
<td class="align-right">
|
<td class="align-right">
|
||||||
<span data-bind="visible:! inEdit()">
|
<span data-bind="visible:! inEdit()">
|
||||||
<span data-bind="text:dbo.helpers.findArrayElement('id', 'vatrate', vat_id(), $root.vats())"></span>
|
<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 panel-bordered panel-primary panel-line">
|
||||||
<div class="panel-heading panel-heading-project">
|
<div class="panel-heading panel-heading-project">
|
||||||
<h3 class="">
|
<h3 class="">
|
||||||
inkomende facturen
|
inkomende facturen (bedragen incl btw)
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body panel-body-project">
|
<div class="panel-body panel-body-project">
|
||||||
<table class="table table-sm">
|
<table class="table table-sm">
|
||||||
<thead>
|
<thead>
|
||||||
<th class="table-cyanish-header">
|
<th class="table-cyanish-header">
|
||||||
externe
|
onderaannemer
|
||||||
</th>
|
</th>
|
||||||
<th class="table-cyanish-header">
|
<th class="table-cyanish-header">
|
||||||
omschrijving
|
omschrijving
|
||||||
|
|||||||
@@ -14,10 +14,10 @@
|
|||||||
start
|
start
|
||||||
</th>
|
</th>
|
||||||
<th class="table-cyanish-header align-right">
|
<th class="table-cyanish-header align-right">
|
||||||
eigen omzet
|
eigen omzet (excl btw)
|
||||||
</th>
|
</th>
|
||||||
<th class="table-cyanish-header align-right">
|
<th class="table-cyanish-header align-right">
|
||||||
overig omzet
|
overig omzet (excl btw)
|
||||||
</th>
|
</th>
|
||||||
<th class="table-cyanish-header">
|
<th class="table-cyanish-header">
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<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">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td colspan="4" class="">
|
<td colspan="4" class="">
|
||||||
<button class="btn btn-primary btn-round btn-sm" data-bind="click:newExternal">
|
<button class="btn btn-primary btn-round btn-sm" data-bind="click:newExternal">
|
||||||
nieuwe externe
|
nieuwe onderaannemer
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
<td colspan="2" class="">
|
<td colspan="2" class="">
|
||||||
|
|||||||
@@ -55,8 +55,29 @@
|
|||||||
</td>
|
</td>
|
||||||
<!-- /ko -->
|
<!-- /ko -->
|
||||||
<td class="align-right">
|
<td class="align-right">
|
||||||
<span data-bind=""></span>
|
<span data-bind="text:hoursAvailable"></span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</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>
|
</table>
|
||||||
@@ -58,8 +58,8 @@ $( function () {
|
|||||||
dbo.externalDataService.saveExternal( submitDATA, function ( data ) {
|
dbo.externalDataService.saveExternal( submitDATA, function ( data ) {
|
||||||
if ( data.success ) {
|
if ( data.success ) {
|
||||||
tellMe( {
|
tellMe( {
|
||||||
title : 'externe aangemaakt',
|
title : 'onderaannemer aangemaakt',
|
||||||
message : 'externe is succesvol opgeslagen',
|
message : 'onderaannemer is succesvol opgeslagen',
|
||||||
modalClass: 'modal-success'
|
modalClass: 'modal-success'
|
||||||
}, function () {
|
}, function () {
|
||||||
vm.hideExternalModal();
|
vm.hideExternalModal();
|
||||||
@@ -78,7 +78,7 @@ $( function () {
|
|||||||
} );
|
} );
|
||||||
errorMessage += '</ul>';
|
errorMessage += '</ul>';
|
||||||
tellMe( {
|
tellMe( {
|
||||||
title : 'fout aanmaken externe',
|
title : 'fout aanmaken onderaannemer',
|
||||||
message : errorMessage,
|
message : errorMessage,
|
||||||
modalClass: 'modal-danger'
|
modalClass: 'modal-danger'
|
||||||
} );
|
} );
|
||||||
|
|||||||
@@ -62,27 +62,27 @@ dbo.externalsInit = function () {
|
|||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
tellMe( {
|
tellMe( {
|
||||||
title : 'verwijderen externe',
|
title : 'verwijderen onderaannemer',
|
||||||
message : 'weet u zeker dat u de externe wilt verwijderen, dit kan niet ongedaan worden gemaakt',
|
message : 'weet u zeker dat u de onderaannemer wilt verwijderen, dit kan niet ongedaan worden gemaakt',
|
||||||
notify : true,
|
notify : true,
|
||||||
noText : 'nee verwijder de externe niet',
|
noText : 'nee verwijder de onderaannemer niet',
|
||||||
yesText : 'ja verwijder de externe',
|
yesText : 'ja verwijder de onderaannemer',
|
||||||
modalClass: 'modal-warning'
|
modalClass: 'modal-warning'
|
||||||
}, function ( response ) {
|
}, function ( response ) {
|
||||||
if ( response ) {
|
if ( response ) {
|
||||||
dbo.externalDataService.removeExternal( self.id, function ( data ) {
|
dbo.externalDataService.removeExternal( self.id, function ( data ) {
|
||||||
if ( data.result ) {
|
if ( data.result ) {
|
||||||
tellMe( {
|
tellMe( {
|
||||||
title : 'externe verwijderd',
|
title : 'onderaannemer verwijderd',
|
||||||
message : 'de externe is succesvol verwijderd',
|
message : 'de onderaannemer is succesvol verwijderd',
|
||||||
modalClass: 'modal-success'
|
modalClass: 'modal-success'
|
||||||
}, function () {
|
}, function () {
|
||||||
vm.refreshExternals();
|
vm.refreshExternals();
|
||||||
} );
|
} );
|
||||||
} else {
|
} else {
|
||||||
tellMe( {
|
tellMe( {
|
||||||
title : 'fout bij verwijderen externe',
|
title : 'fout bij verwijderen onderaannemer',
|
||||||
message : 'de externe kan niet worden verwijderd',
|
message : 'de onderaannemer kan niet worden verwijderd',
|
||||||
modalClass: 'modal-danger'
|
modalClass: 'modal-danger'
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,11 +69,11 @@ dbo.usersInit = function () {
|
|||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
tellMe( {
|
tellMe( {
|
||||||
title : 'verwijderen gebruiker',
|
title : 'verwijderen medewerker',
|
||||||
message : 'weet u zeker dat u de gebruiker wilt verwijderen, dit kan niet ongedaan worden gemaakt',
|
message : 'weet u zeker dat u de medewerker wilt verwijderen, dit kan niet ongedaan worden gemaakt',
|
||||||
notify : true,
|
notify : true,
|
||||||
noText : 'nee verwijder de gebruiker niet',
|
noText : 'nee verwijder de medewerker niet',
|
||||||
yesText : 'ja verwijder de gebruiker',
|
yesText : 'ja verwijder de medewerker',
|
||||||
modalClass: 'modal-warning'
|
modalClass: 'modal-warning'
|
||||||
}, function ( response ) {
|
}, function ( response ) {
|
||||||
console.log( response );
|
console.log( response );
|
||||||
@@ -81,16 +81,16 @@ dbo.usersInit = function () {
|
|||||||
dbo.userDataService.removeUser( self.id, function ( data ) {
|
dbo.userDataService.removeUser( self.id, function ( data ) {
|
||||||
if ( data.result ) {
|
if ( data.result ) {
|
||||||
tellMe( {
|
tellMe( {
|
||||||
title : 'gebruiker verwijderd',
|
title : 'medewerker verwijderd',
|
||||||
message : 'de gebruiker is succesvol verwijderd',
|
message : 'de medewerker is succesvol verwijderd',
|
||||||
modalClass: 'modal-success'
|
modalClass: 'modal-success'
|
||||||
}, function () {
|
}, function () {
|
||||||
vm.refreshUsers();
|
vm.refreshUsers();
|
||||||
} );
|
} );
|
||||||
} else {
|
} else {
|
||||||
tellMe( {
|
tellMe( {
|
||||||
title : 'fout bij verwijderen gebruiker',
|
title : 'fout bij verwijderen medewerker',
|
||||||
message : 'de gebruiker kan niet worden verwijderd',
|
message : 'de medewerker kan niet worden verwijderd',
|
||||||
modalClass: 'modal-danger'
|
modalClass: 'modal-danger'
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,21 +15,23 @@ dbo.monthlyemployeehoursInit = function () {
|
|||||||
|
|
||||||
dbo.monthlyEmployeeHoursModel = {
|
dbo.monthlyEmployeeHoursModel = {
|
||||||
|
|
||||||
uniqueEmployees : ko.observableArray( [] ),
|
uniqueEmployees : ko.observableArray( [] ),
|
||||||
uniqueYears : ko.observableArray( [] ),
|
uniqueYears : ko.observableArray( [] ),
|
||||||
sluggy : ko.observable( 'euro' ),
|
sluggy : ko.observable( 'euro' ),
|
||||||
years : ko.observableArray( [] ),
|
years : ko.observableArray( [] ),
|
||||||
selectedYear : ko.observable(),
|
selectedYear : ko.observable(),
|
||||||
currentTab : false,
|
currentTab : false,
|
||||||
recap : ko.observableArray( [] ),
|
recap : ko.observableArray( [] ),
|
||||||
totalPerEmployee : ko.observableArray( [] ),
|
totalPerEmployee : ko.observableArray( [] ),
|
||||||
totalEmployeeRevenues: ko.observable(),
|
totalEmployeeRevenues : ko.observable(),
|
||||||
totalBudget : ko.observable(),
|
totalEmployeeHours : ko.observable(),
|
||||||
totalCosts : ko.observable(),
|
totalEmployeeAvailableHours: ko.observable(),
|
||||||
totalAvailableBudget : ko.observable(),
|
totalBudget : ko.observable(),
|
||||||
totalSaldo : ko.observable(),
|
totalCosts : ko.observable(),
|
||||||
totalWorkInProgress : ko.observable(),
|
totalAvailableBudget : ko.observable(),
|
||||||
totalInvoicedYear : ko.observableArray( [] ),
|
totalSaldo : ko.observable(),
|
||||||
|
totalWorkInProgress : ko.observable(),
|
||||||
|
totalInvoicedYear : ko.observableArray( [] ),
|
||||||
|
|
||||||
init: function () {
|
init: function () {
|
||||||
var vm = dbo.monthlyEmployeeHoursModel;
|
var vm = dbo.monthlyEmployeeHoursModel;
|
||||||
@@ -54,6 +56,8 @@ dbo.monthlyemployeehoursInit = function () {
|
|||||||
vm.totalSaldo( 0 );
|
vm.totalSaldo( 0 );
|
||||||
vm.totalWorkInProgress( 0 );
|
vm.totalWorkInProgress( 0 );
|
||||||
vm.totalEmployeeRevenues( 0 );
|
vm.totalEmployeeRevenues( 0 );
|
||||||
|
vm.totalEmployeeHours( 0 );
|
||||||
|
vm.totalEmployeeAvailableHours( 0 );
|
||||||
vm.totalPerEmployee.removeAll();
|
vm.totalPerEmployee.removeAll();
|
||||||
vm.totalInvoicedYear.removeAll();
|
vm.totalInvoicedYear.removeAll();
|
||||||
dbo.userDataService.getUniqueProjectEmployees( function ( data ) {
|
dbo.userDataService.getUniqueProjectEmployees( function ( data ) {
|
||||||
@@ -79,6 +83,7 @@ dbo.monthlyemployeehoursInit = function () {
|
|||||||
vm.totalSaldo( dbo.helpers.thousandSeparator( vm.totalSaldo() ) );
|
vm.totalSaldo( dbo.helpers.thousandSeparator( vm.totalSaldo() ) );
|
||||||
vm.totalWorkInProgress( dbo.helpers.thousandSeparator( vm.totalWorkInProgress() ) );
|
vm.totalWorkInProgress( dbo.helpers.thousandSeparator( vm.totalWorkInProgress() ) );
|
||||||
vm.totalEmployeeRevenues( dbo.helpers.thousandSeparator( vm.totalEmployeeRevenues() ) );
|
vm.totalEmployeeRevenues( dbo.helpers.thousandSeparator( vm.totalEmployeeRevenues() ) );
|
||||||
|
vm.totalEmployeeHours( dbo.helpers.thousandSeparator( vm.totalEmployeeHours() ) );
|
||||||
_.each( vm.totalPerEmployee(), function ( p ) {
|
_.each( vm.totalPerEmployee(), function ( p ) {
|
||||||
p.totalRevenue( dbo.helpers.thousandSeparator( p.totalRevenue() ) );
|
p.totalRevenue( dbo.helpers.thousandSeparator( p.totalRevenue() ) );
|
||||||
} );
|
} );
|
||||||
@@ -112,8 +117,6 @@ dbo.monthlyemployeehoursInit = function () {
|
|||||||
|
|
||||||
if ( vm.currentTab == false ) return;
|
if ( vm.currentTab == false ) return;
|
||||||
|
|
||||||
console.log( vm.currentTab );
|
|
||||||
|
|
||||||
dbo.reportsDataService.getEmployeeHours( vm.currentTab.id, vm.selectedYear(), function ( data ) {
|
dbo.reportsDataService.getEmployeeHours( vm.currentTab.id, vm.selectedYear(), function ( data ) {
|
||||||
vm.currentTab.myData( data );
|
vm.currentTab.myData( data );
|
||||||
vm.currentTab.totalJanuari( 0 );
|
vm.currentTab.totalJanuari( 0 );
|
||||||
@@ -293,12 +296,17 @@ dbo.monthlyemployeehoursInit = function () {
|
|||||||
$.each( data.employees, function ( i, p ) {
|
$.each( data.employees, function ( i, p ) {
|
||||||
self.employees.push( new vm.Employee( p ) );
|
self.employees.push( new vm.Employee( p ) );
|
||||||
if ( !self.totalEmployeeRevenues ) self.totalEmployeeRevenues = 0;
|
if ( !self.totalEmployeeRevenues ) self.totalEmployeeRevenues = 0;
|
||||||
|
if ( !self.totalEmployeeHours ) self.totalEmployeeHours = 0;
|
||||||
} );
|
} );
|
||||||
self.totalEmployeeRevenues = data.projectEuros;
|
self.totalEmployeeRevenues = data.projectEuros;
|
||||||
vm.totalEmployeeRevenues( vm.totalEmployeeRevenues() + Number( self.totalEmployeeRevenues ) );
|
|
||||||
self.totalEmployeeRevenues = dbo.helpers.thousandSeparator( self.totalEmployeeRevenues );
|
|
||||||
self.totalEmployeeHours = data.projectHours;
|
self.totalEmployeeHours = data.projectHours;
|
||||||
|
self.hoursAvailable = data.hoursAvailable;
|
||||||
|
vm.totalEmployeeRevenues( vm.totalEmployeeRevenues() + Number( self.totalEmployeeRevenues ) );
|
||||||
|
vm.totalEmployeeHours( vm.totalEmployeeHours() + Number( self.totalEmployeeHours ) );
|
||||||
|
vm.totalEmployeeAvailableHours( vm.totalEmployeeAvailableHours() + Number( self.hoursAvailable ) );
|
||||||
|
self.totalEmployeeRevenues = dbo.helpers.thousandSeparator( self.totalEmployeeRevenues );
|
||||||
self.workInProgress = dbo.helpers.thousandSeparator( data.workInProgress );
|
self.workInProgress = dbo.helpers.thousandSeparator( data.workInProgress );
|
||||||
|
self.hoursAvailable = data.hoursAvailable;
|
||||||
|
|
||||||
self.invoiced = ko.observableArray( [] );
|
self.invoiced = ko.observableArray( [] );
|
||||||
$.each( data.invoiced, function ( i, p ) {
|
$.each( data.invoiced, function ( i, p ) {
|
||||||
@@ -321,12 +329,20 @@ dbo.monthlyemployeehoursInit = function () {
|
|||||||
if ( vm.totalPerEmployee().length == 0 ) hasTotalEmployees = false;
|
if ( vm.totalPerEmployee().length == 0 ) hasTotalEmployees = false;
|
||||||
_.each( data.employees, function ( p ) {
|
_.each( data.employees, function ( p ) {
|
||||||
if ( !hasTotalEmployees ) {
|
if ( !hasTotalEmployees ) {
|
||||||
vm.totalPerEmployee.push( {id: p.id, fullname: p.fullname, totalRevenue: ko.observable( 0 )} );
|
vm.totalPerEmployee.push( {
|
||||||
|
id : p.id,
|
||||||
|
fullname : p.fullname,
|
||||||
|
totalRevenue : ko.observable( 0 ),
|
||||||
|
totalHours : ko.observable( 0 ),
|
||||||
|
totalAvailableHours: ko.observable( 0 )
|
||||||
|
} );
|
||||||
}
|
}
|
||||||
var a = _.find( vm.totalPerEmployee(), function ( o ) {
|
var a = _.find( vm.totalPerEmployee(), function ( o ) {
|
||||||
return o.id == p.id
|
return o.id == p.id
|
||||||
} );
|
} );
|
||||||
a.totalRevenue( a.totalRevenue() + p.revenues );
|
a.totalRevenue( a.totalRevenue() + Number( p.revenues ) );
|
||||||
|
a.totalHours( a.totalHours() + Number( p.hours ) );
|
||||||
|
a.totalAvailableHours( a.totalAvailableHours() + Number( p.availableHours ) );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
var hasTotalsOwpYear = true;
|
var hasTotalsOwpYear = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user