Skip to content

Commit

Permalink
Fixed BR-49 validation
Browse files Browse the repository at this point in the history
- Updated InvoiceValidationTrait

> Fixes #56
  • Loading branch information
josemmo committed Jun 30, 2024
1 parent 78317c4 commit 8399f13
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Traits/InvoiceValidationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ private function getDefaultRules(): array {
}
};
$res['BR-49'] = static function(Invoice $inv) {
if ($inv->getPayment() !== null && $inv->getPayment()->getMeansCode() === null) {
if ($inv->getPayment() === null) return;
if ($inv->getPayment()->getMeansCode() === null && $inv->getPayment()->getTerms() === null) {
return "A Payment instruction (BG-16) shall specify the Payment means type code (BT-81)";
}
};
Expand Down

0 comments on commit 8399f13

Please sign in to comment.