2

My totals are displayed wrong on PDF invoices meaning, my taxes are listed below my shipping. On the cart and in the sales emails is all ok, like: Price Tax Shipping

and only on my PDF invoices it is like

Price Shipping Tax

Where are the informations for PDF invoice totals defined?

2

The sort order of the totals in the pdf is determined by, funnily enough, their sort_order attribute in /app/code/core/Mage/Sales/etc/config.xml

<config>
  <global>
        <!-- SNIP -->
        <pdf>
            <!-- SNIP -->
            <totals>
                <subtotal translate="title">
                    <title>Subtotal</title>
                    <source_field>subtotal</source_field>
                    <font_size>7</font_size>
                    <display_zero>1</display_zero>
                    <sort_order>100</sort_order>
                </subtotal>
                <discount translate="title">
                    <title>Discount</title>
                    <source_field>discount_amount</source_field>
                    <amount_prefix>-</amount_prefix>
                    <font_size>7</font_size>
                    <display_zero>0</display_zero>
                    <sort_order>200</sort_order>
                </discount>
                <shipping translate="title">
                    <title>Shipping &amp; Handling</title>
                    <source_field>shipping_amount</source_field>
                    <font_size>7</font_size>
                    <display_zero>0</display_zero>
                    <sort_order>400</sort_order>
                </shipping>
                <adjustment_positive translate="title">
                    <title>Adjustment Refund</title>
                    <source_field>adjustment_positive</source_field>
                    <font_size>7</font_size>
                    <display_zero>0</display_zero>
                    <sort_order>500</sort_order>
                </adjustment_positive>
                <adjustment_negative translate="title">
                    <title>Adjustment Fee</title>
                    <source_field>adjustment_negative</source_field>
                    <font_size>7</font_size>
                    <display_zero>0</display_zero>
                    <sort_order>600</sort_order>
                </adjustment_negative>
                <grand_total translate="title">
                    <title>Grand Total</title>
                    <source_field>grand_total</source_field>
                    <font_size>8</font_size>
                    <display_zero>1</display_zero>
                    <sort_order>700</sort_order>
                </grand_total>
            </totals>
        </pdf>
  <global>
</config>

In a default Magento install there is no back-end setting (like there is for the checkout totals) to change this.

You can copy the above into your own module's config.xml file and then adjust the sort_order to your liking (cache refresh needed after any edits).

1

Late to the game here, but for others having this issue, you just create a module for your site and add the following to that modules etc/config.xml file (within <global>...</global>):

<pdf>
   <totals>
      <tax translate="title">
         <sort_order>410</sort_order>
      </tax>
   </totals>
</pdf>

Note that this is not found in the core/Sales module as the other answer states, it is found here: /app/code/core/Mage/Tax/etc/config.xml

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.