mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Expenses
This commit is contained in:
parent
5811ad5bca
commit
9acff982cc
@ -16,6 +16,7 @@ use App\Libraries\MultiDB;
|
|||||||
use App\Models\Client;
|
use App\Models\Client;
|
||||||
use App\Models\Credit;
|
use App\Models\Credit;
|
||||||
use App\Models\Document;
|
use App\Models\Document;
|
||||||
|
use App\Models\Expense;
|
||||||
use App\Utils\Traits\WithSorting;
|
use App\Utils\Traits\WithSorting;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
use Livewire\WithPagination;
|
use Livewire\WithPagination;
|
||||||
@ -63,6 +64,10 @@ class DocumentsTable extends Component
|
|||||||
$this->query = $this->credits();
|
$this->query = $this->credits();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'expenses':
|
||||||
|
$this->query = $this->expenses();
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$this->query = $this->documents();
|
$this->query = $this->documents();
|
||||||
break;
|
break;
|
||||||
@ -81,4 +86,12 @@ class DocumentsTable extends Component
|
|||||||
$query->where('client_id', $this->client->id);
|
$query->where('client_id', $this->client->id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function expenses()
|
||||||
|
{
|
||||||
|
return Document::query()
|
||||||
|
->whereHasMorph('documentable', [Expense::class], function ($query) {
|
||||||
|
$query->where('client_id', $this->client->id);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,12 @@
|
|||||||
wire:click="updateResources('credits')" />
|
wire:click="updateResources('credits')" />
|
||||||
{{ ctrans('texts.credits') }}
|
{{ ctrans('texts.credits') }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="button border border-transparent hover:border-gray-600 {{ $tab === 'expenses' ? 'border-gray-600' : '' }}"ž
|
||||||
|
wire:click="updateResources('expenses')" />
|
||||||
|
{{ ctrans('texts.expenses') }}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex items-center justify-between mt-6">
|
<div class="flex items-center justify-between mt-6">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user