Merge branch 'edge' of github.com:webnotes/erpnext into webshop

Conflicts:
	accounts/doctype/sales_invoice/sales_invoice.txt
	stock/doctype/item/item.txt
diff --git a/accounts/doctype/sales_invoice/sales_invoice.py b/accounts/doctype/sales_invoice/sales_invoice.py
index f44a787..cbacf58 100644
--- a/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/accounts/doctype/sales_invoice/sales_invoice.py
@@ -725,7 +725,7 @@
 						"against": self.doc.debit_to,
 						"credit": flt(tax.tax_amount),
 						"remarks": self.doc.remarks,
-						"cost_center": tax.cost_center_other_charges
+						"cost_center": tax.cost_center
 					})
 				)
 				
diff --git a/accounts/doctype/sales_invoice/sales_invoice.txt b/accounts/doctype/sales_invoice/sales_invoice.txt
index a2c422f..9d8f54e 100644
--- a/accounts/doctype/sales_invoice/sales_invoice.txt
+++ b/accounts/doctype/sales_invoice/sales_invoice.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2013-04-19 11:00:14", 
   "docstatus": 0, 
-  "modified": "2013-04-22 11:59:28", 
+  "modified": "2013-04-22 11:59:40", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -1300,5 +1300,5 @@
   "permlevel": 0, 
   "report": 1, 
   "role": "Customer"
- }, 
+ }
 ]
\ No newline at end of file
diff --git a/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt b/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt
index 161eb00..55a41a9 100644
--- a/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt
+++ b/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2013-02-22 01:27:41", 
   "docstatus": 0, 
-  "modified": "2013-04-17 14:05:18", 
+  "modified": "2013-04-17 14:05:50", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -50,7 +50,7 @@
  {
   "default": ":Company", 
   "doctype": "DocField", 
-  "fieldname": "cost_center_other_charges", 
+  "fieldname": "cost_center", 
   "fieldtype": "Link", 
   "label": "Cost Center", 
   "oldfieldname": "cost_center_other_charges", 
diff --git a/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js b/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js
index 1e72010..5787427 100644
--- a/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js
+++ b/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js
@@ -140,7 +140,7 @@
   return 'SELECT tabAccount.name FROM tabAccount WHERE tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus != 2 AND tabAccount.account_type in ("Tax", "Chargeable", "Income Account") AND tabAccount.company = "'+doc.company+'" AND  tabAccount.name LIKE "%s"'
 }
 
-cur_frm.fields_dict['other_charges'].grid.get_field("cost_center_other_charges").get_query = function(doc) {
+cur_frm.fields_dict['other_charges'].grid.get_field("cost_center").get_query = function(doc) {
 	return 'SELECT `tabCost Center`.`name` FROM `tabCost Center` WHERE `tabCost Center`.`company_name` = "' +doc.company+'" AND `tabCost Center`.%(key)s LIKE "%s" AND `tabCost Center`.`group_or_ledger` = "Ledger" AND `tabCost Center`.`docstatus`!= 2 ORDER BY	`tabCost Center`.`name` ASC LIMIT 50';
 }
 
diff --git a/patches/april_2013/p05_update_file_data.py b/patches/april_2013/p05_update_file_data.py
index a5540cc..8811858 100644
--- a/patches/april_2013/p05_update_file_data.py
+++ b/patches/april_2013/p05_update_file_data.py
@@ -1,5 +1,4 @@
 import webnotes, webnotes.utils, os
-from webnotes.modules.export_file import export_to_files
 
 def execute():
 	webnotes.reload_doc("core", "doctype", "file_data")
@@ -26,7 +25,6 @@
 		
 		webnotes.conn.sql("""delete from tabDocField where fieldname='file_list'
 				and parent=%s""", doctype)
-		export_to_files([["DocType", doctype]])
 
 def update_for_doc(doctype, doc):
 	for filedata in doc.file_list.split("\n"):
diff --git a/patches/april_2013/p06_default_cost_center.py b/patches/april_2013/p06_default_cost_center.py
index 4f80d95..4aaa7d5 100644
--- a/patches/april_2013/p06_default_cost_center.py
+++ b/patches/april_2013/p06_default_cost_center.py
@@ -1,10 +1,10 @@
 import webnotes
 
 def execute():
-	for dt, fieldname in \
-		(("Journal Voucher Detail", "cost_center"), 
-		("Sales Taxes and Charges", "cost_center_other_charges"), 
-		("Purchase Taxes and Charges", "cost_center"), ("Delivery Note Item", "cost_center"),
-		("Purchase Invoice Item", "cost_center"), ("Sales Invoice Item", "cost_center")):
-			webnotes.conn.sql_ddl("""alter table `tab%s` alter `%s` drop default""" % (dt, fieldname))
+    webnotes.reload_doc("Stock", "DocType", "Delivery Note Item")
+    for dt in ("Journal Voucher Detail", "Sales Taxes and Charges", 
+		"Purchase Taxes and Charges", "Delivery Note Item", 
+		"Purchase Invoice Item", "Sales Invoice Item"):
+			webnotes.conn.sql_ddl("""alter table `tab%s` alter `cost_center` drop default""" \
+				% (dt,))
 			webnotes.reload_doc(webnotes.conn.get_value("DocType", dt, "module"), "DocType", dt)
diff --git a/patches/april_2013/p07_rename_cost_center_other_charges.py b/patches/april_2013/p07_rename_cost_center_other_charges.py
new file mode 100644
index 0000000..c3c9491
--- /dev/null
+++ b/patches/april_2013/p07_rename_cost_center_other_charges.py
@@ -0,0 +1,9 @@
+import webnotes
+
+def execute():
+	webnotes.reload_doc("Accounts", "DocType", "Sales Taxes and Charges")
+	webnotes.conn.sql("""update `tabSales Taxes and Charges`
+		set cost_center = cost_center_other_charges""")
+	webnotes.conn.sql_ddl("""alter table `tabSales Taxes and Charges`
+		drop column cost_center_other_charges""")
+	
\ No newline at end of file
diff --git a/patches/patch_list.py b/patches/patch_list.py
index abee4f0..2cde56d 100644
--- a/patches/patch_list.py
+++ b/patches/patch_list.py
@@ -244,6 +244,6 @@
 	"patches.april_2013.p06_update_file_size",
 	"patches.april_2013.p05_fixes_in_reverse_modules",
 	"execute:webnotes.delete_doc('DocType Mapper', 'Delivery Note-Packing Slip')",
-    "execute:webnotes.reload_doc('Stock', 'DocType', 'Delivery Note Item')",
+	"patches.april_2013.p07_rename_cost_center_other_charges",
 	"patches.april_2013.p06_default_cost_center",
 ]
\ No newline at end of file
diff --git a/projects/report/daily_time_log_summary/daily_time_log_summary.py b/projects/report/daily_time_log_summary/daily_time_log_summary.py
index 808d1ba..8c1e266 100644
--- a/projects/report/daily_time_log_summary/daily_time_log_summary.py
+++ b/projects/report/daily_time_log_summary/daily_time_log_summary.py
@@ -19,23 +19,29 @@
 	time_logs = webnotes.conn.sql("""select * from `tabTime Log` 
 		where docstatus < 2 %s order by owner asc""" % (conditions, ), filters, as_dict=1)
 
-	data = []	
 	if time_logs:
 		profiles = [time_logs[0].owner]
 		
-	total_hours = 0
+	data = []	
+	total_hours = total_employee_hours = count = 0
 	for tl in time_logs:
 		if tl.owner not in profiles:
 			profiles.append(tl.owner)
-			data.append([])
-
+			data.append(["", "", "", "Total", total_employee_hours, "", "", "", "", ""])
+			total_employee_hours = 0
+			
 		data.append([tl.name, profile_map[tl.owner], tl.from_time, tl.to_time, tl.hours, 
 				tl.activity_type, tl.task, task_map.get(tl.task), tl.project, tl.status])
-				
+			
+		count += 1
 		total_hours += flt(tl.hours)
-	
+		total_employee_hours += flt(tl.hours)
+		
+		if count == len(time_logs):
+			data.append(["", "", "", "Total Hours", total_employee_hours, "", "", "", "", ""])
+
 	if total_hours:
-		data.append(["", "", "", "Total", total_hours, "", "", "", "", ""])
+		data.append(["", "", "", "Grand Total", total_hours, "", "", "", "", ""])
 		
 	return columns, data
 	
diff --git a/startup/boot.py b/startup/boot.py
index 9ed20ff..b202d17 100644
--- a/startup/boot.py
+++ b/startup/boot.py
@@ -36,9 +36,8 @@
 		for key in ['max_users', 'expires_on', 'max_space', 'status', 'developer_mode']:
 			if hasattr(conf, key): bootinfo[key] = getattr(conf, key)
 
-		bootinfo['docs'] += webnotes.conn.sql("""select name, default_currency, cost_center,
-			cost_center as 'cost_center_other_charges' from `tabCompany`""", 
-			as_dict=1, update={"doctype":":Company"})
+		bootinfo['docs'] += webnotes.conn.sql("""select name, default_currency, cost_center
+            from `tabCompany`""", as_dict=1, update={"doctype":":Company"})
 			
 def get_letter_heads():
 	"""load letter heads with startup"""
diff --git a/stock/doctype/item/item.txt b/stock/doctype/item/item.txt
index 3497402..5c2f48d 100644
--- a/stock/doctype/item/item.txt
+++ b/stock/doctype/item/item.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2013-03-28 15:56:38", 
   "docstatus": 0, 
-  "modified": "2013-04-23 11:44:39", 
+  "modified": "2013-04-23 11:44:50", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -882,20 +882,23 @@
   "create": 1, 
   "doctype": "DocPerm", 
   "role": "Material Master Manager", 
-  "write": 1
+  "write": 1,
+  "report": 1
  }, 
  {
   "cancel": 0, 
   "create": 0, 
   "doctype": "DocPerm", 
   "role": "Material Manager", 
-  "write": 0
+  "write": 0,
+  "report": 1
  }, 
  {
   "cancel": 0, 
   "create": 0, 
   "doctype": "DocPerm", 
   "role": "Material User", 
-  "write": 0
+  "write": 0,
+  "report": 1
  }
 ]
\ No newline at end of file