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