Commit f08e1296 by Yvon Kerdoncuff

fix 1 month shift in computation of last recurring payment occurence

parent 4a6deb62
...@@ -216,7 +216,12 @@ class Payment extends BasePayment ...@@ -216,7 +216,12 @@ class Payment extends BasePayment
$paymentEndDate = $this->getRecurrenceMonthsCount() ? $paymentEndDate = $this->getRecurrenceMonthsCount() ?
$dateOfFirstOccurenceAfterInitialPayment->modify( $dateOfFirstOccurenceAfterInitialPayment->modify(
"+" . ($this->getRecurrenceMonthsCount() - 1) . " months" //minus one because initial payment is not considered by payzen as the first occurence /* why minus 2 ?
* Imagine adherent selected 2 occurences on d/m/Y, then
* paymentEndDate should be d/m+1/Y,
* which is already $dateOfFirstOccurenceAfterInitialPayment
*/
"+" . ($this->getRecurrenceMonthsCount() - 2) . " months"
) )
: null; //assume no end date if recurrenceMonthsCount not set : null; //assume no end date if recurrenceMonthsCount not set
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment