Diverse wijzigingen
This commit is contained in:
@@ -41,6 +41,8 @@ class ProjectsController extends MY_Controller {
|
||||
$project->invoiceDetails =
|
||||
$this->Invoices_model->getOutstandingPerProject( $project->id );
|
||||
|
||||
$project->vatrate = Vat::getCurrentVat();
|
||||
|
||||
$this->json( $project );
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class EmployeeTargetValidation extends BaseValidation {
|
||||
'fieldname' => 'gebruiker'
|
||||
],
|
||||
'startmonth' => [
|
||||
'validations' => 'required|decimal',
|
||||
'validations' => 'integer',
|
||||
'fieldname' => 'startmaand'
|
||||
],
|
||||
'startyear' => [
|
||||
|
||||
@@ -56,7 +56,9 @@ class Employeetarget extends BaseModel {
|
||||
|
||||
if( $monthTarget->count() == 0 ) return 0;
|
||||
|
||||
return $monthTarget->first()->target;
|
||||
$monthtarget = $monthTarget->first();
|
||||
|
||||
return $monthtarget->target;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,4 +27,13 @@ class Vat extends BaseModel {
|
||||
return $vats;
|
||||
}
|
||||
|
||||
public static function getCurrentVat()
|
||||
{
|
||||
$currentVat = Vat::whereActive('T')->whereArchive('F')->first();
|
||||
|
||||
if( ! $currentVat) return 0;
|
||||
|
||||
return $currentVat->vatrate;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,22 +27,28 @@ class Invoices_model extends MY_Model {
|
||||
public function getOutstandingPerProject( $projectID )
|
||||
{
|
||||
$this->sql = "
|
||||
SELECT (own_revenue + other_revenue) AS totalrevenue,
|
||||
ROUND(SUM(INV.invoiceamount * ((100 + vatrate) / 100)), 0) AS totalinvoiced,
|
||||
SUM(payed) AS payed
|
||||
FROM invoices INV
|
||||
JOIN projects PRJ
|
||||
ON PRJ.id = INV.project_id
|
||||
JOIN vats VTS
|
||||
ON VTS.id = INV.vat_id
|
||||
JOIN offers OFF
|
||||
ON PRJ.id = OFF.project_id
|
||||
LEFT JOIN (
|
||||
SELECT SUM(paymentamount) payed, invoice_id
|
||||
FROM payments
|
||||
) PAY
|
||||
ON INV.id = PAY.invoice_id
|
||||
WHERE PRJ.id = {$projectID} ";
|
||||
SELECT (own_revenue + other_revenue) AS totalrevenue,
|
||||
ROUND(SUM(INV.invoiceamount * ((100 + vatrate) / 100)), 0) AS totalinvoiced,
|
||||
(
|
||||
SELECT SUM(paymentamount) PAYMENTAMOUNT
|
||||
FROM payments PAY
|
||||
JOIN invoices INV
|
||||
ON INV.id = PAY.invoice_id
|
||||
WHERE INV.project_id = {$projectID}
|
||||
) AS payed
|
||||
FROM invoices INV
|
||||
JOIN projects PRJ
|
||||
ON PRJ.id = INV.project_id
|
||||
JOIN (
|
||||
SELECT vatrate, id
|
||||
FROM vats
|
||||
WHERE active = 'T'
|
||||
AND archive = 'F'
|
||||
) VTS
|
||||
ON VTS.id = INV.vat_id
|
||||
JOIN offers OFF
|
||||
ON PRJ.id = OFF.project_id
|
||||
WHERE PRJ.id = {$projectID} ";
|
||||
|
||||
$invoiceDetails = $this->get_query_row();
|
||||
|
||||
|
||||
@@ -74,7 +74,28 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="4">
|
||||
<b><h5>te prognotiseren: <span data-bind="text:toForecast"></span></h5></b>
|
||||
<table class="table table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>te factureren</th>
|
||||
<th>geprognosticeerd</th>
|
||||
<th>nog te prognosticeren</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<span data-bind="text:outstanding"></span>
|
||||
</td>
|
||||
<td>
|
||||
<span data-bind="text:totalForecast"></span>
|
||||
</td>
|
||||
<td>
|
||||
<span data-bind="text:toForecast"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
@@ -88,29 +88,34 @@
|
||||
<div class="panel panel-bordered panel-primary panel-line">
|
||||
<div class="panel-heading panel-heading-project">
|
||||
<h3 class="">
|
||||
Financieel
|
||||
Financieel <i class="icon fa-refresh pull-right" title="ververs" data-bind="click:refreshProject"></i>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="panel-body panel-body-project">
|
||||
<label class="col-md-6 col-form-label">eigen omzet</label>
|
||||
<label class="col-md-6 col-form-label">eigen omzet(excl.btw)</label>
|
||||
<div class="col-md-6">
|
||||
<h4 class="form-control-label">
|
||||
<i class="icon fa-euro"> </i><span class="euro-amount" data-bind="text:ownRevenue"></span>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
<label class="col-md-6 col-form-label">overige omzet</label>
|
||||
<label class="col-md-6 col-form-label">overige omzet(excl.btw)</label>
|
||||
<div class="col-md-6">
|
||||
<h4 class="form-control-label">
|
||||
<i class="icon fa-euro"> </i><span class="euro-amount" data-bind="text:otherRevenue"></span>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
<label class="col-md-6 col-form-label">Totaal omzet</label>
|
||||
<label class="col-md-6 col-form-label">Totaal omzet(excl.btw)</label>
|
||||
<div class="col-md-6">
|
||||
<h4><i class="icon fa-euro"> </i><span class="euro-amount" data-bind="text:totalRevenues"></span></h4>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
<label class="col-md-6 col-form-label">Totaal omzet(incl.btw)</label>
|
||||
<div class="col-md-6">
|
||||
<h4><i class="icon fa-euro"> </i><span class="euro-amount" data-bind="text:totalRevenuesIncl"></span></h4>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
<label class="col-md-6 col-form-label">Totaal gefactureerd</label>
|
||||
<div class="col-md-6">
|
||||
<h4><i class="icon fa-euro"> </i><span class="euro-amount" data-bind="text:totalInvoiced"></span></h4>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<th class="rotate"><div><span>totaal bestede uren</span></div></th>
|
||||
<th class="rotate"><div><span>uren jaartarget</span></div></th>
|
||||
<th class="rotate"><div><span>aandeel uren besteed tov target</span></div></th>
|
||||
<th class="rotate"><div><span>bezettingsgraad totaal<br />aantal gewerkte uren</span></div></th>
|
||||
<th class="rotate"><div><span>percentage declarable<br />tov totaal</span></div></th>
|
||||
<th class="rotate"><div><span>bezettingsgraad t.o.v. target<br />factureerbare uren</span></div></th>
|
||||
<th class="rotate"><div><span>omzet</span></div></th>
|
||||
<th class="rotate"><div><span>gemiddeld tarief</span></div></th>
|
||||
|
||||
@@ -67,6 +67,9 @@
|
||||
<th class="align-right">
|
||||
<span data-bind="text:availableRevenue"></span>
|
||||
</th>
|
||||
<th class="align-right">
|
||||
<span data-bind="text:owp"></span>
|
||||
</th>
|
||||
<!-- <td class="align-right">-->
|
||||
<!-- <span data-bind="text:externCosts"></span>-->
|
||||
<!-- </td>-->
|
||||
@@ -100,6 +103,9 @@
|
||||
<th class="align-right">
|
||||
<span data-bind="text:totalAvailableRevenues"></span>
|
||||
</th>
|
||||
<th class="align-right">
|
||||
<span data-bind="text:totalOwp"></span>
|
||||
</th>
|
||||
<!-- <th class="align-right">-->
|
||||
<!-- <span data-bind="text:totalCosts"></span>-->
|
||||
<!-- </th>-->
|
||||
|
||||
Reference in New Issue
Block a user