1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
26:
27: class Mage_Tax_Model_Sales_Pdf_Grandtotal extends Mage_Sales_Model_Order_Pdf_Total_Default
28: {
29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39:
40: public function getTotalsForDisplay()
41: {
42: $store = $this->getOrder()->getStore();
43: $config= Mage::getSingleton('tax/config');
44: if (!$config->displaySalesTaxWithGrandTotal($store)) {
45: return parent::getTotalsForDisplay();
46: }
47: $amount = $this->getOrder()->formatPriceTxt($this->getAmount());
48: $amountExclTax = $this->getAmount() - $this->getSource()->getTaxAmount();
49: $amountExclTax = ($amountExclTax > 0) ? $amountExclTax : 0;
50: $amountExclTax = $this->getOrder()->formatPriceTxt($amountExclTax);
51: $tax = $this->getOrder()->formatPriceTxt($this->getSource()->getTaxAmount());
52: $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;
53:
54: $totals = array(array(
55: 'amount' => $this->getAmountPrefix().$amountExclTax,
56: 'label' => Mage::helper('tax')->__('Grand Total (Excl. Tax)') . ':',
57: 'font_size' => $fontSize
58: ));
59:
60: if ($config->displaySalesFullSummary($store)) {
61: $totals = array_merge($totals, $this->getFullTaxInfo());
62: }
63:
64: $totals[] = array(
65: 'amount' => $this->getAmountPrefix().$tax,
66: 'label' => Mage::helper('tax')->__('Tax') . ':',
67: 'font_size' => $fontSize
68: );
69: $totals[] = array(
70: 'amount' => $this->getAmountPrefix().$amount,
71: 'label' => Mage::helper('tax')->__('Grand Total (Incl. Tax)') . ':',
72: 'font_size' => $fontSize
73: );
74: return $totals;
75: }
76: }
77: