<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/sales.xsd">
    <section name="order_invoice">
        <group name="totals">
            <!--
                Override default invoice total models for 'tax' and 'weee' (FPT)
                to support edited orders with partially refunded items.
                Ensures correct tax and grand total calculations during invoicing
                after order modification in admin.
            -->
            <item name="tax" instance="MageWorx\OrderEditor\Model\Invoice\Totals\ModelOrderInvoiceTotalTax" sort_order="200"/>
            <item name="weee" instance="MageWorx\OrderEditor\Model\Invoice\Totals\ModelTotalInvoiceWeee" sort_order="600"/>
        </group>
    </section>
</config>
