Question

I want to add a text box on the total credit memo. I can input amount to refund.

I am trying to add my block in creditmemo_totals

What i tried is add code in

Company/Custom/view/adminhtml/layout/sales_order_creditmemo_new.xml

    <body>
        <referenceBlock name="creditmemo_totals">
            <block class="Company\Custom\Block\Adminhtml\Sales\Order\Creditmemo\Totals" name="Company_fee" template="Company_Custom::creditmemo/companyfee.phtml"/>
        </referenceBlock>
    </body>

What i want to do is add custom fee total box in refund total box like this

enter image description here

Was it helpful?

Solution

To add fee box in refund total block we need to remove adjustments block using

<referenceBlock name="adjustments" remove="true"/>

and then add your block in creditmemo_totals reference

Company/Custom/view/adminhtml/layout/sales_order_creditmemo_new.xml

<body>
    <referenceBlock name="adjustments" remove="true"/>
    <referenceBlock name="creditmemo_totals">
        <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Adjustments" name="Company_fee" template="Company_Custom::creditmemo/ktplfee.phtml"/>
    </referenceBlock>
</body>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top