From e81a3f7e51220709850ed76fcc7124fd0815f32d Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Sat, 9 Sep 2017 13:58:40 +0200 Subject: [PATCH] Profit and Loss Statement. Compensate for to-date = leap-year in period compare. --- reporting/rep707.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reporting/rep707.php b/reporting/rep707.php index 267636da..19a01cab 100644 --- a/reporting/rep707.php +++ b/reporting/rep707.php @@ -252,6 +252,8 @@ function print_profit_and_loss_statement() { $begin = add_months($from, -12); $end = add_months($to, -12); + if (date_comp($to, end_month($to)) == 0) // compensate for leap years. If to-date equal end month + $end = end_month($end); // then the year-1 should also be end month $headers[3] = _('Period Y-1'); } -- 2.30.2