Esempio n. 1
0
/**
 * Calculates and returns the grand total of an item including tax and excluding
 * discount.
 *
 * @param Mage_Sales_Model_Order_Item $item The item to return info from
 * @return Float The grand total
 */
function getItemTotal($item)
{
    return $item->getRowTotal() - $item->getDiscountAmount() + $item->getTaxAmount() + $item->getWeeeTaxAppliedRowAmount();
}
Esempio n. 2
0
 /**
  * Grab the tax amount from the line item based on the taxSource input
  * @param Mage_Sales_Model_Order_Item $item
  * @param string $taxSource
  * @return array represents the tax price with currency code
  */
 protected function _getTaxesCharged($item, $qty, $taxSource = self::LINE_ITEM_TYPE_DEFAULT)
 {
     $store = Mage::app()->getStore($item->getStoreId());
     $tax = 0;
     switch ($taxSource) {
         case self::LINE_ITEM_TYPE_DEFAULT:
             $tax = $item->getTaxAmount() / $qty;
             break;
         case self::LINE_ITEM_TYPE_REFUNDED:
             $tax = $store->roundPrice($item->getTaxRefunded() / $qty);
             break;
         case self::LINE_ITEM_TYPE_INVOICED:
             $tax = $item->getTaxInvoiced() / $qty;
             break;
     }
     return $this->_createCurrencyAmount($tax);
 }
Esempio n. 3
0
 /**
  * Retrieve
  *
  * @param Mage_Sales_Model_Order_Item $item
  * @return unknown
  */
 public function itemToQuoteItem(Mage_Sales_Model_Order_Item $item)
 {
     $quoteItem = Mage::getModel('sales/quote_item')->setStoreId($item->getStoreId())->setQuoteItemId($item->getId())->setProductId($item->getProductId())->setSuperProductId($item->getSuperProductId())->setParentProductId($item->getParentProductId())->setSku($item->getSku())->setName($item->getName())->setDescription($item->getDescription())->setWeight($item->getWeight())->setCustomPrice($item->getPrice())->setDiscountPercent($item->getDiscountPercent())->setDiscountAmount($item->getDiscountAmount())->setTaxPercent($item->getTaxPercent())->setTaxAmount($item->getTaxAmount())->setRowWeight($item->getRowWeight())->setRowTotal($item->getRowTotal())->setAppliedRuleIds($item->getAppliedRuleIds())->setBaseDiscountAmount($item->getBaseDiscountAmount())->setBaseTaxAmount($item->getBaseTaxAmount())->setBaseRowTotal($item->getBaseRowTotal());
     return $quoteItem;
 }
Esempio n. 4
0
 /**
  * Calculates and returns the grand total of an item including tax and excluding
  * discount.
  *
  * @param Mage_Sales_Model_Order_Item $item The item to return info from
  * @return Float The grand total
  */
 protected function getItemTotal($item)
 {
     //return $item->getRowTotal() - $item->getDiscountAmount() + $item->getTaxAmount() + $item->getWeeeTaxAppliedRowAmount();
     return $item->getRowTotal() + $item->getTaxAmount() + $item->getHiddenTaxAmount() + $item->getWeeeTaxAppliedRowAmount() - $item->getDiscountAmount();
 }