projects
/
fa-stable.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
46d1ae5
)
Correction in accruals to avoid skipping shorter months.
author
Janusz Dobrowolski
<janusz@frontaccouting.eu>
Sun, 15 Apr 2012 09:23:36 +0000
(11:23 +0200)
committer
Janusz Dobrowolski
<janusz@frontaccouting.eu>
Sun, 15 Apr 2012 09:23:36 +0000
(11:23 +0200)
gl/accruals.php
patch
|
blob
|
history
diff --git
a/gl/accruals.php
b/gl/accruals.php
index c9233a058868f61ef074d2da853e24c224c0f19d..4bfc923b10517901bb401cb78c08f8e5867262e1 100644
(file)
--- 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)