Example #1
0
 /**
  * Check if tax amount should be included to grandtotal block
  * array(
  *  $index => array(
  *      'amount'   => $amount,
  *      'label'    => $label,
  *      'font_size'=> $font_size
  *  )
  * )
  * @return array
  */
 public function getTotalsForDisplay()
 {
     $store = $this->getOrder()->getStore();
     $config = Mage::getSingleton('tax/config');
     if ($config->displaySalesTaxWithGrandTotal($store)) {
         return array();
     }
     return parent::getTotalsForDisplay();
 }
Example #2
0
 public function getAmount()
 {
     $disc = parent::getAmount();
     $hidden = $this->getSource()->getHiddenTaxAmount();
     if ($disc > 0) {
         $disc -= $hidden;
     } else {
         $disc += $hidden;
     }
     return $disc;
 }
Example #3
0
 public function getTotalsForDisplay()
 {
     parent::getTotalsForDisplay();
     $amount = $this->getOrder()->formatPriceTxt($this->getAmount());
     if ($this->getAmountPrefix()) {
         $amount = $this->getAmountPrefix() . $amount;
     }
     $fontsize = $this->getFontSize() ? $this->getFontSize() : 7;
     $totals = array(array('label' => 'Offer Discount', 'amount' => $amount, 'font_size' => $fontsize));
     return $totals;
 }
Example #4
0
 public function getTotalsForDisplay()
 {
     parent::getTotalsForDisplay();
     // getAmount is defined in the parent class and should read
     // the value from the defined source_field in config.xml
     $creditPointAmount = $this->getCreditpointAmt();
     $creditPoints = number_format(Mage::getModel('creditpoint/creditpoint')->load($this->getOrder()->getEntityId(), 'order_id')->getAppliedCreditPoint());
     $label = Mage::helper('creditpoint')->getCreditPointLabel($creditPoints);
     $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;
     $total = array('amount' => '-' . $creditPointAmount, 'label' => $label, 'font_size' => $fontSize);
     return array($total);
 }
Example #5
0
 /**
  * Check if tax amount should be included to grandtotal block
  * array(
  *  $index => array(
  *      'amount'   => $amount,
  *      'label'    => $label,
  *      'font_size'=> $font_size
  *  )
  * )
  * @return array
  */
 public function getTotalsForDisplay()
 {
     $store = $this->getOrder()->getStore();
     $config = Mage::getSingleton('tax/config');
     if ($config->displaySalesTaxWithGrandTotal($store)) {
         return array();
     }
     $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;
     $totals = array();
     if ($config->displaySalesFullSummary($store)) {
         $totals = $this->getFullTaxInfo();
     }
     $totals = array_merge($totals, parent::getTotalsForDisplay());
     return $totals;
 }
Example #6
0
 /**
  * Check if tax amount should be included to grandtotals block
  * array(
  *  $index => array(
  *      'amount'   => $amount,
  *      'label'    => $label,
  *      'font_size'=> $font_size
  *  )
  * )
  * @return array
  */
 public function getTotalsForDisplay()
 {
     $store = $this->getOrder()->getStore();
     $config = Mage::getSingleton('tax/config');
     if (!$config->displaySalesTaxWithGrandTotal($store)) {
         return parent::getTotalsForDisplay();
     }
     $amount = $this->getOrder()->formatPriceTxt($this->getAmount());
     $amountExclTax = $this->getAmount() - $this->getSource()->getTaxAmount();
     $amountExclTax = $this->getOrder()->formatPriceTxt($amountExclTax);
     $tax = $this->getOrder()->formatPriceTxt($this->getSource()->getTaxAmount());
     $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;
     $totals = array(array('amount' => $this->getAmountPrefix() . $amountExclTax, 'label' => Mage::helper('tax')->__('Grand Total (Excl. Tax)') . ':', 'font_size' => $fontSize), array('amount' => $this->getAmountPrefix() . $tax, 'label' => Mage::helper('tax')->__('Tax') . ':', 'font_size' => $fontSize), array('amount' => $this->getAmountPrefix() . $amount, 'label' => Mage::helper('tax')->__('Grand Total (Incl. Tax)') . ':', 'font_size' => $fontSize));
     return $totals;
 }
 /**
  * Check if tax amount should be included to grandtotals block
  * array(
  *  $index => array(
  *      'amount'   => $amount,
  *      'label'    => $label,
  *      'font_size'=> $font_size
  *  )
  * )
  * @return array
  */
 public function getTotalsForDisplay()
 {
     if (!$this->getOrder()->getDcOrderId() || $this->getOrder()->getDeliveryDutyType() == Dutycalculator_Charge_Helper_Data::DC_DELIVERY_TYPE_DDU || $this->getOrder()->getFailedCalculation()) {
         $store = $this->getOrder()->getStore();
         $config = Mage::getSingleton('tax/config');
         if (!$config->displaySalesTaxWithGrandTotal($store)) {
             return parent::getTotalsForDisplay();
         }
         $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;
         $totals = array(array('amount' => $this->getAmountPrefix() . $amountExclTax, 'label' => Mage::helper('tax')->__('Grand Total (Excl. Tax)') . ':', 'font_size' => $fontSize));
         if ($config->displaySalesFullSummary($store)) {
             $totals = array_merge($totals, $this->getFullTaxInfo());
         }
         $totals[] = array('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);
         return $totals;
     } else {
         $store = $this->getOrder()->getStore();
         $config = Mage::getSingleton('tax/config');
         $amount = $this->getOrder()->formatPriceTxt($this->getAmount());
         $amountExclTax = $this->getAmount() - ($this->getSource()->getTaxAmount() + $this->getSource()->getImportDutyTax());
         $amountExclTax = $amountExclTax > 0 ? $amountExclTax : 0;
         $amountExclTax = $this->getOrder()->formatPriceTxt($amountExclTax);
         $tax = $this->getOrder()->formatPriceTxt($this->getSource()->getTaxAmount() + $this->getSource()->getSalesTax());
         $duty = $this->getOrder()->formatPriceTxt($this->getSource()->getImportDuty());
         $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;
         $totals = array(array('amount' => $this->getAmountPrefix() . $amountExclTax, 'label' => Mage::helper('tax')->__('Grand Total (Excl. Tax)') . ':', 'font_size' => $fontSize));
         //			if ($config->displaySalesFullSummary($store)) {
         //				$totals = array_merge($totals, $this->getFullTaxInfo());
         //			}
         $totals[] = array('amount' => $this->getAmountPrefix() . $tax, 'label' => Mage::helper('tax')->__('Sales Tax') . ':', 'font_size' => $fontSize);
         $title = $this->getOrder()->getDeliveryDutyType() == Dutycalculator_Charge_Helper_Data::DC_DELIVERY_TYPE_DDU ? $this->getOrder()->getFailedCalculation() ? 'Any import duty & taxes are paid upon delivery and are not included in the final price' : 'Estimated import duty & taxes (Not included in grand total, paid upon delivery)' : 'Import duty & additional taxes';
         $totals[] = array('amount' => $this->getAmountPrefix() . $duty, 'label' => Mage::helper('dccharge')->__($title) . ':', 'font_size' => $fontSize);
         $totals[] = array('amount' => $this->getAmountPrefix() . $amount, 'label' => Mage::helper('tax')->__('Grand Total (Incl. Tax)') . ':', 'font_size' => $fontSize);
         return $totals;
     }
 }
Example #8
0
 /**
  * Check if tax amount should be included to grandtotals block
  * array(
  *  $index => array(
  *      'amount'   => $amount,
  *      'label'    => $label,
  *      'font_size'=> $font_size
  *  )
  * )
  * @return array
  */
 public function getTotalsForDisplay()
 {
     $store = $this->getOrder()->getStore();
     $config = Mage::getSingleton('Mage_Tax_Model_Config');
     if (!$config->displaySalesTaxWithGrandTotal($store)) {
         return parent::getTotalsForDisplay();
     }
     $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;
     $totals = array(array('amount' => $this->getAmountPrefix() . $amountExclTax, 'label' => Mage::helper('Mage_Tax_Helper_Data')->__('Grand Total (Excl. Tax)') . ':', 'font_size' => $fontSize));
     if ($config->displaySalesFullSummary($store)) {
         $totals = array_merge($totals, $this->getFullTaxInfo());
     }
     $totals[] = array('amount' => $this->getAmountPrefix() . $tax, 'label' => Mage::helper('Mage_Tax_Helper_Data')->__('Tax') . ':', 'font_size' => $fontSize);
     $totals[] = array('amount' => $this->getAmountPrefix() . $amount, 'label' => Mage::helper('Mage_Tax_Helper_Data')->__('Grand Total (Incl. Tax)') . ':', 'font_size' => $fontSize);
     return $totals;
 }