Skip to content

Commit

Permalink
Merge pull request #227 from RobinGeuze/detailCanBeMatchable
Browse files Browse the repository at this point in the history
Fix more Project salestransactionline issues
  • Loading branch information
rojtjo authored Oct 6, 2023
2 parents 8218c2e + a638d9b commit a8201ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/SalesTransactionLine.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}

Expand All @@ -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);
}

Expand Down

0 comments on commit a8201ee

Please sign in to comment.