00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 class Mage_Sales_Model_Order_Creditmemo_Total_Grand extends Mage_Sales_Model_Order_Creditmemo_Total_Abstract
00029 {
00030 public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
00031 {
00032 $grandTotal = $creditmemo->getGrandTotal();
00033 $baseGrandTotal = $creditmemo->getBaseGrandTotal();
00034
00035 $grandTotal+= $creditmemo->getShippingAmount();
00036 $baseGrandTotal+= $creditmemo->getBaseShippingAmount();
00037
00038 $grandTotal+= $creditmemo->getAdjustmentPositive();
00039 $baseGrandTotal+= $creditmemo->getBaseAdjustmentPositive();
00040
00041 $grandTotal-= $creditmemo->getAdjustmentNegative();
00042 $baseGrandTotal-= $creditmemo->getBaseAdjustmentNegative();
00043
00044 $creditmemo->setGrandTotal($grandTotal);
00045 $creditmemo->setBaseGrandTotal($baseGrandTotal);
00046
00047 $creditmemo->setAdjustment($creditmemo->getAdjustmentPositive()-$creditmemo->getAdjustmentNegative());
00048 $creditmemo->setBaseAdjustment($creditmemo->getBaseAdjustmentPositive()-$creditmemo->getBaseAdjustmentNegative());
00049
00050 return $this;
00051 }
00052 }