Bug 12274: Invoice detail: don't crash on certain billing dates
authorJonathan Druart <jonathan.druart@biblibre.com>
Tue, 20 May 2014 11:39:26 +0000 (13:39 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 21 May 2014 18:59:28 +0000 (18:59 +0000)
Bug 10613 sent the billingdate as a string. The template wants a DateTime
object.

To reproduce:
1/ Go on a invoice detail page
2/ Select a billing date
3/ Boom without the patch
[Tue May 20 13:39:18 2014] invoice.pl: Template process failed: undef
error - The 'day' parameter ("2014") to DateTime::new did not pass the
'an integer which is a possible valid day of month' callback.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Not all dates will make it go 'boom' but 31/07/2014 did.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
acqui/invoice.pl

index 84b7834..18e94d9 100755 (executable)
@@ -150,7 +150,7 @@ $template->param(
     suppliername     => $details->{'suppliername'},
     booksellerid     => $details->{'booksellerid'},
     datereceived     => $details->{'datereceived'},
-    billingdate      => C4::Dates->new($details->{'billingdate'}, "iso")->output(),
+    billingdate      => $details->{'billingdate'},
     invoiceclosedate => $details->{'closedate'},
     shipmentcost     => $details->{'shipmentcost'},
     orders_loop      => \@orders_loop,