<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<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_creditmemo_grid.sales_order_view_creditmemo_grid_data_source</item>
        </item>
    </argument>
    <settings>
        <spinner>sales_order_creditmemo_columns</spinner>
        <deps>
            <dep>sales_order_view_creditmemo_grid.sales_order_view_creditmemo_grid_data_source</dep>
        </deps>
    </settings>
    <dataSource name="sales_order_view_creditmemo_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_creditmemo</aclResource>
        <dataProvider class="Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider" name="sales_order_view_creditmemo_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 }, componentType = column, index = ${ $.index }:visible</link>
                    </imports>
                </settings>
            </filterSelect>
        </filters>
        <massaction name="listing_massaction">
            <action name="pdfcreditmemos_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/creditmemo/pdfcreditmemos</item>
                    </item>
                </argument>
                <settings>
                    <type>pdfcreditmemos_order</type>
                    <label translate="true">PDF Creditmemos</label>
                </settings>
            </action>
        </massaction>
        <paging name="listing_paging"/>
    </listingToolbar>
    <columns name="sales_order_creditmemo_columns">
        <settings>
            <childDefaults>
                <param name="fieldAction" xsi:type="array">
                    <item name="provider" xsi:type="string">sales_order_view_creditmemo_grid.sales_order_view_creditmemo_grid.sales_order_creditmemo_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">Credit Memo</label>
            </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">Created</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\Creditmemo\State\Options"/>
                <dataType>select</dataType>
                <label translate="true">Status</label>
            </settings>
        </column>
        <column name="base_grand_total" class="Magento\Sales\Ui\Component\Listing\Column\Price">
            <settings>
                <filter>textRange</filter>
                <label translate="true">Refunded</label>
            </settings>
        </column>
        <column name="order_status" component="Magento_Ui/js/grid/columns/select">
            <settings>
                <filter>select</filter>
                <options class="Magento\Sales\Ui\Component\Listing\Column\Status\Options"/>
                <dataType>select</dataType>
                <label translate="true">Order Status</label>
                <visible>false</visible>
            </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 &amp; Handling</label>
                <visible>false</visible>
            </settings>
        </column>
        <column name="adjustment_positive" class="Magento\Sales\Ui\Component\Listing\Column\Price">
            <settings>
                <filter>textRange</filter>
                <label translate="true">Adjustment Refund</label>
                <visible>false</visible>
            </settings>
        </column>
        <column name="adjustment_negative" class="Magento\Sales\Ui\Component\Listing\Column\Price">
            <settings>
                <filter>textRange</filter>
                <label translate="true">Adjustment Fee</label>
                <visible>false</visible>
            </settings>
        </column>
        <column name="order_base_grand_total" class="Magento\Sales\Ui\Component\Listing\Column\Price">
            <settings>
                <filter>textRange</filter>
                <label translate="true">Grand Total</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_creditmemo/view</item>
                    <item name="urlEntityParamName" xsi:type="string">creditmemo_id</item>
                </item>
            </argument>
            <settings>
                <indexField>entity_id</indexField>
            </settings>
        </actionsColumn>
    </columns>
</listing>
