I browsed the tables and discovered that tax rates, codes, etc are saved at order level. How can I display tax summary having tax code, rate, etc at each item line in invoices generated from backend?
Magento – How to display tax details at item lines in invoice
magento-2.1magento2order-itemsorderstax
Best Answer
I did it in this way. In the code below i just added the column DISCOUNT, but you could add what you want following the same logic. Also for creditmemo pdf.
Create a custom module and override
Magento\Sales\Model\ResourceModel\Order\Invoice
andMagento\Sales\Model\Order\Pdf\Items\Invoice\DefaultInvoice
with your class indi.xml
.Then in
Vendor\Module\Override\Sales\Model\Order\Pdf\Invoice
rewrite_drawHeader()
method.And in
Vendor\Module\Override\Sales\Model\Order\Pdf\Items\Invoice\DefaultInvoice
rewritedraw()
method.