Merge branch 'ticket-14273-voucher' into develop

This commit is contained in:
Michael RICOIS 2017-10-27 15:21:23 +02:00
commit 4af87fd2ec

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;