|
8 | 8 | use Illuminate\Support\Str; |
9 | 9 | use Livewire\Livewire; |
10 | 10 | use Modules\Clients\Models\Relation; |
| 11 | +use Modules\Core\Enums\NumberingType; |
11 | 12 | use Modules\Core\Models\Numbering; |
12 | 13 | use Modules\Core\Models\TaxRate; |
13 | 14 | use Modules\Core\Tests\AbstractCompanyPanelTestCase; |
@@ -38,7 +39,7 @@ public function it_lists_invoices(): void |
38 | 39 | /* Arrange */ |
39 | 40 | $user = $this->user; |
40 | 41 | $customer = Relation::factory()->for($this->company)->customer()->create(); |
41 | | - $documentGroup = Numbering::factory()->for($this->company)->create(); |
| 42 | + $documentGroup = Numbering::factory()->for($this->company)->state(['type' => NumberingType::INVOICE->value])->create(); |
42 | 43 | $taxRate = TaxRate::factory()->for($this->company)->create(); |
43 | 44 | $productCategory = ProductCategory::factory()->for($this->company)->create(); |
44 | 45 | $productUnit = ProductUnit::factory()->for($this->company)->create(); |
@@ -87,7 +88,7 @@ public function it_creates_an_invoice_through_a_modal(): void |
87 | 88 | { |
88 | 89 | /* Arrange */ |
89 | 90 | $customer = Relation::factory()->for($this->company)->customer()->create(); |
90 | | - $documentGroup = Numbering::factory()->for($this->company)->create(); |
| 91 | + $documentGroup = Numbering::factory()->for($this->company)->state(['type' => NumberingType::INVOICE->value])->create(); |
91 | 92 | $taxRate = TaxRate::factory()->for($this->company)->create(); |
92 | 93 | $productCategory = ProductCategory::factory()->for($this->company)->create(); |
93 | 94 | $productUnit = ProductUnit::factory()->for($this->company)->create(); |
@@ -141,7 +142,7 @@ public function it_fails_to_create_invoice_through_a_modal_without_required_invo |
141 | 142 | { |
142 | 143 | /* Arrange */ |
143 | 144 | $customer = Relation::factory()->for($this->company)->customer()->create(); |
144 | | - $documentGroup = Numbering::factory()->for($this->company)->create(); |
| 145 | + $documentGroup = Numbering::factory()->for($this->company)->state(['type' => NumberingType::INVOICE->value])->create(); |
145 | 146 | $taxRate = TaxRate::factory()->for($this->company)->create(); |
146 | 147 | $productCategory = ProductCategory::factory()->for($this->company)->create(); |
147 | 148 | $productUnit = ProductUnit::factory()->for($this->company)->create(); |
@@ -186,7 +187,7 @@ public function it_fails_to_create_invoice_through_a_modal_without_required_invo |
186 | 187 | { |
187 | 188 | /* Arrange */ |
188 | 189 | $customer = Relation::factory()->for($this->company)->customer()->create(); |
189 | | - $documentGroup = Numbering::factory()->for($this->company)->create(); |
| 190 | + $documentGroup = Numbering::factory()->for($this->company)->state(['type' => NumberingType::INVOICE->value])->create(); |
190 | 191 | $taxRate = TaxRate::factory()->for($this->company)->create(); |
191 | 192 | $productCategory = ProductCategory::factory()->for($this->company)->create(); |
192 | 193 | $productUnit = ProductUnit::factory()->for($this->company)->create(); |
@@ -229,7 +230,7 @@ public function it_fails_to_create_invoice_through_a_modal_without_required_cust |
229 | 230 | { |
230 | 231 | /* Arrange */ |
231 | 232 | $customer = Relation::factory()->for($this->company)->customer()->create(); |
232 | | - $documentGroup = Numbering::factory()->for($this->company)->create(); |
| 233 | + $documentGroup = Numbering::factory()->for($this->company)->state(['type' => NumberingType::INVOICE->value])->create(); |
233 | 234 | $taxRate = TaxRate::factory()->for($this->company)->create(); |
234 | 235 | $productCategory = ProductCategory::factory()->for($this->company)->create(); |
235 | 236 | $productUnit = ProductUnit::factory()->for($this->company)->create(); |
@@ -274,7 +275,7 @@ public function it_updates_an_invoice_through_a_modal(): void |
274 | 275 | { |
275 | 276 | /* Arrange */ |
276 | 277 | $customer = Relation::factory()->for($this->company)->customer()->create(); |
277 | | - $documentGroup = Numbering::factory()->for($this->company)->create(); |
| 278 | + $documentGroup = Numbering::factory()->for($this->company)->state(['type' => NumberingType::INVOICE->value])->create(); |
278 | 279 | $taxRate = TaxRate::factory()->for($this->company)->create(); |
279 | 280 | $productCategory = ProductCategory::factory()->for($this->company)->create(); |
280 | 281 | $productUnit = ProductUnit::factory()->for($this->company)->create(); |
@@ -325,7 +326,7 @@ public function it_updates_an_invoice_through_a_modal(): void |
325 | 326 | public function it_creates_an_invoice_with_items(): void |
326 | 327 | { |
327 | 328 | $customer = Relation::factory()->for($this->company)->customer()->create(); |
328 | | - $documentGroup = Numbering::factory()->for($this->company)->create(); |
| 329 | + $documentGroup = Numbering::factory()->for($this->company)->state(['type' => NumberingType::INVOICE->value])->create(); |
329 | 330 | $taxRate = TaxRate::factory()->for($this->company)->create(); |
330 | 331 | $productCategory = ProductCategory::factory()->for($this->company)->create(); |
331 | 332 | $productUnit = ProductUnit::factory()->for($this->company)->create(); |
@@ -381,7 +382,7 @@ public function it_fails_to_create_invoice_without_required_invoice_number(): vo |
381 | 382 | /* Arrange */ |
382 | 383 | $user = $this->user; |
383 | 384 | $customer = Relation::factory()->for($this->company)->customer()->create(); |
384 | | - $documentGroup = Numbering::factory()->for($this->company)->create(); |
| 385 | + $documentGroup = Numbering::factory()->for($this->company)->state(['type' => NumberingType::INVOICE->value])->create(); |
385 | 386 | $taxRate = TaxRate::factory()->for($this->company)->create(); |
386 | 387 | $productCategory = ProductCategory::factory()->for($this->company)->create(); |
387 | 388 | $productUnit = ProductUnit::factory()->for($this->company)->create(); |
@@ -425,7 +426,7 @@ public function it_fails_to_create_invoice_without_required_invoice_status(): vo |
425 | 426 | /* Arrange */ |
426 | 427 | $user = $this->user; |
427 | 428 | $customer = Relation::factory()->for($this->company)->customer()->create(); |
428 | | - $documentGroup = Numbering::factory()->for($this->company)->create(); |
| 429 | + $documentGroup = Numbering::factory()->for($this->company)->state(['type' => NumberingType::INVOICE->value])->create(); |
429 | 430 | $taxRate = TaxRate::factory()->for($this->company)->create(); |
430 | 431 | $productCategory = ProductCategory::factory()->for($this->company)->create(); |
431 | 432 | $productUnit = ProductUnit::factory()->for($this->company)->create(); |
@@ -467,7 +468,7 @@ public function it_fails_to_create_invoice_without_required_customer(): void |
467 | 468 | /* Arrange */ |
468 | 469 | $user = $this->user; |
469 | 470 | $customer = Relation::factory()->for($this->company)->customer()->create(); |
470 | | - $documentGroup = Numbering::factory()->for($this->company)->create(); |
| 471 | + $documentGroup = Numbering::factory()->for($this->company)->state(['type' => NumberingType::INVOICE->value])->create(); |
471 | 472 | $taxRate = TaxRate::factory()->for($this->company)->create(); |
472 | 473 | $productCategory = ProductCategory::factory()->for($this->company)->create(); |
473 | 474 | $productUnit = ProductUnit::factory()->for($this->company)->create(); |
@@ -510,7 +511,7 @@ public function it_updates_an_invoice(): void |
510 | 511 | { |
511 | 512 | /* Arrange */ |
512 | 513 | $customer = Relation::factory()->for($this->company)->customer()->create(); |
513 | | - $documentGroup = Numbering::factory()->for($this->company)->create(); |
| 514 | + $documentGroup = Numbering::factory()->for($this->company)->state(['type' => NumberingType::INVOICE->value])->create(); |
514 | 515 | $taxRate = TaxRate::factory()->for($this->company)->create(); |
515 | 516 | $productCategory = ProductCategory::factory()->for($this->company)->create(); |
516 | 517 | $productUnit = ProductUnit::factory()->for($this->company)->create(); |
@@ -586,7 +587,7 @@ public function it_deletes_an_invoice(): void |
586 | 587 | /* Arrange */ |
587 | 588 | $user = $this->user; |
588 | 589 | $customer = Relation::factory()->for($this->company)->customer()->create(); |
589 | | - $documentGroup = Numbering::factory()->for($this->company)->create(); |
| 590 | + $documentGroup = Numbering::factory()->for($this->company)->state(['type' => NumberingType::INVOICE->value])->create(); |
590 | 591 | $taxRate = TaxRate::factory()->for($this->company)->create(); |
591 | 592 | $productCategory = ProductCategory::factory()->for($this->company)->create(); |
592 | 593 | $productUnit = ProductUnit::factory()->for($this->company)->create(); |
|
0 commit comments