mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
Merge pull request #4058 from beganovich/v2-hide-gateway-fees-from-invoices-table
Client portal: Hide "Gateway Fees" from invoices-table
This commit is contained in:
commit
4f879c815d
@ -5,7 +5,6 @@ namespace App\Http\Livewire;
|
||||
use App\Models\Invoice;
|
||||
use App\Utils\Traits\WithSorting;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Livewire\Component;
|
||||
use Livewire\WithPagination;
|
||||
|
||||
@ -58,27 +57,6 @@ class InvoicesTable extends Component
|
||||
->where('status_id', '<>', Invoice::STATUS_DRAFT)
|
||||
->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', [
|
||||
'invoices' => $query,
|
||||
]);
|
||||
|
@ -22,10 +22,6 @@
|
||||
<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>
|
||||
</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 class="py-2 -my-2 overflow-x-auto sm:-mx-6 sm:px-6 lg:-mx-8 lg:px-8">
|
||||
|
Loading…
Reference in New Issue
Block a user