Diverse aanpassing nav mail Peter
This commit is contained in:
@@ -70,6 +70,7 @@ class EmployeeHoursController extends MY_Controller {
|
|||||||
}
|
}
|
||||||
elseif ( $hourType == 'OFFERS' )
|
elseif ( $hourType == 'OFFERS' )
|
||||||
{
|
{
|
||||||
|
$data['projectemployee_id'] = $data['employee_id'];
|
||||||
unset( $data['employee_id'] );
|
unset( $data['employee_id'] );
|
||||||
$data['hourtype_id'] = $data['hourtype_id'] - 8;
|
$data['hourtype_id'] = $data['hourtype_id'] - 8;
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,9 @@ class ProjectsController extends MY_Controller {
|
|||||||
$project->invoiceDetails =
|
$project->invoiceDetails =
|
||||||
$this->Invoices_model->getOutstandingPerProject( $project->id );
|
$this->Invoices_model->getOutstandingPerProject( $project->id );
|
||||||
|
|
||||||
|
$project->hourTotals =
|
||||||
|
Projecthour::getTotalHoursPerProject( $project->id );
|
||||||
|
|
||||||
$this->json( $project );
|
$this->json( $project );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,9 +27,9 @@ class ReportsController extends MY_Controller {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function recapProjects()
|
public function recapProjects( $archive )
|
||||||
{
|
{
|
||||||
$recapprojects = new Recapprojects();
|
$recapprojects = new Recapprojects( $archive );
|
||||||
|
|
||||||
$projects = $recapprojects->getProjects();
|
$projects = $recapprojects->getProjects();
|
||||||
|
|
||||||
@@ -59,9 +59,9 @@ class ReportsController extends MY_Controller {
|
|||||||
$this->json( $result );
|
$this->json( $result );
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getInvoiceOverview( $year = FALSE )
|
public function getInvoiceOverview( $year = FALSE, $orderType, $orderDirection, $archive )
|
||||||
{
|
{
|
||||||
$invoices = new Invoices( $year );
|
$invoices = new Invoices( $year, $orderType, $orderDirection, $archive );
|
||||||
|
|
||||||
$invoiceReport = $invoices->getInvoiceReport();
|
$invoiceReport = $invoices->getInvoiceReport();
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class MY_Controller extends CI_Controller {
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$this->version = '1.00.00';
|
$this->version = '1.00.01';
|
||||||
|
|
||||||
$this->load->library( 'beheer/session/RetrieveUserSession' );
|
$this->load->library( 'beheer/session/RetrieveUserSession' );
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ class Recapprojects {
|
|||||||
|
|
||||||
private $ci;
|
private $ci;
|
||||||
private $index;
|
private $index;
|
||||||
|
private $archive;
|
||||||
private $project;
|
private $project;
|
||||||
private $projects;
|
private $projects;
|
||||||
private $employeeHours;
|
private $employeeHours;
|
||||||
@@ -22,10 +23,12 @@ class Recapprojects {
|
|||||||
private $projectEmployeeDetail;
|
private $projectEmployeeDetail;
|
||||||
private $projectEmployeeDetails;
|
private $projectEmployeeDetails;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct( $archive )
|
||||||
{
|
{
|
||||||
$this->ci =& get_instance();
|
$this->ci =& get_instance();
|
||||||
|
|
||||||
|
$this->archive = $archive;
|
||||||
|
|
||||||
$this->ci->load->Model( 'projects/Invoices_model' );
|
$this->ci->load->Model( 'projects/Invoices_model' );
|
||||||
|
|
||||||
$this->handle();
|
$this->handle();
|
||||||
@@ -51,7 +54,7 @@ class Recapprojects {
|
|||||||
|
|
||||||
private function setProjects()
|
private function setProjects()
|
||||||
{
|
{
|
||||||
$this->projects = Project::getActiveProjects()->toArray();
|
$this->projects = Project::getActiveProjects( $this->archive )->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function setUniqueEmployees()
|
private function setUniqueEmployees()
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ class InvoiceOverview {
|
|||||||
private $invoicesTotal;
|
private $invoicesTotal;
|
||||||
private $needInvoice;
|
private $needInvoice;
|
||||||
private $projectDetails;
|
private $projectDetails;
|
||||||
|
private $projectnumber;
|
||||||
|
|
||||||
public function __construct( $project, $year )
|
public function __construct( $project, $year )
|
||||||
{
|
{
|
||||||
@@ -41,6 +42,8 @@ class InvoiceOverview {
|
|||||||
|
|
||||||
private function handle()
|
private function handle()
|
||||||
{
|
{
|
||||||
|
$this->setProjectnumber();
|
||||||
|
|
||||||
$this->setProjectname();
|
$this->setProjectname();
|
||||||
|
|
||||||
$this->setCustomer();
|
$this->setCustomer();
|
||||||
@@ -60,9 +63,14 @@ class InvoiceOverview {
|
|||||||
$this->setProjectDetails();
|
$this->setProjectDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function setProjectnumber()
|
||||||
|
{
|
||||||
|
$this->projectnumber = $this->project->projectnumber;
|
||||||
|
}
|
||||||
|
|
||||||
private function setProjectname()
|
private function setProjectname()
|
||||||
{
|
{
|
||||||
$this->projectname = $this->project->projectname . '(' . $this->project->projectnumber . ')';
|
$this->projectname = $this->project->projectname;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function setCustomer()
|
private function setCustomer()
|
||||||
@@ -111,6 +119,7 @@ class InvoiceOverview {
|
|||||||
private function setProjectDetails()
|
private function setProjectDetails()
|
||||||
{
|
{
|
||||||
$this->projectDetails = [
|
$this->projectDetails = [
|
||||||
|
'projectnumber' => $this->projectnumber,
|
||||||
'projectname' => $this->projectname,
|
'projectname' => $this->projectname,
|
||||||
'customer' => $this->customer,
|
'customer' => $this->customer,
|
||||||
'totalToInvoicingExcl' => number_format( $this->totalToInvoicingExcl, 0, ',', '.' ),
|
'totalToInvoicingExcl' => number_format( $this->totalToInvoicingExcl, 0, ',', '.' ),
|
||||||
|
|||||||
@@ -20,10 +20,16 @@ class Invoices {
|
|||||||
private $invoiceForecasts;
|
private $invoiceForecasts;
|
||||||
private $invoiceOverviews = [];
|
private $invoiceOverviews = [];
|
||||||
private $invoiceReport = [];
|
private $invoiceReport = [];
|
||||||
|
private $orderType;
|
||||||
|
private $orderDirection;
|
||||||
|
private $archive;
|
||||||
|
|
||||||
public function __construct( $year )
|
public function __construct( $year, $orderType, $orderDirection, $archive )
|
||||||
{
|
{
|
||||||
$this->year = $year;
|
$this->year = $year;
|
||||||
|
$this->orderType = $orderType;
|
||||||
|
$this->orderDirection = $orderDirection;
|
||||||
|
$this->archive = $archive;
|
||||||
|
|
||||||
$this->handle();
|
$this->handle();
|
||||||
}
|
}
|
||||||
@@ -44,7 +50,8 @@ class Invoices {
|
|||||||
|
|
||||||
private function setProjects()
|
private function setProjects()
|
||||||
{
|
{
|
||||||
$this->projects = Project::getProjectsForReport();
|
$this->projects =
|
||||||
|
Project::getProjectsForReport( $this->orderType, $this->orderDirection, $this->archive );
|
||||||
}
|
}
|
||||||
|
|
||||||
private function loopProjects()
|
private function loopProjects()
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ class Project extends BaseModel {
|
|||||||
Project::whereId( $projectID )->delete();
|
Project::whereId( $projectID )->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getActiveProjects()
|
public static function getActiveProjects($archive = 'T')
|
||||||
{
|
{
|
||||||
$projects = Project::selectRaw( "projects.id, YEAR(projects.startdate) AS instroom, YEAR(projects.enddate) AS uitstroom, projectnumber, current_financial_year,
|
$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" )
|
||||||
@@ -104,15 +104,22 @@ class Project extends BaseModel {
|
|||||||
->join( 'offers AS OFF', 'OFF.project_id', '=', 'projects.id' )
|
->join( 'offers AS OFF', 'OFF.project_id', '=', 'projects.id' )
|
||||||
->groupBy( 'projects.id' )
|
->groupBy( 'projects.id' )
|
||||||
->groupBy( 'OFF.own_revenue' )
|
->groupBy( 'OFF.own_revenue' )
|
||||||
->groupBy( 'OFF.other_revenue' )
|
->groupBy( 'OFF.other_revenue' );
|
||||||
->get();
|
|
||||||
|
if( $archive == 'F') $projects = $projects->where('projects.archive', '=', 'F');
|
||||||
|
|
||||||
|
$projects = $projects->get();
|
||||||
|
|
||||||
return $projects;
|
return $projects;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getProjectsForReport()
|
public static function getProjectsForReport( $orderType, $orderDirection, $archive = 'F' )
|
||||||
{
|
{
|
||||||
$projects = self::getBaseProject()->get();
|
$projects = self::getBaseProject();
|
||||||
|
|
||||||
|
if ( $archive == 'F' ) $projects = $projects->whereArchive( 'F' );
|
||||||
|
|
||||||
|
$projects = $projects->orderBy( $orderType, $orderDirection )->get();
|
||||||
|
|
||||||
return $projects;
|
return $projects;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,5 +61,21 @@ class Projecthour extends BaseModel {
|
|||||||
Projecthour::whereId( $projecthourID )->delete();
|
Projecthour::whereId( $projecthourID )->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getTotalHoursPerProject( $projectID )
|
||||||
|
{
|
||||||
|
$totalProjecthours =
|
||||||
|
self::selectRaw( "CONCAT(firstname, ' ', middlename, ' ', lastname) AS fullname,
|
||||||
|
SUM(IF(hourtype_id = 1, hours, 0)) AS declarable,
|
||||||
|
SUM(IF(hourtype_id = 1, hours * tarif, 0)) AS revenues,
|
||||||
|
SUM(IF(hourtype_id != 1, hours, 0)) AS nondeclarable" )
|
||||||
|
->join( 'projectemployees AS PRE', 'PRE.id', '=', 'projecthours.projectemployee_id' )
|
||||||
|
->join( 'users AS USR', 'USR.id', '=', 'PRE.user_id' )
|
||||||
|
->groupBy( 'USR.id' )
|
||||||
|
->where( 'PRE.project_id', '=', $projectID )
|
||||||
|
->get();
|
||||||
|
|
||||||
|
return $totalProjecthours;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -49,7 +49,21 @@ class QEmployeeHours {
|
|||||||
if( $month != 0 ) $sql .= "AND MONTH(hourdate) = '$month' ";
|
if( $month != 0 ) $sql .= "AND MONTH(hourdate) = '$month' ";
|
||||||
$sql .= "
|
$sql .= "
|
||||||
GROUP BY PEM.user_id, MONTH(hourdate)
|
GROUP BY PEM.user_id, MONTH(hourdate)
|
||||||
|
UNION
|
||||||
|
SELECT PH.projectemployee_id AS user_id,
|
||||||
|
MONTH(hourdate) monthID,
|
||||||
|
SUM(hours) AS projecthours,
|
||||||
|
0 AS profitablehours,
|
||||||
|
SUM(IF(hourtype_id = 3, hours, 0)) AS nonprofitablehours,
|
||||||
|
0 AS revenues,
|
||||||
|
0 AS nonprojecthours
|
||||||
|
FROM projecthours PH
|
||||||
|
WHERE YEAR(hourdate) = '{$year}' ";
|
||||||
|
if( $month != 0 ) $sql .= "AND MONTH(hourdate) = '$month' ";
|
||||||
|
$sql .= "
|
||||||
|
GROUP BY PH.projectemployee_id, MONTH(hourdate)
|
||||||
) AS Q1
|
) AS Q1
|
||||||
|
|
||||||
JOIN users AS USR
|
JOIN users AS USR
|
||||||
ON USR.id = Q1.user_id
|
ON USR.id = Q1.user_id
|
||||||
GROUP BY user_id ";
|
GROUP BY user_id ";
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
<div class="panel panel-bordered panel-primary panel-line">
|
||||||
|
<div class="panel-heading panel-heading-project">
|
||||||
|
<h3 class="">
|
||||||
|
projecturen
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
<div class="panel-body panel-body-project">
|
||||||
|
<table class="table table-sm">
|
||||||
|
<thead>
|
||||||
|
<th class="table-cyanish-header" width="40%">
|
||||||
|
medewerker
|
||||||
|
</th>
|
||||||
|
<th class="table-cyanish-header align-right" width="20%">
|
||||||
|
niet declarabel
|
||||||
|
</th>
|
||||||
|
<th class="table-cyanish-header align-right" width="20%">
|
||||||
|
declarabel
|
||||||
|
</th>
|
||||||
|
<th class="table-cyanish-header align-right" width="20%">
|
||||||
|
omzet
|
||||||
|
</th>
|
||||||
|
</thead>
|
||||||
|
<tbody data-bind="foreach:hourTotals">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<span data-bind="text:fullname"></span>
|
||||||
|
</td>
|
||||||
|
<td class="align-right">
|
||||||
|
<span data-bind="text:nondeclarable"></span> uur
|
||||||
|
</td>
|
||||||
|
<td class="align-right">
|
||||||
|
<span data-bind="text:declarable"></span> uur
|
||||||
|
</td>
|
||||||
|
<td class="align-right">
|
||||||
|
<span data-bind="text:revenues"></span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<th class="table-cyanish-header">
|
||||||
|
totaal
|
||||||
|
</th>
|
||||||
|
<th class="align-right table-cyanish-header">
|
||||||
|
<span data-bind="text:totalNonDeclarable"></span> uur
|
||||||
|
</th>
|
||||||
|
<th class="align-right table-cyanish-header">
|
||||||
|
<span data-bind="text:totalDeclarable"></span> uur
|
||||||
|
</th>
|
||||||
|
<th class="align-right table-cyanish-header">
|
||||||
|
<span data-bind="text:totalRevenueHours"></span>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
<?php $this->load->view( 'modals/partials/_projectemployees' ); ?>
|
<?php $this->load->view( 'modals/partials/_projectemployees' ); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-7">
|
<div class="col-md-7">
|
||||||
<?php $this->load->view( 'modals/partials/_hours' ); ?>
|
<?php $this->load->view( 'modals/partials/_hourTotals' ); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,6 +12,24 @@
|
|||||||
maak spreadsheet
|
maak spreadsheet
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="row form-horizontal">
|
||||||
|
<label class="col-md-4 form-control-label">archief</label>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<div class="onoffswitch" data-bind="click:toggleArchive">
|
||||||
|
<input type="checkbox"
|
||||||
|
name="onoffswitch"
|
||||||
|
class="onoffswitch-checkbox"
|
||||||
|
data-bind="checked:archive"
|
||||||
|
id="myonoffswitch">
|
||||||
|
<label class="onoffswitch-label" for="myonoffswitch">
|
||||||
|
<span class="onoffswitch-inner"></span>
|
||||||
|
<span class="onoffswitch-switch"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
|||||||
@@ -8,6 +8,26 @@
|
|||||||
<!-- <div class="invalid-feedback" data-bind="visible: ! validYear()">geen geldig jaar</div>-->
|
<!-- <div class="invalid-feedback" data-bind="visible: ! validYear()">geen geldig jaar</div>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-3">
|
||||||
|
<div class="row form-horizontal">
|
||||||
|
<label class="col-md-4 form-control-label">archief</label>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<div class="onoffswitch" data-bind="click:toggleArchive">
|
||||||
|
<input type="checkbox"
|
||||||
|
name="onoffswitch"
|
||||||
|
class="onoffswitch-checkbox"
|
||||||
|
data-bind="checked:archive"
|
||||||
|
id="myonoffswitch">
|
||||||
|
<label class="onoffswitch-label" for="myonoffswitch">
|
||||||
|
<span class="onoffswitch-inner"></span>
|
||||||
|
<span class="onoffswitch-switch"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="nav-tabs-horizontal">
|
<div class="nav-tabs-horizontal">
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<th class="table-tealish-header pointer"
|
<th class="table-tealish-header pointer"
|
||||||
data-bind="click:directionOrderProjects.bind($data, 'USR.firstname')">projectleider</th>
|
data-bind="click:directionOrderProjects.bind($data, 'USR.firstname')">projectleider</th>
|
||||||
<th class="table-tealish-header pointer"
|
<th class="table-tealish-header pointer"
|
||||||
data-bind="click:directionOrderProjects.bind($data, 'CUS.name')">klant</th>
|
data-bind="click:directionOrderProjects.bind($data, 'projectname')">projectnaam</th>
|
||||||
<th class="table-tealish-header pointer"
|
<th class="table-tealish-header pointer"
|
||||||
data-bind="click:directionOrderProjects.bind($data, 'startdate')">start</th>
|
data-bind="click:directionOrderProjects.bind($data, 'startdate')">start</th>
|
||||||
<th class="table-tealish-header align-right">eigen tarief omzet</th>
|
<th class="table-tealish-header align-right">eigen tarief omzet</th>
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
<span data-bind="text:projectleader"></span>
|
<span data-bind="text:projectleader"></span>
|
||||||
</td>
|
</td>
|
||||||
<td data-bind="click:$root.selectPoject" class="pointer">
|
<td data-bind="click:$root.selectPoject" class="pointer">
|
||||||
<span data-bind="text:customer"></span>
|
<span data-bind="text:projectname, attr:{title:customer}"></span>
|
||||||
</td>
|
</td>
|
||||||
<td data-bind="click:$root.selectPoject" class="pointer">
|
<td data-bind="click:$root.selectPoject" class="pointer">
|
||||||
<span data-bind="text:startdate"></span>
|
<span data-bind="text:startdate"></span>
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
<table class="table table-condensed" style="font-size:0.8em;">
|
<table class="table table-condensed" style="font-size:0.8em;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th class="rotate">
|
||||||
|
<div class="pointer">
|
||||||
|
<span data-bind="click:sortList.bind($data, 'projectnumber')">
|
||||||
|
projectnummer
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</th>
|
||||||
<th class="rotate">
|
<th class="rotate">
|
||||||
<div><span>project</span></div>
|
<div><span>project</span></div>
|
||||||
</th>
|
</th>
|
||||||
@@ -30,6 +37,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<!-- ko foreach: invoiceOverview -->
|
<!-- ko foreach: invoiceOverview -->
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><span data-bind="text:projectnumber"></span></td>
|
||||||
<td><span data-bind="text:projectname"></span></td>
|
<td><span data-bind="text:projectname"></span></td>
|
||||||
<td><span data-bind="text:customer"></span></td>
|
<td><span data-bind="text:customer"></span></td>
|
||||||
<td class="align-right"><span data-bind="text:totalToInvoicingExcl"></span></td>
|
<td class="align-right"><span data-bind="text:totalToInvoicingExcl"></span></td>
|
||||||
@@ -43,7 +51,7 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="2" class="align-right">
|
<th colspan="3" class="align-right">
|
||||||
totaal
|
totaal
|
||||||
</th>
|
</th>
|
||||||
<th class="align-right">
|
<th class="align-right">
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
dbo.invoiceDataService = {
|
dbo.invoiceDataService = {
|
||||||
|
|
||||||
getInvoiceOverview: function ( year, callback ) {
|
getInvoiceOverview: function ( year, orderType, orderDirection, archive, callback ) {
|
||||||
$.getJSON( 'index.php/reports/reportsController/getInvoiceOverview/' + year )
|
$.getJSON( 'index.php/reports/reportsController/getInvoiceOverview/' + year + '/' + orderType + '/' + orderDirection + '/' + archive )
|
||||||
.done( function ( data ) {
|
.done( function ( data ) {
|
||||||
callback( data );
|
callback( data );
|
||||||
} );
|
} );
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ dbo.reportsDataService = {
|
|||||||
} );
|
} );
|
||||||
},
|
},
|
||||||
|
|
||||||
getRecapProjects: function(callback){
|
getRecapProjects: function(archive, callback){
|
||||||
$.getJSON( 'index.php/reports/reportsController/recapProjects' )
|
$.getJSON( 'index.php/reports/reportsController/recapProjects/' + archive )
|
||||||
.done( function ( data ) {
|
.done( function ( data ) {
|
||||||
callback( data );
|
callback( data );
|
||||||
} );
|
} );
|
||||||
|
|||||||
@@ -56,10 +56,10 @@ dbo.helpers = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
findArrayElement: function ( toFind, element, value, array ) {
|
findArrayElement: function ( toFind, element, value, array ) {
|
||||||
console.log( toFind ); // het element in de array
|
// console.log( toFind ); // het element in de array
|
||||||
console.log( element );
|
// console.log( element );
|
||||||
console.log( value );
|
// console.log( value );
|
||||||
console.log( array );
|
// console.log( array );
|
||||||
if ( !Array.isArray( array ) ) return null;
|
if ( !Array.isArray( array ) ) return null;
|
||||||
|
|
||||||
var foundValue = null
|
var foundValue = null
|
||||||
|
|||||||
@@ -56,6 +56,10 @@ $( function () {
|
|||||||
totalForecast : ko.observable(),
|
totalForecast : ko.observable(),
|
||||||
toForecast : ko.observable(),
|
toForecast : ko.observable(),
|
||||||
toInvoice : 0,
|
toInvoice : 0,
|
||||||
|
hourTotals : ko.observableArray( [] ),
|
||||||
|
totalNonDeclarable : ko.observable( 0 ),
|
||||||
|
totalDeclarable : ko.observable( 0 ),
|
||||||
|
totalRevenueHours : ko.observable( 0 ),
|
||||||
|
|
||||||
init: function () {
|
init: function () {
|
||||||
var vm = dbo.editProjectModal;
|
var vm = dbo.editProjectModal;
|
||||||
@@ -835,6 +839,22 @@ $( function () {
|
|||||||
vm.costs( dbo.helpers.numberWithPoints( Math.round( Number( data.offer.costs ) ) ) );
|
vm.costs( dbo.helpers.numberWithPoints( Math.round( Number( data.offer.costs ) ) ) );
|
||||||
vm.totalRevenues( dbo.helpers.numberWithPoints( Math.round( revenues ) ) );
|
vm.totalRevenues( dbo.helpers.numberWithPoints( Math.round( revenues ) ) );
|
||||||
|
|
||||||
|
vm.hourTotals.removeAll();
|
||||||
|
vm.totalNonDeclarable( 0 );
|
||||||
|
vm.totalDeclarable( 0 );
|
||||||
|
vm.totalRevenueHours( 0 );
|
||||||
|
_.each( data.hourTotals, function ( p ) {
|
||||||
|
vm.hourTotals.push( {
|
||||||
|
fullname : p.fullname,
|
||||||
|
nondeclarable: p.nondeclarable,
|
||||||
|
declarable : p.declarable,
|
||||||
|
revenues : dbo.helpers.numberWithPoints( Math.round( Number( p.revenues ) ) )
|
||||||
|
} );
|
||||||
|
vm.totalNonDeclarable( Number( vm.totalNonDeclarable() ) + Number( p.nondeclarable ) );
|
||||||
|
vm.totalDeclarable( Number( vm.totalDeclarable() ) + Number( p.declarable ) );
|
||||||
|
vm.totalRevenueHours( Number( vm.totalRevenueHours() ) + Number( p.revenues ) );
|
||||||
|
} );
|
||||||
|
vm.totalRevenueHours( dbo.helpers.numberWithPoints( Math.round( vm.totalRevenueHours() ) ) );
|
||||||
|
|
||||||
_.each( data.projectemployees, function ( p ) {
|
_.each( data.projectemployees, function ( p ) {
|
||||||
vm.projectEmployees.push( new vm.Projectemployee( p ) );
|
vm.projectEmployees.push( new vm.Projectemployee( p ) );
|
||||||
@@ -1012,7 +1032,6 @@ $( function () {
|
|||||||
},
|
},
|
||||||
|
|
||||||
Reservation: function ( data ) {
|
Reservation: function ( data ) {
|
||||||
console.log( data );
|
|
||||||
this.id = data.id;
|
this.id = data.id;
|
||||||
this.project_id = data.project_id;
|
this.project_id = data.project_id;
|
||||||
this.reservationamount = ko.observable( data.reservationamount );
|
this.reservationamount = ko.observable( data.reservationamount );
|
||||||
|
|||||||
@@ -154,6 +154,7 @@ dbo.projectsInit = function () {
|
|||||||
self.id = data.id;
|
self.id = data.id;
|
||||||
self.projectnumber = data.projectnumber;
|
self.projectnumber = data.projectnumber;
|
||||||
self.projectleader = data.projectleader ? data.projectleader.fullname : '#NB';
|
self.projectleader = data.projectleader ? data.projectleader.fullname : '#NB';
|
||||||
|
self.projectname = data.projectname;
|
||||||
self.customer = data.customer ? data.customer.name : '#NB';
|
self.customer = data.customer ? data.customer.name : '#NB';
|
||||||
self.startdate = data.startdate;
|
self.startdate = data.startdate;
|
||||||
self.enddate = data.enddate;
|
self.enddate = data.enddate;
|
||||||
|
|||||||
@@ -35,6 +35,9 @@ dbo.invoicereportInit = function () {
|
|||||||
forecastOtherYears : ko.observable(),
|
forecastOtherYears : ko.observable(),
|
||||||
forecastRemaining : ko.observable(),
|
forecastRemaining : ko.observable(),
|
||||||
totalProjectPayments : ko.observable(),
|
totalProjectPayments : ko.observable(),
|
||||||
|
orderType : 'projectnumber',
|
||||||
|
orderDirection : false,
|
||||||
|
archive : ko.observable( false ),
|
||||||
|
|
||||||
init: function () {
|
init: function () {
|
||||||
var vm = dbo.invoicereport;
|
var vm = dbo.invoicereport;
|
||||||
@@ -52,7 +55,10 @@ dbo.invoicereportInit = function () {
|
|||||||
|
|
||||||
vm.resetTotals();
|
vm.resetTotals();
|
||||||
|
|
||||||
dbo.invoiceDataService.getInvoiceOverview( vm.selectedYear(), function ( data ) {
|
var orderDirection = vm.orderDirection ? 'ASC' : 'DESC';
|
||||||
|
var archive = vm.archive() ? 'T' : 'F';
|
||||||
|
|
||||||
|
dbo.invoiceDataService.getInvoiceOverview( vm.selectedYear(), vm.orderType, orderDirection, archive, function ( data ) {
|
||||||
vm.invoiceOverview( data.invoiceOverview );
|
vm.invoiceOverview( data.invoiceOverview );
|
||||||
vm.setInvoiceOverviewTotals( data.invoiceOverview );
|
vm.setInvoiceOverviewTotals( data.invoiceOverview );
|
||||||
|
|
||||||
@@ -81,6 +87,22 @@ dbo.invoicereportInit = function () {
|
|||||||
} );
|
} );
|
||||||
},
|
},
|
||||||
|
|
||||||
|
toggleArchive: function () {
|
||||||
|
var vm = dbo.invoicereport;
|
||||||
|
vm.archive( !vm.archive() );
|
||||||
|
|
||||||
|
vm.initModule();
|
||||||
|
},
|
||||||
|
|
||||||
|
sortList: function ( orderType ) {
|
||||||
|
var vm = dbo.invoicereport;
|
||||||
|
|
||||||
|
vm.orderType = orderType;
|
||||||
|
vm.orderDirection = !vm.orderDirection;
|
||||||
|
|
||||||
|
vm.initModule();
|
||||||
|
},
|
||||||
|
|
||||||
resetTotals: function () {
|
resetTotals: function () {
|
||||||
var vm = dbo.invoicereport;
|
var vm = dbo.invoicereport;
|
||||||
|
|
||||||
@@ -165,6 +187,7 @@ dbo.invoicereportInit = function () {
|
|||||||
Monthforecast: function ( data ) {
|
Monthforecast: function ( data ) {
|
||||||
var vm = dbo.invoicereport;
|
var vm = dbo.invoicereport;
|
||||||
var self = this;
|
var self = this;
|
||||||
|
self.projectnumber = data.projectnumber;
|
||||||
self.projectname = data.projectname;
|
self.projectname = data.projectname;
|
||||||
self.customer = data.customer;
|
self.customer = data.customer;
|
||||||
self.needInvoice = data.needInvoice;
|
self.needInvoice = data.needInvoice;
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ dbo.monthlyemployeehoursInit = function () {
|
|||||||
totalNextFinancialYear : ko.observable(),
|
totalNextFinancialYear : ko.observable(),
|
||||||
totalInvoicedYear : ko.observableArray( [] ),
|
totalInvoicedYear : ko.observableArray( [] ),
|
||||||
validYear : ko.observable( true ),
|
validYear : ko.observable( true ),
|
||||||
|
archive : ko.observable(),
|
||||||
|
|
||||||
init: function () {
|
init: function () {
|
||||||
var vm = dbo.monthlyEmployeeHoursModel;
|
var vm = dbo.monthlyEmployeeHoursModel;
|
||||||
@@ -72,7 +73,9 @@ dbo.monthlyemployeehoursInit = function () {
|
|||||||
vm.uniqueEmployees.push( new vm.UniqueEmployee( p ) )
|
vm.uniqueEmployees.push( new vm.UniqueEmployee( p ) )
|
||||||
} );
|
} );
|
||||||
} );
|
} );
|
||||||
dbo.reportsDataService.getRecapProjects( function ( data ) {
|
|
||||||
|
var archive = vm.archive() ? 'T' : 'F';
|
||||||
|
dbo.reportsDataService.getRecapProjects( archive, function ( data ) {
|
||||||
vm.recap.removeAll();
|
vm.recap.removeAll();
|
||||||
vm.uniqueYears.removeAll();
|
vm.uniqueYears.removeAll();
|
||||||
$.each( data, function ( i, p ) {
|
$.each( data, function ( i, p ) {
|
||||||
@@ -121,6 +124,13 @@ dbo.monthlyemployeehoursInit = function () {
|
|||||||
} );
|
} );
|
||||||
},
|
},
|
||||||
|
|
||||||
|
toggleArchive: function () {
|
||||||
|
var vm = dbo.monthlyEmployeeHoursModel;
|
||||||
|
|
||||||
|
vm.archive( !vm.archive() );
|
||||||
|
vm.initModule();
|
||||||
|
},
|
||||||
|
|
||||||
checkYear: function () {
|
checkYear: function () {
|
||||||
var vm = dbo.monthlyEmployeeHoursModel;
|
var vm = dbo.monthlyEmployeeHoursModel;
|
||||||
if ( timeout ) {
|
if ( timeout ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user