0

I need to have the quantity on the Credit Memo PDF printout with a negative sign.

How can achieve this?

2

The items of a credit memo PDF are rendered in Mage_Sales_Model_Order_Pdf_Items_Creditmemo_Default, around line 77.

Rewrite the model from a custom extension and change

$lines[0][] = array(
            'text'  => $item->getQty() * 1,
            'feed'  => 445,
            'font'  => 'bold',
            'align' => 'right',
        );

to

$lines[0][] = array(
            'text'  => $item->getQty() * -1,
            'feed'  => 445,
            'font'  => 'bold',
            'align' => 'right',
        );

Rewriting can be done in the config.xml

< ?xml version="1.0"?>
<config>
    [...]
    <global>
       <models>
          <sales>
              <rewrite>
                  <order_pdf_items_creditmemo_default>[Namespace]_[Module]_Model_Sales_Order_Pdf_Items_Creditmemo_Default</order_pdf_items_creditmemo_default>
              </rewrite>
          </sales>
       </models>
    </global>
</config>

you're custom class extending the origional one

  • Thanks, I managed to modify the qty and row totals to have a negative sign before the value. How can I add a negative sign to the totals as well? – Andras Nov 4 '15 at 12:54

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.