Public Member Functions | |
collect (Mage_Sales_Model_Order_Creditmemo $creditmemo) |
Definition at line 28 of file Subtotal.php.
collect | ( | Mage_Sales_Model_Order_Creditmemo $ | creditmemo | ) |
Collect Creditmemo subtotal
Mage_Sales_Model_Order_Creditmemo | $creditmemo |
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 }