Skip to content

Commit

Permalink
Merge pull request #226 from RobinGeuze/detailCanBeMatchable
Browse files Browse the repository at this point in the history
Allow matchable statusses other than notmatchable for the detail line
  • Loading branch information
rojtjo authored Oct 4, 2023
2 parents 34daa95 + 6c6a336 commit 8218c2e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/SalesTransactionLine.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down

0 comments on commit 8218c2e

Please sign in to comment.