Hello,
I am trying to issue a refund on an order. When I do any type of refund(full/partial), the refund amount does not include the tips amount. Using the following code to refund:
$serviceOrder = Mage::getModel('sales/service_order', $order);
$order stores correct values for grand total, subtotal, tips, tax etc.
$creditmemo = $serviceOrder->prepareInvoiceCreditmemo($invoice);
$creditmemo->setRefundRequested(true)
->setOfflineRequested(false)
->register();
$transaction = Mage::getModel('core/resource_transaction');
$transaction->addObject($creditmemo)
->addObject($creditmemo->getOrder())
->addObject($creditmemo->getInvoice())
->save();