Compare commits
87 Commits
a6050b1e07
...
62be191e9a
Author | SHA1 | Date |
---|---|---|
|
62be191e9a | |
|
544217baf5 | |
|
6b505e1c02 | |
|
c11dd2b699 | |
|
47b14d3c83 | |
|
fc2703158f | |
|
1e43a33023 | |
|
2a39bf5a57 | |
|
8f7ccfe733 | |
|
e94daefa54 | |
|
e635fb53fa | |
|
1bb7d9000f | |
|
24ec0430c1 | |
|
374d05a2ca | |
|
1d09afbeb3 | |
|
ca9bf70c9a | |
|
291e69e68c | |
|
db8d117dcf | |
|
bc21c86414 | |
|
e4c08c3765 | |
|
219c141359 | |
|
6acab6888b | |
|
b594e92cda | |
|
09acf0c98c | |
|
2012aa636f | |
|
62340871c6 | |
|
e6412d9a89 | |
|
c6c7bda0eb | |
|
28d7914802 | |
|
d9ce28d568 | |
|
b80d8e3f2c | |
|
a21c4f608f | |
|
49be4f35e9 | |
|
5212115ee8 | |
|
7d3f52ec45 | |
|
072ab6abb8 | |
|
3ae0ef4bf5 | |
|
2ea8b8380c | |
|
d24cef307a | |
|
b1e0bc00d6 | |
|
49e0fc4252 | |
|
c287d1183b | |
|
2409443222 | |
|
2d646bb908 | |
|
a25edc0b6a | |
|
91a8e05c94 | |
|
c2cd43380e | |
|
5f8f2fb996 | |
|
9fa62d61c0 | |
|
c34418ee8a | |
|
979e6faf7e | |
|
d9e8f38030 | |
|
600243bad1 | |
|
595980cb1d | |
|
592161603d | |
|
c159d79487 | |
|
29d068bcce | |
|
94b809016a | |
|
5838a20b27 | |
|
7d960f02c8 | |
|
11fca9d670 | |
|
cc440580e8 | |
|
6e72879874 | |
|
9a33972ded | |
|
f2b72b85cb | |
|
918449be69 | |
|
77036ecbba | |
|
fce8019a73 | |
|
cf48c30432 | |
|
c8b994c5ac | |
|
712d9f155a | |
|
9906f7ab8e | |
|
b08df4d1df | |
|
7734d6ef82 | |
|
b3011a5322 | |
|
dc7d0d1354 | |
|
42b628b165 | |
|
8abeede8e6 | |
|
08729871c9 | |
|
f91c8ffa58 | |
|
d81e65613c | |
|
85800ae2b9 | |
|
5165ad932b | |
|
30c9a4e573 | |
|
b5581a6142 | |
|
b1e2e39fc3 | |
|
0d89768f4b |
16
CHANGELOG.md
16
CHANGELOG.md
|
@ -1,21 +1,5 @@
|
||||||
# Letzte Änderungen
|
# Letzte Änderungen
|
||||||
|
|
||||||
### 1.12.6
|
|
||||||
|
|
||||||
- Fix: Beiträge von Familienmitgliedern splitten
|
|
||||||
|
|
||||||
### 1.12.5
|
|
||||||
|
|
||||||
- Fix: Synchronisieren von bestehenden Beiträgen aus NaMi
|
|
||||||
|
|
||||||
### 1.12.4
|
|
||||||
|
|
||||||
- Filter Mitglieder nach Verhaltenskodex
|
|
||||||
|
|
||||||
### 1.12.3
|
|
||||||
|
|
||||||
- Volltextsuche für Rechnungen
|
|
||||||
|
|
||||||
### 1.12.2
|
### 1.12.2
|
||||||
|
|
||||||
- Zuschussliste Gallier
|
- Zuschussliste Gallier
|
||||||
|
|
|
@ -22,8 +22,7 @@ class InsertMemberAction
|
||||||
{
|
{
|
||||||
$region = Region::firstWhere('nami_id', $member->regionId ?: -1);
|
$region = Region::firstWhere('nami_id', $member->regionId ?: -1);
|
||||||
|
|
||||||
|
return Member::updateOrCreate(['nami_id' => $member->id], [
|
||||||
$payload = [
|
|
||||||
'firstname' => $member->firstname,
|
'firstname' => $member->firstname,
|
||||||
'lastname' => $member->lastname,
|
'lastname' => $member->lastname,
|
||||||
'joined_at' => $member->joinedAt,
|
'joined_at' => $member->joinedAt,
|
||||||
|
@ -52,16 +51,7 @@ class InsertMemberAction
|
||||||
'mitgliedsnr' => $member->memberId,
|
'mitgliedsnr' => $member->memberId,
|
||||||
'version' => $member->version,
|
'version' => $member->version,
|
||||||
'keepdata' => $member->keepdata,
|
'keepdata' => $member->keepdata,
|
||||||
];
|
]);
|
||||||
|
|
||||||
// Dont update subscription if fee id of existing member's subscription is already the same
|
|
||||||
if ($existing = Member::nami($member->id)) {
|
|
||||||
if ($existing->subscription && $existing->subscription->fee->nami_id === $member->feeId) {
|
|
||||||
$payload['subscription_id'] = $existing->subscription->id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Member::updateOrCreate(['nami_id' => $member->id], $payload);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSubscription(NamiMember $member): ?Subscription
|
public function getSubscription(NamiMember $member): ?Subscription
|
||||||
|
|
|
@ -49,6 +49,7 @@ class Invoice extends Model
|
||||||
*/
|
*/
|
||||||
public static function createForMember(Member $member, Collection $members, int $year, Subscription $subscription = null): self
|
public static function createForMember(Member $member, Collection $members, int $year, Subscription $subscription = null): self
|
||||||
{
|
{
|
||||||
|
$subscription = $subscription ?: $member->subscription;
|
||||||
$invoice = new self([
|
$invoice = new self([
|
||||||
'to' => [
|
'to' => [
|
||||||
'name' => 'Familie ' . $member->lastname,
|
'name' => 'Familie ' . $member->lastname,
|
||||||
|
@ -65,8 +66,7 @@ class Invoice extends Model
|
||||||
|
|
||||||
$positions = collect([]);
|
$positions = collect([]);
|
||||||
foreach ($members as $member) {
|
foreach ($members as $member) {
|
||||||
$memberSubscription = $subscription ?: $member->subscription;
|
foreach ($subscription->children as $child) {
|
||||||
foreach ($memberSubscription->children as $child) {
|
|
||||||
$positions->push([
|
$positions->push([
|
||||||
'description' => str($child->name)->replace('{name}', $member->firstname . ' ' . $member->lastname)->replace('{year}', (string) $year),
|
'description' => str($child->name)->replace('{name}', $member->firstname . ' ' . $member->lastname)->replace('{year}', (string) $year),
|
||||||
'price' => $child->amount,
|
'price' => $child->amount,
|
||||||
|
|
|
@ -46,8 +46,6 @@ class FilterScope extends ScoutFilter
|
||||||
public array $exclude = [],
|
public array $exclude = [],
|
||||||
public ?bool $hasFullAddress = null,
|
public ?bool $hasFullAddress = null,
|
||||||
public ?bool $hasBirthday = null,
|
public ?bool $hasBirthday = null,
|
||||||
public ?bool $hasSvk = null,
|
|
||||||
public ?bool $hasVk = null,
|
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,12 +85,6 @@ class FilterScope extends ScoutFilter
|
||||||
if ($this->hasBirthday === true) {
|
if ($this->hasBirthday === true) {
|
||||||
$filter->push('birthday IS NOT NULL');
|
$filter->push('birthday IS NOT NULL');
|
||||||
}
|
}
|
||||||
if ($this->hasSvk !== null) {
|
|
||||||
$filter->push('has_svk = ' . ($this->hasSvk ? 'true' : 'false'));
|
|
||||||
}
|
|
||||||
if ($this->hasVk !== null) {
|
|
||||||
$filter->push('has_vk = ' . ($this->hasVk ? 'true' : 'false'));
|
|
||||||
}
|
|
||||||
if ($this->ausstand === true) {
|
if ($this->ausstand === true) {
|
||||||
$filter->push('ausstand > 0');
|
$filter->push('ausstand > 0');
|
||||||
}
|
}
|
||||||
|
|
|
@ -544,8 +544,6 @@ class Member extends Model implements Geolocatable
|
||||||
'bill_kind' => $this->bill_kind?->value,
|
'bill_kind' => $this->bill_kind?->value,
|
||||||
'group_id' => $this->group->id,
|
'group_id' => $this->group->id,
|
||||||
'group_name' => $this->group->inner_name ?: $this->group->name,
|
'group_name' => $this->group->inner_name ?: $this->group->name,
|
||||||
'has_vk' => $this->has_vk,
|
|
||||||
'has_svk' => $this->has_svk,
|
|
||||||
'links' => [
|
'links' => [
|
||||||
'show' => route('member.show', ['member' => $this], false),
|
'show' => route('member.show', ['member' => $this], false),
|
||||||
'edit' => route('member.edit', ['member' => $this], false),
|
'edit' => route('member.edit', ['member' => $this], false),
|
||||||
|
|
|
@ -163,10 +163,6 @@ class MemberResource extends JsonResource
|
||||||
'activity_ids' => [],
|
'activity_ids' => [],
|
||||||
'subactivity_ids' => []
|
'subactivity_ids' => []
|
||||||
],
|
],
|
||||||
'boolean_filter' => [
|
|
||||||
['id' => true, 'name' => 'Ja'],
|
|
||||||
['id' => false, 'name' => 'Nein'],
|
|
||||||
],
|
|
||||||
'default' => [
|
'default' => [
|
||||||
'gender_id' => null,
|
'gender_id' => null,
|
||||||
'salutation' => '',
|
'salutation' => '',
|
||||||
|
|
|
@ -138,7 +138,7 @@ return [
|
||||||
'key' => env('MEILI_MASTER_KEY', null),
|
'key' => env('MEILI_MASTER_KEY', null),
|
||||||
'index-settings' => [
|
'index-settings' => [
|
||||||
Member::class => [
|
Member::class => [
|
||||||
'filterableAttributes' => ['address', 'birthday', 'ausstand', 'bill_kind', 'group_id', 'memberships', 'has_vk', 'has_svk', 'id'],
|
'filterableAttributes' => ['address', 'birthday', 'ausstand', 'bill_kind', 'group_id', 'memberships', 'id'],
|
||||||
'searchableAttributes' => ['fullname', 'address'],
|
'searchableAttributes' => ['fullname', 'address'],
|
||||||
'sortableAttributes' => ['lastname', 'firstname'],
|
'sortableAttributes' => ['lastname', 'firstname'],
|
||||||
'displayedAttributes' => ['age_group_icon', 'group_name', 'links', 'is_leader', 'lastname', 'firstname', 'fullname', 'address', 'ausstand', 'birthday', 'id', 'memberships', 'bill_kind', 'group_id'],
|
'displayedAttributes' => ['age_group_icon', 'group_name', 'links', 'is_leader', 'lastname', 'firstname', 'fullname', 'address', 'ausstand', 'birthday', 'id', 'memberships', 'bill_kind', 'group_id'],
|
||||||
|
|
|
@ -37,8 +37,6 @@ class MemberFactory extends Factory
|
||||||
'email' => $this->faker->safeEmail(),
|
'email' => $this->faker->safeEmail(),
|
||||||
'recertified_at' => null,
|
'recertified_at' => null,
|
||||||
'keepdata' => false,
|
'keepdata' => false,
|
||||||
'has_svk' => $this->faker->boolean(),
|
|
||||||
'has_vk' => $this->faker->boolean(),
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,24 +48,6 @@
|
||||||
size="sm"
|
size="sm"
|
||||||
@update:model-value="setFilter('ausstand', $event)"
|
@update:model-value="setFilter('ausstand', $event)"
|
||||||
></f-switch>
|
></f-switch>
|
||||||
<f-select
|
|
||||||
id="has_vk"
|
|
||||||
name="has_vk"
|
|
||||||
:model-value="getFilter('has_vk')"
|
|
||||||
label="Verhaltenskodex unterschrieben"
|
|
||||||
size="sm"
|
|
||||||
:options="meta.boolean_filter"
|
|
||||||
@update:model-value="setFilter('has_vk', $event)"
|
|
||||||
></f-select>
|
|
||||||
<f-select
|
|
||||||
id="has_svk"
|
|
||||||
name="has_svk"
|
|
||||||
:model-value="getFilter('has_svk')"
|
|
||||||
label="SVK unterschrieben"
|
|
||||||
size="sm"
|
|
||||||
:options="meta.boolean_filter"
|
|
||||||
@update:model-value="setFilter('has_svk', $event)"
|
|
||||||
></f-select>
|
|
||||||
<f-multipleselect
|
<f-multipleselect
|
||||||
id="group_ids"
|
id="group_ids"
|
||||||
:options="meta.groups"
|
:options="meta.groups"
|
||||||
|
|
|
@ -202,30 +202,6 @@ class MemberIndexTest extends EndToEndTestCase
|
||||||
]])->assertInertiaCount('data.data', 1);
|
]])->assertInertiaCount('data.data', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testItFiltersForSvkPrevention(): void
|
|
||||||
{
|
|
||||||
Member::factory()->defaults()->create(['has_svk' => true]);
|
|
||||||
Member::factory()->defaults()->create(['has_svk' => false]);
|
|
||||||
Member::factory()->defaults()->create(['has_svk' => false]);
|
|
||||||
|
|
||||||
sleep(1);
|
|
||||||
$this->callFilter('member.index', ['has_svk' => true])->assertInertiaCount('data.data', 1);
|
|
||||||
$this->callFilter('member.index', ['has_svk' => false])->assertInertiaCount('data.data', 2);
|
|
||||||
$this->callFilter('member.index', ['has_svk' => null])->assertInertiaCount('data.data', 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testItFiltersForVkPrevention(): void
|
|
||||||
{
|
|
||||||
Member::factory()->defaults()->create(['has_vk' => true]);
|
|
||||||
Member::factory()->defaults()->create(['has_vk' => false]);
|
|
||||||
Member::factory()->defaults()->create(['has_vk' => false]);
|
|
||||||
|
|
||||||
sleep(1);
|
|
||||||
$this->callFilter('member.index', ['has_vk' => true])->assertInertiaCount('data.data', 1);
|
|
||||||
$this->callFilter('member.index', ['has_vk' => false])->assertInertiaCount('data.data', 2);
|
|
||||||
$this->callFilter('member.index', ['has_vk' => null])->assertInertiaCount('data.data', 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testGroupOfMembershipsFilterCanBeEmpty(): void
|
public function testGroupOfMembershipsFilterCanBeEmpty(): void
|
||||||
{
|
{
|
||||||
$mitglied = Activity::factory()->create();
|
$mitglied = Activity::factory()->create();
|
||||||
|
|
|
@ -90,8 +90,8 @@ class MassStoreActionTest extends TestCase
|
||||||
|
|
||||||
$this->assertDatabaseCount('invoices', 1);
|
$this->assertDatabaseCount('invoices', 1);
|
||||||
$this->assertDatabaseCount('invoice_positions', 2);
|
$this->assertDatabaseCount('invoice_positions', 2);
|
||||||
$this->assertDatabaseHas('invoice_positions', ['description' => 'beitrag Max Muster', 'price' => 4466]);
|
$this->assertDatabaseHas('invoice_positions', ['description' => 'beitrag Max Muster']);
|
||||||
$this->assertDatabaseHas('invoice_positions', ['description' => 'beitrag Jane Muster', 'price' => 4466]);
|
$this->assertDatabaseHas('invoice_positions', ['description' => 'beitrag Jane Muster']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testItSeparatesBillKinds(): void
|
public function testItSeparatesBillKinds(): void
|
||||||
|
@ -105,21 +105,4 @@ class MassStoreActionTest extends TestCase
|
||||||
$this->assertDatabaseCount('invoices', 2);
|
$this->assertDatabaseCount('invoices', 2);
|
||||||
$this->assertDatabaseCount('invoice_positions', 2);
|
$this->assertDatabaseCount('invoice_positions', 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testItSeparatesSubscriptions(): void
|
|
||||||
{
|
|
||||||
$member1 = Member::factory()->defaults()->emailBillKind()
|
|
||||||
->for(Subscription::factory()->forFee()->children([new Child('beitrag1 {name}', 4466)]))
|
|
||||||
->create(['firstname' => 'Member1', 'lastname' => 'ln']);
|
|
||||||
$member2 = Member::factory()->defaults()->sameFamilyAs($member1)->emailBillKind()
|
|
||||||
->for(Subscription::factory()->forFee()->children([new Child('beitrag2 {name}', 4467)]))
|
|
||||||
->create(['firstname' => 'Member2']);
|
|
||||||
|
|
||||||
$this->postJson(route('invoice.mass-store'), ['year' => now()->addYear()->year])->assertOk();
|
|
||||||
$invoice = Invoice::first();
|
|
||||||
|
|
||||||
$this->assertDatabaseCount('invoice_positions', 2);
|
|
||||||
$this->assertDatabaseHas('invoice_positions', ['invoice_id' => $invoice->id, 'member_id' => $member1->id, 'description' => 'beitrag1 Member1 ln', 'price' => 4466]);
|
|
||||||
$this->assertDatabaseHas('invoice_positions', ['invoice_id' => $invoice->id, 'member_id' => $member2->id, 'description' => 'beitrag2 Member2 ln', 'price' => 4467]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ use App\Country;
|
||||||
use App\Fee;
|
use App\Fee;
|
||||||
use App\Gender;
|
use App\Gender;
|
||||||
use App\Group;
|
use App\Group;
|
||||||
use App\Member\Member;
|
|
||||||
use App\Nationality;
|
use App\Nationality;
|
||||||
use App\Payment\Subscription;
|
use App\Payment\Subscription;
|
||||||
use App\Region;
|
use App\Region;
|
||||||
|
@ -143,20 +142,3 @@ it('testItPullsMemberWithNoSubscription', function () {
|
||||||
'subscription_id' => null,
|
'subscription_id' => null,
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('doesnt set first subscription if fee matches', function () {
|
|
||||||
$this->loginNami();
|
|
||||||
Subscription::factory()->forFee(55)->create();
|
|
||||||
$otherSubscription = Subscription::factory()->forFee(55)->create();
|
|
||||||
$member = Member::factory()->defaults()->inNami(1001)->create(['subscription_id' => $otherSubscription->id]);
|
|
||||||
app(MemberFake::class)->shows(1000, 1001, [
|
|
||||||
'beitragsartId' => 55,
|
|
||||||
]);
|
|
||||||
|
|
||||||
app(PullMemberAction::class)->handle(1000, 1001);
|
|
||||||
|
|
||||||
$this->assertDatabaseHas('members', [
|
|
||||||
'subscription_id' => $otherSubscription->id,
|
|
||||||
'id' => $member->id,
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
|
|
|
@ -149,7 +149,7 @@ class ShowTest extends TestCase
|
||||||
->for(Group::factory())
|
->for(Group::factory())
|
||||||
->for(Nationality::factory()->name('deutsch'))
|
->for(Nationality::factory()->name('deutsch'))
|
||||||
->for(Subscription::factory()->forFee())
|
->for(Subscription::factory()->forFee())
|
||||||
->create(['firstname' => 'Max', 'lastname' => 'Muster', 'has_vk' => false, 'has_svk' => false]);
|
->create(['firstname' => 'Max', 'lastname' => 'Muster']);
|
||||||
|
|
||||||
$response = $this->get("/member/{$member->id}");
|
$response = $this->get("/member/{$member->id}");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue