From 4e34b4db29524fb35f017f183563bce89c29a42e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 28 Dec 2010 15:48:55 +0100 Subject: [PATCH] =?utf8?q?get=5Fopenbalance=5Fdate=20kann=20unter=20Umst?= =?utf8?q?=C3=A4nden=20undef=20f=C3=BCr=20$closedto=20bekommen,=20und=20mu?= =?utf8?q?ss=20damit=20umgehen=20k=C3=B6nnen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/RP.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SL/RP.pm b/SL/RP.pm index 607eb389e..84dd73e22 100644 --- a/SL/RP.pm +++ b/SL/RP.pm @@ -53,6 +53,8 @@ use strict; sub get_openbalance_date { my ($closedto, $target) = map { $::locale->parse_date_to_object(\%::myconfig, $_) } @_; + return unless $closedto; + $closedto->subtract(years => 1) while ($target - $closedto)->is_negative; $closedto->add(days => 1); return $::locale->format_date(\%::myconfig, $closedto); -- 2.20.1