[stock entry] total amount field added
diff --git a/stock/doctype/stock_entry/stock_entry.py b/stock/doctype/stock_entry/stock_entry.py
index d08deef..bce0f62 100644
--- a/stock/doctype/stock_entry/stock_entry.py
+++ b/stock/doctype/stock_entry/stock_entry.py
@@ -57,6 +57,7 @@
 		self.validate_return_reference_doc()
 		self.validate_with_material_request()
 		self.validate_fiscal_year()
+		self.set_total_amount()
 		
 	def on_submit(self):
 		self.update_serial_no(1)
@@ -174,6 +175,9 @@
 		elif self.doc.purpose != "Material Transfer":
 			self.doc.production_order = None
 			
+	def set_total_amount(self):
+		self.doc.total_amount = sum([flt(item.amount) for item in self.doclist.get({"parentfield": "mtn_details"})])
+			
 	def make_gl_entries(self):
 		if not cint(webnotes.defaults.get_global_default("auto_inventory_accounting")):
 			return
@@ -220,7 +224,7 @@
 			if not flt(d.incoming_rate):
 				d.incoming_rate = self.get_incoming_rate(args)
 				
-			d.amount = flt(d.qty) * flt(d.incoming_rate)
+			d.amount = flt(d.transfer_qty) * flt(d.incoming_rate)
 			
 	def get_incoming_rate(self, args):
 		incoming_rate = 0
diff --git a/stock/doctype/stock_entry/stock_entry.txt b/stock/doctype/stock_entry/stock_entry.txt
index fef710b..d88b0b7 100644
--- a/stock/doctype/stock_entry/stock_entry.txt
+++ b/stock/doctype/stock_entry/stock_entry.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-03-28 15:56:40", 
+  "creation": "2013-04-09 11:43:55", 
   "docstatus": 0, 
-  "modified": "2013-03-29 15:31:42", 
+  "modified": "2013-05-09 13:31:00", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -520,6 +520,14 @@
  }, 
  {
   "doctype": "DocField", 
+  "fieldname": "total_amount", 
+  "fieldtype": "Currency", 
+  "label": "Total Amount", 
+  "options": "Company:company:default_currency", 
+  "read_only": 1
+ }, 
+ {
+  "doctype": "DocField", 
   "fieldname": "project_name", 
   "fieldtype": "Link", 
   "in_filter": 1, 
@@ -559,6 +567,14 @@
   "reqd": 1
  }, 
  {
+  "doctype": "DocField", 
+  "fieldname": "col5", 
+  "fieldtype": "Column Break", 
+  "print_width": "50%", 
+  "read_only": 0, 
+  "width": "50%"
+ }, 
+ {
   "allow_on_submit": 0, 
   "doctype": "DocField", 
   "fieldname": "company", 
@@ -577,14 +593,6 @@
   "search_index": 0
  }, 
  {
-  "doctype": "DocField", 
-  "fieldname": "col5", 
-  "fieldtype": "Column Break", 
-  "print_width": "50%", 
-  "read_only": 0, 
-  "width": "50%"
- }, 
- {
   "allow_on_submit": 0, 
   "doctype": "DocField", 
   "fieldname": "amended_from",