From a4b28f3fedae28ea92f597e345f75911c8118639 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Sun, 15 Apr 2012 11:23:36 +0200 Subject: [PATCH] Correction in accruals to avoid skipping shorter months. --- gl/accruals.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gl/accruals.php b/gl/accruals.php index c9233a05..4bfc923b 100644 --- a/gl/accruals.php +++ b/gl/accruals.php @@ -57,6 +57,10 @@ if (isset($_POST['go']) || isset($_POST['show'])) $per = $periods - 1; $date = $date_ = get_post('date_'); $freq = get_post('freq'); + if ($freq == 3 || $freq == 4) { + $date_ = begin_month($date_); // avoid skip on shorter months + $date = end_month($date_); // avoid skip on shorter months + } $lastdate = ($freq == 1 ? add_days($date_, 7*$per) : ($freq == 2 ? add_days($date_, 14*$per) : ($freq == 3 ? add_months($date_, $per) -- 2.30.2