Merge branch 'edge'
diff --git a/accounts/doctype/c_form/c_form.js b/accounts/doctype/c_form/c_form.js
index 29c05f7..d8c7d81 100644
--- a/accounts/doctype/c_form/c_form.js
+++ b/accounts/doctype/c_form/c_form.js
@@ -26,6 +26,10 @@
 	}
 }
 
+cur_frm.fields_dict.state.get_query = function(doc) {
+	return {filters: { country: "India"}}
+}
+
 cur_frm.cscript.invoice_no = function(doc, cdt, cdn) {
 	var d = locals[cdt][cdn];
 	get_server_fields('get_invoice_details', d.invoice_no, 'invoice_details', doc, cdt, cdn, 1);
diff --git a/accounts/doctype/c_form/c_form.py b/accounts/doctype/c_form/c_form.py
index 5bca063..2636b0c 100644
--- a/accounts/doctype/c_form/c_form.py
+++ b/accounts/doctype/c_form/c_form.py
@@ -68,7 +68,7 @@
 		self.set_total_invoiced_amount()
 
 	def set_total_invoiced_amount(self):
-		total = sum([flt(d.total) for d in getlist(self.doclist, 'invoice_details')])
+		total = sum([flt(d.grand_total) for d in getlist(self.doclist, 'invoice_details')])
 		webnotes.conn.set(self.doc, 'total_invoiced_amount', total)
 
 	def get_invoice_details(self, invoice_no):
diff --git a/accounts/doctype/c_form/c_form.txt b/accounts/doctype/c_form/c_form.txt
index c429632..3a956e9 100644
--- a/accounts/doctype/c_form/c_form.txt
+++ b/accounts/doctype/c_form/c_form.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-19 10:23:34", 
+  "creation": "2013-01-30 12:49:46", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:57", 
+  "modified": "2013-02-13 11:29:18", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -127,9 +127,9 @@
  {
   "doctype": "DocField", 
   "fieldname": "state", 
-  "fieldtype": "Select", 
+  "fieldtype": "Link", 
   "label": "State", 
-  "options": "link:State\ncountry='India'", 
+  "options": "State", 
   "read_only": 0, 
   "reqd": 1
  }, 
@@ -171,7 +171,7 @@
   "fieldtype": "Link", 
   "label": "Amended From", 
   "no_copy": 1, 
-  "options": "Sales Invoice", 
+  "options": "C-Form", 
   "print_hide": 1, 
   "read_only": 1
  },