-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
dac3d53 - remove disabled code from SalesChannelType form type a8352a6 Merge branch 'feature/magento2-integr' into testmerge-magentoint b9016f8 - removing BC break from order view regarding payments 466b4a1 - fixed issue with Migration where it was trying to create the order table on updating the application while it already exists - fixed issue with association name in the Enum field being inconsistent between the installer and the migration - Added additional enum options such as Box and Pallet 3b67642 MAR10001-931: Update Order and OrderItem entities with additional fields e45d024 MM-26: Test and stabilize product sync feature - Fixed issue with check connection on existing integration - Fixed issue with invalid transformations of pricing value triggers update prices on every save of product form a0b0778 MM-25: Add logic for product prices and inventory synchronization (#50) e3d1dbe MM-13: Implement initial products export (#49) 024bee3 MM-23: Add logic to process changes in integration (#47) 951f48f MM-22: Add logic to process changes in Sales Channel (#46) 006abe2 MM-8: Add logic for tax class dictionary synchronization (#45) f502e9d MM-6: Prepare logic for dictionary synchronization (#40) 46fa924 MM-4: Create Magento2 integration form - Added missed constraints d019c62 MM-4: Create Magento2 integration form git-subtree-dir: package/marello git-subtree-split: dac3d53
- Loading branch information
Showing
36 changed files
with
828 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/Marello/Bundle/OrderBundle/EventListener/Doctrine/OrderItemProductUnitListener.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
namespace Marello\Bundle\OrderBundle\EventListener\Doctrine; | ||
|
||
use Doctrine\ORM\Event\LifecycleEventArgs; | ||
use Marello\Bundle\OrderBundle\Entity\OrderItem; | ||
use Marello\Bundle\ProductBundle\Migrations\Data\ORM\LoadProductUnitData; | ||
use Oro\Bundle\EntityBundle\ORM\DoctrineHelper; | ||
use Oro\Bundle\EntityExtendBundle\Tools\ExtendHelper; | ||
|
||
class OrderItemProductUnitListener | ||
{ | ||
/** | ||
* @var DoctrineHelper | ||
*/ | ||
protected $doctrineHelper; | ||
|
||
/** | ||
* @param DoctrineHelper $doctrineHelper | ||
*/ | ||
public function __construct(DoctrineHelper $doctrineHelper) | ||
{ | ||
$this->doctrineHelper = $doctrineHelper; | ||
} | ||
|
||
|
||
/** | ||
* @param LifecycleEventArgs $args | ||
*/ | ||
public function postPersist(LifecycleEventArgs $args) | ||
{ | ||
$entity = $args->getEntity(); | ||
if ($entity instanceof OrderItem && $entity->getProductUnit() === null) { | ||
$entity->setProductUnit($this->findDefaultProductUnit()); | ||
} | ||
} | ||
|
||
/** | ||
* @return null|object | ||
*/ | ||
private function findDefaultProductUnit() | ||
{ | ||
$productUnitClass = ExtendHelper::buildEnumValueClassName(LoadProductUnitData::PRODUCT_UNIT_ENUM_CLASS); | ||
$productUnit = $this->doctrineHelper | ||
->getEntityManagerForClass($productUnitClass) | ||
->getRepository($productUnitClass) | ||
->findOneByDefault(true); | ||
|
||
if ($productUnit) { | ||
return $productUnit; | ||
} | ||
|
||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
src/Marello/Bundle/OrderBundle/Migrations/Schema/v1_12/MarelloOrderBundle.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
|
||
namespace Marello\Bundle\OrderBundle\Migrations\Schema\v1_12; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Oro\Bundle\EntityExtendBundle\EntityConfig\ExtendScope; | ||
use Oro\Bundle\EntityExtendBundle\Migration\Extension\ExtendExtension; | ||
use Oro\Bundle\EntityExtendBundle\Migration\Extension\ExtendExtensionAwareInterface; | ||
use Oro\Bundle\MigrationBundle\Migration\Migration; | ||
use Oro\Bundle\MigrationBundle\Migration\QueryBag; | ||
|
||
class MarelloOrderBundle implements Migration, ExtendExtensionAwareInterface | ||
{ | ||
/** | ||
* @var ExtendExtension | ||
*/ | ||
protected $extendExtension; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function up(Schema $schema, QueryBag $queries) | ||
{ | ||
$this->updateOrderTable($schema); | ||
$this->updateOrderItemTable($schema); | ||
} | ||
|
||
private function updateOrderTable(Schema $schema) | ||
{ | ||
$table = $schema->getTable('marello_order_order'); | ||
$table->addColumn('delivery_date', 'datetime', ['notnull' => false]); | ||
$table->addColumn('order_note', 'text', ['notnull' => false]); | ||
$table->addColumn('po_number', 'string', ['length' => 255, 'notnull' => false]); | ||
} | ||
|
||
private function updateOrderItemTable(Schema $schema) | ||
{ | ||
$tableName = $this->extendExtension->getNameGenerator()->generateEnumTableName('marello_product_unit'); | ||
// enum table is already available and created... | ||
if ($schema->hasTable($tableName)) { | ||
return; | ||
} | ||
|
||
$table = $schema->getTable('marello_order_order_item'); | ||
$this->extendExtension->addEnumField( | ||
$schema, | ||
$table, | ||
'productUnit', | ||
'marello_product_unit', | ||
false, | ||
false, | ||
[ | ||
'extend' => ['owner' => ExtendScope::OWNER_SYSTEM], | ||
] | ||
); | ||
} | ||
|
||
/** | ||
* Sets the ExtendExtension | ||
* | ||
* @param ExtendExtension $extendExtension | ||
*/ | ||
public function setExtendExtension(ExtendExtension $extendExtension) | ||
{ | ||
$this->extendExtension = $extendExtension; | ||
} | ||
} |
Oops, something went wrong.