Skip to content

Commit

Permalink
ENGCOM-1623: #14063 - Wrong invoice prefix in multistore setup due to…
Browse files Browse the repository at this point in the history
… default stor… #15332

 - Merge Pull Request #15332 from sanjay-wagento/magento2:feature-wrong-invoice-prefix
 - Merged commits:
   1. 75f62bc
  • Loading branch information
magento-engcom-team committed May 21, 2018
2 parents 32892a4 + 75f62bc commit f74f224
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,15 @@ protected function _beforeSave(\Magento\Framework\Model\AbstractModel $object)
{
/** @var \Magento\Sales\Model\AbstractModel $object */
if ($object instanceof EntityInterface && $object->getIncrementId() == null) {
$store = $object->getStore();
$storeId = $store->getId();
if ($storeId === null) {
$storeId = $store->getGroup()->getDefaultStoreId();
}
$object->setIncrementId(
$this->sequenceManager->getSequence(
$object->getEntityType(),
$object->getStore()->getGroup()->getDefaultStoreId()
$storeId
)->getNextValue()
);
}
Expand Down

0 comments on commit f74f224

Please sign in to comment.