postnl / postnl-magento2

This is the official Magento 2 extension for the logistics company PostNL. Add shipping options and parcelshops to your checkout. Create labels with track and trace functionality from the backend.
58 stars 61 forks source link

Shipping, invoice, credit memo grids are not filled #344

Closed kaplansin closed 1 year ago

kaplansin commented 1 year ago

Following plugins adds additional tables in query builder while updating grid tables

TIG_Postnl has following plugins which adds additional tables in query builder while updating grid tables.

 <type name="Magento\Sales\Model\ResourceModel\Grid">
         <plugin name="TIG_PostNL_OrderPlace" type="TIG\PostNL\Plugin\Order\AsyncPlugin" sortOrder="1" />
         <plugin name="TIG_PostNL_ShipmentPlace" type="TIG\PostNL\Plugin\Shipment\AsyncPlugin" sortOrder="1" />
     </type>

Magento uses same query builder in same transaction and final generated query contains previous additional tables.

Expected Query:

 SELECT `sales_creditmemo`.`entity_id` FROM `sales_creditmemo`
  LEFT JOIN `magento_sales_creditmemo_grid_archive`
    ON sales_creditmemo.entity_id = magento_sales_creditmemo_grid_archive.entity_id
       WHERE (sales_creditmemo.updated_at >= '2022-10-31 15:48:10') AND
       (magento_sales_creditmemo_grid_archive.entity_id IS NULL)

Query with additional Tables after TIG_PostNL plugins

 SELECT `sales_creditmemo`.`entity_id` FROM `sales_creditmemo`
  LEFT JOIN `magento_sales_order_grid_archive` ON sales_creditmemo.entity_id = magento_sales_order_grid_archive.entity_id
  LEFT JOIN `magento_sales_shipment_grid_archive` ON sales_creditmemo.entity_id = magento_sales_shipment_grid_archive.entity_id
  LEFT JOIN `magento_sales_creditmemo_grid_archive` ON sales_creditmemo.entity_id = magento_sales_creditmemo_grid_archive.entity_id
   WHERE (sales_creditmemo.updated_at >= '2022-11-16 07:47:31') AND
    (magento_sales_order_grid_archive.entity_id IS NULL) AND
    (magento_sales_shipment_grid_archive.entity_id IS NULL) AND
    (magento_sales_creditmemo_grid_archive.entity_id IS NULL)

To Reproduce Steps to reproduce the behavior:

  1. Create Order,
  2. Create Credit Memo
  3. Run async grid crons (sales_grid_order_creditmemo_async_insert)

Expected result Credit memo grid table must be updated

Actual result New record does not appear in grid.

Please complete the following information

tig-jeffreybranderhorst commented 1 year ago

Hi @kaplansin ,

I have tried to reproduce this issue, after running the cron our grid updates with the new credit memo. So I'm not able to reproduce this issue, could you contact digitaleklantsupport@postnl.nl for direct support, so we can test and look at your staging site to find the problem.

Have a great day, Jeffrey

kaplansin commented 1 year ago

@tig-jeffreybranderhorst Can you test it with Magento 2.4.4-p2 EE Issue must be happening only on EE version.

orkuncv commented 1 year ago

Hi @tig-jeffreybranderhorst ,

Did you try it on Magento Commerce? Also sounds like the same issue as #322

kaplansin commented 1 year ago

Yes we have this issue on Magento Commerce 2.4.4-p2

tig-jeffreybranderhorst commented 1 year ago

Hi @kaplansin and @orkuncv ,

We were able to also test this on a Commerce version, there indeed it seems it does not work like #322 I will connect this github issue to our backlog issue of #322. We will discuss this issue with PostNL in our next meeting.

Thank you both for submitting this issue, we will fix it as soon as possible. If you got any questions, please don't hesitate and ask them here.

Have a great day, Jeffrey

tig-vincentthart commented 1 year ago

@kaplansin

we created a patch for Magento, which should resolve this issue. See #322

tig-vincentthart commented 1 year ago

@kaplansin & @orkuncv,

It looks like Magento has resolved this within the 2.4.6 release. Therefore we close this issue.

Thanks again for sharing your input.

Greetings,

Vincent