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