Skip to content

Commit

Permalink
magento#14063 - Wrong invoice prefix in multistore setup due to defau…
Browse files Browse the repository at this point in the history
…lt store id
  • Loading branch information
sanjay-wagento authored and gelanivishal committed Jun 1, 2018
1 parent 6103b6b commit c308795
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,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 c308795

Please sign in to comment.