Skip to content

Commit

Permalink
Merge pull request #7 from jonasdekeukelaere/fix-item-without-price
Browse files Browse the repository at this point in the history
Allow empty amount for text invoice lines
  • Loading branch information
tijsverkoyen authored Aug 6, 2024
2 parents 2c95f6f + a3ddfec commit 3843627
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Invoice/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Item
{
protected string $description;

protected float $amount;
protected ?float $amount;

protected ?float $price;

Expand Down Expand Up @@ -39,8 +39,8 @@ class Item

public function __construct(
string $description,
float $amount,
?float $price,
?float $amount = null,
?float $price = null,
?int $vat = null
) {
$this->description = $description;
Expand All @@ -59,14 +59,14 @@ public function __construct(
$this->productId = null;
}

public function setAmount(float $amount): Item
public function setAmount(?float $amount): Item
{
$this->amount = $amount;

return $this;
}

public function getAmount(): float
public function getAmount(): ?float
{
return $this->amount;
}
Expand Down

0 comments on commit 3843627

Please sign in to comment.