Merge branch 'develop' of gitlab.antadis.net:dev-antadis/bebeboutik into develop

This commit is contained in:
Christophe Latour 2017-10-27 15:21:45 +02:00
commit eedf758df6

View File

@ -121,11 +121,10 @@ class Ant_Refund_Discount extends Module
$end = new DateTime($item->date_to);
$interval = $start->diff($end);
$newStart = new DateTime();
$newEnd = new DateTime();
$newEnd->add($interval);
$voucher->date_from = date('Y-m-d H:i:s', $newStart->format('Y-m-d H:i:s'));
$voucher->date_to = date('Y-m-d H:i:s', $newEnd->format('Y-m-d H:i:s'));
$newDate = new DateTime('now');
$voucher->date_from = $newDate->format('Y-m-d H:i:s');
$newDate->add($interval);
$voucher->date_to = $newDate->format('Y-m-d H:i:s');
if (!$voucher->validateFieldsLang(false) OR !$voucher->add()) {
return false;