Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
9524f5e0a5
@ -395,7 +395,7 @@ if ($ispaymentok) {
|
|||||||
|
|
||||||
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
|
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
|
||||||
if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) {
|
if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) {
|
||||||
$result = $object->validate($user);
|
$result = ($object->status == $object::STATUS_EXCLUDED) ? -1 : $object->validate($user); // if membre is excluded (status == -2) the new validation is not possible
|
||||||
if ($result < 0 || empty($object->datevalid)) {
|
if ($result < 0 || empty($object->datevalid)) {
|
||||||
$error++;
|
$error++;
|
||||||
$errmsg = $object->error;
|
$errmsg = $object->error;
|
||||||
@ -413,7 +413,13 @@ if ($ispaymentok) {
|
|||||||
|
|
||||||
$datesubend = null;
|
$datesubend = null;
|
||||||
if ($datesubscription && $defaultdelay && $defaultdelayunit) {
|
if ($datesubscription && $defaultdelay && $defaultdelayunit) {
|
||||||
$datesubend = dol_time_plus_duree(dol_time_plus_duree($datesubscription, $defaultdelay, $defaultdelayunit), -1, 'd');
|
$datesubend = dol_time_plus_duree($datesubscription, $defaultdelay, $defaultdelayunit);
|
||||||
|
// the new end date of subscription must be in futur
|
||||||
|
while ($datesubend < $now) {
|
||||||
|
$datesubend = dol_time_plus_duree($datesubend, $defaultdelay, $defaultdelayunit);
|
||||||
|
$datesubscription = dol_time_plus_duree($datesubscription, $defaultdelay, $defaultdelayunit);
|
||||||
|
}
|
||||||
|
$datesubend = dol_time_plus_duree($datesubend, -1, 'd');
|
||||||
}
|
}
|
||||||
|
|
||||||
$paymentdate = $now;
|
$paymentdate = $now;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user