Magento – PDF invoice items file location in Magento 2

invoicemagento2pdf

I am working on Magento 2 pdf invoice and trying to change layout of default invoice.As I have seen in default Magento pdf there are six column for displaying items in pdf

Products
SKU
Price
Qty 
Tax
Subtotal

When I have checked in admin email template it is calling layout for displaying all items

{{layout area="frontend" handle="sales_email_order_invoice_items" invoice=$invoice order=$order}}

and in phtml file

vendor/magento/module-sales/view/frontend/templates/email/invoice/items.phtml

there are only three column

<thead>
        <tr>
            <th class="item-info">
                <?= /* @escapeNotVerified */  __('Items'); ?>
            </th>
            <th class="item-qty">
                <?= /* @escapeNotVerified */  __('Qty'); ?>
            </th>
            <th class="item-subtotal">
                <?= /* @escapeNotVerified */  __('Subtotal'); ?>
            </th>
        </tr>
    </thead>

I am not getting which file is exactly called when

{{layout area="frontend" handle="sales_email_order_invoice_items" invoice=$invoice order=$order}}

layout is loaded.Please help me if anybody know about it.

Best Answer

Below Model class is responsible for displaying items in invoice pdf.

Magento\Sales\Model\Order\Pdf\Invoice.php

You need to override this model class.

Related Topic