Commit 489e4b18 by Kohinos Cooperatic

make recurrent payment existence control work

parent a4fcb34f
......@@ -202,11 +202,15 @@ class Payment extends BasePayment
$reason = "Attribut détails vide ou clés absentes.";
return null;
}
$firstDayOfcreationMonth = DateTime::createFromFormat(
'YMd',substr($this->details,0,6) . "01"
$firstDayOfCreationMonth = DateTime::createFromFormat(
'Ymd',substr($this->details['vads_effective_creation_date'],0,6) . "01"
);
if(!$firstDayOfCreationMonth) {
$reason = "Error parsing vads_effective_creation_date : " . $this->details['vads_effective_creation_date'];
return null;
}
$day = $this->getRecurrenceMonthDay() ? $this->getRecurrenceMonthDay() - 1 : 0; //if not set assume first day of month (not a big deal anyway)
$dateOfFirstOccurenceAfterInitialPayment = $firstDayOfcreationMonth->modify(
$dateOfFirstOccurenceAfterInitialPayment = $firstDayOfCreationMonth->modify(
$day . " days next month"
);
......
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