Skip to content

Commit

Permalink
Fixed counterpart invoice types.
Browse files Browse the repository at this point in the history
  • Loading branch information
firebed committed Aug 14, 2024
1 parent 9cfab0f commit d79af35
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/Enums/InvoiceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,18 @@ enum InvoiceType: string

public function isRetail(): bool
{
return in_array($this, self::retailInvoiceTypes());
return in_array($this, [
self::TYPE_11_1,
self::TYPE_11_2,
self::TYPE_11_3,
self::TYPE_11_4,
self::TYPE_11_5,
]);
}

public static function retailInvoiceTypes(): array
public function hasCounterpart(): bool
{
return [
return !in_array($this, [
self::TYPE_11_1,
self::TYPE_11_2,
self::TYPE_11_3,
Expand All @@ -405,12 +411,7 @@ public static function retailInvoiceTypes(): array
self::TYPE_13_4,
self::TYPE_13_30,
self::TYPE_13_31,
];
}

public function hasCounterpart(): bool
{
return !$this->isRetail();
]);
}

public function supportsFuelInvoice(): bool
Expand Down Expand Up @@ -443,7 +444,7 @@ public function supportsDeliveryNote(): bool
self::TYPE_1_6,
self::TYPE_5_1,
self::TYPE_5_2,
self::TYPE_11_1,
self::TYPE_11_1,
]);
}

Expand Down

0 comments on commit d79af35

Please sign in to comment.