First of all, it will be broad to answer all of it. But I will give you head start.
You will need to override few blocks, you can do this by just copy those files in
local folder or create an extension (recommended). Learn magento extension development from here.
Learn how to override blocks and other files in magento from here.
First you will need to provide a
text field in invoice view page so that admin can enter manually, which is obviously going to be recorded into database.
sql/your_setup/install-your_version.php, create column in
$installer = $this;
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'nullable' => true,
'default' => null,
'comment' => 'Custom Invoice No'
This will insert a column called
your_column_name in to
sales_flat_invoice table, where you will store your custom invoice no.
You will now need to include an
input field in your overridden
invoice view block (I would override
<input type="text" name="invoice[custom_number]" id = "custom_invoice_no" value="<?php echo $invoice->getYourColumnName();?>/>
And then, will have a button to call your extension's controller to insert invoice number in that table. Learn here.
Finally, to include recorded custom invoice number, override invoice creator blocks.
Learn from here.
It's not complete answer, but should help you to start with.