Redesigned templates. Now all templates must be inside templates/pages templates/generators
diff --git a/erpnext/templates/pages/invoice.py b/erpnext/templates/pages/invoice.py
new file mode 100644
index 0000000..9d6a558
--- /dev/null
+++ b/erpnext/templates/pages/invoice.py
@@ -0,0 +1,30 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+from webnotes import _
+from webnotes.utils import flt, fmt_money
+
+no_cache = True
+
+def get_context():
+	from erpnext.templates.utils import get_transaction_context
+	context = get_transaction_context("Sales Invoice", webnotes.form_dict.name)
+	modify_status(context.get("doc"))
+	context.update({
+		"parent_link": "invoices",
+		"parent_title": "Invoices"
+	})
+	return context
+	
+def modify_status(doc):
+	doc.status = ""
+	if flt(doc.outstanding_amount):
+		doc.status = '<span class="label %s"><i class="icon-fixed-width %s"></i> %s</span>' % \
+			("label-warning", "icon-exclamation-sign", 
+			_("To Pay") + " = " + fmt_money(doc.outstanding_amount, currency=doc.currency))
+	else:
+		doc.status = '<span class="label %s"><i class="icon-fixed-width %s"></i> %s</span>' % \
+			("label-success", "icon-ok", _("Paid"))
+		
\ No newline at end of file