Magento – Change sort order totals in invoice PDF

invoicemagento-1.9pdftotals

How can i change the sort order in invoice PDF?

Now i have:

enter image description here

But i want the following:

  • Subtotal
  • Shipping
  • Total

  • TAX 6%

  • TAX 21%
  • Total TAX

Thanks!

Best Answer

You can customise the sort order of totals for PDFs in XML. You will need to setup a basic module (and ensure it has dependencies of Mage_Sales and Mage_Tax), then add the following code the config.xml of your module:

Note: I have left the default ordering as is below, you can customise to your needs.

<global>
    <pdf>
        <subtotal>
            <sort_order>100</sort_order>
        </subtotal>
        <discount>
            <sort_order>200</sort_order>
        </discount>
        <tax>
            <sort_order>300</sort_order>
        </tax>
        <shipping>
            <sort_order>400</sort_order>
        </shipping>
        <adjustment_positive>
            <sort_order>500</sort_order>
        </adjustment_positive>
        <adjustment_negative>
            <sort_order>600</sort_order>
        </adjustment_negative>
        <grand_total>
            <sort_order>700</sort_order>
        </grand_total>
    </pdf>
</global>
Related Topic