Skip to content

Commit

Permalink
Squashed 'package/marello/' changes from e2134fd..0bc0152
Browse files Browse the repository at this point in the history
0bc0152 - added additional check on order view to make sure a customer exists on the order before trying to render properties of the customer
633f259 MM-42: Test and fix functionality (#66)
6d656f8 MM-42: Test and fix functionality (#65)
a62f4b7 MM-40: Test and fix import order functionality (#63)
49b6550 MM-38: Implement sync processors (#61)
1d6be06 MM-35: Fix issue 'Removed special product price won't sync on Magento side' (#58)
d0d640d - added non proxy class of the Marello Product Unit as without this it can cause issues when the 'normal' class is used to send templates instead of the Proxy class of the product unit
ad177b0 - Added default value for $data property as in most cases it will expect an array even if the data is not set on an Entity
4ce14c7 - updated email templates with name variable for ProductUnit - updated migration version for the application to load the new templates
0a23414 - added ProductUnit variable provider for rendering the product unit in the email templates as this is an enum field which is behaving as an extended entity with a proxy class that wasn't allowed in the email templates
f230508 - Added the shipping origin based on WFA rules back for shipping methods that use the origin to determine shipping costs, the addres of the warehouse remains an estimation
1f44fe2 - updated field to check for available inventory, it used the balanced inventory instead of the inventory qty which is the qty that is left from the balanced inventory
224ba34 - removed check that was going through the WFA rules that wasn't necessary for either Payment methods and Shipping methods on the Order creation
a287a3a - fixed renaming email templates for Order and Invoice notifications
361a765 - Updated email templates with new style
88337f5 - updated WorkflowstartListener test to check new behaviour of the OrderWorkflowStart
87716bd - Fixed issue with WorkflowStartListener where only the last order id (which came in batches) was getting a workflow start
1f318b4 - Removed statuses that are NULL from the OrderItemStatus dashboard widget as they cannot be displayed correctly
04a60f8 - added Order status to Order which will serve as preparation for the next step in the Order Management - currently no critical parts are relying on the new Order status as of yet, it's also not visibile in the current implementation
3d51851 - renamed table alias as the datagrid was confused which one was the actual table and which one was the column of the ProductUnit in the InventoryItem grid
8b9df75 - split the SalesBundle migrations as v1_3 was already released...
36e9e92 Merge branch 'task/ZON20001-0-update-m2-bundle' into maintenance/3.0
0442000 Merge branch 'feature/magento2-integr' into task/ZON20001-0-update-m2-bundle
9ac3f06 MM-29: Add functionality to map relation between website and sales_channel on the integration form (#54)

git-subtree-dir: package/marello
git-subtree-split: 0bc0152
  • Loading branch information
24198 committed Aug 25, 2020
1 parent 7d530c8 commit 63f5e48
Show file tree
Hide file tree
Showing 82 changed files with 2,913 additions and 1,887 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace Marello\Bundle\CoreBundle\EventListener;

use Doctrine\Common\Util\ClassUtils;
use Doctrine\ORM\Event\OnClearEventArgs;
use Oro\Bundle\SecurityBundle\Authentication\Token\OrganizationAwareTokenInterface;
use Oro\Bundle\SecurityBundle\EventListener\RefreshContextListener as ParentListener;
use ProxyManager\Proxy\VirtualProxyInterface;

/**
* Fix issue with "Proxy interface given instead of class manager",
* it occurs because EntityManager was made as lazy in https://github.com/doctrine/DoctrineBundle/pull/559
*/
class RefreshContextListener extends ParentListener
{
/**
* @param OnClearEventArgs $event
* @param OrganizationAwareTokenInterface $token
*/
protected function checkOrganization(OnClearEventArgs $event, OrganizationAwareTokenInterface $token)
{
$organization = $token->getOrganization();
if (!is_object($organization)) {
return;
}
$organizationClass = ClassUtils::getClass($organization);
if ($event->getEntityClass() && $event->getEntityClass() !== $organizationClass) {
return;
}
/**
* Start customization
*/
$em = $event->getEntityManager();
$classEm = $this->doctrine->getManagerForClass($organizationClass);
if ($classEm instanceof VirtualProxyInterface) {
$classEm = $classEm->getWrappedValueHolderValue();
}
if ($em !== $classEm) {
return;
}
/**
* End customization
*/
$organization = $this->refreshEntity($organization, $organizationClass, $em);
if (!$organization) {
return;
}
$token->setOrganization($organization);
}
}
7 changes: 6 additions & 1 deletion src/Marello/Bundle/CoreBundle/Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,9 @@ services:
arguments:
- '@oro_entity.doctrine_helper'
tags:
- { name: twig.extension }
- { name: twig.extension }

marello_core.event_listener.refresh_context:
class: Marello\Bundle\CoreBundle\EventListener\RefreshContextListener
decorates: oro_security.listener.refresh_context_listener
parent: oro_security.listener.refresh_context_listener
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private function getAvailableBalancedInventory(Product $product, SalesChannel $s
$salesChannelGroup = $salesChannel->getGroup();
$result = $this->getBalancedInventoryLevel($product, $salesChannelGroup);

return ($result) ? $result->getBalancedInventoryQty() : 0;
return ($result) ? $result->getInventoryQty() : 0;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ datagrids:
- p.denormalizedDefaultName as productName
- p.sku as productSku
- i.enableBatchInventory as enableBatchInventory
- productUnit.name as productUnit
- pu.name as productUnit
- COALESCE(SUM(il.inventory), 0) AS inventoryQty
- COALESCE(SUM(il.allocatedInventory), 0) AS allocatedInventoryQty
- COALESCE(SUM(il.inventory - il.allocatedInventory), 0) AS virtualInventoryQty
Expand All @@ -18,7 +18,7 @@ datagrids:
left:
- { join: i.product, alias: p }
- { join: i.inventoryLevels, alias: il }
- { join: i.productUnit, alias: productUnit }
- { join: i.productUnit, alias: pu }
groupBy: i.id
columns:
productSku:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

namespace Marello\Bundle\InvoiceBundle\Migrations\Data\ORM;

use Doctrine\Common\Persistence\ObjectManager;

use Oro\Bundle\EmailBundle\Migrations\Data\ORM\AbstractEmailFixture;
use Oro\Bundle\MigrationBundle\Fixture\VersionedFixtureInterface;

class UpdateEmailTemplates extends AbstractEmailFixture implements
VersionedFixtureInterface
{
/**
* {@inheritdoc}
*/
protected function findExistingTemplate(ObjectManager $manager, array $template)
{
$name = $template['params']['name'];
if (empty($name)) {
return null;
}

return $manager->getRepository('OroEmailBundle:EmailTemplate')->findOneBy([
'name' => $template['params']['name'],
'entityName' => 'Marello\Bundle\InvoiceBundle\Entity\Invoice'
]);
}

/**
* Return path to email templates
*
* @return string
*/
public function getEmailsDir()
{
return $this->container
->get('kernel')
->locateResource('@MarelloInvoiceBundle/Migrations/Data/ORM/data/email_templates');
}

/**
* {@inheritdoc}
*/
public function getVersion()
{
return '1.2';
}
}
Loading

0 comments on commit 63f5e48

Please sign in to comment.