From 6c6a336f7f89d16d38f0f92ec0f3e2b4563871df Mon Sep 17 00:00:00 2001 From: Robin Geuze Date: Wed, 4 Oct 2023 09:29:17 +0200 Subject: [PATCH] Allow matchable statusses other than notmatchable for the detail line --- src/SalesTransactionLine.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/SalesTransactionLine.php b/src/SalesTransactionLine.php index f8a0eef0..f416d914 100644 --- a/src/SalesTransactionLine.php +++ b/src/SalesTransactionLine.php @@ -115,7 +115,8 @@ public function setValue(Money $value): BaseTransactionLine } /** - * Payment status of the sales transaction. If line type detail or vat always notmatchable. Read-only attribute. + * Payment status of the sales transaction. If line type detail or vat always notmatchable, according to the documentation. + * However, in practice this appears to be untrue for detail, see issue #177. Read-only attribute. * * @param string|null $matchStatus * @return $this @@ -125,7 +126,7 @@ public function setMatchStatus(?string $matchStatus): BaseTransactionLine { if ( $matchStatus !== null && - in_array($this->getLineType(), [LineType::DETAIL(), LineType::VAT()]) && + $this->getLineType() === LineType::VAT() && $matchStatus != self::MATCHSTATUS_NOTMATCHABLE ) { throw Exception::invalidMatchStatusForLineType($matchStatus, $this);