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

  • please check my answer – Rakesh Donga Mar 13 '19 at 5:38
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'
                        ),
                    );
                     }
                }
  • 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 '19 at 7:23
  • what update ? app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php. – Rakesh Donga Mar 13 '19 at 7:27
  • Same code you shared. – SA Soibal Mar 13 '19 at 7:29
  • you want to remove also above tax also? i don't understand – Rakesh Donga Mar 13 '19 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 '19 at 7:34

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.