Modify PDF template


could you please help me to modify PDF template? I want that instead ‘Total’ would be the price with discount and also instead ‘Subtotal’ would be the amount of discounts. I will add the example of what Im asking.

Thank you in advance.

Templates have an own section in the wiki: