Profit and Loss Statement. Compensate for to-date = leap-year in period compare.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Sat, 9 Sep 2017 11:58:40 +0000 (13:58 +0200)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Sat, 9 Sep 2017 11:58:40 +0000 (13:58 +0200)
reporting/rep707.php

index 267636dac66b11b573b9214f12c6a6d787e0184e..19a01cabbfe64952f350729c9a8839aa75d77319 100644 (file)
@@ -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');
        }