Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #316 #361

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* @copyright 2014 FireGento Team (http://www.firegento.com)
* @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3)
*/

/**
* Shipment bundle item model.
*
Expand Down Expand Up @@ -45,27 +46,27 @@ class FireGento_Pdf_Model_Tax_Sales_Pdf_Grandtotal extends Mage_Tax_Model_Sales_
*/
public function getTotalsForDisplay()
{
$store = $this->getOrder()->getStore();
$config = Mage::getSingleton('tax/config');
$store = $this->getOrder()->getStore();
$config = Mage::getSingleton('tax/config');
$noDisplaySumOnDetails = Mage::getStoreConfig(self::NO_SUM_ON_DETAILS, $store);
$hideGrandTotalExclTax = Mage::getStoreConfig(self::HIDE_GRANDTOTAL_EXCL_TAX, $store);
if (!$config->displaySalesTaxWithGrandTotal($store)) {
return parent::getTotalsForDisplay();
}

$amount = $this->getOrder()->formatPriceTxt($this->getAmount());
$amount = $this->getOrder()->formatPriceTxt($this->getAmount());
$amountExclTax = $this->getAmount() - $this->getSource()->getTaxAmount();
$amountExclTax = ($amountExclTax > 0) ? $amountExclTax : 0;
$amountExclTax = $this->getOrder()->formatPriceTxt($amountExclTax);
$tax = $this->getOrder()->formatPriceTxt($this->getSource()->getTaxAmount());
$fontSize = $this->getFontSize() ? $this->getFontSize() : 7;
$tax = $this->getOrder()->formatPriceTxt($this->getSource()->getTaxAmount());
$fontSize = $this->getFontSize() ? $this->getFontSize() : 7;

$totals = array();
if (!$hideGrandTotalExclTax) {
$totals[] = array(
'amount' => $this->getAmountPrefix() . $amountExclTax,
'label' => Mage::helper('tax')->__('Grand Total (Excl. Tax)') . ':',
'font_size' => $fontSize
'amount' => $this->getAmountPrefix() . $amountExclTax,
'label' => Mage::helper('tax')->__('Grand Total (Excl. Tax)') . ':',
'font_size' => $fontSize,
);
}

Expand All @@ -79,24 +80,34 @@ public function getTotalsForDisplay()
$totals = array_merge($totals, $this->getFullTaxInfo());
if (!$noDisplaySumOnDetails) {
$totals[] = array(
'amount' => $this->getAmountPrefix() . $tax,
'label' => Mage::helper('tax')->__('Tax') . ':',
'font_size' => $fontSize
'amount' => $this->getAmountPrefix() . $tax,
'label' => Mage::helper('tax')->__('Tax') . ':',
'font_size' => $fontSize,
);
}
} else {
$totals[] = array(
'amount' => $this->getAmountPrefix() . $tax,
'label' => Mage::helper('tax')->__('Tax') . ':',
'font_size' => $fontSize
'amount' => $this->getAmountPrefix() . $tax,
'label' => Mage::helper('tax')->__('Tax') . ':',
'font_size' => $fontSize,
);
}

$totals[] = array(
'amount' => $this->getAmountPrefix() . $amount,
'label' => Mage::helper('tax')->__('Grand Total (Incl. Tax)') . ':',
'font_size' => $fontSize
'amount' => $this->getAmountPrefix() . $amount,
'label' => Mage::helper('tax')->__('Grand Total (Incl. Tax)') . ':',
'font_size' => $fontSize,
);
return $totals;
}

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

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