Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

magento 2.3 - Sales Invoice Grid some Columns Filters not working when added new Tax/Vat Number column

I have added new column Tax/Vat Number in Sales Invoice Grid. For this column filter i have added the following code in Custom Module Plugin file as

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;
}

And this Tax/Vat Column and its filter is working fine. But after adding this new filter remaining filters are not working.

For Example: When we tried to filter with the invoice id it was getting the following error:

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

And similar error when try to filter with some other columns only after adding this new column and filter.

Please help...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...