Statistiken/Abo: Kundenfeedback 2026-07-24 komplett umgesetzt + Steuern: DATEV-Fixes 08+09/2025 (Sammel-Commit Branch-WIP)
Feedback-Umsetzung (dev/2026-07-22/feedback-analyse-2026-07-24.md, alle 10 Punkte):
- VIP-Statistik: eigener Berater ('ich', Linie 0) in Neue-Kundenabos- und beiden Top-10-Listen; Top-10-Umsatz sortiert nach abgerechneten Ist-Punkten + Abo-Anzahl-Spalte; Fußnote nicht-payline-wirksame Punkte (SalesVolumePoints::nonPaylinePoints)
- Führungskräfte-Liste: beide Sichten 'direkt' (an nächster FK abgeschnitten, additiv) und 'gesamt' (komplette Downline), Gesamt-Spalte nach Kundenzählweise
- Team-Abos: je Ebene 'abgerechnet (Monat)' und 'bis zum 25. erwartet'; Payline-Karte mit Teamabo-/Kundenabo-Zählern
- Incentive-Live-Ranking: Qualifizierte zuerst nummeriert (fixt auch isWinner rank<=max_winners)
- Porto: Netto-/Brutto-Kennzeichnung (Berater netto, Endkunden inkl. MwSt., portal_view-Flag; auch CRM-/Shop-Warenkorb + Checkout), Yard::shipping_tax-Fix
- Struktur-Ansicht: Abo-Badges 'A' (eigenes Abo) und '(n)' (Kundenabos) je Teampartner, gebatcht
- Abo-Löschung: Softdelete setzt active=0 (UserAbo deleting-Hook) + Bereinigungs-Migration für gelöschte-aber-aktive Abos
- Doku: technische Analyse + Kundinnen-Feedback-Dokument unter dev/2026-07-22/
- Tests: IncentiveRankingTest, TeamStructureAboBadgesTest, YardShippingTaxTest (neu); BackofficeStatisticsListsTest, TeamAboOverviewTest, PaylineForecastServiceTest, AboAdminDeleteTest, AboOneTimeViewTest erweitert
Außerdem enthalten (Branch-WIP vor dem Feedback): DATEV-Abgleich-Fixes 08+09/2025, USt-ID-Live-Validierung sowie restliche unkommittete Stände (u. a. Abo-Pause-Sprachkeys).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
657d4bd5b7
commit
ac3bd6e8ea
136 changed files with 7610 additions and 2688 deletions
75
tests/Unit/Services/VatIdServiceTest.php
Normal file
75
tests/Unit/Services/VatIdServiceTest.php
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Unit\Services;
|
||||
|
||||
use App\Services\VatIdService;
|
||||
use Tests\TestCase;
|
||||
|
||||
class VatIdServiceTest extends TestCase
|
||||
{
|
||||
private VatIdService $service;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->service = new VatIdService;
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_normalizes_vat_ids()
|
||||
{
|
||||
$this->assertEquals('ATU12345678', $this->service->normalize(' at-u 12.345,678 '));
|
||||
$this->assertEquals('', $this->service->normalize(null));
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_extracts_country_code_from_prefix()
|
||||
{
|
||||
$this->assertEquals('AT', $this->service->extractCountryCode('ATU12345678'));
|
||||
$this->assertEquals('ES', $this->service->extractCountryCode('ESY9284953M'));
|
||||
|
||||
// Kein EU-Präfix -> Fallback auf Account-Land
|
||||
$this->assertEquals('AT', $this->service->extractCountryCode('53618009', 'AT'));
|
||||
$this->assertNull($this->service->extractCountryCode('53618009', 'CH'));
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_checks_plausible_format()
|
||||
{
|
||||
$this->assertTrue($this->service->isPlausibleFormat('ATU12345678'));
|
||||
$this->assertTrue($this->service->isPlausibleFormat('DE123456789'));
|
||||
$this->assertTrue($this->service->isPlausibleFormat('ESY9284953M'));
|
||||
|
||||
// Nur Ziffern ohne Länderpräfix (z.B. österreichische Steuernummer)
|
||||
$this->assertFalse($this->service->isPlausibleFormat('53618009'));
|
||||
// Kein EU-Ländercode
|
||||
$this->assertFalse($this->service->isPlausibleFormat('CH123456789'));
|
||||
$this->assertFalse($this->service->isPlausibleFormat(''));
|
||||
$this->assertFalse($this->service->isPlausibleFormat(null));
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function german_vat_ids_never_qualify_for_reverse_charge()
|
||||
{
|
||||
$this->assertFalse($this->service->qualifiesForReverseCharge('DE123456789'));
|
||||
$this->assertFalse($this->service->qualifiesForReverseCharge('de 123 456 789'));
|
||||
$this->assertTrue($this->service->qualifiesForReverseCharge('ATU12345678'));
|
||||
$this->assertFalse($this->service->qualifiesForReverseCharge('53618009'));
|
||||
$this->assertFalse($this->service->qualifiesForReverseCharge(null));
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function vies_check_returns_invalid_for_implausible_ids_without_api_call()
|
||||
{
|
||||
$this->assertEquals(VatIdService::CHECK_INVALID, $this->service->checkVies('53618009'));
|
||||
$this->assertEquals(VatIdService::CHECK_INVALID, $this->service->checkViesCached(''));
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function vies_check_returns_unavailable_when_disabled()
|
||||
{
|
||||
config(['services.vies.enabled' => false]);
|
||||
|
||||
$this->assertEquals(VatIdService::CHECK_UNAVAILABLE, $this->service->checkVies('ATU12345678'));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue