销售发票网格某些列过滤器在添加新税/增值税号列时不起作用

时间:2021-01-07 12:10:14

标签: magento-2.3

我在销售发票网格中添加了新的税/增值税号列。 对于这个列过滤器,我在自定义模块插件文件中添加了以下代码

public function aroundGetReport(CollectionFactory $subject, \Closure $proceed, $requestName)
{
    $result = $proceed($requestName);

    if (self::SALES_ORDER_INVOICE_GRID_DATA_SOURCE == $requestName) {
        if ($result instanceof $this->collection) {
            $select = $this->collection->getSelect();
            $select->joinLeft(
                ['sales_order' => $this->collection->getTable('sales_order')],
                'main_table.order_increment_id = sales_order.increment_id',
                ['customer_taxvat']
            );

            return $this->collection;
        }
    }

    return $result;
}

此税/增值税列及其过滤器工作正常。但是添加这个新过滤器后,其余过滤器不起作用。

例如: 当我们尝试使用发票 ID 进行过滤时,出现以下错误:

Integrity constraint violation: 1052 Column 'increment_id' in where clause is ambiguous.

仅在添加此新列和过滤器后尝试使用其他一些列进行过滤时也会出现类似错误。

请帮忙...

0 个答案:

没有答案