Mage_Sales_Model_Order_Creditmemo_Total_Subtotal Class Reference

Inheritance diagram for Mage_Sales_Model_Order_Creditmemo_Total_Subtotal:

Mage_Sales_Model_Order_Creditmemo_Total_Abstract

List of all members.

Public Member Functions

 collect (Mage_Sales_Model_Order_Creditmemo $creditmemo)


Detailed Description

Definition at line 28 of file Subtotal.php.


Member Function Documentation

collect ( Mage_Sales_Model_Order_Creditmemo creditmemo  ) 

Collect Creditmemo subtotal

Parameters:
Mage_Sales_Model_Order_Creditmemo $creditmemo
Returns:
Mage_Sales_Model_Order_Creditmemo_Total_Subtotal

Reimplemented from Mage_Sales_Model_Order_Creditmemo_Total_Abstract.

Definition at line 36 of file Subtotal.php.

00037     {
00038         $subtotal       = 0;
00039         $baseSubtotal   = 0;
00040 
00041         foreach ($creditmemo->getAllItems() as $item) {
00042             $item->calcRowTotal();
00043             if ($item->getOrderItem()->isDummy()) {
00044                 continue;
00045             }
00046             $subtotal+= $item->getRowTotal();
00047             $baseSubtotal+= $item->getBaseRowTotal();
00048         }
00049 
00050         $creditmemo->setSubtotal($subtotal);
00051         $creditmemo->setBaseSubtotal($baseSubtotal);
00052 
00053         $creditmemo->setGrandTotal($creditmemo->getGrandTotal() + $subtotal);
00054         $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $baseSubtotal);
00055         return $this;
00056     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:46 2009 for Magento by  doxygen 1.5.8