mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 01:24:34 -04:00
Hide Gateway Fees from invoices-table (cp)
This commit is contained in:
parent
fac03fce96
commit
ed0fe053ec
@ -5,7 +5,6 @@ namespace App\Http\Livewire;
|
|||||||
use App\Models\Invoice;
|
use App\Models\Invoice;
|
||||||
use App\Utils\Traits\WithSorting;
|
use App\Utils\Traits\WithSorting;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
use Livewire\WithPagination;
|
use Livewire\WithPagination;
|
||||||
|
|
||||||
@ -58,27 +57,6 @@ class InvoicesTable extends Component
|
|||||||
->where('status_id', '<>', Invoice::STATUS_DRAFT)
|
->where('status_id', '<>', Invoice::STATUS_DRAFT)
|
||||||
->paginate($this->per_page);
|
->paginate($this->per_page);
|
||||||
|
|
||||||
if (in_array('gateway_fees', $this->status)) {
|
|
||||||
$transformed = $query
|
|
||||||
->getCollection()
|
|
||||||
->filter(function ($invoice) {
|
|
||||||
$invoice['line_items'] = collect($invoice->line_items)
|
|
||||||
->filter(function ($item) {
|
|
||||||
return $item->type_id == '4' || $item->type_id == 4;
|
|
||||||
});
|
|
||||||
|
|
||||||
return count($invoice['line_items']);
|
|
||||||
});
|
|
||||||
|
|
||||||
$query = new \Illuminate\Pagination\LengthAwarePaginator(
|
|
||||||
$transformed,
|
|
||||||
$transformed->count(),
|
|
||||||
$query->perPage(),
|
|
||||||
$query->currentPage(),
|
|
||||||
['path' => request()->url(), 'query' => ['page' => $query->currentPage()]]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return render('components.livewire.invoices-table', [
|
return render('components.livewire.invoices-table', [
|
||||||
'invoices' => $query,
|
'invoices' => $query,
|
||||||
]);
|
]);
|
||||||
|
@ -22,10 +22,6 @@
|
|||||||
<input wire:model="status" value="overdue" type="checkbox" class="cursor-pointer form-checkbox" id="overdue-checkbox">
|
<input wire:model="status" value="overdue" type="checkbox" class="cursor-pointer form-checkbox" id="overdue-checkbox">
|
||||||
<label for="overdue-checkbox" class="text-sm cursor-pointer">{{ ctrans('texts.overdue') }}</label>
|
<label for="overdue-checkbox" class="text-sm cursor-pointer">{{ ctrans('texts.overdue') }}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="mr-3">
|
|
||||||
<input wire:model="status" value="gateway_fees" type="checkbox" class="cursor-pointer form-checkbox" id="gateway-fees-checkbox">
|
|
||||||
<label for="gateway-fees-checkbox" class="text-sm cursor-pointer">{{ ctrans('texts.gateway_fees') }}</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="py-2 -my-2 overflow-x-auto sm:-mx-6 sm:px-6 lg:-mx-8 lg:px-8">
|
<div class="py-2 -my-2 overflow-x-auto sm:-mx-6 sm:px-6 lg:-mx-8 lg:px-8">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user