Skip to content

Commit a8201ee

Browse files
authored
Merge pull request #227 from RobinGeuze/detailCanBeMatchable
Fix more Project salestransactionline issues
2 parents 8218c2e + a638d9b commit a8201ee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/SalesTransactionLine.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function setMatchStatus(?string $matchStatus): BaseTransactionLine
126126
{
127127
if (
128128
$matchStatus !== null &&
129-
$this->getLineType() === LineType::VAT() &&
129+
$this->getLineType()->equals(LineType::VAT()) &&
130130
$matchStatus != self::MATCHSTATUS_NOTMATCHABLE
131131
) {
132132
throw Exception::invalidMatchStatusForLineType($matchStatus, $this);
@@ -144,7 +144,7 @@ public function setMatchStatus(?string $matchStatus): BaseTransactionLine
144144
*/
145145
public function setMatchLevel(?int $matchLevel): BaseTransactionLine
146146
{
147-
if ($matchLevel !== null && !$this->getLineType()->equals(LineType::TOTAL())) {
147+
if ($matchLevel !== null && $this->getLineType()->equals(LineType::VAT())) {
148148
throw Exception::invalidFieldForLineType('matchLevel', $this);
149149
}
150150

@@ -160,7 +160,7 @@ public function setMatchLevel(?int $matchLevel): BaseTransactionLine
160160
*/
161161
public function setBaseValueOpen(?Money $baseValueOpen): BaseTransactionLine
162162
{
163-
if ($baseValueOpen !== null && !$this->getLineType()->equals(LineType::TOTAL())) {
163+
if ($baseValueOpen !== null && $this->getLineType()->equals(LineType::VAT())) {
164164
throw Exception::invalidFieldForLineType('baseValueOpen', $this);
165165
}
166166

0 commit comments

Comments
 (0)