public function fillBackOrder($reason = '', $cost = 0)
{
/*
* Only allow a previous state of back-ordered
*/
$this->validatePreviousState([$this::STATE_COMMERCE_BACK_ORDERED], $this::STATE_COMMERCE_BACK_ORDER_FILLED);
$this->setAttribute('state', $this::STATE_COMMERCE_BACK_ORDER_FILLED);
if (empty($reason)) {
$reason = $this->getTransactionReason('back-order-filled');
}
try {
return $this->processStockTakeAndSave($this->getAttribute('quantity'), 'inventory.transaction.back-order.filled', $reason, $cost);
} catch (NotEnoughStockException $e) {
}
return false;
}