diuversen opmerkingen 19062018
This commit is contained in:
@@ -132,4 +132,4 @@ $autoload['language'] = array();
|
|||||||
|
|
|
|
||||||
| $autoload['model'] = array('first_model' => 'first');
|
| $autoload['model'] = array('first_model' => 'first');
|
||||||
*/
|
*/
|
||||||
$autoload['model'] = ['beheer/User_model'];
|
$autoload['model'] = ['beheer/User_model', ];
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Created by Pensare Software.
|
||||||
|
* User: Theo Weijmer
|
||||||
|
* Date: 20/06/2018
|
||||||
|
* Time: 14:16
|
||||||
|
*/
|
||||||
|
|
||||||
|
class AuthorisationController extends MY_Controller {
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
|
if( AUTHENTICATED == FALSE ) die('NO ACCES');
|
||||||
|
|
||||||
|
$models = [];
|
||||||
|
$libraries = [];
|
||||||
|
|
||||||
|
$this->load->model( $models );
|
||||||
|
$this->load->library( $libraries );
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRoleAuthorisations()
|
||||||
|
{
|
||||||
|
$roleAuthorisations = Role::getPagesAccessByRole();
|
||||||
|
|
||||||
|
return $roleAuthorisations;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -81,4 +81,11 @@ class ReportsController extends MY_Controller {
|
|||||||
$this->json( $result );
|
$this->json( $result );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function saveCurrentFinnacialYear( $projectID )
|
||||||
|
{
|
||||||
|
$amount = $this->input->post( 'amount' );
|
||||||
|
|
||||||
|
Project::whereId( $projectID )->update( ['current_financial_year' => $amount] );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,7 @@ class Recapprojects {
|
|||||||
private $employeeBudget;
|
private $employeeBudget;
|
||||||
private $uniqueEmployee;
|
private $uniqueEmployee;
|
||||||
private $uniqueEmployees;
|
private $uniqueEmployees;
|
||||||
|
private $currentFinancialYear;
|
||||||
private $projectEmployeeDetail;
|
private $projectEmployeeDetail;
|
||||||
private $projectEmployeeDetails;
|
private $projectEmployeeDetails;
|
||||||
|
|
||||||
@@ -81,6 +82,8 @@ class Recapprojects {
|
|||||||
|
|
||||||
$this->setWorkInProgress();
|
$this->setWorkInProgress();
|
||||||
|
|
||||||
|
$this->setCurrentFinancialYear();
|
||||||
|
|
||||||
$this->index ++;
|
$this->index ++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -223,6 +226,11 @@ class Recapprojects {
|
|||||||
$this->projects[ $this->index ]['workInProgress'] = 0;
|
$this->projects[ $this->index ]['workInProgress'] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function setCurrentFinancialYear()
|
||||||
|
{
|
||||||
|
$this->currentFinancialYear = $this->project['current_financial_year'];
|
||||||
|
}
|
||||||
|
|
||||||
private function setInvoicedYears()
|
private function setInvoicedYears()
|
||||||
{
|
{
|
||||||
foreach ( $this->projects as $this->project )
|
foreach ( $this->projects as $this->project )
|
||||||
|
|||||||
@@ -44,5 +44,14 @@ class Page extends Eloquent {
|
|||||||
return $appPages;
|
return $appPages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getPageAccessByRoleLevel( $roleLevel )
|
||||||
|
{
|
||||||
|
self::selectRaw( "
|
||||||
|
IF(id = page_id, 'MAIN', 'SUB') AS typepage,
|
||||||
|
IF((SELECT {$roleLevel} & pagelevel ) = 0, 'F', 'T') AS pageaccess" )
|
||||||
|
->orderByRaw( "id, IF(id = page_id, 0, 1)" )
|
||||||
|
->get();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -92,7 +92,7 @@ class Project extends BaseModel {
|
|||||||
|
|
||||||
public static function getActiveProjects()
|
public static function getActiveProjects()
|
||||||
{
|
{
|
||||||
$projects = Project::selectRaw( "projects.id, YEAR(projects.startdate) AS instroom, YEAR(projects.enddate) AS uitstroom, projectnumber,
|
$projects = Project::selectRaw( "projects.id, YEAR(projects.startdate) AS instroom, YEAR(projects.enddate) AS uitstroom, projectnumber, current_financial_year,
|
||||||
projectname, CUS.name, OFF.own_revenue, OFF.other_revenue" )
|
projectname, CUS.name, OFF.own_revenue, OFF.other_revenue" )
|
||||||
->join( 'customers AS CUS', 'CUS.id', '=', 'projects.customer_id' )
|
->join( 'customers AS CUS', 'CUS.id', '=', 'projects.customer_id' )
|
||||||
->join( 'offers AS OFF', 'OFF.project_id', '=', 'projects.id' )
|
->join( 'offers AS OFF', 'OFF.project_id', '=', 'projects.id' )
|
||||||
|
|||||||
@@ -42,5 +42,19 @@ class Role extends BaseModel {
|
|||||||
return $roleHierarchy;
|
return $roleHierarchy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getPagesAccessByRole()
|
||||||
|
{
|
||||||
|
$roles = self::all();
|
||||||
|
|
||||||
|
foreach ( $roles as $role )
|
||||||
|
{
|
||||||
|
$pageroles[ $role->id ]['rolelevel'] = $role->rolelevel;
|
||||||
|
$pageroles[ $role->id ]['rolename'] = $role->rolename;
|
||||||
|
|
||||||
|
$pageroles[ $role->id ]['pagesAccess'] =
|
||||||
|
Page::getPageAccessByRoleLevel( $role->rolelevel );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -152,7 +152,7 @@
|
|||||||
event:{keyup:validateNumber}">
|
event:{keyup:validateNumber}">
|
||||||
</div>
|
</div>
|
||||||
<small>
|
<small>
|
||||||
eigen omzet (excl btw)
|
Eigen tarief omzet (excl btw)
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
@@ -167,13 +167,13 @@
|
|||||||
event:{keyup:validateNumber}">
|
event:{keyup:validateNumber}">
|
||||||
</div>
|
</div>
|
||||||
<small>
|
<small>
|
||||||
overige omzet (excl btw)
|
Overige kosten (excl btw)
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="col-md-3 control-label">
|
<label class="col-md-3 control-label">
|
||||||
kosten derden
|
 
|
||||||
</label>
|
</label>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<div class="input-group input-group-icon">
|
<div class="input-group input-group-icon">
|
||||||
|
|||||||
@@ -103,21 +103,21 @@
|
|||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body panel-body-project">
|
<div class="panel-body panel-body-project">
|
||||||
<label class="col-md-6 col-form-label">eigen omzet(excl.btw)</label>
|
<label class="col-md-6 col-form-label">Eigen tarief omzet(excl.btw)</label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<h4 class="form-control-label">
|
<h4 class="form-control-label">
|
||||||
<i class="icon fa-euro"> </i><span class="euro-amount" data-bind="text:ownRevenue"></span>
|
<i class="icon fa-euro"> </i><span class="euro-amount" data-bind="text:ownRevenue"></span>
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
<label class="col-md-6 col-form-label">overige omzet(excl.btw)</label>
|
<label class="col-md-6 col-form-label">Overige kosten(excl.btw)</label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<h4 class="form-control-label">
|
<h4 class="form-control-label">
|
||||||
<i class="icon fa-euro"> </i><span class="euro-amount" data-bind="text:otherRevenue"></span>
|
<i class="icon fa-euro"> </i><span class="euro-amount" data-bind="text:otherRevenue"></span>
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
<label class="col-md-6 col-form-label">kosten(excl.btw)</label>
|
<label class="col-md-6 col-form-label">Kosten derden(excl.btw)</label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<h4 class="form-control-label">
|
<h4 class="form-control-label">
|
||||||
<i class="icon fa-euro"> </i><span class="euro-amount" data-bind="text:costs"></span>
|
<i class="icon fa-euro"> </i><span class="euro-amount" data-bind="text:costs"></span>
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<div class="AUTHORISATION">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<table class="table table-condensed">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>rol</th>
|
||||||
|
<!-- ko foreach:roles -->
|
||||||
|
<th>
|
||||||
|
<span data-bind="text:rolename"></span>
|
||||||
|
</th>
|
||||||
|
<!-- /ko -->
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<td>
|
||||||
|
<span data-bind="text:pagename"></span>
|
||||||
|
</td>
|
||||||
|
<!-- ko foreach:roles -->
|
||||||
|
<th>
|
||||||
|
<span data-bind="text:rolename"></span>
|
||||||
|
</th>
|
||||||
|
<!-- /ko -->
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -5,9 +5,9 @@
|
|||||||
<th class="table-tealish-header">projectleider</th>
|
<th class="table-tealish-header">projectleider</th>
|
||||||
<th class="table-tealish-header">klant</th>
|
<th class="table-tealish-header">klant</th>
|
||||||
<th class="table-tealish-header">start</th>
|
<th class="table-tealish-header">start</th>
|
||||||
<th class="table-tealish-header align-right">eigen omzet</th>
|
<th class="table-tealish-header align-right">eigen tarief omzet</th>
|
||||||
<th class="table-tealish-header align-right">overige omzet</th>
|
<th class="table-tealish-header align-right">overige kosten</th>
|
||||||
<th class="table-tealish-header align-right">kosten</th>
|
<th class="table-tealish-header align-right">Kosten derden</th>
|
||||||
<th class="table-tealish-header align-right">totaal</th>
|
<th class="table-tealish-header align-right">totaal</th>
|
||||||
<th class="table-tealish-header"> </th>
|
<th class="table-tealish-header"> </th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
<script src="js/lib/modules/beheer/customersModule.js?version=<?= $this->version ?>"></script>
|
<script src="js/lib/modules/beheer/customersModule.js?version=<?= $this->version ?>"></script>
|
||||||
<script src="js/lib/modules/beheer/externalsModule.js?version=<?= $this->version ?>"></script>
|
<script src="js/lib/modules/beheer/externalsModule.js?version=<?= $this->version ?>"></script>
|
||||||
<script src="js/lib/modules/beheer/vatModule.js?version=<?= $this->version ?>"></script>
|
<script src="js/lib/modules/beheer/vatModule.js?version=<?= $this->version ?>"></script>
|
||||||
|
<script src="js/lib/modules/beheer/authorisationModule.js?version=<?= $this->version ?>"></script>
|
||||||
<script src="js/lib/modules/projects/offersModule.js?version=<?= $this->version ?>"></script>
|
<script src="js/lib/modules/projects/offersModule.js?version=<?= $this->version ?>"></script>
|
||||||
<script src="js/lib/modules/projects/projectsModule.js?version=<?= $this->version ?>"></script>
|
<script src="js/lib/modules/projects/projectsModule.js?version=<?= $this->version ?>"></script>
|
||||||
<script src="js/lib/modules/projects/employeehoursModule.js?version=<?= $this->version ?>"></script>
|
<script src="js/lib/modules/projects/employeehoursModule.js?version=<?= $this->version ?>"></script>
|
||||||
@@ -67,6 +68,7 @@
|
|||||||
<script src="js/lib/dataservices/invoiceDataService.js"></script>
|
<script src="js/lib/dataservices/invoiceDataService.js"></script>
|
||||||
<script src="js/lib/dataservices/reservationsDataService.js"></script>
|
<script src="js/lib/dataservices/reservationsDataService.js"></script>
|
||||||
<script src="js/lib/dataservices/employeeTargetDataService.js"></script>
|
<script src="js/lib/dataservices/employeeTargetDataService.js"></script>
|
||||||
|
<script src="js/lib/dataservices/authorisationDataService.js"></script>
|
||||||
|
|
||||||
<script src="js/lib/services/chartService.js"></script>
|
<script src="js/lib/services/chartService.js"></script>
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,6 @@
|
|||||||
<th class="rotate">
|
<th class="rotate">
|
||||||
<div><span>instroom</span></div>
|
<div><span>instroom</span></div>
|
||||||
</th>
|
</th>
|
||||||
<th class="rotate">
|
|
||||||
<div><span>uitstroom</span></div>
|
|
||||||
</th>
|
|
||||||
<th class="rotate">
|
<th class="rotate">
|
||||||
<div><span>naam</span></div>
|
<div><span>naam</span></div>
|
||||||
</th>
|
</th>
|
||||||
@@ -39,18 +36,18 @@
|
|||||||
<th class="rotate">
|
<th class="rotate">
|
||||||
<div><span>OWP</span></div>
|
<div><span>OWP</span></div>
|
||||||
</th>
|
</th>
|
||||||
<!-- ko foreach: uniqueYears -->
|
|
||||||
<th class="rotate">
|
<th class="rotate">
|
||||||
<div><span data-bind="text:year"></span></div>
|
<div><span>Lopend boekjaar</span></div>
|
||||||
|
</th>
|
||||||
|
<th class="rotate">
|
||||||
|
<div><span>Volgend boekjaar</span></div>
|
||||||
</th>
|
</th>
|
||||||
<!-- /ko -->
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody data-bind="foreach:recap">
|
<tbody data-bind="foreach:recap">
|
||||||
<tr>
|
<tr>
|
||||||
<td><span data-bind="text:projectnumber"></span></td>
|
<td><span data-bind="text:projectnumber"></span></td>
|
||||||
<td><span data-bind="text:instroom"></span></td>
|
<td><span data-bind="text:instroom"></span></td>
|
||||||
<td><span data-bind="text:uitstroom ? uitstroom : ''"></span></td>
|
|
||||||
<td><span data-bind="text:projectname"></span></td>
|
<td><span data-bind="text:projectname"></span></td>
|
||||||
<td><span data-bind="text:name"></span></td>
|
<td><span data-bind="text:name"></span></td>
|
||||||
<!-- ko foreach: employees -->
|
<!-- ko foreach: employees -->
|
||||||
@@ -70,25 +67,20 @@
|
|||||||
<th class="align-right">
|
<th class="align-right">
|
||||||
<span data-bind="text:owp"></span>
|
<span data-bind="text:owp"></span>
|
||||||
</th>
|
</th>
|
||||||
<!-- <td class="align-right">-->
|
<td width="100px">
|
||||||
<!-- <span data-bind="text:externCosts"></span>-->
|
<input class="form-control form-control-xsm align-right"
|
||||||
<!-- </td>-->
|
data-bind="textInput:currentFinancialYear,
|
||||||
<!-- <th class="align-right">-->
|
event:{keyup:$root.saveCurrentFinancialYear},
|
||||||
<!-- <span data-bind="text:saldo"></span>-->
|
css:{'red-border': ! pristine()}"/>
|
||||||
<!-- </th>-->
|
</td>
|
||||||
<!-- <th class="align-right">-->
|
<td class="align-right">
|
||||||
<!-- <span data-bind="text:workInProgress"></span>-->
|
<span data-bind="text:nextFinancialYears"></span>
|
||||||
<!-- </th>-->
|
</td>
|
||||||
<!-- ko foreach:invoiced -->
|
|
||||||
<th class="align-right">
|
|
||||||
<span data-bind="text:invoiced"></span>
|
|
||||||
</th>
|
|
||||||
<!-- /ko -->
|
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="align-right" colspan="5">totaal</th>
|
<th class="align-right" colspan="4">totaal</th>
|
||||||
<!-- ko foreach: totalPerEmployee -->
|
<!-- ko foreach: totalPerEmployee -->
|
||||||
<th class="align-right">
|
<th class="align-right">
|
||||||
<span data-bind="text:totalRevenue"></span>
|
<span data-bind="text:totalRevenue"></span>
|
||||||
@@ -106,39 +98,13 @@
|
|||||||
<th class="align-right">
|
<th class="align-right">
|
||||||
<span data-bind="text:totalOwp"></span>
|
<span data-bind="text:totalOwp"></span>
|
||||||
</th>
|
</th>
|
||||||
<!-- <th class="align-right">-->
|
|
||||||
<!-- <span data-bind="text:totalCosts"></span>-->
|
|
||||||
<!-- </th>-->
|
|
||||||
<!-- <th class="align-right">-->
|
|
||||||
<!-- <span data-bind="text:totalSaldo"></span>-->
|
|
||||||
<!-- </th>-->
|
|
||||||
<!-- <th class="align-right">-->
|
|
||||||
<!-- <span data-bind="text:totalWorkInProgress"></span>-->
|
|
||||||
<!-- </th>-->
|
|
||||||
<!-- ko foreach:totalInvoicedYear -->
|
|
||||||
<th class="align-right">
|
<th class="align-right">
|
||||||
<span data-bind="text:totalInvoiced"></span>
|
<span data-bind="text:totalCurrentFinancialYear"></span>
|
||||||
|
</th>
|
||||||
|
<th class="align-right">
|
||||||
|
<span data-bind="text:totalNextFinancialYear"></span>
|
||||||
</th>
|
</th>
|
||||||
<!-- /ko -->
|
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
<!--<div class="row">-->
|
|
||||||
<!-- <div class="col-md-3">-->
|
|
||||||
<!-- <div class="graph-holder" style="min-height:350px">-->
|
|
||||||
<!-- <canvas id="recap-revenues" width="300px"></canvas>-->
|
|
||||||
<!-- <div id="recap-revenues-legends"></div>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!-- <div class="col-md-3">-->
|
|
||||||
<!-- <div class="graph-holder" style="min-height:350px">-->
|
|
||||||
<!-- <canvas id="recap-revenues-project" width="300px"></canvas>-->
|
|
||||||
<!-- <div id="recap-revenues-project-legends"></div>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!-- <div class="col-md-6">-->
|
|
||||||
<!-- <div class="graph-holder" style="min-height:350px">-->
|
|
||||||
<!-- <canvas id="recap-owh" width="300px"></canvas>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!--</div>-->
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
/* @override
|
||||||
|
http://dbois.local/css/correction.css?* */
|
||||||
|
|
||||||
body{
|
body{
|
||||||
padding-top:0;
|
padding-top:0;
|
||||||
/*font-size:12px;*/
|
/*font-size:12px;*/
|
||||||
@@ -58,3 +61,7 @@ body{
|
|||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.form-control-xsm {
|
||||||
|
padding: 0px 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -111,6 +111,10 @@ th.focus-green{
|
|||||||
border-bottom: 1px solid red !important;
|
border-bottom: 1px solid red !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.red-border{
|
||||||
|
border: 2px solid red !important;
|
||||||
|
}
|
||||||
|
|
||||||
/*********SWITCH************/
|
/*********SWITCH************/
|
||||||
.onoffswitch {
|
.onoffswitch {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
/**
|
||||||
|
* Created by Pensare Software.
|
||||||
|
* User: Theo Weijmer
|
||||||
|
* Date: 20/06/2018
|
||||||
|
* Time: 14:15
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
dbo.authorisationDataService = {
|
||||||
|
|
||||||
|
getRoleAuthorisations: function ( callback ) {
|
||||||
|
$.getJSON( 'index.php/beheer/AuthorisationController/getRoleAuthorisations' )
|
||||||
|
.done( function ( data ) {
|
||||||
|
callback( data );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -8,14 +8,14 @@
|
|||||||
dbo.employeeTargetDataService = {
|
dbo.employeeTargetDataService = {
|
||||||
|
|
||||||
getEmployeeTargets: function ( employeeID, callback ) {
|
getEmployeeTargets: function ( employeeID, callback ) {
|
||||||
$.getJSON( 'index.php/beheer/employeetargetController/getEmployeeTargets/' + employeeID )
|
$.getJSON( 'index.php/beheer/employeeTargetController/getEmployeeTargets/' + employeeID )
|
||||||
.done( function ( data ) {
|
.done( function ( data ) {
|
||||||
callback( data );
|
callback( data );
|
||||||
} );
|
} );
|
||||||
},
|
},
|
||||||
|
|
||||||
saveEmployeeTarget: function ( submitDATA, callback ) {
|
saveEmployeeTarget: function ( submitDATA, callback ) {
|
||||||
$.post( 'index.php/beheer/employeetargetController/saveEmployeeTarget', submitDATA, function () {
|
$.post( 'index.php/beheer/employeeTargetController/saveEmployeeTarget', submitDATA, function () {
|
||||||
}, 'json' )
|
}, 'json' )
|
||||||
.done( function ( data ) {
|
.done( function ( data ) {
|
||||||
callback( data );
|
callback( data );
|
||||||
|
|||||||
@@ -27,6 +27,13 @@ dbo.reportsDataService = {
|
|||||||
.done( function ( data ) {
|
.done( function ( data ) {
|
||||||
callback( data );
|
callback( data );
|
||||||
} );
|
} );
|
||||||
|
},
|
||||||
|
|
||||||
|
saveCurrentFinnacialYear: function(projectID, amount, callback){
|
||||||
|
$.post( 'index.php/reports/reportsController/saveCurrentFinnacialYear/' + projectID, {amount:amount} )
|
||||||
|
.done( function ( data ) {
|
||||||
|
callback( data );
|
||||||
|
}, 'json' );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
/**
|
||||||
|
* Created by Pensare Software.
|
||||||
|
* User: Theo Weijmer
|
||||||
|
* Date: 20/06/2018
|
||||||
|
* Time: 14:11
|
||||||
|
*/
|
||||||
|
|
||||||
|
dbo.authorisationInit = function () {
|
||||||
|
|
||||||
|
if ( dbo.authorisationModel !== undefined ) {
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
dbo.authorisationModel = {
|
||||||
|
|
||||||
|
roles : ko.observableArray([]) ,
|
||||||
|
|
||||||
|
init: function () {
|
||||||
|
var self = dbo.authorisationModel;
|
||||||
|
|
||||||
|
self.refreshPageAuthorisations();
|
||||||
|
},
|
||||||
|
|
||||||
|
refreshPageAuthorisations: function () {
|
||||||
|
dbo.authorisationDataService.getRoleAuthorisations( function ( data ) {
|
||||||
|
console.log( data );
|
||||||
|
} );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
dbo.authorisationModel.init();
|
||||||
|
|
||||||
|
ko.applyBindings( dbo.authorisationModel, document.getElementById( 'AUTHORISATION' ) );
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -35,6 +35,8 @@ dbo.monthlyemployeehoursInit = function () {
|
|||||||
totalSaldo : ko.observable(),
|
totalSaldo : ko.observable(),
|
||||||
totalOwp : ko.observable(),
|
totalOwp : ko.observable(),
|
||||||
totalWorkInProgress : ko.observable(),
|
totalWorkInProgress : ko.observable(),
|
||||||
|
totalCurrentFinancialYear : ko.observable(),
|
||||||
|
totalNextFinancialYear : ko.observable(),
|
||||||
totalInvoicedYear : ko.observableArray( [] ),
|
totalInvoicedYear : ko.observableArray( [] ),
|
||||||
validYear : ko.observable( true ),
|
validYear : ko.observable( true ),
|
||||||
|
|
||||||
@@ -62,6 +64,8 @@ dbo.monthlyemployeehoursInit = function () {
|
|||||||
vm.totalEmployeeHours( 0 );
|
vm.totalEmployeeHours( 0 );
|
||||||
vm.totalEmployeeAvailableHours( 0 );
|
vm.totalEmployeeAvailableHours( 0 );
|
||||||
vm.totalOwp( 0 );
|
vm.totalOwp( 0 );
|
||||||
|
vm.totalCurrentFinancialYear( 0 );
|
||||||
|
vm.totalNextFinancialYear( 0 );
|
||||||
vm.totalPerEmployee.removeAll();
|
vm.totalPerEmployee.removeAll();
|
||||||
vm.totalInvoicedYear.removeAll();
|
vm.totalInvoicedYear.removeAll();
|
||||||
dbo.userDataService.getUniqueProjectEmployees( function ( data ) {
|
dbo.userDataService.getUniqueProjectEmployees( function ( data ) {
|
||||||
@@ -300,6 +304,7 @@ dbo.monthlyemployeehoursInit = function () {
|
|||||||
var vm = dbo.monthlyEmployeeHoursModel;
|
var vm = dbo.monthlyEmployeeHoursModel;
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
self.projectID = data.id
|
||||||
self.projectnumber = data.projectnumber;
|
self.projectnumber = data.projectnumber;
|
||||||
self.instroom = data.instroom;
|
self.instroom = data.instroom;
|
||||||
self.uitstroom = data.uitstroom;
|
self.uitstroom = data.uitstroom;
|
||||||
@@ -309,7 +314,14 @@ dbo.monthlyemployeehoursInit = function () {
|
|||||||
self.hours = data.hours;
|
self.hours = data.hours;
|
||||||
self.totalEmpoloyeeRevenues = 0;
|
self.totalEmpoloyeeRevenues = 0;
|
||||||
self.availableRevenue = data.own_revenue - data.projectEuros;
|
self.availableRevenue = data.own_revenue - data.projectEuros;
|
||||||
self.owp = self.availableRevenue < 0 ? 0 : self.availableRevenue;
|
self.owpNumber = self.availableRevenue < 0 ? 0 : self.availableRevenue;
|
||||||
|
self.owp = self.owpNumber;
|
||||||
|
self.currentFinancialYear = ko.observable( data.current_financial_year );
|
||||||
|
self.pristine = ko.observable( true );
|
||||||
|
|
||||||
|
self.nextFinancialYears = ko.pureComputed( function () {
|
||||||
|
return dbo.helpers.thousandSeparator( Number( self.owpNumber ) - Number( self.currentFinancialYear() ) );
|
||||||
|
} );
|
||||||
self.externCosts = dbo.helpers.thousandSeparator( data.projectcosts );
|
self.externCosts = dbo.helpers.thousandSeparator( data.projectcosts );
|
||||||
self.budget = dbo.helpers.thousandSeparator( data.budget );
|
self.budget = dbo.helpers.thousandSeparator( data.budget );
|
||||||
self.ownRevenue = dbo.helpers.thousandSeparator( data.own_revenue );
|
self.ownRevenue = dbo.helpers.thousandSeparator( data.own_revenue );
|
||||||
@@ -393,11 +405,53 @@ dbo.monthlyemployeehoursInit = function () {
|
|||||||
this.hours = data.hours;
|
this.hours = data.hours;
|
||||||
this.budget = data.budget;
|
this.budget = data.budget;
|
||||||
this.availableHours = data.availableHours;
|
this.availableHours = data.availableHours;
|
||||||
|
},
|
||||||
|
|
||||||
|
saveCurrentFinancialYear: function () {
|
||||||
|
var self = this;
|
||||||
|
self.pristine( false );
|
||||||
|
|
||||||
|
self.currentFinancialYear( dbo.helpers.validateNumber( self.currentFinancialYear() ) );
|
||||||
|
|
||||||
|
if ( timeout ) {
|
||||||
|
clearTimeout( timeout );
|
||||||
|
timeout = null;
|
||||||
|
}
|
||||||
|
timeout = setTimeout( function () {
|
||||||
|
if ( self.currentFinancialYear().length == 0 ) self.currentFinancialYear( 0 );
|
||||||
|
|
||||||
|
dbo.reportsDataService.saveCurrentFinnacialYear(
|
||||||
|
self.projectID, self.currentFinancialYear(), function () {
|
||||||
|
self.pristine( true );
|
||||||
|
} );
|
||||||
|
}, 400 );
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
dbo.monthlyEmployeeHoursModel.init();
|
dbo.monthlyEmployeeHoursModel.init();
|
||||||
|
|
||||||
|
|
||||||
|
dbo.monthlyEmployeeHoursModel.totalCurrentFinancialYear = ko.pureComputed( function () {
|
||||||
|
var totalCurrentFinancialYear = 0
|
||||||
|
var vm = dbo.monthlyEmployeeHoursModel;
|
||||||
|
_.each( vm.recap(), function ( p ) {
|
||||||
|
totalCurrentFinancialYear += Number( p.currentFinancialYear() );
|
||||||
|
} );
|
||||||
|
|
||||||
|
return dbo.helpers.thousandSeparator( totalCurrentFinancialYear );
|
||||||
|
} );
|
||||||
|
|
||||||
|
dbo.monthlyEmployeeHoursModel.totalNextFinancialYear = ko.pureComputed( function () {
|
||||||
|
var totalNextFinancialYear = 0
|
||||||
|
var vm = dbo.monthlyEmployeeHoursModel;
|
||||||
|
_.each( vm.recap(), function ( p ) {
|
||||||
|
totalNextFinancialYear += Number( p.owpNumber ) - Number( p.currentFinancialYear() );
|
||||||
|
} );
|
||||||
|
|
||||||
|
return dbo.helpers.thousandSeparator( totalNextFinancialYear );
|
||||||
|
} );
|
||||||
|
|
||||||
ko.applyBindings( dbo.monthlyEmployeeHoursModel, document.getElementById( "MONTHLYEMPLOYEEHOURS" ) );
|
ko.applyBindings( dbo.monthlyEmployeeHoursModel, document.getElementById( "MONTHLYEMPLOYEEHOURS" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user