<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Copyright 2015 Adobe
 * All Rights Reserved.
 */
-->
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            <item name="provider" xsi:type="string">sales_order_view_invoice_grid.sales_order_view_invoice_grid_data_source</item>
        </item>
    </argument>
    <settings>
        <spinner>sales_order_invoice_columns</spinner>
        <deps>
            <dep>sales_order_view_invoice_grid.sales_order_view_invoice_grid_data_source</dep>
        </deps>
    </settings>
    <dataSource name="sales_order_view_invoice_grid_data_source" component="Magento_Ui/js/grid/provider">
        <settings>
            <filterUrlParams>
                <param name="order_id">*</param>
            </filterUrlParams>
            <updateUrl path="mui/index/render"/>
        </settings>
        <aclResource>Magento_Sales::sales_invoice</aclResource>
        <dataProvider class="Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider" name="sales_order_view_invoice_grid_data_source">
            <settings>
                <requestFieldName>id</requestFieldName>
                <primaryFieldName>entity_id</primaryFieldName>
            </settings>
        </dataProvider>
    </dataSource>
    <listingToolbar name="listing_top">
        <bookmark name="bookmarks"/>
        <columnsControls name="columns_controls"/>
        <exportButton name="export_button">
            <settings>
                <additionalParams>
                    <param xsi:type="string" active="true" name="order_id">*</param>
                </additionalParams>
            </settings>
        </exportButton>
        <filterSearch name="fulltext"/>
        <filters name="listing_filters">
            <filterSelect name="store_id" provider="${ $.parentName }">
                <settings>
                    <options class="Magento\Store\Ui\Component\Listing\Column\Store\Options"/>
                    <caption translate="true">All Store Views</caption>
                    <label translate="true">Purchased From</label>
                    <dataScope>store_id</dataScope>
                    <imports>
                        <link name="visible">ns = ${ $.ns }, index = ${ $.index }:visible</link>
                    </imports>
                </settings>
            </filterSelect>
        </filters>
        <massaction name="listing_massaction">
            <action name="pdfinvoices_order" class="Magento\Sales\Ui\Component\Control\PdfAction">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="pdfAction" xsi:type="string">sales/invoice/pdfinvoices</item>
                    </item>
                </argument>
                <settings>
                    <type>pdfinvoices_order</type>
                    <label translate="true">PDF Invoices</label>
                </settings>
            </action>
        </massaction>
        <paging name="listing_paging"/>
    </listingToolbar>
    <columns name="sales_order_invoice_columns">
        <settings>
            <childDefaults>
                <param name="fieldAction" xsi:type="array">
                    <item name="provider" xsi:type="string">sales_order_view_invoice_grid.sales_order_view_invoice_grid.sales_order_invoice_columns.actions</item>
                    <item name="target" xsi:type="string">applyAction</item>
                    <item name="params" xsi:type="array">
                        <item name="0" xsi:type="string">view</item>
                        <item name="1" xsi:type="string">${ $.$data.rowIndex }</item>
                    </item>
                </param>
            </childDefaults>
        </settings>
        <selectionsColumn name="ids">
            <settings>
                <indexField>entity_id</indexField>
            </settings>
        </selectionsColumn>
        <column name="increment_id">
            <settings>
                <filter>text</filter>
                <label translate="true">Invoice</label>
                <sorting>asc</sorting>
            </settings>
        </column>
        <column name="created_at" class="Magento\Ui\Component\Listing\Columns\Date" component="Magento_Ui/js/grid/columns/date">
            <settings>
                <filter>dateRange</filter>
                <dataType>date</dataType>
                <label translate="true">Invoice Date</label>
            </settings>
        </column>
        <column name="order_increment_id">
            <settings>
                <filter>text</filter>
                <label translate="true">Order #</label>
            </settings>
        </column>
        <column name="order_created_at" class="Magento\Ui\Component\Listing\Columns\Date" component="Magento_Ui/js/grid/columns/date">
            <settings>
                <filter>dateRange</filter>
                <dataType>date</dataType>
                <label translate="true">Order Date</label>
            </settings>
        </column>
        <column name="billing_name">
            <settings>
                <filter>text</filter>
                <label translate="true">Bill-to Name</label>
            </settings>
        </column>
        <column name="state" component="Magento_Ui/js/grid/columns/select">
            <settings>
                <filter>select</filter>
                <options class="Magento\Sales\Ui\Component\Listing\Column\Invoice\State\Options"/>
                <dataType>select</dataType>
                <label translate="true">Status</label>
            </settings>
        </column>
        <column name="grand_total" class="Magento\Sales\Ui\Component\Listing\Column\PurchasedPrice">
            <settings>
                <filter>textRange</filter>
                <label translate="true">Amount</label>
            </settings>
        </column>
        <column name="store_id" class="Magento\Store\Ui\Component\Listing\Column\Store">
            <settings>
                <label translate="true">Purchased From</label>
                <bodyTmpl>ui/grid/cells/html</bodyTmpl>
                <sortable>false</sortable>
                <visible>false</visible>
            </settings>
        </column>
        <column name="billing_address" class="Magento\Sales\Ui\Component\Listing\Column\Address">
            <settings>
                <filter>text</filter>
                <label translate="true">Billing Address</label>
                <bodyTmpl>ui/grid/cells/html</bodyTmpl>
                <visible>false</visible>
            </settings>
        </column>
        <column name="shipping_address" class="Magento\Sales\Ui\Component\Listing\Column\Address">
            <settings>
                <filter>text</filter>
                <label translate="true">Shipping Address</label>
                <bodyTmpl>ui/grid/cells/html</bodyTmpl>
                <visible>false</visible>
            </settings>
        </column>
        <column name="customer_name">
            <settings>
                <filter>text</filter>
                <label translate="true">Customer Name</label>
                <visible>false</visible>
            </settings>
        </column>
        <column name="customer_email">
            <settings>
                <filter>text</filter>
                <label translate="true">Email</label>
                <visible>false</visible>
            </settings>
        </column>
        <column name="customer_group_id" component="Magento_Ui/js/grid/columns/select">
            <settings>
                <filter>select</filter>
                <options class="Magento\Customer\Ui\Component\Listing\Column\Group\Options"/>
                <dataType>select</dataType>
                <label translate="true">Customer Group</label>
                <visible>false</visible>
            </settings>
        </column>
        <column name="payment_method" component="Magento_Ui/js/grid/columns/select">
            <settings>
                <filter>select</filter>
                <options class="Magento\Payment\Ui\Component\Listing\Column\Method\Options"/>
                <dataType>select</dataType>
                <label translate="true">Payment Method</label>
                <visible>false</visible>
            </settings>
        </column>
        <column name="shipping_information">
            <settings>
                <filter>text</filter>
                <label translate="true">Shipping Information</label>
                <visible>false</visible>
            </settings>
        </column>
        <column name="subtotal" class="Magento\Sales\Ui\Component\Listing\Column\Price">
            <settings>
                <filter>textRange</filter>
                <label translate="true">Subtotal</label>
                <visible>false</visible>
            </settings>
        </column>
        <column name="shipping_and_handling" class="Magento\Sales\Ui\Component\Listing\Column\Price">
            <settings>
                <filter>textRange</filter>
                <label translate="true">Shipping and Handling</label>
                <visible>false</visible>
            </settings>
        </column>
        <actionsColumn name="actions" class="Magento\Sales\Ui\Component\Listing\Column\ViewAction">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="viewUrlPath" xsi:type="string">sales/order_invoice/view</item>
                    <item name="urlEntityParamName" xsi:type="string">invoice_id</item>
                </item>
            </argument>
            <settings>
                <indexField>increment_id</indexField>
            </settings>
        </actionsColumn>
    </columns>
</listing>
