Sortering factuuroverzicht rapportages
This commit is contained in:
@@ -108,7 +108,7 @@ class Invoices {
|
|||||||
|
|
||||||
private function setInvoiced()
|
private function setInvoiced()
|
||||||
{
|
{
|
||||||
$this->invoiced = Invoice::getInvoiced( $this->year );
|
$this->invoiced = Invoice::getInvoiced( $this->year, $this->orderType, $this->orderDirection );
|
||||||
}
|
}
|
||||||
|
|
||||||
private function setInvoicedYears()
|
private function setInvoicedYears()
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ class MonthForecast {
|
|||||||
private function setProjectDetails()
|
private function setProjectDetails()
|
||||||
{
|
{
|
||||||
$this->projectDetails = [
|
$this->projectDetails = [
|
||||||
|
'projectnumber' => $this->project->projectnumber,
|
||||||
'projectname' => $this->projectname,
|
'projectname' => $this->projectname,
|
||||||
'customer' => $this->customer,
|
'customer' => $this->customer,
|
||||||
'needInvoice' => number_format( $this->invoiceForecast->getNeedInvoice(), 0, ',', '.' ),
|
'needInvoice' => number_format( $this->invoiceForecast->getNeedInvoice(), 0, ',', '.' ),
|
||||||
@@ -88,4 +89,4 @@ class MonthForecast {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ class MonthPayments {
|
|||||||
private function setProjectDetails()
|
private function setProjectDetails()
|
||||||
{
|
{
|
||||||
$this->projectDetails[] = [
|
$this->projectDetails[] = [
|
||||||
|
'projectnumber' => $this->project->projectnumber,
|
||||||
'projectname' => $this->projectname,
|
'projectname' => $this->projectname,
|
||||||
'customer' => $this->customer,
|
'customer' => $this->customer,
|
||||||
'monthPayments' => $this->monthPayments,
|
'monthPayments' => $this->monthPayments,
|
||||||
|
|||||||
@@ -63,13 +63,13 @@ class Invoice extends BaseModel {
|
|||||||
return $invoiceID;
|
return $invoiceID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getInvoiced( $year )
|
public static function getInvoiced( $year, $orderType='invoicedate', $orderDirection='DESC' )
|
||||||
{
|
{
|
||||||
$invoiced = Invoice::selectRaw('invoicenumber, PRJ.projectname, projectnumber, CUS.name, invoicedate, CUS.name, ROUND(invoiceamount, 0) AS invoiceamount')
|
$invoiced = Invoice::selectRaw('invoicenumber, PRJ.projectname, projectnumber, CUS.name, invoicedate, CUS.name, ROUND(invoiceamount, 0) AS invoiceamount')
|
||||||
->join('projects AS PRJ', 'PRJ.id', '=', 'invoices.project_id')
|
->join('projects AS PRJ', 'PRJ.id', '=', 'invoices.project_id')
|
||||||
->join('customers AS CUS', 'CUS.id', '=', 'PRJ.customer_id')
|
->join('customers AS CUS', 'CUS.id', '=', 'PRJ.customer_id')
|
||||||
->whereRaw("DATE_FORMAT(invoicedate, '%Y') = {$year}")
|
->whereRaw("DATE_FORMAT(invoicedate, '%Y') = {$year}")
|
||||||
->orderBy('invoicedate')
|
->orderBy($orderType, $orderDirection)
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
return $invoiced;
|
return $invoiced;
|
||||||
|
|||||||
@@ -3,6 +3,13 @@
|
|||||||
<table class="table table-striped table-condensed">
|
<table class="table table-striped table-condensed">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th>
|
||||||
|
<div class="pointer">
|
||||||
|
<span data-bind="click:sortList.bind($data, 'projectnumber')">
|
||||||
|
projectnummer
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</th>
|
||||||
<th>
|
<th>
|
||||||
factuurnummer
|
factuurnummer
|
||||||
</th>
|
</th>
|
||||||
@@ -28,6 +35,9 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody data-bind="foreach:invoiced">
|
<tbody data-bind="foreach:invoiced">
|
||||||
<tr>
|
<tr>
|
||||||
|
<td>
|
||||||
|
<span data-bind="text:projectnumber"></span>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span data-bind="text:invoicenumber"></span>
|
<span data-bind="text:invoicenumber"></span>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -26,7 +33,8 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<!-- ko foreach: monthForecasts -->
|
<!-- ko foreach: monthForecasts -->
|
||||||
<tr>
|
<tr>
|
||||||
<td><span data-bind="text:projectname"></span></td>
|
<td><span data-bind="text:projectnumber"></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 focus-green"><span data-bind="text:needInvoice"></span></td>
|
<td class="align-right focus-green"><span data-bind="text:needInvoice"></span></td>
|
||||||
<!-- ko foreach : forecastMonths -->
|
<!-- ko foreach : forecastMonths -->
|
||||||
@@ -58,4 +66,4 @@
|
|||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -20,7 +27,8 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<!-- ko foreach: monthPayments -->
|
<!-- ko foreach: monthPayments -->
|
||||||
<tr>
|
<tr>
|
||||||
<td><span data-bind="text:projectname"></span></td>
|
<td><span data-bind="text:projectnumber"></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>
|
||||||
<!-- ko foreach : paymentMonths -->
|
<!-- ko foreach : paymentMonths -->
|
||||||
<td class="align-right"><span data-bind="text:paymentamount"></span></td>
|
<td class="align-right"><span data-bind="text:paymentamount"></span></td>
|
||||||
@@ -44,4 +52,4 @@
|
|||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -235,6 +235,7 @@ dbo.invoicereportInit = function () {
|
|||||||
Monthpayment: function (data) {
|
Monthpayment: 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.totalProjectPayments = data.totalProjectPayments
|
self.totalProjectPayments = data.totalProjectPayments
|
||||||
@@ -259,6 +260,7 @@ dbo.invoicereportInit = function () {
|
|||||||
this.invoiceamount = dbo.helpers.thousandSeparator(data.invoiceamount)
|
this.invoiceamount = dbo.helpers.thousandSeparator(data.invoiceamount)
|
||||||
this.vat = dbo.helpers.thousandSeparator(vat)
|
this.vat = dbo.helpers.thousandSeparator(vat)
|
||||||
this.inclVat = dbo.helpers.thousandSeparator(inclVat)
|
this.inclVat = dbo.helpers.thousandSeparator(inclVat)
|
||||||
|
this.projectnumber = data.projectnumber
|
||||||
this.project = data.projectnumber + ' ' + data.projectname
|
this.project = data.projectnumber + ' ' + data.projectname
|
||||||
this.invoicedate = data.invoicedate
|
this.invoicedate = data.invoicedate
|
||||||
this.name = data.name
|
this.name = data.name
|
||||||
|
|||||||
Reference in New Issue
Block a user