firegento / firegento-pdf

Generates nicer and configurable PDF for invoices, creditmemos and shippings in Magento
100 stars 62 forks source link

Fixes #316 #361

Open Schrank opened 6 years ago

Schrank commented 6 years ago

Thanks @nige-one

sprankhub commented 6 years ago

Did you test this @Schrank? I just tested it and it does not change anything for me. The "Shipping & Handling Tax" is still shown separately and does not show any tax rate. Are you sure this works @nige-one?

Schrank commented 6 years ago

No, I just added it and then left the room :) (no joke)

nige-one commented 6 years ago

It works like a charm for me. Just tested it again, dropped my XML totals extension from https://github.com/firegento/firegento-pdf/issues/316#issuecomment-225514966 and copied the new file from the PR.

Maybe a configuration issue. Here is mine: image

Note the overridden fields, which do not seem to take affect, since everything is still working as expected in the B2C configuration. This installation is version 1.9.3.6.

By the way: I changed

    public function __getCalculatedTaxes()
    {
        return array();
    }

to

    public function _getCalculatedTaxes()
    {
        return $this->_getTaxHelper()->getCalculatedTaxes($this->getSource());
    }

I really can't remember why at the moment, but I think it has something to do with rendering the order itself as PDF to use it as order confirmation. Probably this addresses https://github.com/firegento/firegento-pdf/pull/297#issuecomment-160663808 as well.

sprankhub commented 6 years ago

@nige-one could you provide a screenshot of the totals section of the invoice PDF? Mine looks like this:

image

As you can see, it still dows not show the tax rate of the shipping and handling tax.

nige-one commented 6 years ago

Ok, I have to extend my answer. Shipping tax and value of goods taxes get only summed up if you return an empty array for both functions _getShippingTax() and _getCalculatedTaxes(). So @Schrank's PR should lead to the wanted behaviour.