diff --git a/core/lib/Thelia/Model/Order.php b/core/lib/Thelia/Model/Order.php index 1835af62c..aa69cf6f8 100644 --- a/core/lib/Thelia/Model/Order.php +++ b/core/lib/Thelia/Model/Order.php @@ -38,6 +38,15 @@ class Order extends BaseOrder $this->dispatchEvent(TheliaEvents::ORDER_AFTER_CREATE, new OrderEvent($this)); } + public function postSave(ConnectionInterface $con = null) + { + if($this->isPaid() && null === $this->getInvoiceDate()) { + $this + ->setInvoiceDate(time()) + ->save($con); + } + } + public function generateRef() { /* order addresses are unique */