Mage_Sales_Model_Order_Invoice_Total_Subtotal Class Reference

Inheritance diagram for Mage_Sales_Model_Order_Invoice_Total_Subtotal:

Mage_Sales_Model_Order_Invoice_Total_Abstract

List of all members.

Public Member Functions

 collect (Mage_Sales_Model_Order_Invoice $invoice)


Detailed Description

Definition at line 28 of file Subtotal.php.


Member Function Documentation

collect ( Mage_Sales_Model_Order_Invoice invoice  ) 

Collect invoice subtotal

Parameters:
Mage_Sales_Model_Order_Invoice $invoice
Returns:
Mage_Sales_Model_Order_Invoice_Total_Subtotal

Reimplemented from Mage_Sales_Model_Order_Invoice_Total_Abstract.

Definition at line 36 of file Subtotal.php.

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


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

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