Spreadsheet

This commit is contained in:
2018-07-29 21:26:49 +02:00
parent 30535f7048
commit b86c3fc4b9
26 changed files with 1286 additions and 432 deletions
@@ -59,26 +59,22 @@ class ReportsController extends MY_Controller {
$this->json( $result );
}
public function getInvoiceOverview( $year )
public function getInvoiceOverview( $year = FALSE )
{
$sql = Qinvoiceoverview::fire( $year );
$invoices = new Invoices( $year );
$query = $this->db->query( $sql );
$invoiceReport = $invoices->getInvoiceReport();
$result = $query->result();
$this->json( $invoiceReport );
}
foreach ( $result as $project )
{
$sql = QinvoiceMonthOverview::fire( $project->id, $year );
public function createInvoicesSpreadsheet( $year = FALSE )
{
$invoices = new Invoices( $year );
$query = $this->db->query( $sql );
$invoiceReport = $invoices->getInvoiceReport();
$months = $query->result();
$project->months = $months;
}
$this->json( $result );
new InvoiceSpreadsheet($invoiceReport);
}
public function saveCurrentFinnacialYear( $projectID )
@@ -0,0 +1,80 @@
<?php
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 29/07/2018
* Time: 20:40
*/
class InvoiceSheet {
const HEADERS = [
'A' => 'project',
'B' => 'klant',
'C' => 'Totaal te factureren excl. btw',
'D' => 'Totaal te factureren incl. btw',
'E' => 'Gefactureerd overige jaren incl. btw',
'F' => 'Gefactureerd lopende boekjaar incl. btw',
'G' => 'Gefactureerd totaal incl. btw',
'H' => 'Nog te factureren incl. btw'
];
private $invoiceOverview;
private $sheet;
private $row;
public function __construct( $invoiceOverview, $sheet )
{
$this->invoiceOverview = $invoiceOverview;
$this->sheet = $sheet;
$this->handle();
}
private function handle()
{
$this->setHeader();
$this->setBody();
$this->setTotals();
}
private function setHeader()
{
foreach ( self::HEADERS as $cell => $header )
{
$this->sheet->setCellValue( $cell . '1', $header );
$this->sheet->getColumnDimension( $cell )->setAutoSize( TRUE );
}
}
private function setBody()
{
$this->row = 2;
foreach ( $this->invoiceOverview AS $project )
{
$this->sheet->setCellValue( 'A' . $this->row, $project['projectname'] );
$this->sheet->setCellValue( 'B' . $this->row, $project['customer'] );
$this->sheet->setCellValue( 'C' . $this->row, str_replace( '.', '', $project['totalToInvoicingExcl'] ) );
$this->sheet->setCellValue( 'D' . $this->row, str_replace( '.', '', $project['totalToInvoicingIncl'] ) );
$this->sheet->setCellValue( 'E' . $this->row, str_replace( '.', '', $project['totalInvoicedOtherYears'] ) );
$this->sheet->setCellValue( 'F' . $this->row, str_replace( '.', '', $project['totalInvoicedThisYear'] ) );
$this->sheet->setCellValue( 'G' . $this->row, str_replace( '.', '', $project['invoicesTotal'] ) );
$this->sheet->setCellValue( 'H' . $this->row, str_replace( '.', '', $project['needInvoice'] ) );
$this->row ++;
}
}
private function setTotals()
{
$lastRow = $this->row - 1;
$this->sheet->setCellValue( 'C' . $this->row, '=SUM(C2:C' . $lastRow . ')' );
$this->sheet->setCellValue( 'D' . $this->row, '=SUM(D2:D' . $lastRow . ')' );
$this->sheet->setCellValue( 'E' . $this->row, '=SUM(E2:E' . $lastRow . ')' );
$this->sheet->setCellValue( 'F' . $this->row, '=SUM(F2:F' . $lastRow . ')' );
$this->sheet->setCellValue( 'G' . $this->row, '=SUM(G2:G' . $lastRow . ')' );
$this->sheet->setCellValue( 'H' . $this->row, '=SUM(H2:H' . $lastRow . ')' );
}
}
@@ -0,0 +1,88 @@
<?php
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 29/07/2018
* Time: 20:04
*/
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
class InvoiceSpreadsheet {
private $invoiceReport;
private $spreadsheet;
private $invoiceSheet;
private $fullpathname;
private $filename;
private $ci;
public function __construct( $invoiceReport )
{
$this->ci =& get_instance();
$this->invoiceReport = $invoiceReport;
$this->ci->load->helper( 'download' );
$this->handle();
}
private function handle()
{
$this->setSpreadsheet();
$this->setInvoiceSheet();
$this->setFilename();
$this->setFullPathname();
$this->createFile();
$this->downloadSpreadsheet();
}
private function setSpreadsheet()
{
$this->spreadsheet = new Spreadsheet();
}
private function setInvoiceSheet()
{
$invoiceSheet = new Worksheet( $this->spreadsheet, 'Facturen' );
$this->invoiceSheet =
$this->spreadsheet->addSheet( $invoiceSheet );
new InvoiceSheet( $this->invoiceReport['invoiceOverview'], $this->invoiceSheet );
}
private function setFilename()
{
$this->filename = 'facturen' . date( 'YmdHis' ) . '.xlsx';
}
private function setFullPathname()
{
$this->fullpathname = MYROOTPATH . 'documents/spreadsheets/' . $this->filename;
}
private function createFile()
{
$writer = new Xlsx( $this->spreadsheet );
$writer->save( $this->fullpathname );
}
private function downloadSpreadsheet()
{
$data = file_get_contents( $this->fullpathname );
force_download( $this->filename, $data );
}
}
@@ -0,0 +1,124 @@
<?php
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 29/07/2018
* Time: 13:14
*/
class InvoiceForecast {
private $year;
private $project;
private $customer;
private $forecast;
private $currentYear;
private $projectname;
private $needInvoice;
private $projectDetails;
private $forecastThisYear = 0;
private $forecastRemaining;
private $forecastOtherYears = 0;
public function __construct( $project, $needInvoice, $year )
{
$this->project = $project;
$this->needInvoice = $needInvoice;
$this->year = $year;
$this->handle();
}
public function getProjectDetails()
{
return $this->projectDetails;
}
public function getNeedInvoice()
{
return $this->needInvoice;
}
public function getForecastOtherYear()
{
return $this->forecastOtherYears;
}
public function getForecastRemaining()
{
return $this->forecastRemaining;
}
private function handle()
{
$this->setCurrentyear();
$this->setProjectname();
$this->setCustomer();
$this->loopForecasts();
$this->setForecastRemaining();
$this->setProjectDetails();
}
private function setCurrentyear()
{
$this->currentYear = date( 'Y' );
}
private function setProjectname()
{
$this->projectname = $this->project->projectname . '(' . $this->project->projectnumber . ')';
}
private function setCustomer()
{
$this->customer = $this->project->customer->name;
}
private function loopForecasts()
{
if ( is_null( $this->project->forecasts ) ) return $this->forecastThisYear = 0;
foreach ( $this->project->forecasts as $this->forecast )
{
$this->setForecastThisYear();
$this->setForecastOtherYears();
}
}
private function setForecastThisYear()
{
if ( $this->forecast->year == $this->year )
$this->forecastThisYear += $this->forecast->forecastamount;
}
private function setForecastOtherYears()
{
if ( $this->forecast->year != $this->year )
$this->forecastOtherYears += $this->forecast->forecastamount;
}
private function setForecastRemaining()
{
$this->forecastRemaining =
$this->needInvoice - $this->forecastThisYear - $this->forecastOtherYears;
}
private function setProjectDetails()
{
$this->projectDetails = [
'projectname' => $this->projectname,
'customer' => $this->customer,
'needInvoice' => number_format( $this->needInvoice, 0, ',', '.' ),
'forecastThisYear' => number_format( $this->forecastThisYear, 0, ',', '.' ),
'forecastOtherYears' => number_format( $this->forecastOtherYears, 0, ',', '.' ),
'forecastRemaining' => number_format( $this->forecastRemaining, 0, ',', '.' ),
];
}
}
@@ -0,0 +1,129 @@
<?php
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 29/07/2018
* Time: 10:29
*/
class InvoiceOverview {
private $project;
private $currentYear;
private $projectname;
private $customer;
private $totalToInvoicingExcl;
private $totalToInvoicingIncl;
private $totalInvoicedOtherYears;
private $totalInvoicedThisYear;
private $invoicesTotal;
private $needInvoice;
private $projectDetails;
public function __construct( $project )
{
$this->project = $project;
$this->handle();
}
public function getProjectDetails()
{
return $this->projectDetails;
}
public function getNeedinvoice( )
{
return $this->needInvoice;
}
private function handle()
{
$this->setCurrentyear();
$this->setProjectname();
$this->setCustomer();
$this->setTotalToInvoicingExcl();
$this->setTotalToInvoicingIncl();
$this->setTotalInvoicedOtherYears();
$this->setTotalInvoicedThisYear();
$this->setInvoicesTotal();
$this->setNeedInvoice();
$this->setProjectDetails();
}
private function setCurrentyear()
{
$this->currentYear = date( 'Y' );
}
private function setProjectname()
{
$this->projectname = $this->project->projectname . '(' . $this->project->projectnumber . ')';
}
private function setCustomer()
{
$this->customer = $this->project->customer->name;
}
private function setTotalToInvoicingExcl()
{
$offer = $this->project->offer;
$this->totalToInvoicingExcl =
$offer->own_revenue + $offer->other_revenue + $offer->costs;
}
private function setTotalToInvoicingIncl()
{
$this->totalToInvoicingIncl =
$this->totalToInvoicingExcl * ( 1 + ( $this->project->vat->vatrate / 100 ) );
}
private function setTotalInvoicedOtherYears()
{
$this->totalInvoicedOtherYears =
Invoice::invoicePerYear( $this->project->id, $this->currentYear, FALSE );
}
private function setTotalInvoicedThisYear()
{
$this->totalInvoicedThisYear =
Invoice::invoicePerYear( $this->project->id, $this->currentYear, TRUE );
}
private function setInvoicesTotal()
{
$this->invoicesTotal =
$this->totalInvoicedOtherYears + $this->totalInvoicedThisYear;
}
private function setNeedInvoice()
{
$this->needInvoice =
$this->totalToInvoicingIncl - $this->invoicesTotal;
}
private function setProjectDetails()
{
$this->projectDetails = [
'projectname' => $this->projectname,
'customer' => $this->customer,
'totalToInvoicingExcl' => number_format( $this->totalToInvoicingExcl, 0, ',', '.' ),
'totalToInvoicingIncl' => number_format( $this->totalToInvoicingIncl, 0, ',', '.' ),
'totalInvoicedOtherYears' => number_format( $this->totalInvoicedOtherYears, 0, ',', '.' ),
'totalInvoicedThisYear' => number_format( $this->totalInvoicedThisYear, 0, ',', '.' ),
'invoicesTotal' => number_format( $this->invoicesTotal, 0, ',', '.' ),
'needInvoice' => number_format( $this->needInvoice, 0, ',', '.' )
];
}
}
@@ -0,0 +1,104 @@
<?php
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 29/07/2018
* Time: 10:19
*/
class Invoices {
private $year;
private $project;
private $projects;
private $monthPayment;
private $monthPayments;
private $monthForecast;
private $monthForecasts;
private $invoiceOverview;
private $invoiceForecast;
private $invoiceForecasts;
private $invoiceOverviews = [];
private $invoiceReport = [];
public function __construct( $year )
{
$this->year = $year;
$this->handle();
}
public function getInvoiceReport()
{
return $this->invoiceReport;
}
private function handle()
{
$this->setProjects();
$this->loopProjects();
$this->setInvoiceReport();
}
private function setProjects()
{
$this->projects = Project::getProjectsForReport();
}
private function loopProjects()
{
foreach ( $this->projects as $this->project )
{
$this->setInvoiceOverview();
$this->setInvoiceForecasts();
$this->setMonthForecasts();
$this->setMonthPayments();
}
}
private function setInvoiceOverview()
{
$this->invoiceOverview = new InvoiceOverview( $this->project, $this->year );
$this->invoiceOverviews[] = $this->invoiceOverview->getProjectDetails();
}
private function setInvoiceForecasts()
{
$this->invoiceForecast =
new InvoiceForecast( $this->project, $this->invoiceOverview->getNeedinvoice(), $this->year );
$this->invoiceForecasts[] = $this->invoiceForecast->getProjectDetails();
}
public function setMonthForecasts()
{
$this->monthForecast =
new MonthForecast( $this->invoiceForecast, $this->project, $this->year );
$this->monthForecasts[] = $this->monthForecast->getProjectDetails();
}
public function setMonthPayments()
{
$this->monthPayment =
new MonthPayments( $this->project, $this->year );
$this->monthPayments[] = $this->monthPayment->getProjectDetails();
}
private function setInvoiceReport()
{
$this->invoiceReport = [
'invoiceOverview' => $this->invoiceOverviews,
'forecasts' => $this->invoiceForecasts,
'monthForecasts' => $this->monthForecasts,
'monthPayments' => $this->monthPayments
];
}
}
@@ -0,0 +1,91 @@
<?php
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 29/07/2018
* Time: 14:23
*/
class MonthForecast {
private $year;
private $project;
private $forecast;
private $customer;
private $projectname;
private $forecastMonths;
private $projectDetails;
private $invoiceForecast;
public function __construct( InvoiceForecast $invoiceForecast, $project, $year )
{
$this->project = $project;
$this->invoiceForecast = $invoiceForecast;
$this->year = $year;
$this->handle();
}
public function getProjectDetails()
{
return $this->projectDetails;
}
private function handle()
{
$this->setProjectname();
$this->setCustomer();
$this->setInitialsForecastMonths();
$this->loopForecasts();
$this->setProjectDetails();
}
private function setProjectname()
{
$this->projectname = $this->project->projectname . '(' . $this->project->projectnumber . ')';
}
private function setCustomer()
{
$this->customer = $this->project->customer->name;
}
private function setInitialsForecastMonths()
{
for ( $i = 1; $i <= 12; $i ++ )
{
$this->forecastMonths[ $i ] = ['forecastamount' => 0];
}
}
private function loopForecasts()
{
foreach ( $this->project->forecasts as $this->forecast )
{
$this->setMonthForecast();
}
}
private function setMonthForecast()
{
if ( $this->forecast->year == $this->year )
$this->forecastMonths[ $this->forecast->month_id ]['forecastamount'] += $this->forecast->forecastamount;
}
private function setProjectDetails()
{
$this->projectDetails = [
'projectname' => $this->projectname,
'customer' => $this->customer,
'needInvoice' => number_format( $this->invoiceForecast->getNeedInvoice(), 0, ',', '.' ),
'forecastOtherYears' => number_format( $this->invoiceForecast->getForecastOtherYear(), 0, ',', '.' ),
'forecastRemaining' => number_format( $this->invoiceForecast->getForecastRemaining(), 0, ',', '.' ),
'forecastMonths' => $this->forecastMonths
];
}
}
@@ -0,0 +1,100 @@
<?php
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 29/07/2018
* Time: 14:23
*/
class MonthPayments {
private $year;
private $project;
private $payment;
private $customer;
private $projectname;
private $monthPayments;
private $projectDetails;
private $totalProjectPayments;
public function __construct( $project, $year )
{
$this->project = $project;
$this->year = $year;
$this->handle();
}
public function getProjectDetails()
{
return $this->projectDetails;
}
private function handle()
{
$this->setProjectname();
$this->setCustomer();
$this->setInitialsMonthPayments();
$this->loopPayments();
$this->setProjectDetails();
}
private function setProjectname()
{
$this->projectname = $this->project->projectname . '(' . $this->project->projectnumber . ')';
}
private function setCustomer()
{
$this->customer = $this->project->customer->name;
}
private function setInitialsMonthPayments()
{
for ( $i = 1; $i <= 12; $i ++ )
{
$this->monthPayments[ $i ] = ['paymentamount' => 0];
}
}
private function loopPayments()
{
foreach ( $this->project->invoices as $invoice )
{
foreach($invoice->payments as $this->payment)
{
$this->setMonthPayments();
$this->setTotalProjectPayments();
}
}
}
private function setMonthPayments()
{
$paymentYear = date( 'Y', strtotime( $this->payment->paymentdate ) );
$paymentMonth = date( 'n', strtotime( $this->payment->paymentdate ) );
if ( $paymentYear == $this->year )
$this->monthPayments[ $paymentMonth ]['paymentamount'] += $this->payment->paymentamount;
}
private function setTotalProjectPayments()
{
$this->totalProjectPayments += $this->payment->paymentamount;
}
private function setProjectDetails()
{
$this->projectDetails = [
'projectname' => $this->projectname,
'customer' => $this->customer,
'monthPayments' => $this->monthPayments,
'totalProjectPayments' => number_format( $this->totalProjectPayments, 0, ',', '.' )
];
}
}
+22
View File
@@ -24,6 +24,28 @@ class Invoice extends BaseModel {
return $this->belongsTo( 'Vat' );
}
public static function invoicePerYear( $projectID, $year, $thatYear = TRUE )
{
$invoices = Invoice::selectRAW( 'SUM(invoiceamount * ( 1 +(vatrate / 100))) AS invoicetotal' )
->join( 'vats', 'vats.id', '=', 'invoices.vat_id' )
->whereProjectId( $projectID );
if ( $thatYear )
{
$invoices = $invoices->whereRaw( "YEAR(invoicedate) = {$year}" );
}
else
{
$invoices = $invoices->whereRaw( "YEAR(invoicedate) != {$year}" );
}
if ( $invoices->count() == 0 ) return 0;
$invoices = $invoices->first();
return $invoices->invoicetotal;
}
public static function saveInvoice( $invoiceID, $invoice )
{
$invoice = (array) $invoice;
+8
View File
@@ -104,6 +104,13 @@ class Project extends BaseModel {
return $projects;
}
public static function getProjectsForReport()
{
$projects = self::getBaseProject()->get();
return $projects;
}
public static function getBaseProject()
{
$project = Project::with( [
@@ -115,6 +122,7 @@ class Project extends BaseModel {
'projectemployees.user' => function ( $q ) {
$q->selectRaw( "id, CONCAT(firstname, ' ', middlename, ' ', lastname) AS fullname" );
}] )
->with('vat')
->with(['forecasts'])
->with(['reservations'])
->with( 'projectemployees.projecthours' )
@@ -0,0 +1,61 @@
<div id="INVOICEREPORT">
<div class="row">
<div class="col-md-1">
<label>jaar</label>
</div>
<div class="col-md-2">
<input type="text" class="form-control" data-bind="textInput:selectedYear, event:{keyup:checkYear}">
<div class="invalid-feedback" data-bind="visible: ! validYear()">geen geldig jaar</div>
</div>
<div class="col-md-2">
<button class="btn btn-success" data-bind="click:createSpreadsheet">
maak spreadsheet
</button>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="nav-tabs-horizontal">
<ul class="nav nav-tabs nav-tabs-solid">
<li class="nav-item"
data-bind="click:setActivetab.bind($data, 'invoice')" style="z-index:10">
<a class="nav-link"
data-bind="css:{'active':invoiceTab() == 'invoice'}">facturen</a>
</li>
<li class="nav-item" data-bind="click:setActivetab.bind($data, 'forecast')" style="z-index:10">
<a class="nav-link"
data-bind="css:{'active':invoiceTab() == 'forecast'}">prognoses</a>
</li>
<li class="nav-item" data-bind="click:setActivetab.bind($data, 'monthforecast')" style="z-index:10">
<a class="nav-link"
data-bind="css:{'active':invoiceTab() == 'monthforecast'}">maand prognoses</a>
</li>
<li class="nav-item" data-bind="click:setActivetab.bind($data, 'monthpayments')" style="z-index:10">
<a class="nav-link" data-bind="css:{'active':invoiceTab() == 'monthpayments'}">maand betalingen</a>
</li>
<li class="nav-item" data-bind="click:setActivetab.bind($data, 'externals')" style="z-index:10">
<a class="nav-link" data-bind="css:{'active':invoiceTab() == 'externals'}">onderaannemers</a>
</li>
</ul>
<div class="tab-content">
<div data-bind="visible:invoiceTab() == 'invoice'">
<?php $this->load->view('reports/invoices/invoiceoverview_report'); ?>
</div>
<div id="invoiceforecast" data-bind="visible:invoiceTab() == 'forecast'">
<?php $this->load->view('reports/invoices/invoiceforecast_report'); ?>
</div>
<div id="invoiceforecast" data-bind="visible:invoiceTab() == 'monthforecast'">
<?php $this->load->view('reports/invoices/monthforecast_report'); ?>
</div>
<div id="invoiceforecast" data-bind="visible:invoiceTab() == 'monthpayments'">
<?php $this->load->view('reports/invoices/monthpayment_report'); ?>
</div>
<div id="invoiceforecast" data-bind="visible:invoiceTab() == 'externals'">
<?php $this->load->view('reports/invoices/contractors_report'); ?>
</div>
</div>
</div>
</div>
</div>
</div>
@@ -1,37 +0,0 @@
<div id="OUTGOINGINVOICES">
<div class="row">
<div class="col-md-1">
<label>jaar</label>
</div>
<div class="col-md-2">
<input type="text" class="form-control" data-bind="textInput:selectedYear, event:{keyup:checkYear}">
<div class="invalid-feedback" data-bind="visible: ! validYear()">geen geldig jaar</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="nav-tabs-horizontal">
<ul class="nav nav-tabs nav-tabs-solid">
<li class="nav-item" data-bind="click:setActivetab.bind($data, 'invoice')" style="z-index:10">
<a class="nav-link" data-bind="css:{'active':invoiceTab() == 'invoice'}">facturen</a>
</li>
<li class="nav-item" data-bind="click:setActivetab.bind($data, 'forecast')" style="z-index:10">
<a class="nav-link" data-bind="css:{'active':invoiceTab() == 'forecast'}">prognoses</a>
</li>
<li class="nav-item" data-bind="click:setActivetab.bind($data, 'monthforecast')" style="z-index:10">
<a class="nav-link" data-bind="css:{'active':invoiceTab() == 'monthforecast'}">maand prognoses</a>
</li>
<li class="nav-item" data-bind="click:setActivetab.bind($data, 'monthpayments')" style="z-index:10">
<a class="nav-link" data-bind="css:{'active':invoiceTab() == 'monthpayments'}">maand betalingen</a>
</li>
<li class="nav-item" data-bind="click:setActivetab.bind($data, 'externals')" style="z-index:10">
<a class="nav-link" data-bind="css:{'active':invoiceTab() == 'externals'}">onderaannemers</a>
</li>
</ul>
<div class="tab-content">
<?php $this->load->view('reports/invoices/_invoicetable'); ?>
</div>
</div>
</div>
</div>
</div>
+1 -1
View File
@@ -44,7 +44,7 @@
<script src="js/lib/modules/projects/employeehoursModule.js?version=<?= $this->version ?>"></script>
<script src="js/lib/modules/reports/monthlyEmployeeHoursModule.js?version=<?= $this->version ?>"></script>
<script src="js/lib/modules/reports/employeeHours.js?version=<?= $this->version ?>"></script>
<script src="js/lib/modules/reports/outgoingInvoices.js?version=<?= $this->version ?>"></script>
<script src="js/lib/modules/reports/invoicereport.js?version=<?= $this->version ?>"></script>
<script src="js/lib/modules/reports/reservations.js?version=<?= $this->version ?>"></script>
<!-- ***********MODALS************* -->
@@ -1,218 +0,0 @@
<table class="table table-condensed" style="font-size:0.8em;">
<thead>
<tr>
<th class="rotate">
<div><span>project</span></div>
</th>
<th class="rotate" width="150px">
<div><span>klant</span></div>
</th>
<th class="rotate" width="100px">
<div><span>status afgehandeld</span></div>
</th>
<!-- <th class="rotate">-->
<!-- <div><span>projectleider</span></div>-->
<!-- </th>-->
<!-- ko if:$root.invoiceTab() == 'invoice' -->
<th class="rotate">
<div><span>te factureren(excl btw)</span></div>
</th>
<th class="rotate">
<div><span>te factureren(incl btw)</span></div>
</th>
<th class="rotate">
<div><span>gefactureerd <br />voorgaande jaren(incl btw)</span></div>
</th>
<th class="rotate">
<div><span>gefactureerd <br />lopend jaar(incl btw)</span></div>
</th>
<th class="rotate">
<div><span>totaal gefactureerd</span></div>
</th>
<th class="rotate">
<div><span>betaald voorgaande jaren</span></div>
</th>
<th class="rotate">
<div><span>betaald lopend jaar</span></div>
</th>
<th class="rotate">
<div><span>totaal betaald</span></div>
</th>
<th class="rotate">
<div><span>nog niet betaald</span></div>
</th>
<!-- /ko -->
<!-- ko if:$root.invoiceTab() == 'forecast' -->
<th class="rotate" width="100px">
<div><span>nog te factureren (incl.btw)</span></div>
</th>
<th class="rotate" width="100px">
<div><span>nog te factureren lopend jaar</span></div>
</th>
<th class="rotate" width="100px">
<div><span>nog te factureren na lopend jaar</span></div>
</th>
<th class="rotate" width="100px">
<div><span>nog te prognotiseren</span></div>
</th>
<!-- /ko -->
<!-- ko if:$root.invoiceTab() == 'monthforecast' -->
<th class="rotate">
<div><span>te factureren(incl btw)</span></div>
</th>
<!-- ko foreach:months -->
<th class="rotate"><div><span data-bind="text:month"></span></div></th>
<!-- /ko -->
<th class="rotate">
<div><span>te factureren volgende jaren</span></div>
</th>
<!-- /ko -->
<!-- ko if:$root.invoiceTab() == 'monthpayments' -->
<!-- ko foreach:months -->
<th class="rotate"><div><span data-bind="text:month"></span></div></th>
<!-- /ko -->
<!-- /ko -->
</tr>
</thead>
<tbody>
<!-- ko foreach: projects -->
<tr>
<td><span data-bind="text:projectnumber"></span></td>
<td><span data-bind="text:customername"></span></td>
<td><span data-bind="text:statusProject == 'CLOSED' ? 'afgesloten' : 'open'"></span></td>
<!-- <td><span data-bind="text:fullname"></span>-->
</td>
<!-- ko if:$root.invoiceTab() == 'invoice' -->
<td class="align-right">
<i class="icon fa-euro"></i>
<span data-bind="text:revenues"></span>
</td>
<td class="align-right">
<i class="icon fa-euro"></i>
<span data-bind="text:totalInvoice"></span>
</td>
<td class="align-right">
<i class="icon fa-euro"></i>
<span data-bind="text:invoicedOtherYears"></span>
</td>
<td class="align-right">
<i class="icon fa-euro"></i>
<span data-bind="text:invoicedCurentYear"></span>
</td>
<th class="align-right focus-green">
<i class="icon fa-euro"></i>
<span data-bind="text:totalInvoiced"></span>
</th>
<td class="align-right">
<i class="icon fa-euro"></i>
<span data-bind="text:invoicedOtherYearsPayed"></span>
</td>
<td class="align-right">
<i class="icon fa-euro"></i>
<span data-bind="text:invoicedCurentYearPayed"></span>
</td>
<th class="align-right focus-green">
<i class="icon fa-euro"></i>
<span data-bind="text:totalInvoicedPayed"></span>
</th>
<th class="align-right">
<i class="icon fa-euro"></i>
<span data-bind="text:notPayed"></span>
</th>
<!-- /ko -->
<!-- ko if:$root.invoiceTab() == 'forecast' -->
<td class="align-right">
<i class="icon fa-euro"></i>
<span data-bind="text:toInvoice"></span>
</td>
<td class="align-right">
<i class="icon fa-euro"></i>
<span data-bind="text:currentforecast"></span>
</td>
<td class="align-right">
<i class="icon fa-euro"></i>
<span data-bind="text:otherforecast"></span>
</td>
<th class="align-right focus-green">
<i class="icon fa-euro"></i>
<span data-bind="text:missingForecast"></span>
</th>
<!-- /ko -->
<!-- ko if:$root.invoiceTab() == 'monthforecast' -->
<td class="align-right">
<i class="icon fa-euro"></i>
<span data-bind="text:toInvoice"></span>
</td>
<!-- ko foreach:months -->
<td class="align-right">
<span data-bind="text:forecastamount">
</span>
</td>
<!-- /ko -->
<td class="align-right">
<i class="icon fa-euro"></i>
<span data-bind="text:toInvoiceFuture">
</span>
</td>
<!-- /ko -->
<!-- ko if:$root.invoiceTab() == 'monthpayments' -->
<!-- ko foreach:months -->
<td class="align-right">
<span data-bind="text:paymentamount">
</span>
</td>
<!-- /ko -->
<!-- /ko -->
</tr>
<!-- /ko -->
</tbody>
<tfoot>
<tr>
<th colspan="3" class="align-right">
totaal
</th>
<!-- ko if:$root.invoiceTab() == 'forecast' -->
<th class="align-right">
<i class="icon fa-euro"></i>
<span data-bind="text:totalToInvoice"></span>
</th>
<th class="align-right">
<i class="icon fa-euro"></i>
<span data-bind="text:totalCurrentforecast"></span>
</th>
<th class="align-right">
<i class="icon fa-euro"></i>
<span data-bind="text:totalOtherforecast"></span>
</th>
<th class="align-right focus-green">
<i class="icon fa-euro"></i>
<span data-bind="text:totalMissingForecast"></span>
</th>
<!-- /ko -->
<!-- ko if:$root.invoiceTab() == 'monthforecast' -->
<th class="align-right">
<i class="icon fa-euro"></i>
<span data-bind="text:totalToInvoice"></span>
</th>
<!-- ko foreach:months -->
<th class="align-right">
<span data-bind="text:dbo.helpers.numberWithPoints($root['forecast' + month]())">
</span>
</th>
<!-- /ko -->
<th class="align-right">
<i class="icon fa-euro"></i>
<span data-bind="text:totalToInvoiceFuture"></span>
</th>
<!-- /ko -->
<!-- ko if:$root.invoiceTab() == 'monthpayments' -->
<!-- ko foreach:months -->
<th class="align-right">
<span data-bind="text:dbo.helpers.numberWithPoints($root['payment' + month]())">
</span>
</th>
<!-- /ko -->
<!-- /ko -->
</tr>
</tfoot>
</table>
@@ -0,0 +1,7 @@
<?php
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 29/07/2018
* Time: 13:21
*/
@@ -0,0 +1,55 @@
<table class="table table-condensed" style="font-size:0.8em;">
<thead>
<tr>
<th class="rotate">
<div><span>project</span></div>
</th>
<th class="rotate">
<div><span>klant</span></div>
</th>
<th class="rotate">
<div><span>Nog te factureren<br />incl. btw</span></div>
</th>
<th class="rotate">
<div><span>Nog te factureren<br />lopend boekjaar incl. btw</span></div>
</th>
<th class="rotate">
<div><span>Nog te factureren<br /> na lopend boekjaar incl. btw</span></div>
</th>
<th class="rotate">
<div><span>Nog te prognotiseren<br />incl. btw</span></div>
</th>
</tr>
</thead>
<tbody>
<!-- ko foreach: forecasts -->
<tr>
<td><span data-bind="text:projectname"></span></td>
<td><span data-bind="text:customer"></span></td>
<td class="align-right"><span data-bind="text:needInvoice"></span></td>
<td class="align-right"><span data-bind="text:forecastThisYear"></span></td>
<td class="align-right"><span data-bind="text:forecastOtherYears"></span></td>
<td class="align-right focus-green"><span data-bind="text:forecastRemaining"></span></td>
</tr>
<!-- /ko -->
</tbody>
<tfoot>
<tr>
<th colspan="2" class="align-right">
totaal
</th>
<th class="align-right">
<span data-bind="text:needInvoice"></span>
</th>
<th class="align-right">
<span data-bind="text:forecastThisYear"></span>
</th>
<th class="align-right">
<span data-bind="text:forecastOtherYears"></span>
</th>
<th class="align-right focus-green">
<span data-bind="text:forecastRemaining"></span>
</th>
</tr>
</tfoot>
</table>
@@ -0,0 +1,69 @@
<table class="table table-condensed" style="font-size:0.8em;">
<thead>
<tr>
<th class="rotate">
<div><span>project</span></div>
</th>
<th class="rotate">
<div><span>klant</span></div>
</th>
<th class="rotate">
<div><span>Totaal te factureren<br />excl. btw</span></div>
</th>
<th class="rotate">
<div><span>Totaal te factureren<br />incl. btw</span></div>
</th>
<th class="rotate">
<div><span>Gefactureerd overige jaren<br />incl. btw</span></div>
</th>
<th class="rotate">
<div><span>Gefactureerd lopende boekjaar<br />incl. btw</span></div>
</th>
<th class="rotate">
<div><span>Gefactureerd totaal<br />incl. btw</span></div>
</th>
<th class="rotate">
<div><span>Nog te factureren<br />incl. btw</span></div>
</th>
</tr>
</thead>
<tbody>
<!-- ko foreach: invoiceOverview -->
<tr>
<td><span data-bind="text:projectname"></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:totalToInvoicingIncl"></span></td>
<td class="align-right"><span data-bind="text:totalInvoicedOtherYears"></span></td>
<td class="align-right"><span data-bind="text:totalInvoicedThisYear"></span></td>
<td class="align-right"><span data-bind="text:invoicesTotal"></span></td>
<td class="align-right focus-green"><span data-bind="text:needInvoice"></span></td>
</tr>
<!-- /ko -->
</tbody>
<tfoot>
<tr>
<th colspan="2" class="align-right">
totaal
</th>
<th class="align-right">
<span data-bind="text:totalToInvoicingExcl"></span>
</th>
<th class="align-right">
<span data-bind="text:totalToInvoicingIncl"></span>
</th>
<th class="align-right">
<span data-bind="text:totalInvoicedOtherYears"></span>
</th>
<th class="align-right">
<span data-bind="text:totalInvoicedThisYear"></span>
</th>
<th class="align-right">
<span data-bind="text:invoicesTotal"></span>
</th>
<th class="align-right focus-green">
<span data-bind="text:needInvoice"></span>
</th>
</tr>
</tfoot>
</table>
@@ -0,0 +1,61 @@
<table class="table table-condensed" style="font-size:0.8em;">
<thead>
<tr>
<th class="rotate">
<div><span>project</span></div>
</th>
<th class="rotate">
<div><span>klant</span></div>
</th>
<th class="rotate">
<div><span>Nog te factureren<br />incl. btw</span></div>
</th>
<!-- ko foreach:months -->
<th class="rotate">
<div><span data-bind="text:month"></span></div>
</th>
<!-- /ko -->
<th class="rotate">
<div><span>Nog te factureren<br /> na lopend boekjaar incl. btw</span></div>
</th>
<th class="rotate">
<div><span>Nog te prognotiseren<br />incl. btw</span></div>
</th>
</tr>
</thead>
<tbody>
<!-- ko foreach: monthForecasts -->
<tr>
<td><span data-bind="text:projectname"></span></td>
<td><span data-bind="text:customer"></span></td>
<td class="align-right focus-green"><span data-bind="text:needInvoice"></span></td>
<!-- ko foreach : forecastMonths -->
<td class="align-right"><span data-bind="text:forecastamount"></span></td>
<!-- /ko -->
<td class="align-right"><span data-bind="text:forecastOtherYears"></span></td>
<td class="align-right focus-green"><span data-bind="text:forecastRemaining"></span></td>
</tr>
<!-- /ko -->
</tbody>
<tfoot>
<tr>
<th colspan="2" class="align-right">
</th>
<th class="align-right focus-green">
<span data-bind="text:needInvoice"></span>
</th>
<!-- ko foreach:monthTotals -->
<th class="align-right">
<span data-bind="text:forecastamount()"></span>
</th>
<!-- /ko -->
<th class="align-right">
<span data-bind="text:forecastOtherYears"></span>
</th>
<th class="align-right focus-green">
<span data-bind="text:forecastRemaining"></span>
</th>
</tr>
</tfoot>
</table>
@@ -0,0 +1,47 @@
<table class="table table-condensed" style="font-size:0.8em;">
<thead>
<tr>
<th class="rotate">
<div><span>project</span></div>
</th>
<th class="rotate">
<div><span>klant</span></div>
</th>
<!-- ko foreach:months -->
<th class="rotate">
<div><span data-bind="text:month"></span></div>
</th>
<!-- /ko -->
<th class="rotate">
<div><span>Totaal gefactureerd<br />lopend boekjaar incl. btw</span></div>
</th>
</tr>
</thead>
<tbody>
<!-- ko foreach: monthPayments -->
<tr>
<td><span data-bind="text:projectname"></span></td>
<td><span data-bind="text:customer"></span></td>
<!-- ko foreach : paymentMonths -->
<td class="align-right"><span data-bind="text:paymentamount"></span></td>
<!-- /ko -->
<td class="align-right focus-green"><span data-bind="text:totalProjectPayments"></span></td>
</tr>
<!-- /ko -->
</tbody>
<tfoot>
<tr>
<th colspan="2" class="align-right">
totaal
</th>
<!-- ko foreach:monthPaymentTotals -->
<th class="align-right">
<span data-bind="text:paymentamount"></span>
</th>
<!-- /ko -->
<th class="align-right focus-green">
<span data-bind="text:totalProjectPayments"></span>
</th>
</tr>
</tfoot>
</table>