In this article we can generate invoice programmatically.
$yourorder have your order, get invoice ID of your order and save with the help capture() function.
With this code your invoice for the order is created.
Here is code....
$yourinvoiceId = Mage::getModel('sales/order_invoice_api')
$createInvoice = Mage::getModel('sales/order_invoice')