<?php
 namespace App\ImportedDocument; class InvoiceAbstract extends EntityAbstract { public $idTina; public $number; public $date; public $dueDate; public $limitProcessingValue; public $currency; protected function validateEntityFields(\App\MessagesCollector $messagesCollector) { if ($this->date and !validDate($this->date)) { $messagesCollector->addInfo('The invoice date is not valid.'); } if ($this->dueDate and !validDate($this->dueDate)) { $messagesCollector->addInfo('The invoice due date is not valid.'); } if ($this->currency and !\App\Config\Currencies::getInstance()->check($this->currency)) { $messagesCollector->addWarning('The invoice currency is not valid.'); } if (strlen((string)$this->limitProcessingValue) and !is_numeric($this->limitProcessingValue)) { $messagesCollector->addWarning('The invoice total value value is not valid.'); } if (strlen((string)$this->limitProcessingValue) and !$this->currency) { $messagesCollector->addWarning('When indicating `limitProcessingValue` you must set the currency also.'); } } }