From: Joe Hunt Date: Sat, 9 Sep 2017 11:58:40 +0000 (+0200) Subject: Profit and Loss Statement. Compensate for to-date = leap-year in period compare. X-Git-Tag: v2.4.3~43 X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=commitdiff_plain;h=e81a3f7e51220709850ed76fcc7124fd0815f32d Profit and Loss Statement. Compensate for to-date = leap-year in period compare. --- 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'); }