1

i want to add new custom column in Invoice View Page. in Items Invoiced details.

i add code in sales_order_view.xml file but it's not working, the column not addedd.

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body>
<referenceBlock name="invoice_items">
<block class="Magento\Sales\Block\Adminhtml\Items\Column\DefaultColumn" name="cgst" template="Ncode_Test::test.phtml" group="cgst"/>
</referenceBlock> </body> </page>

enter image description here

please help me on this. how can i add custom column in invoice?

rocky9310
  • 115
  • 1
  • 12

1 Answers1

0
your_magento_base/app/code/Magenest/CutomizeOrderInvoice/view/adminhtml/layout/sales_order_invoice_view.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
   <body>
       <referenceContainer name="content">
           <block class="Magento\Backend\Block\Template"
                  name="magenest_sales_invoice_custom_section" before="sales_invoice_view"
                  template="Magenest_CutomizeOrderInvoice::order/invoice/view/custom_section.phtml">
           </block>
       </referenceContainer>
   </body>
</page>

your_magento_base/app/code/Magenest/CutomizeOrderInvoice/view/adminhtml/templates/order/invoice/view/custom_section.phtml
<section class="admin__page-section">
   <div class="admin__page-section-title">
       <span class="title"><?= $block->escapeHtml(__('Magenest Custom Section')) ?></span>
   </div>
   <div id="invoice_item_container" class="admin__page-section-content">
       <div>
            <p><b>This my section :</b> section custom information</p>
           <strong>Copyright © by Magenest</strong>
       </div>
   </div>
</section>