parent
e004bbfca1
commit
fbd4640396
app
resources/js
|
@ -14,6 +14,7 @@ use App\Member\DeleteJob;
|
|||
use App\Nationality;
|
||||
use App\Payment\Subscription;
|
||||
use App\Region;
|
||||
use App\Setting\GeneralSettings;
|
||||
use Illuminate\Http\Request;
|
||||
use Inertia\Response;
|
||||
|
||||
|
@ -27,7 +28,7 @@ class MemberController extends Controller
|
|||
'subactivity_id' => null,
|
||||
];
|
||||
|
||||
public function index(Request $request): Response {
|
||||
public function index(Request $request, GeneralSettings $settings): Response {
|
||||
session()->put('menu', 'member');
|
||||
session()->put('title', 'Mitglieder');
|
||||
|
||||
|
@ -41,8 +42,8 @@ class MemberController extends Controller
|
|||
$payload = app(MemberView::class)->index($request, $query['filter']);
|
||||
$payload['toolbar'] = [
|
||||
['href' => route('member.create'), 'label' => 'Mitglied anlegen', 'color' => 'primary', 'icon' => 'plus'],
|
||||
['href' => route('allpayment.create'), 'label' => 'Rechnungen erstellen', 'color' => 'primary', 'icon' => 'plus'],
|
||||
['href' => route('sendpayment.create'), 'label' => 'Rechnungen versenden', 'color' => 'info', 'icon' => 'envelope'],
|
||||
['href' => route('allpayment.create'), 'label' => 'Rechnungen erstellen', 'color' => 'primary', 'icon' => 'plus', 'show' => $settings->hasModule('bill')],
|
||||
['href' => route('sendpayment.create'), 'label' => 'Rechnungen versenden', 'color' => 'info', 'icon' => 'envelope', 'show' => $settings->hasModule('bill')],
|
||||
];
|
||||
$payload['query'] = $query;
|
||||
$payload['billKinds'] = BillKind::get()->pluck('name', 'id');
|
||||
|
|
|
@ -27,4 +27,9 @@ class GeneralSettings extends Settings
|
|||
return 'general';
|
||||
}
|
||||
|
||||
public function hasModule(string $module): bool
|
||||
{
|
||||
return in_array($module, $this->modules);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<div class="flex">
|
||||
<span class="text-xl font-semibold text-white leading-none" v-html="$page.props.title"></span>
|
||||
<div class="flex ml-4">
|
||||
<inertia-link v-for="link, index in $page.props.toolbar" :key="index" :href="link.href" v-text="link.label" class="btn label mr-2" :class="`btn-${link.color}`">
|
||||
<inertia-link v-for="link, index in filterMenu" :key="index" :href="link.href" v-text="link.label" class="btn label mr-2" :class="`btn-${link.color}`">
|
||||
<sprite :src="link.icon"></sprite>
|
||||
</inertia-link>
|
||||
</div>
|
||||
|
@ -57,6 +57,11 @@ export default {
|
|||
get() {
|
||||
return this.$page.props.search;
|
||||
}
|
||||
},
|
||||
filterMenu() {
|
||||
return this.$page.props.toolbar
|
||||
? this.$page.props.toolbar.filter(menu => menu.show !== false):
|
||||
[];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="px-6 py-2 flex border-b border-gray-600 space-x-3">
|
||||
<f-switch id="ausstand" @input="reload" v-model="value.ausstand" label="Nur Ausstände" size="sm"></f-switch>
|
||||
<f-select id="billKinds" @input="reload" :options="billKinds" v-model="value.bill_kind" label="Rechnung" size="sm"></f-select>
|
||||
<f-switch v-show="hasModule('bill')" id="ausstand" @input="reload" v-model="value.ausstand" label="Nur Ausstände" size="sm"></f-switch>
|
||||
<f-select v-show="hasModule('bill')" id="billKinds" @input="reload" :options="billKinds" v-model="value.bill_kind" label="Rechnung" size="sm"></f-select>
|
||||
<f-select id="activity_id" @input="reload" :options="activities" v-model="value.activity_id" label="Tätigkeit" size="sm"></f-select>
|
||||
<f-select id="subactivity_id" @input="reload" :options="subactivities" v-model="value.subactivity_id" label="Untertätigkeit" size="sm"></f-select>
|
||||
</div>
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
<th>Tags</th>
|
||||
<th>Beitrag</th>
|
||||
<th>Geburtstag</th>
|
||||
<th>Rechnung</th>
|
||||
<th>Ausstand</th>
|
||||
<th v-show="hasModule('bill')">Rechnung</th>
|
||||
<th v-show="hasModule('bill')">Ausstand</th>
|
||||
<th>Eintritt</th>
|
||||
<th></th>
|
||||
</thead>
|
||||
|
@ -38,13 +38,13 @@
|
|||
</td>
|
||||
<td v-text="member.subscription_name"></td>
|
||||
<td v-text="`${member.birthday_human}`"></td>
|
||||
<td>
|
||||
<td v-show="hasModule('bill')">
|
||||
<div class="flex justify-center">
|
||||
<div class="btn btn-sm label primary" v-text="member.bill_kind_name" v-if="member.bill_kind_name"></div>
|
||||
<div class="text-xs" v-else>Kein</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<td v-show="hasModule('bill')">
|
||||
<div class="flex justify-center">
|
||||
<div class="btn btn-sm label primary" v-show="member.pending_payment" v-text="member.pending_payment"></div>
|
||||
</div>
|
||||
|
@ -52,7 +52,7 @@
|
|||
<td v-text="`${member.joined_at_human}`"></td>
|
||||
<td class="flex">
|
||||
<inertia-link :href="`/member/${member.id}/edit`" class="inline-flex btn btn-warning btn-sm"><sprite src="pencil"></sprite></inertia-link>
|
||||
<a href="#" @click.prevent="openSidebar(index, 'payment.index')" class="inline-flex btn btn-info btn-sm"><sprite src="money"></sprite></a>
|
||||
<a href="#" v-show="hasModule('bill')" @click.prevent="openSidebar(index, 'payment.index')" class="inline-flex btn btn-info btn-sm"><sprite src="money"></sprite></a>
|
||||
<a href="#" @click.prevent="openSidebar(index, 'membership.index')" class="inline-flex btn btn-info btn-sm"><sprite src="user"></sprite></a>
|
||||
<inertia-link href="#" @click.prevent="remove(member)" class="inline-flex btn btn-danger btn-sm"><sprite src="trash"></sprite></inertia-link>
|
||||
</td>
|
||||
|
|
Loading…
Reference in New Issue