2

I am using Magento 1.9.3

I have enabled Display Full Tax Summary and its working fine. I can see my VAT and TAX both in totals area.

But now I need to remove only Total Tax data from invoice PDF. (Screenshot)

Is it possible to remove Total Tax data only form PDF?

enter image description here

1
  • please check my answer Mar 13, 2019 at 5:38

1 Answer 1

1

override this file

app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php

to

app/code/local/Mage/Sales/Model/Order/Pdf/Abstract.php

and Find insertTotals function

foreach ($total->getTotalsForDisplay() as $totalData) {
    $lineBlock['lines'][] = array(
        array(
            'text'      => $totalData['label'],
            'feed'      => 475,
            'align'     => 'right',
            'font_size' => $totalData['font_size'],
            'font'      => 'bold'
        ),
        array(
            'text'      => $totalData['amount'],
            'feed'      => 565,
            'align'     => 'right',
            'font_size' => $totalData['font_size'],
            'font'      => 'bold'
        ),
    );
}

to

foreach ($total->getTotalsForDisplay() as $totalData) {
                    if($totalData['label'] != "Tax:") {
                    $lineBlock['lines'][] = array(
                        array(
                            'text'      => $totalData['label'],
                            'feed'      => 475,
                            'align'     => 'right',
                            'font_size' => $totalData['font_size'],
                            'font'      => 'bold'
                        ),
                        array(
                            'text'      => $totalData['amount'],
                            'feed'      => 565,
                            'align'     => 'right',
                            'font_size' => $totalData['font_size'],
                            'font'      => 'bold'
                        ),
                    );
                     }
                }
9
  • Dear Rakesh, worked but I had to update the app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php. Thanks a lot man.
    – SA Soibal
    Mar 13, 2019 at 7:23
  • what update ? app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php. Mar 13, 2019 at 7:27
  • Same code you shared.
    – SA Soibal
    Mar 13, 2019 at 7:29
  • you want to remove also above tax also? i don't understand Mar 13, 2019 at 7:30
  • Rakesh: Code you shared dose the exact thing what I needed. I am just saying that I had to change in app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php file instead of app/code/local/Mage/Sales/Model/Order/Pdf/Abstract.php. Please accept the edit.
    – SA Soibal
    Mar 13, 2019 at 7:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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