Skip to content

Commit

Permalink
FIX suggested end for membership can be before subscription start (#2…
Browse files Browse the repository at this point in the history
…6351)

* Fix wrong debug log

* Fix suggested end for membership can be in the past

MEMBER_SUBSCRIPTION_SUGGEST_END_OF_YEAR and MEMBER_SUBSCRIPTION_SUGGEST_END_OF_MONTH should be based on the subscription start date, not on the creation date

* Fix typo
  • Loading branch information
daraelmin authored Oct 26, 2023
1 parent 00a936b commit a815c99
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion htdocs/adherents/class/adherentstats.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public function countMembersByTagAndStatus($numberYears = 0)
$sql .= " GROUP BY c.rowid, c.label";
$sql .= " ORDER BY label ASC";

dol_syslog("box_members_by_type::select nb of members per type", LOG_DEBUG);
dol_syslog("box_members_by_tag::select nb of members per tag", LOG_DEBUG);
$result = $this->db->query($sql);

if ($result) {
Expand Down
4 changes: 2 additions & 2 deletions htdocs/adherents/subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -990,9 +990,9 @@
}
if (!$dateto) {
if (getDolGlobalInt('MEMBER_SUBSCRIPTION_SUGGEST_END_OF_MONTH')) {
$dateto = dol_get_last_day($currentyear, $currentmonth);
$dateto = dol_get_last_day(dol_print_date($datefrom, "%Y"), dol_print_date($datefrom, "%m"));
} elseif (getDolGlobalInt('MEMBER_SUBSCRIPTION_SUGGEST_END_OF_YEAR')) {
$dateto = dol_get_last_day($currentyear);
$dateto = dol_get_last_day(dol_print_date($datefrom, "%Y"));
} else {
$dateto = -1; // By default, no date is suggested
}
Expand Down

0 comments on commit a815c99

Please sign in to comment.