Skip to content

Commit

Permalink
correct handle the \AbraFlexi\Date in overdueDays()
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitexus committed Sep 6, 2022
1 parent 06904e2 commit 45429f8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/AbraFlexi/FakturaVydana.php
Expand Up @@ -219,6 +219,9 @@ public function getQrCodeBase64($size = 140) {
* @return int
*/
static public function overdueDays($dueDate) {
if(is_object($dueDate) && array_key_exists('isNull', get_class_vars( get_class($dueDate))) && ($dueDate->isNull === true)){
throw new Exception('$dueDate->isNull is true', self);
}
$dateDiff = date_diff(is_object($dueDate) ? $dueDate : RO::flexiDateToDateTime($dueDate),
new \DateTime());
if ($dateDiff->invert == 1) {
Expand Down

0 comments on commit 45429f8

Please sign in to comment.