diff --git a/src/Models/Transaction.php b/src/Models/Transaction.php index f338705..bafe149 100644 --- a/src/Models/Transaction.php +++ b/src/Models/Transaction.php @@ -100,7 +100,12 @@ protected function hydrateData( stdClass $data ) { $this->AccountingDate = new DateTime( $data->accountingDate ); } - $this->ValueDate = new DateTime( $data->valueDate ); + if( isset( $data->valueDate ) and !empty( $data->valueDate ) ) { + $this->ValueDate = new DateTime( $data->valueDate ); + + } else { + $this->ValueDate = new DateTime(); + } $this->Currency = (string)$data->currency; $this->Amount = (float)$data->amount;