I followed this to create an invoice for an order and it worked. But the created newly invoice is marked as paid. Can I created it as unpaid?
$invoice = $order->prepareInvoice();
$invoice->register();
Mage::getModel('core/resource_transaction')
->addObject($invoice)
->addObject($invoice->getOrder())
->save();
$invoice->sendEmail(true, '');
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true);
$order->save();