Fixes for statements

This commit is contained in:
David Bomba 2025-08-16 10:20:59 +10:00
parent ced1e1198a
commit 67f3107a3e
1 changed files with 2 additions and 8 deletions

View File

@ -212,6 +212,7 @@ class Statement
$this->client->settings = $settings;
$this->entity = \App\Models\Invoice::factory()->make(); //@phpstan-ignore-line
$this->entity->client_id = $this->client->id;//@phpstan-ignore-line
$this->entity->client = $this->client;//@phpstan-ignore-line
$ii = \App\Models\InvoiceInvitation::factory()->make(); //@phpstan-ignore-line
$ii->setRelation('invoice', $this->entity); //@phpstan-ignore-line
@ -219,17 +220,10 @@ class Statement
$ii->setRelation('company', $this->client->company);
$ii->setRelation('user', $this->client->user);
$this->entity->client->setRelation('company', $this->client->company);
$this->entity->setRelation('invitations', $ii); //@phpstan-ignore-line
$this->entity->setRelation('invitations', collect([$ii])); //@phpstan-ignore-line
$this->entity->setRelation('company', $this->client->company);
$this->entity->setRelation('user', $this->client->user);
// $this->entity = \App\Models\Invoice::factory()->make(); //@phpstan-ignore-line
// $this->entity->client = \App\Models\Client::factory()->make(['settings' => $settings]); //@phpstan-ignore-line
// $this->entity->client->setRelation('company', $this->client->company);
// $this->entity->setRelation('invitations', \App\Models\InvoiceInvitation::factory()->make()); //@phpstan-ignore-line
// $this->entity->setRelation('company', $this->client->company);
// $this->entity->setRelation('user', $this->client->user);
}
return $this;