From a638d9b2b26a7ec863d42f0b2ec049db4ed188c2 Mon Sep 17 00:00:00 2001 From: Robin Geuze Date: Fri, 6 Oct 2023 08:29:56 +0200 Subject: [PATCH] Apparently all fields on salestransactionline that are listed in the documentation as 'total' only, can also be set on 'detail' if the line has a project --- src/SalesTransactionLine.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SalesTransactionLine.php b/src/SalesTransactionLine.php index f416d914..1798ce93 100644 --- a/src/SalesTransactionLine.php +++ b/src/SalesTransactionLine.php @@ -126,7 +126,7 @@ public function setMatchStatus(?string $matchStatus): BaseTransactionLine { if ( $matchStatus !== null && - $this->getLineType() === LineType::VAT() && + $this->getLineType()->equals(LineType::VAT()) && $matchStatus != self::MATCHSTATUS_NOTMATCHABLE ) { throw Exception::invalidMatchStatusForLineType($matchStatus, $this); @@ -144,7 +144,7 @@ public function setMatchStatus(?string $matchStatus): BaseTransactionLine */ public function setMatchLevel(?int $matchLevel): BaseTransactionLine { - if ($matchLevel !== null && !$this->getLineType()->equals(LineType::TOTAL())) { + if ($matchLevel !== null && $this->getLineType()->equals(LineType::VAT())) { throw Exception::invalidFieldForLineType('matchLevel', $this); } @@ -160,7 +160,7 @@ public function setMatchLevel(?int $matchLevel): BaseTransactionLine */ public function setBaseValueOpen(?Money $baseValueOpen): BaseTransactionLine { - if ($baseValueOpen !== null && !$this->getLineType()->equals(LineType::TOTAL())) { + if ($baseValueOpen !== null && $this->getLineType()->equals(LineType::VAT())) { throw Exception::invalidFieldForLineType('baseValueOpen', $this); }