mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Working on reports
This commit is contained in:
parent
a67a04525b
commit
2387d45960
@ -70,6 +70,8 @@ class AbstractReport
|
|||||||
$class[] = 'group-letter-100';
|
$class[] = 'group-letter-100';
|
||||||
} elseif (in_array($field, ['amount', 'paid', 'balance'])) {
|
} elseif (in_array($field, ['amount', 'paid', 'balance'])) {
|
||||||
$class[] = 'group-number-50';
|
$class[] = 'group-number-50';
|
||||||
|
} elseif (in_array($field, ['age'])) {
|
||||||
|
$class[] = 'group-number-30';
|
||||||
}
|
}
|
||||||
|
|
||||||
$class = count($class) ? implode(' ', $class) : 'group-false';
|
$class = count($class) ? implode(' ', $class) : 'group-false';
|
||||||
@ -90,8 +92,9 @@ class AbstractReport
|
|||||||
$columns_labeled = $this->tableHeaderArray();
|
$columns_labeled = $this->tableHeaderArray();
|
||||||
$str = '';
|
$str = '';
|
||||||
|
|
||||||
foreach ($columns_labeled as $field => $attr)
|
foreach ($columns_labeled as $field => $attr) {
|
||||||
$str .= "<th class=\"{$attr['class']}\" data-priority=\"3\">{$attr['label']}</th>";
|
$str .= sprintf('<th class="%s" data-priorityx="3">%s</th>', $attr['class'], $attr['label']);
|
||||||
|
}
|
||||||
|
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ class AgingReport extends AbstractReport
|
|||||||
'invoice_number',
|
'invoice_number',
|
||||||
'invoice_date',
|
'invoice_date',
|
||||||
'due_date',
|
'due_date',
|
||||||
'age' => ['group-number-30'],
|
'age',
|
||||||
'amount',
|
'amount',
|
||||||
'balance',
|
'balance',
|
||||||
];
|
];
|
||||||
|
@ -19,19 +19,17 @@ class QuoteReport extends AbstractReport
|
|||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
$account = Auth::user()->account;
|
$account = Auth::user()->account;
|
||||||
$status = $this->options['invoice_status'];
|
$statusIds = $this->options['status_ids'];
|
||||||
$exportFormat = $this->options['export_format'];
|
$exportFormat = $this->options['export_format'];
|
||||||
|
|
||||||
$clients = Client::scope()
|
$clients = Client::scope()
|
||||||
->orderBy('name')
|
->orderBy('name')
|
||||||
->withArchived()
|
->withArchived()
|
||||||
->with('contacts')
|
->with('contacts')
|
||||||
->with(['invoices' => function ($query) use ($status) {
|
->with(['invoices' => function ($query) use ($statusIds) {
|
||||||
if ($status == 'draft') {
|
|
||||||
$query->whereIsPublic(false);
|
|
||||||
}
|
|
||||||
$query->quotes()
|
$query->quotes()
|
||||||
->withArchived()
|
->withArchived()
|
||||||
|
->statusIds($statusIds)
|
||||||
->where('invoice_date', '>=', $this->startDate)
|
->where('invoice_date', '>=', $this->startDate)
|
||||||
->where('invoice_date', '<=', $this->endDate)
|
->where('invoice_date', '<=', $this->endDate)
|
||||||
->with(['invoice_items']);
|
->with(['invoice_items']);
|
||||||
|
@ -247,14 +247,16 @@
|
|||||||
->appendIcon(Icon::create('play'))
|
->appendIcon(Icon::create('play'))
|
||||||
->large() !!}
|
->large() !!}
|
||||||
|
|
||||||
<button id="popover" type="button" class="btn btn-default btn-lg">
|
@if (request()->report_type)
|
||||||
{{ trans('texts.columns') }}
|
<button id="popover" type="button" class="btn btn-default btn-lg">
|
||||||
{!! Icon::create('th-list') !!}
|
{{ trans('texts.columns') }}
|
||||||
</button>
|
{!! Icon::create('th-list') !!}
|
||||||
|
</button>
|
||||||
|
|
||||||
<div class="hidden">
|
<div class="hidden">
|
||||||
<div id="popover-target"></div>
|
<div id="popover-target"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
</center>
|
</center>
|
||||||
|
|
||||||
@ -298,7 +300,7 @@
|
|||||||
<p> </p>
|
<p> </p>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<table class="tablesorter tablesorter-data" style="display:none">
|
<table id="{{ request()->report_type }}Report" class="tablesorter tablesorter-data" style="display:none">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
{!! $report ? $report->tableHeader() : '' !!}
|
{!! $report ? $report->tableHeader() : '' !!}
|
||||||
@ -424,7 +426,7 @@
|
|||||||
function setFiltersShown() {
|
function setFiltersShown() {
|
||||||
var val = $('#report_type').val();
|
var val = $('#report_type').val();
|
||||||
$('#dateField').toggle(val == '{{ ENTITY_TAX_RATE }}');
|
$('#dateField').toggle(val == '{{ ENTITY_TAX_RATE }}');
|
||||||
$('#statusField').toggle(val == '{{ ENTITY_INVOICE }}' || val == '{{ ENTITY_PRODUCT }}');
|
$('#statusField').toggle(['invoice', 'quote', 'product'].indexOf(val) >= 0);
|
||||||
$('#invoiceOrExpenseField').toggle(val == '{{ ENTITY_DOCUMENT }}');
|
$('#invoiceOrExpenseField').toggle(val == '{{ ENTITY_DOCUMENT }}');
|
||||||
$('#currencyType').toggle(val == '{{ ENTITY_PAYMENT }}');
|
$('#currencyType').toggle(val == '{{ ENTITY_PAYMENT }}');
|
||||||
}
|
}
|
||||||
@ -536,6 +538,9 @@
|
|||||||
},
|
},
|
||||||
widgetOptions : {
|
widgetOptions : {
|
||||||
columnSelector_mediaqueryName: "{{ trans('texts.auto') }}",
|
columnSelector_mediaqueryName: "{{ trans('texts.auto') }}",
|
||||||
|
columnSelector_mediaqueryHidden: true,
|
||||||
|
columnSelector_saveColumns: true,
|
||||||
|
//storage_useSessionStorage: true,
|
||||||
filter_cssFilter: 'form-control',
|
filter_cssFilter: 'form-control',
|
||||||
group_collapsed: true,
|
group_collapsed: true,
|
||||||
group_saveGroups: false,
|
group_saveGroups: false,
|
||||||
@ -557,15 +562,15 @@
|
|||||||
}
|
}
|
||||||
}).show();
|
}).show();
|
||||||
|
|
||||||
// call this function to copy the column selection code into the popover
|
@if (request()->report_type)
|
||||||
$.tablesorter.columnSelector.attachTo( $('.tablesorter-data'), '#popover-target');
|
$.tablesorter.columnSelector.attachTo( $('.tablesorter-data'), '#popover-target');
|
||||||
|
$('#popover')
|
||||||
$('#popover')
|
.popover({
|
||||||
.popover({
|
placement: 'right',
|
||||||
placement: 'right',
|
html: true, // required if content has HTML
|
||||||
html: true, // required if content has HTML
|
content: $('#popover-target')
|
||||||
content: $('#popover-target')
|
});
|
||||||
});
|
@endif
|
||||||
|
|
||||||
$(".tablesorter-totals").tablesorter({
|
$(".tablesorter-totals").tablesorter({
|
||||||
theme: 'bootstrap',
|
theme: 'bootstrap',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user