set invoiceDate to current date when order status is changed to paid
This commit is contained in:
@@ -38,6 +38,15 @@ class Order extends BaseOrder
|
|||||||
$this->dispatchEvent(TheliaEvents::ORDER_AFTER_CREATE, new OrderEvent($this));
|
$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()
|
public function generateRef()
|
||||||
{
|
{
|
||||||
/* order addresses are unique */
|
/* order addresses are unique */
|
||||||
|
|||||||
Reference in New Issue
Block a user