Merge branch 'master' into edge
diff --git a/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt b/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt
index 1b8b991..d814ad8 100644
--- a/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt
+++ b/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:05", 
+  "creation": "2013-02-22 01:27:37", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:50", 
+  "modified": "2013-03-07 07:03:18", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
diff --git a/accounts/doctype/budget_detail/budget_detail.txt b/accounts/doctype/budget_detail/budget_detail.txt
index b2b312c..3feb6f7 100644
--- a/accounts/doctype/budget_detail/budget_detail.txt
+++ b/accounts/doctype/budget_detail/budget_detail.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:05", 
+  "creation": "2013-02-22 01:27:37", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:28:16", 
+  "modified": "2013-03-07 07:03:19", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
diff --git a/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt b/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt
index 0f11876..ff5d8fd 100644
--- a/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt
+++ b/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:05", 
+  "creation": "2013-02-22 01:27:38", 
   "docstatus": 0, 
-  "modified": "2013-01-22 14:41:34", 
+  "modified": "2013-03-07 07:03:19", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
diff --git a/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt b/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt
index f9b7372..ba247d3 100644
--- a/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt
+++ b/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:06", 
+  "creation": "2013-02-22 01:27:38", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:50", 
+  "modified": "2013-03-07 07:03:19", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -30,6 +30,7 @@
   "fieldtype": "Link", 
   "label": "Invoice No", 
   "options": "Sales Invoice", 
+  "print_width": "160px", 
   "width": "160px"
  }, 
  {
@@ -37,6 +38,7 @@
   "fieldname": "invoice_date", 
   "fieldtype": "Date", 
   "label": "Invoice Date", 
+  "print_width": "120px", 
   "read_only": 1, 
   "width": "120px"
  }, 
@@ -46,6 +48,7 @@
   "fieldtype": "Link", 
   "label": "Territory", 
   "options": "Territory", 
+  "print_width": "120px", 
   "read_only": 1, 
   "width": "120px"
  }, 
@@ -55,6 +58,7 @@
   "fieldtype": "Currency", 
   "label": "Net Total", 
   "options": "Company:company:default_currency", 
+  "print_width": "120px", 
   "read_only": 1, 
   "width": "120px"
  }, 
@@ -64,6 +68,7 @@
   "fieldtype": "Currency", 
   "label": "Grand Total", 
   "options": "Company:company:default_currency", 
+  "print_width": "120px", 
   "read_only": 1, 
   "width": "120px"
  }
diff --git a/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt b/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt
index 245ddf1..ac30346 100644
--- a/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt
+++ b/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:06", 
+  "creation": "2013-02-22 01:27:39", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:50", 
+  "modified": "2013-03-07 07:03:23", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -34,6 +34,7 @@
   "oldfieldname": "account", 
   "oldfieldtype": "Link", 
   "options": "Account", 
+  "print_width": "250px", 
   "reqd": 1, 
   "search_index": 1, 
   "width": "250px"
@@ -65,6 +66,7 @@
   "oldfieldname": "cost_center", 
   "oldfieldtype": "Link", 
   "options": "Cost Center", 
+  "print_width": "180px", 
   "search_index": 0, 
   "width": "180px"
  }, 
diff --git a/accounts/doctype/multi_ledger_report_detail/multi_ledger_report_detail.txt b/accounts/doctype/multi_ledger_report_detail/multi_ledger_report_detail.txt
index df91e1c..46563dd 100755
--- a/accounts/doctype/multi_ledger_report_detail/multi_ledger_report_detail.txt
+++ b/accounts/doctype/multi_ledger_report_detail/multi_ledger_report_detail.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2012-03-27 14:35:44", 
+  "creation": "2013-02-22 01:27:39", 
   "docstatus": 0, 
-  "modified": "2012-03-27 14:35:44", 
+  "modified": "2013-03-07 07:03:26", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -10,10 +10,7 @@
   "doctype": "DocType", 
   "istable": 1, 
   "module": "Accounts", 
-  "name": "__common__", 
-  "section_style": "Simple", 
-  "show_in_menu": 0, 
-  "version": 3
+  "name": "__common__"
  }, 
  {
   "doctype": "DocField", 
@@ -26,6 +23,7 @@
   "parentfield": "fields", 
   "parenttype": "DocType", 
   "permlevel": 0, 
+  "print_width": "300px", 
   "reqd": 1, 
   "width": "300px"
  }, 
diff --git a/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt b/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt
index 5fcb606..1908101 100644
--- a/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt
+++ b/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:07", 
+  "creation": "2013-02-22 01:27:39", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:50", 
+  "modified": "2013-03-07 07:03:26", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
diff --git a/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt b/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt
index dadf28a..201bb53 100644
--- a/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt
+++ b/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:08", 
+  "creation": "2013-02-22 01:27:40", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:50", 
+  "modified": "2013-03-07 07:03:26", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -33,6 +33,7 @@
   "oldfieldname": "journal_voucher", 
   "oldfieldtype": "Link", 
   "options": "Journal Voucher", 
+  "print_width": "180px", 
   "read_only": 1, 
   "width": "180px"
  }, 
@@ -45,6 +46,7 @@
   "oldfieldname": "jv_detail_no", 
   "oldfieldtype": "Date", 
   "print_hide": 1, 
+  "print_width": "80px", 
   "read_only": 1, 
   "width": "80px"
  }, 
@@ -56,6 +58,7 @@
   "oldfieldname": "advance_amount", 
   "oldfieldtype": "Currency", 
   "options": "Company:company:default_currency", 
+  "print_width": "100px", 
   "read_only": 1, 
   "width": "100px"
  }, 
@@ -67,6 +70,7 @@
   "oldfieldname": "allocated_amount", 
   "oldfieldtype": "Currency", 
   "options": "Company:company:default_currency", 
+  "print_width": "100px", 
   "width": "100px"
  }, 
  {
@@ -76,6 +80,7 @@
   "label": "Remarks", 
   "oldfieldname": "remarks", 
   "oldfieldtype": "Small Text", 
+  "print_width": "150px", 
   "read_only": 1, 
   "width": "150px"
  }
diff --git a/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt b/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt
index 553041e..b8d9a1d 100755
--- a/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt
+++ b/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-02-11 10:54:51", 
+  "creation": "2013-02-27 13:45:00", 
   "docstatus": 0, 
-  "modified": "2013-02-27 18:10:04", 
+  "modified": "2013-03-07 07:03:26", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
diff --git a/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt b/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt
index 6067afb..62ee960 100644
--- a/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt
+++ b/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:08", 
+  "creation": "2013-02-22 01:27:40", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:50", 
+  "modified": "2013-03-07 07:03:29", 
   "modified_by": "Administrator", 
   "owner": "wasim@webnotestech.com"
  }, 
@@ -62,6 +62,7 @@
   "label": "Description", 
   "oldfieldname": "description", 
   "oldfieldtype": "Small Text", 
+  "print_width": "300px", 
   "reqd": 1, 
   "width": "300px"
  }, 
diff --git a/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt b/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt
index 6216c89..32ef4c5 100644
--- a/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt
+++ b/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:09", 
+  "creation": "2013-02-22 01:27:41", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:51", 
+  "modified": "2013-03-07 07:03:30", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -33,6 +33,7 @@
   "oldfieldname": "journal_voucher", 
   "oldfieldtype": "Link", 
   "options": "Journal Voucher", 
+  "print_width": "250px", 
   "read_only": 1, 
   "width": "250px"
  }, 
@@ -45,6 +46,7 @@
   "oldfieldname": "jv_detail_no", 
   "oldfieldtype": "Data", 
   "print_hide": 1, 
+  "print_width": "120px", 
   "read_only": 1, 
   "width": "120px"
  }, 
@@ -56,6 +58,7 @@
   "oldfieldname": "advance_amount", 
   "oldfieldtype": "Currency", 
   "options": "Company:company:default_currency", 
+  "print_width": "120px", 
   "read_only": 1, 
   "width": "120px"
  }, 
@@ -67,6 +70,7 @@
   "oldfieldname": "allocated_amount", 
   "oldfieldtype": "Currency", 
   "options": "Company:company:default_currency", 
+  "print_width": "120px", 
   "width": "120px"
  }, 
  {
@@ -76,6 +80,7 @@
   "label": "Remarks", 
   "oldfieldname": "remarks", 
   "oldfieldtype": "Small Text", 
+  "print_width": "150px", 
   "read_only": 1, 
   "width": "150px"
  }
diff --git a/accounts/doctype/sales_invoice_item/sales_invoice_item.txt b/accounts/doctype/sales_invoice_item/sales_invoice_item.txt
index ae1afe9..c8b18a4 100644
--- a/accounts/doctype/sales_invoice_item/sales_invoice_item.txt
+++ b/accounts/doctype/sales_invoice_item/sales_invoice_item.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-29 19:25:49", 
+  "creation": "2013-03-05 09:11:04", 
   "docstatus": 0, 
-  "modified": "2013-03-01 13:41:51", 
+  "modified": "2013-03-07 07:03:30", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -73,6 +73,7 @@
   "label": "Description", 
   "oldfieldname": "description", 
   "oldfieldtype": "Text", 
+  "print_width": "200px", 
   "reqd": 1, 
   "width": "200px"
  }, 
@@ -190,6 +191,7 @@
   "oldfieldtype": "Link", 
   "options": "Account", 
   "print_hide": 1, 
+  "print_width": "120px", 
   "reqd": 1, 
   "width": "120px"
  }, 
@@ -203,6 +205,7 @@
   "oldfieldtype": "Link", 
   "options": "Cost Center", 
   "print_hide": 1, 
+  "print_width": "120px", 
   "reqd": 0, 
   "width": "120px"
  }, 
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 bbac704..3b32524 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
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-24 15:56:19", 
+  "creation": "2013-02-22 01:27:41", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:28:04", 
+  "modified": "2013-03-07 07:03:31", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -63,6 +63,7 @@
   "label": "Description", 
   "oldfieldname": "description", 
   "oldfieldtype": "Small Text", 
+  "print_width": "300px", 
   "reqd": 1, 
   "width": "300px"
  }, 
@@ -163,6 +164,7 @@
   "label": "Is this Tax included in Basic Rate?", 
   "no_copy": 0, 
   "print_hide": 1, 
+  "print_width": "150px", 
   "report_hide": 1, 
   "width": "150px"
  }
diff --git a/accounts/report/gross_profit/gross_profit.py b/accounts/report/gross_profit/gross_profit.py
index de8651b..fa926da 100644
--- a/accounts/report/gross_profit/gross_profit.py
+++ b/accounts/report/gross_profit/gross_profit.py
@@ -1,15 +1,13 @@
 from __future__ import unicode_literals
 import webnotes
 from webnotes.utils import flt
-
-stock_ledger_entries = None
-item_sales_bom = None
+from stock.utils import get_buying_amount, get_sales_bom
 
 def execute(filters=None):
 	if not filters: filters = {}
 	
-	get_stock_ledger_entries(filters)
-	get_sales_bom()
+	stock_ledger_entries = get_stock_ledger_entries(filters)
+	item_sales_bom = get_sales_bom()
 	
 	delivery_note_items = webnotes.conn.sql("""select dn.name, dn.posting_date, dn.posting_time,
 		dn.project_name, item.item_code, item.item_name, item.description, item.warehouse,
@@ -26,7 +24,8 @@
 	data = []
 	for row in delivery_note_items:
 		selling_amount = flt(row.amount)
-		buying_amount = get_buying_amount(row)
+		buying_amount = get_buying_amount(row.item_code, row.warehouse, 
+			row.qty, row.name, row.item_row, stock_ledger_entries, item_sales_bom)
 		if selling_amount:
 			gross_profit = selling_amount - buying_amount
 			gross_profit_percent = (gross_profit / selling_amount) * 100.0
@@ -38,42 +37,8 @@
 			gross_profit, gross_profit_percent, row.project])
 			
 	return columns, data
-
-def get_buying_amount(row):
-	if item_sales_bom.get(row.item_code):
-		# sales bom item
-		buying_amount = 0.0
-		for bom_item in item_sales_bom[row.item_code]:
-			buying_amount += _get_buying_amount(row.name, "[** No Item Row **]",
-				bom_item.item_code, row.warehouse, bom_item.qty * row.qty)
-		return buying_amount
-	else:
-		# doesn't have sales bom
-		return _get_buying_amount(row.name, row.item_row, row.item_code, row.warehouse, row.qty)
-		
-def _get_buying_amount(voucher_no, item_row, item_code, warehouse, qty):
-	for i, sle in enumerate(stock_ledger_entries):
-		if sle.voucher_type == "Delivery Note" and sle.voucher_no == voucher_no:
-			if (sle.voucher_detail_no == item_row) or \
-				(sle.item_code == item_code and sle.warehouse == warehouse and \
-				abs(flt(sle.qty)) == qty):
-					buying_amount = flt(stock_ledger_entries[i+1].stock_value) - flt(sle.stock_value)
-
-					return buying_amount
-					
-	return 0.0
-
-def get_sales_bom():
-	global item_sales_bom
 	
-	item_sales_bom = {}
-	
-	for r in webnotes.conn.sql("""select parent, item_code, qty from `tabSales BOM Item`""", as_dict=1):
-		item_sales_bom.setdefault(r.parent, []).append(r)
-	
-def get_stock_ledger_entries(filters):
-	global stock_ledger_entries
-	
+def get_stock_ledger_entries(filters):	
 	query = """select item_code, voucher_type, voucher_no,
 		voucher_detail_no, posting_date, posting_time, stock_value,
 		warehouse, actual_qty as qty
@@ -84,4 +49,4 @@
 	
 	query += " order by item_code desc, warehouse desc, posting_date desc, posting_time desc, name desc"
 
-	stock_ledger_entries = webnotes.conn.sql(query, filters, as_dict=True)
+	return webnotes.conn.sql(query, filters, as_dict=True)
diff --git a/buying/doctype/purchase_order_item/purchase_order_item.txt b/buying/doctype/purchase_order_item/purchase_order_item.txt
index edb3092..cd00f87 100755
--- a/buying/doctype/purchase_order_item/purchase_order_item.txt
+++ b/buying/doctype/purchase_order_item/purchase_order_item.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-02-07 11:00:11", 
+  "creation": "2013-02-22 01:27:42", 
   "docstatus": 0, 
-  "modified": "2013-02-18 13:39:02", 
+  "modified": "2013-03-07 07:03:27", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
diff --git a/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt b/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt
index dd71989..d08963b 100644
--- a/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt
+++ b/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:10", 
+  "creation": "2013-02-22 01:27:42", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:51", 
+  "modified": "2013-03-07 07:03:28", 
   "modified_by": "Administrator", 
   "owner": "dhanalekshmi@webnotestech.com"
  }, 
diff --git a/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt b/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt
index 4c5ba81..4c0ce0d 100644
--- a/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt
+++ b/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:10", 
+  "creation": "2013-02-22 01:27:42", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:51", 
+  "modified": "2013-03-07 07:03:28", 
   "modified_by": "Administrator", 
   "owner": "wasim@webnotestech.com"
  }, 
@@ -70,6 +70,7 @@
   "label": "Description", 
   "oldfieldname": "description", 
   "oldfieldtype": "Data", 
+  "print_width": "300px", 
   "read_only": 1, 
   "width": "300px"
  }, 
diff --git a/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt b/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt
index c9f6b2d..066185e 100644
--- a/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt
+++ b/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2012-03-27 14:35:52", 
+  "creation": "2013-02-22 01:27:43", 
   "docstatus": 0, 
-  "modified": "2012-03-27 14:35:52", 
+  "modified": "2013-03-07 07:03:29", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -11,10 +11,7 @@
   "doctype": "DocType", 
   "istable": 1, 
   "module": "Buying", 
-  "name": "__common__", 
-  "section_style": "Tray", 
-  "show_in_menu": 0, 
-  "version": 2
+  "name": "__common__"
  }, 
  {
   "doctype": "DocField", 
diff --git a/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt b/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt
index cf79f04..53fa9f8 100644
--- a/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt
+++ b/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-29 19:25:55", 
+  "creation": "2013-02-22 01:27:43", 
   "docstatus": 0, 
-  "modified": "2013-02-18 13:39:45", 
+  "modified": "2013-03-07 07:03:32", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
diff --git a/hr/doctype/appraisal_goal/appraisal_goal.txt b/hr/doctype/appraisal_goal/appraisal_goal.txt
index 7df60c1..ed71e69 100644
--- a/hr/doctype/appraisal_goal/appraisal_goal.txt
+++ b/hr/doctype/appraisal_goal/appraisal_goal.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:13", 
+  "creation": "2013-02-22 01:27:44", 
   "docstatus": 0, 
-  "modified": "2013-01-22 14:16:18", 
+  "modified": "2013-03-07 07:03:18", 
   "modified_by": "Administrator", 
   "owner": "ashwini@webnotestech.com"
  }, 
@@ -33,6 +33,7 @@
   "label": "Goal", 
   "oldfieldname": "kra", 
   "oldfieldtype": "Small Text", 
+  "print_width": "240px", 
   "reqd": 1, 
   "width": "240px"
  }, 
@@ -43,6 +44,7 @@
   "label": "Weightage (%)", 
   "oldfieldname": "per_weightage", 
   "oldfieldtype": "Currency", 
+  "print_width": "70px", 
   "reqd": 1, 
   "width": "70px"
  }, 
@@ -56,6 +58,7 @@
   "oldfieldname": "score", 
   "oldfieldtype": "Select", 
   "options": "\n0\n1\n2\n3\n4\n5", 
+  "print_width": "70px", 
   "width": "70px"
  }, 
  {
@@ -66,6 +69,7 @@
   "no_copy": 1, 
   "oldfieldname": "score_earned", 
   "oldfieldtype": "Currency", 
+  "print_width": "70px", 
   "read_only": 1, 
   "width": "70px"
  }
diff --git a/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt b/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt
index 59d0e8d..da9fde0 100644
--- a/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt
+++ b/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:13", 
+  "creation": "2013-02-22 01:27:44", 
   "docstatus": 0, 
-  "modified": "2013-01-22 13:35:58", 
+  "modified": "2013-03-07 07:03:18", 
   "modified_by": "Administrator", 
   "owner": "ashwini@webnotestech.com"
  }, 
@@ -34,6 +34,7 @@
   "label": "KRA", 
   "oldfieldname": "kra", 
   "oldfieldtype": "Small Text", 
+  "print_width": "200px", 
   "width": "200px"
  }, 
  {
@@ -43,6 +44,7 @@
   "label": "Weightage (%)", 
   "oldfieldname": "per_weightage", 
   "oldfieldtype": "Currency", 
+  "print_width": "100px", 
   "width": "100px"
  }
 ]
\ No newline at end of file
diff --git a/hr/doctype/employee_education/employee_education.txt b/hr/doctype/employee_education/employee_education.txt
index dd07df8..46b6f00 100644
--- a/hr/doctype/employee_education/employee_education.txt
+++ b/hr/doctype/employee_education/employee_education.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2012-03-27 14:35:54", 
+  "creation": "2013-02-22 01:27:45", 
   "docstatus": 0, 
-  "modified": "2012-03-27 14:35:54", 
+  "modified": "2013-03-07 07:03:21", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -10,10 +10,7 @@
   "doctype": "DocType", 
   "istable": 1, 
   "module": "HR", 
-  "name": "__common__", 
-  "section_style": "Simple", 
-  "show_in_menu": 0, 
-  "version": 5
+  "name": "__common__"
  }, 
  {
   "doctype": "DocField", 
@@ -42,6 +39,7 @@
   "label": "Qualification", 
   "oldfieldname": "qualification", 
   "oldfieldtype": "Data", 
+  "print_width": "100px", 
   "width": "100px"
  }, 
  {
diff --git a/hr/doctype/employee_external_work_history/employee_external_work_history.txt b/hr/doctype/employee_external_work_history/employee_external_work_history.txt
index eea7d65..05fc5c0 100644
--- a/hr/doctype/employee_external_work_history/employee_external_work_history.txt
+++ b/hr/doctype/employee_external_work_history/employee_external_work_history.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:14", 
+  "creation": "2013-02-22 01:27:45", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:51", 
+  "modified": "2013-03-07 07:03:21", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
diff --git a/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt b/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt
index dd1c11f..d813e7c 100644
--- a/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt
+++ b/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2012-03-27 14:35:57", 
+  "creation": "2013-02-22 01:27:45", 
   "docstatus": 0, 
-  "modified": "2012-03-27 14:35:57", 
+  "modified": "2013-03-07 07:03:21", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -10,10 +10,7 @@
   "doctype": "DocType", 
   "istable": 1, 
   "module": "HR", 
-  "name": "__common__", 
-  "section_style": "Simple", 
-  "show_in_menu": 0, 
-  "version": 6
+  "name": "__common__"
  }, 
  {
   "doctype": "DocField", 
diff --git a/hr/doctype/employee_training/employee_training.txt b/hr/doctype/employee_training/employee_training.txt
index 256a99e..6b3a754 100644
--- a/hr/doctype/employee_training/employee_training.txt
+++ b/hr/doctype/employee_training/employee_training.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2012-03-27 14:35:59", 
+  "creation": "2013-02-22 01:27:45", 
   "docstatus": 0, 
-  "modified": "2012-03-27 14:35:59", 
+  "modified": "2013-03-07 07:03:21", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -10,10 +10,7 @@
   "doctype": "DocType", 
   "istable": 1, 
   "module": "HR", 
-  "name": "__common__", 
-  "section_style": "Simple", 
-  "show_in_menu": 0, 
-  "version": 5
+  "name": "__common__"
  }, 
  {
   "doctype": "DocField", 
diff --git a/hr/doctype/expense_claim_detail/expense_claim_detail.txt b/hr/doctype/expense_claim_detail/expense_claim_detail.txt
index d8f9400..d2b5cf3 100644
--- a/hr/doctype/expense_claim_detail/expense_claim_detail.txt
+++ b/hr/doctype/expense_claim_detail/expense_claim_detail.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:14", 
+  "creation": "2013-02-22 01:27:46", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:51", 
+  "modified": "2013-03-07 07:03:21", 
   "modified_by": "Administrator", 
   "owner": "harshada@webnotestech.com"
  }, 
@@ -31,6 +31,7 @@
   "label": "Expense Date", 
   "oldfieldname": "expense_date", 
   "oldfieldtype": "Date", 
+  "print_width": "150px", 
   "reqd": 0, 
   "width": "150px"
  }, 
@@ -42,6 +43,7 @@
   "oldfieldname": "expense_type", 
   "oldfieldtype": "Link", 
   "options": "link:Expense Claim Type", 
+  "print_width": "150px", 
   "reqd": 1, 
   "width": "150px"
  }, 
@@ -52,6 +54,7 @@
   "label": "Description", 
   "oldfieldname": "description", 
   "oldfieldtype": "Small Text", 
+  "print_width": "300px", 
   "width": "300px"
  }, 
  {
@@ -62,6 +65,7 @@
   "oldfieldname": "claim_amount", 
   "oldfieldtype": "Currency", 
   "options": "Company:company:default_currency", 
+  "print_width": "150px", 
   "reqd": 1, 
   "width": "150px"
  }, 
@@ -75,6 +79,7 @@
   "oldfieldname": "sanctioned_amount", 
   "oldfieldtype": "Currency", 
   "options": "Company:company:default_currency", 
+  "print_width": "150px", 
   "width": "150px"
  }
 ]
\ No newline at end of file
diff --git a/hr/doctype/holiday/holiday.txt b/hr/doctype/holiday/holiday.txt
index 734b970..94f7936 100644
--- a/hr/doctype/holiday/holiday.txt
+++ b/hr/doctype/holiday/holiday.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2012-03-27 14:35:57", 
+  "creation": "2013-02-22 01:27:46", 
   "docstatus": 0, 
-  "modified": "2012-03-27 14:35:57", 
+  "modified": "2013-03-07 07:03:21", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -10,10 +10,7 @@
   "doctype": "DocType", 
   "istable": 1, 
   "module": "HR", 
-  "name": "__common__", 
-  "section_style": "Simple", 
-  "show_in_menu": 0, 
-  "version": 2
+  "name": "__common__"
  }, 
  {
   "doctype": "DocField", 
@@ -32,6 +29,7 @@
   "fieldname": "description", 
   "fieldtype": "Small Text", 
   "label": "Description", 
+  "print_width": "300px", 
   "width": "300px"
  }, 
  {
diff --git a/hr/doctype/leave_block_list_allow/leave_block_list_allow.txt b/hr/doctype/leave_block_list_allow/leave_block_list_allow.txt
index 4d73833..8e362f3 100644
--- a/hr/doctype/leave_block_list_allow/leave_block_list_allow.txt
+++ b/hr/doctype/leave_block_list_allow/leave_block_list_allow.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-02-14 17:37:38", 
+  "creation": "2013-02-22 01:27:47", 
   "docstatus": 0, 
-  "modified": "2013-02-14 17:41:53", 
+  "modified": "2013-03-07 07:03:23", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -23,6 +23,7 @@
   "parentfield": "fields", 
   "parenttype": "DocType", 
   "permlevel": 0, 
+  "print_width": "200px", 
   "reqd": 1, 
   "width": "200px"
  }, 
diff --git a/hr/doctype/leave_block_list_date/leave_block_list_date.txt b/hr/doctype/leave_block_list_date/leave_block_list_date.txt
index 7c7ef38..d0b9fbf 100644
--- a/hr/doctype/leave_block_list_date/leave_block_list_date.txt
+++ b/hr/doctype/leave_block_list_date/leave_block_list_date.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-02-14 17:37:38", 
+  "creation": "2013-02-22 01:27:47", 
   "docstatus": 0, 
-  "modified": "2013-02-14 17:41:44", 
+  "modified": "2013-03-07 07:03:23", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -19,6 +19,7 @@
   "parentfield": "fields", 
   "parenttype": "DocType", 
   "permlevel": 0, 
+  "print_width": "200px", 
   "reqd": 1, 
   "width": "200px"
  }, 
diff --git a/hr/doctype/other_income_detail/other_income_detail.txt b/hr/doctype/other_income_detail/other_income_detail.txt
index 0913e4c..b647ee7 100644
--- a/hr/doctype/other_income_detail/other_income_detail.txt
+++ b/hr/doctype/other_income_detail/other_income_detail.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:15", 
+  "creation": "2013-02-22 01:27:47", 
   "docstatus": 0, 
-  "modified": "2013-01-22 14:56:40", 
+  "modified": "2013-03-07 07:03:26", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -44,6 +44,7 @@
   "label": "Particulars", 
   "oldfieldname": "particulars2", 
   "oldfieldtype": "Small Text", 
+  "print_width": "200px", 
   "read_only": 1, 
   "reqd": 1, 
   "width": "200px"
diff --git a/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt b/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt
index 958147c..86acef0 100644
--- a/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt
+++ b/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:15", 
+  "creation": "2013-02-22 01:27:48", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:52", 
+  "modified": "2013-03-07 07:03:30", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -46,6 +46,7 @@
   "oldfieldname": "d_type", 
   "oldfieldtype": "Data", 
   "options": "Deduction Type", 
+  "print_width": "200px", 
   "width": "200px"
  }, 
  {
diff --git a/hr/doctype/salary_slip_earning/salary_slip_earning.txt b/hr/doctype/salary_slip_earning/salary_slip_earning.txt
index e0acf29..64f4dc6 100644
--- a/hr/doctype/salary_slip_earning/salary_slip_earning.txt
+++ b/hr/doctype/salary_slip_earning/salary_slip_earning.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:15", 
+  "creation": "2013-02-22 01:27:48", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:52", 
+  "modified": "2013-03-07 07:03:30", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -46,6 +46,7 @@
   "oldfieldname": "e_type", 
   "oldfieldtype": "Data", 
   "options": "Earning Type", 
+  "print_width": "200px", 
   "width": "200px"
  }, 
  {
diff --git a/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt b/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt
index 1591b0f..53dbf69 100644
--- a/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt
+++ b/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:16", 
+  "creation": "2013-02-22 01:27:48", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:52", 
+  "modified": "2013-03-07 07:03:30", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -32,6 +32,7 @@
   "oldfieldname": "d_type", 
   "oldfieldtype": "Select", 
   "options": "Deduction Type", 
+  "print_width": "200px", 
   "reqd": 1, 
   "width": "200px"
  }, 
diff --git a/hr/doctype/salary_structure_earning/salary_structure_earning.txt b/hr/doctype/salary_structure_earning/salary_structure_earning.txt
index 74f6fe2..29c3f52 100644
--- a/hr/doctype/salary_structure_earning/salary_structure_earning.txt
+++ b/hr/doctype/salary_structure_earning/salary_structure_earning.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:16", 
+  "creation": "2013-02-22 01:27:48", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:52", 
+  "modified": "2013-03-07 07:03:30", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -34,6 +34,7 @@
   "oldfieldname": "e_type", 
   "oldfieldtype": "Data", 
   "options": "Earning Type", 
+  "print_width": "200px", 
   "reqd": 1, 
   "width": "200px"
  }, 
diff --git a/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt b/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt
index fb09611..07aad7d 100644
--- a/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt
+++ b/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:16", 
+  "creation": "2013-02-22 01:27:48", 
   "docstatus": 0, 
-  "modified": "2013-01-23 16:43:10", 
+  "modified": "2013-03-07 07:03:18", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -44,6 +44,7 @@
   "label": "Description", 
   "oldfieldname": "description", 
   "oldfieldtype": "Text", 
+  "print_width": "300px", 
   "width": "300px"
  }, 
  {
@@ -88,6 +89,7 @@
   "oldfieldname": "parent_bom", 
   "oldfieldtype": "Link", 
   "options": "BOM", 
+  "print_width": "250px", 
   "width": "250px"
  }, 
  {
diff --git a/manufacturing/doctype/bom_item/bom_item.txt b/manufacturing/doctype/bom_item/bom_item.txt
index 1da7f0d..14be95a 100644
--- a/manufacturing/doctype/bom_item/bom_item.txt
+++ b/manufacturing/doctype/bom_item/bom_item.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:16", 
+  "creation": "2013-02-22 01:27:49", 
   "docstatus": 0, 
-  "modified": "2013-01-23 16:43:11", 
+  "modified": "2013-03-07 07:03:18", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -67,6 +67,7 @@
   "oldfieldname": "bom_no", 
   "oldfieldtype": "Link", 
   "options": "BOM", 
+  "print_width": "150px", 
   "reqd": 0, 
   "search_index": 1, 
   "width": "150px"
@@ -103,6 +104,7 @@
   "label": "Amount", 
   "oldfieldname": "amount_as_per_mar", 
   "oldfieldtype": "Currency", 
+  "print_width": "150px", 
   "read_only": 1, 
   "width": "150px"
  }, 
@@ -122,6 +124,7 @@
   "label": "Item Description", 
   "oldfieldname": "description", 
   "oldfieldtype": "Text", 
+  "print_width": "250px", 
   "reqd": 0, 
   "width": "250px"
  }, 
diff --git a/manufacturing/doctype/bom_operation/bom_operation.txt b/manufacturing/doctype/bom_operation/bom_operation.txt
index e722bbe..56805b5 100644
--- a/manufacturing/doctype/bom_operation/bom_operation.txt
+++ b/manufacturing/doctype/bom_operation/bom_operation.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:16", 
+  "creation": "2013-02-22 01:27:49", 
   "docstatus": 0, 
-  "modified": "2013-01-23 16:43:12", 
+  "modified": "2013-03-07 07:03:19", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
diff --git a/manufacturing/doctype/production_plan_item/production_plan_item.txt b/manufacturing/doctype/production_plan_item/production_plan_item.txt
index a2f9367..3af1bea 100644
--- a/manufacturing/doctype/production_plan_item/production_plan_item.txt
+++ b/manufacturing/doctype/production_plan_item/production_plan_item.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-19 10:23:34", 
+  "creation": "2013-02-22 01:27:49", 
   "docstatus": 0, 
-  "modified": "2013-01-22 14:00:34", 
+  "modified": "2013-03-07 07:03:26", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -33,6 +33,7 @@
   "oldfieldname": "item_code", 
   "oldfieldtype": "Link", 
   "options": "Item", 
+  "print_width": "150px", 
   "reqd": 1, 
   "width": "150px"
  }, 
@@ -44,6 +45,7 @@
   "oldfieldname": "bom_no", 
   "oldfieldtype": "Link", 
   "options": "BOM", 
+  "print_width": "100px", 
   "reqd": 1, 
   "width": "100px"
  }, 
@@ -55,6 +57,7 @@
   "label": "Planned Qty", 
   "oldfieldname": "planned_qty", 
   "oldfieldtype": "Currency", 
+  "print_width": "100px", 
   "reqd": 1, 
   "width": "100px"
  }, 
@@ -76,6 +79,7 @@
   "label": "SO Pending Qty", 
   "oldfieldname": "prevdoc_reqd_qty", 
   "oldfieldtype": "Currency", 
+  "print_width": "100px", 
   "read_only": 1, 
   "reqd": 0, 
   "width": "100px"
@@ -87,6 +91,7 @@
   "label": "UOM", 
   "oldfieldname": "stock_uom", 
   "oldfieldtype": "Data", 
+  "print_width": "80px", 
   "read_only": 1, 
   "reqd": 1, 
   "width": "80px"
@@ -98,6 +103,7 @@
   "label": "Description", 
   "oldfieldname": "description", 
   "oldfieldtype": "Text", 
+  "print_width": "200px", 
   "read_only": 1, 
   "width": "200px"
  }
diff --git a/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt b/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt
index 9c2b132..dc5b88d 100644
--- a/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt
+++ b/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:17", 
+  "creation": "2013-02-22 01:27:49", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:52", 
+  "modified": "2013-03-07 07:03:26", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -46,6 +46,7 @@
   "oldfieldname": "prevdoc_docname", 
   "oldfieldtype": "Data", 
   "options": "Sales Order", 
+  "print_width": "150px", 
   "width": "150px"
  }, 
  {
@@ -55,6 +56,7 @@
   "label": "SO Date", 
   "oldfieldname": "document_date", 
   "oldfieldtype": "Date", 
+  "print_width": "120px", 
   "read_only": 1, 
   "width": "120px"
  }, 
@@ -64,6 +66,7 @@
   "fieldtype": "Link", 
   "label": "Customer", 
   "options": "Customer", 
+  "print_width": "150px", 
   "read_only": 1, 
   "width": "150px"
  }, 
@@ -73,6 +76,7 @@
   "fieldtype": "Currency", 
   "label": "Grand Total", 
   "options": "Company:company:default_currency", 
+  "print_width": "120px", 
   "read_only": 1, 
   "width": "120px"
  }, 
diff --git a/projects/doctype/project_milestone/project_milestone.txt b/projects/doctype/project_milestone/project_milestone.txt
index 4641b5d..11c5d20 100644
--- a/projects/doctype/project_milestone/project_milestone.txt
+++ b/projects/doctype/project_milestone/project_milestone.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2012-03-27 14:36:06", 
+  "creation": "2013-02-22 01:27:50", 
   "docstatus": 0, 
-  "modified": "2012-03-27 14:36:06", 
+  "modified": "2013-03-07 07:03:26", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -10,9 +10,7 @@
   "doctype": "DocType", 
   "istable": 1, 
   "module": "Projects", 
-  "name": "__common__", 
-  "section_style": "Simple", 
-  "version": 4
+  "name": "__common__"
  }, 
  {
   "doctype": "DocField", 
@@ -41,6 +39,7 @@
   "label": "Milestone", 
   "oldfieldname": "milestone", 
   "oldfieldtype": "Text", 
+  "print_width": "300px", 
   "width": "300px"
  }, 
  {
diff --git a/projects/doctype/time_log_batch_detail/time_log_batch_detail.txt b/projects/doctype/time_log_batch_detail/time_log_batch_detail.txt
index d1e1eae..8bd554f 100644
--- a/projects/doctype/time_log_batch_detail/time_log_batch_detail.txt
+++ b/projects/doctype/time_log_batch_detail/time_log_batch_detail.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-02-28 17:56:12", 
+  "creation": "2013-03-05 09:11:06", 
   "docstatus": 0, 
-  "modified": "2013-03-01 15:20:17", 
+  "modified": "2013-03-07 07:03:34", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -30,6 +30,7 @@
   "fieldtype": "Link", 
   "label": "Time Log", 
   "options": "Time Log", 
+  "print_width": "200px", 
   "reqd": 1, 
   "width": "200px"
  }, 
diff --git a/selling/doctype/installation_note_item/installation_note_item.txt b/selling/doctype/installation_note_item/installation_note_item.txt
index 16f9bbc..a2ccdc4 100644
--- a/selling/doctype/installation_note_item/installation_note_item.txt
+++ b/selling/doctype/installation_note_item/installation_note_item.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:18", 
+  "creation": "2013-02-22 01:27:51", 
   "docstatus": 0, 
-  "modified": "2013-01-22 14:47:00", 
+  "modified": "2013-03-07 07:03:21", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -42,6 +42,7 @@
   "label": "Description", 
   "oldfieldname": "description", 
   "oldfieldtype": "Data", 
+  "print_width": "300px", 
   "read_only": 1, 
   "width": "300px"
  }, 
@@ -63,6 +64,7 @@
   "label": "Serial No", 
   "oldfieldname": "serial_no", 
   "oldfieldtype": "Small Text", 
+  "print_width": "180px", 
   "width": "180px"
  }, 
  {
@@ -75,6 +77,7 @@
   "oldfieldname": "prevdoc_detail_docname", 
   "oldfieldtype": "Data", 
   "print_hide": 1, 
+  "print_width": "150px", 
   "read_only": 1, 
   "width": "150px"
  }, 
@@ -89,6 +92,7 @@
   "oldfieldname": "prevdoc_docname", 
   "oldfieldtype": "Data", 
   "print_hide": 1, 
+  "print_width": "150px", 
   "read_only": 1, 
   "search_index": 1, 
   "width": "150px"
@@ -104,6 +108,7 @@
   "oldfieldname": "prevdoc_doctype", 
   "oldfieldtype": "Data", 
   "print_hide": 1, 
+  "print_width": "150px", 
   "read_only": 1, 
   "search_index": 1, 
   "width": "150px"
diff --git a/selling/doctype/opportunity_item/opportunity_item.txt b/selling/doctype/opportunity_item/opportunity_item.txt
index f9f8c79..ba7870e 100644
--- a/selling/doctype/opportunity_item/opportunity_item.txt
+++ b/selling/doctype/opportunity_item/opportunity_item.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:19", 
+  "creation": "2013-02-22 01:27:51", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:53", 
+  "modified": "2013-03-07 07:03:26", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -50,6 +50,7 @@
   "label": "Description", 
   "oldfieldname": "description", 
   "oldfieldtype": "Text", 
+  "print_width": "300px", 
   "reqd": 1, 
   "width": "300px"
  }, 
diff --git a/selling/doctype/quotation_item/quotation_item.txt b/selling/doctype/quotation_item/quotation_item.txt
index 8979562..dccc503 100644
--- a/selling/doctype/quotation_item/quotation_item.txt
+++ b/selling/doctype/quotation_item/quotation_item.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:19", 
+  "creation": "2013-02-22 01:27:52", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:54", 
+  "modified": "2013-03-07 07:03:29", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -36,6 +36,7 @@
   "oldfieldtype": "Link", 
   "options": "Item", 
   "print_hide": 0, 
+  "print_width": "150px", 
   "reqd": 1, 
   "search_index": 1, 
   "width": "150px"
@@ -58,6 +59,7 @@
   "oldfieldname": "item_name", 
   "oldfieldtype": "Data", 
   "print_hide": 1, 
+  "print_width": "150px", 
   "reqd": 1, 
   "search_index": 1, 
   "width": "150px"
@@ -70,6 +72,7 @@
   "oldfieldname": "description", 
   "oldfieldtype": "Small Text", 
   "print_hide": 0, 
+  "print_width": "300px", 
   "reqd": 1, 
   "width": "300px"
  }, 
@@ -83,6 +86,7 @@
   "oldfieldname": "qty", 
   "oldfieldtype": "Currency", 
   "print_hide": 0, 
+  "print_width": "100px", 
   "reqd": 1, 
   "search_index": 0, 
   "width": "100px"
@@ -95,6 +99,7 @@
   "oldfieldname": "stock_uom", 
   "oldfieldtype": "Data", 
   "print_hide": 0, 
+  "print_width": "100px", 
   "read_only": 1, 
   "reqd": 0, 
   "width": "100px"
@@ -109,6 +114,7 @@
   "oldfieldtype": "Currency", 
   "options": "currency", 
   "print_hide": 1, 
+  "print_width": "100px", 
   "reqd": 0, 
   "width": "100px"
  }, 
@@ -121,6 +127,7 @@
   "oldfieldname": "adj_rate", 
   "oldfieldtype": "Float", 
   "print_hide": 1, 
+  "print_width": "100px", 
   "width": "100px"
  }, 
  {
@@ -134,6 +141,7 @@
   "oldfieldtype": "Currency", 
   "options": "currency", 
   "print_hide": 0, 
+  "print_width": "100px", 
   "reqd": 0, 
   "search_index": 0, 
   "width": "100px"
@@ -149,6 +157,7 @@
   "oldfieldtype": "Currency", 
   "options": "currency", 
   "print_hide": 0, 
+  "print_width": "100px", 
   "read_only": 1, 
   "reqd": 0, 
   "search_index": 0, 
@@ -163,6 +172,7 @@
   "oldfieldtype": "Currency", 
   "options": "Company:company:default_currency", 
   "print_hide": 1, 
+  "print_width": "100px", 
   "read_only": 1, 
   "width": "100px"
  }, 
@@ -177,6 +187,7 @@
   "oldfieldtype": "Currency", 
   "options": "Company:company:default_currency", 
   "print_hide": 1, 
+  "print_width": "100px", 
   "reqd": 0, 
   "search_index": 0, 
   "width": "100px"
@@ -192,6 +203,7 @@
   "oldfieldtype": "Currency", 
   "options": "Company:company:default_currency", 
   "print_hide": 1, 
+  "print_width": "100px", 
   "read_only": 1, 
   "reqd": 0, 
   "search_index": 0, 
@@ -222,6 +234,7 @@
   "oldfieldtype": "Link", 
   "options": "Brand", 
   "print_hide": 1, 
+  "print_width": "150px", 
   "read_only": 1, 
   "search_index": 1, 
   "width": "150px"
@@ -247,6 +260,7 @@
   "oldfieldname": "prevdoc_docname", 
   "oldfieldtype": "Data", 
   "print_hide": 1, 
+  "print_width": "150px", 
   "read_only": 1, 
   "report_hide": 0, 
   "width": "150px"
@@ -261,6 +275,7 @@
   "oldfieldname": "prevdoc_doctype", 
   "oldfieldtype": "Data", 
   "print_hide": 1, 
+  "print_width": "150px", 
   "read_only": 1, 
   "report_hide": 0, 
   "width": "150px"
diff --git a/selling/doctype/sales_and_purchase_return_item/sales_and_purchase_return_item.txt b/selling/doctype/sales_and_purchase_return_item/sales_and_purchase_return_item.txt
index 179a6a3..4f844b3 100644
--- a/selling/doctype/sales_and_purchase_return_item/sales_and_purchase_return_item.txt
+++ b/selling/doctype/sales_and_purchase_return_item/sales_and_purchase_return_item.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:20", 
+  "creation": "2013-02-22 01:27:52", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:54", 
+  "modified": "2013-03-07 07:03:30", 
   "modified_by": "Administrator", 
   "owner": "wasim@webnotestech.com"
  }, 
@@ -42,6 +42,7 @@
   "label": "Description", 
   "oldfieldname": "description", 
   "oldfieldtype": "Data", 
+  "print_width": "300px", 
   "read_only": 1, 
   "width": "300px"
  }, 
diff --git a/selling/doctype/sales_order_item/sales_order_item.txt b/selling/doctype/sales_order_item/sales_order_item.txt
index dc8d19e..fff2d08 100644
--- a/selling/doctype/sales_order_item/sales_order_item.txt
+++ b/selling/doctype/sales_order_item/sales_order_item.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:21", 
+  "creation": "2013-02-22 01:27:52", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:54", 
+  "modified": "2013-03-07 07:03:30", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -34,6 +34,7 @@
   "oldfieldname": "item_code", 
   "oldfieldtype": "Link", 
   "options": "Item", 
+  "print_width": "150px", 
   "reqd": 1, 
   "search_index": 1, 
   "width": "150px"
@@ -55,6 +56,7 @@
   "oldfieldname": "item_name", 
   "oldfieldtype": "Data", 
   "print_hide": 1, 
+  "print_width": "150", 
   "reqd": 1, 
   "width": "150"
  }, 
@@ -66,6 +68,7 @@
   "label": "Description", 
   "oldfieldname": "description", 
   "oldfieldtype": "Small Text", 
+  "print_width": "300px", 
   "reqd": 1, 
   "search_index": 1, 
   "width": "300px"
@@ -78,6 +81,7 @@
   "label": "Quantity", 
   "oldfieldname": "qty", 
   "oldfieldtype": "Currency", 
+  "print_width": "100px", 
   "reqd": 1, 
   "width": "100px"
  }, 
@@ -89,6 +93,7 @@
   "label": "UOM", 
   "oldfieldname": "stock_uom", 
   "oldfieldtype": "Data", 
+  "print_width": "70px", 
   "read_only": 1, 
   "reqd": 0, 
   "width": "70px"
@@ -103,6 +108,7 @@
   "oldfieldtype": "Currency", 
   "options": "currency", 
   "print_hide": 1, 
+  "print_width": "70px", 
   "reqd": 0, 
   "width": "70px"
  }, 
@@ -115,6 +121,7 @@
   "oldfieldname": "adj_rate", 
   "oldfieldtype": "Float", 
   "print_hide": 1, 
+  "print_width": "70px", 
   "width": "70px"
  }, 
  {
@@ -126,6 +133,7 @@
   "oldfieldname": "export_rate", 
   "oldfieldtype": "Currency", 
   "options": "currency", 
+  "print_width": "100px", 
   "reqd": 0, 
   "width": "100px"
  }, 
@@ -139,6 +147,7 @@
   "oldfieldname": "export_amount", 
   "oldfieldtype": "Currency", 
   "options": "currency", 
+  "print_width": "100px", 
   "read_only": 1, 
   "reqd": 0, 
   "width": "100px"
@@ -152,6 +161,7 @@
   "oldfieldtype": "Currency", 
   "options": "Company:company:default_currency", 
   "print_hide": 1, 
+  "print_width": "100px", 
   "read_only": 1, 
   "width": "100px"
  }, 
@@ -165,6 +175,7 @@
   "oldfieldtype": "Currency", 
   "options": "Company:company:default_currency", 
   "print_hide": 1, 
+  "print_width": "100px", 
   "reqd": 0, 
   "width": "100px"
  }, 
@@ -179,6 +190,7 @@
   "oldfieldtype": "Currency", 
   "options": "Company:company:default_currency", 
   "print_hide": 1, 
+  "print_width": "100px", 
   "read_only": 1, 
   "reqd": 0, 
   "width": "100px"
@@ -193,6 +205,7 @@
   "oldfieldtype": "Link", 
   "options": "Warehouse", 
   "print_hide": 1, 
+  "print_width": "150px", 
   "reqd": 0, 
   "width": "150px"
  }, 
@@ -207,6 +220,7 @@
   "oldfieldname": "projected_qty", 
   "oldfieldtype": "Currency", 
   "print_hide": 1, 
+  "print_width": "70px", 
   "read_only": 1, 
   "width": "70px"
  }, 
@@ -218,6 +232,7 @@
   "label": "Actual Qty", 
   "no_copy": 1, 
   "print_hide": 1, 
+  "print_width": "70px", 
   "read_only": 1, 
   "width": "70px"
  }, 
@@ -233,6 +248,7 @@
   "oldfieldname": "delivered_qty", 
   "oldfieldtype": "Currency", 
   "print_hide": 1, 
+  "print_width": "100px", 
   "read_only": 1, 
   "search_index": 0, 
   "width": "100px"
@@ -258,6 +274,7 @@
   "oldfieldname": "planned_qty", 
   "oldfieldtype": "Currency", 
   "print_hide": 1, 
+  "print_width": "50px", 
   "read_only": 1, 
   "report_hide": 1, 
   "width": "50px"
@@ -272,6 +289,7 @@
   "oldfieldname": "produced_qty", 
   "oldfieldtype": "Currency", 
   "print_hide": 1, 
+  "print_width": "50px", 
   "read_only": 1, 
   "report_hide": 1, 
   "width": "50px"
diff --git a/selling/doctype/sales_team/sales_team.txt b/selling/doctype/sales_team/sales_team.txt
index c1a00d7..add466c 100644
--- a/selling/doctype/sales_team/sales_team.txt
+++ b/selling/doctype/sales_team/sales_team.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:22", 
+  "creation": "2013-02-22 01:27:53", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:56", 
+  "modified": "2013-03-07 07:03:31", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -33,6 +33,7 @@
   "oldfieldname": "sales_person", 
   "oldfieldtype": "Link", 
   "options": "Sales Person", 
+  "print_width": "200px", 
   "reqd": 1, 
   "search_index": 1, 
   "width": "200px"
@@ -44,6 +45,7 @@
   "label": "Designation", 
   "oldfieldname": "sales_designation", 
   "oldfieldtype": "Data", 
+  "print_width": "100px", 
   "width": "100px"
  }, 
  {
@@ -54,6 +56,7 @@
   "label": "Contact No.", 
   "oldfieldname": "contact_no", 
   "oldfieldtype": "Data", 
+  "print_width": "100px", 
   "width": "100px"
  }, 
  {
@@ -63,6 +66,7 @@
   "label": "Allocated (%)", 
   "oldfieldname": "allocated_percentage", 
   "oldfieldtype": "Currency", 
+  "print_width": "100px", 
   "reqd": 0, 
   "width": "100px"
  }, 
@@ -74,6 +78,7 @@
   "oldfieldname": "allocated_amount", 
   "oldfieldtype": "Currency", 
   "options": "Company:company:default_currency", 
+  "print_width": "120px", 
   "reqd": 0, 
   "width": "120px"
  }, 
diff --git a/setup/doctype/series_detail/series_detail.txt b/setup/doctype/series_detail/series_detail.txt
index 19ef3fb..98a5d78 100644
--- a/setup/doctype/series_detail/series_detail.txt
+++ b/setup/doctype/series_detail/series_detail.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2012-03-27 14:36:25", 
+  "creation": "2013-02-22 01:27:57", 
   "docstatus": 0, 
-  "modified": "2012-03-27 14:36:25", 
+  "modified": "2013-03-07 07:03:32", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -10,10 +10,7 @@
   "doctype": "DocType", 
   "istable": 1, 
   "module": "Setup", 
-  "name": "__common__", 
-  "section_style": "Tray", 
-  "show_in_menu": 0, 
-  "version": 3
+  "name": "__common__"
  }, 
  {
   "doctype": "DocField", 
@@ -41,7 +38,6 @@
   "fieldtype": "Check", 
   "label": "Remove", 
   "oldfieldname": "remove", 
-  "oldfieldtype": "Check", 
-  "trigger": "Client"
+  "oldfieldtype": "Check"
  }
 ]
\ No newline at end of file
diff --git a/setup/doctype/sms_parameter/sms_parameter.txt b/setup/doctype/sms_parameter/sms_parameter.txt
index 55f90be..cc7a002 100755
--- a/setup/doctype/sms_parameter/sms_parameter.txt
+++ b/setup/doctype/sms_parameter/sms_parameter.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2012-03-27 14:36:25", 
+  "creation": "2013-02-22 01:27:58", 
   "docstatus": 0, 
-  "modified": "2012-03-27 14:36:25", 
+  "modified": "2013-03-07 07:03:32", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -10,10 +10,7 @@
   "doctype": "DocType", 
   "istable": 1, 
   "module": "Setup", 
-  "name": "__common__", 
-  "section_style": "Simple", 
-  "show_in_menu": 0, 
-  "version": 4
+  "name": "__common__"
  }, 
  {
   "doctype": "DocField", 
@@ -23,6 +20,7 @@
   "parentfield": "fields", 
   "parenttype": "DocType", 
   "permlevel": 0, 
+  "print_width": "150px", 
   "reqd": 1, 
   "width": "150px"
  }, 
diff --git a/setup/doctype/target_detail/target_detail.txt b/setup/doctype/target_detail/target_detail.txt
index 21b6323..b3e2886 100644
--- a/setup/doctype/target_detail/target_detail.txt
+++ b/setup/doctype/target_detail/target_detail.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:24", 
+  "creation": "2013-02-22 01:27:58", 
   "docstatus": 0, 
-  "modified": "2013-01-23 16:52:10", 
+  "modified": "2013-03-07 07:03:33", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
diff --git a/setup/doctype/workflow_action_detail/workflow_action_detail.txt b/setup/doctype/workflow_action_detail/workflow_action_detail.txt
index 2ef95fd..7393882 100644
--- a/setup/doctype/workflow_action_detail/workflow_action_detail.txt
+++ b/setup/doctype/workflow_action_detail/workflow_action_detail.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2012-03-27 14:36:26", 
+  "creation": "2013-02-22 01:27:59", 
   "docstatus": 0, 
-  "modified": "2012-03-27 14:36:26", 
+  "modified": "2013-03-07 07:03:34", 
   "modified_by": "Administrator", 
   "owner": "swarnalata@webnotestech.com"
  }, 
@@ -10,10 +10,7 @@
   "doctype": "DocType", 
   "istable": 1, 
   "module": "Setup", 
-  "name": "__common__", 
-  "section_style": "Simple", 
-  "show_in_menu": 0, 
-  "version": 5
+  "name": "__common__"
  }, 
  {
   "doctype": "DocField", 
@@ -22,6 +19,7 @@
   "parentfield": "fields", 
   "parenttype": "DocType", 
   "permlevel": 0, 
+  "print_width": "200px", 
   "width": "200px"
  }, 
  {
diff --git a/setup/doctype/workflow_rule_detail/workflow_rule_detail.txt b/setup/doctype/workflow_rule_detail/workflow_rule_detail.txt
index 73c1cf3..1aee3fe 100644
--- a/setup/doctype/workflow_rule_detail/workflow_rule_detail.txt
+++ b/setup/doctype/workflow_rule_detail/workflow_rule_detail.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2012-03-27 14:36:26", 
+  "creation": "2013-02-22 01:27:59", 
   "docstatus": 0, 
-  "modified": "2012-03-27 14:36:26", 
+  "modified": "2013-03-07 07:03:34", 
   "modified_by": "Administrator", 
   "owner": "swarnalata@webnotestech.com"
  }, 
@@ -10,10 +10,7 @@
   "doctype": "DocType", 
   "istable": 1, 
   "module": "Setup", 
-  "name": "__common__", 
-  "section_style": "Simple", 
-  "show_in_menu": 0, 
-  "version": 9
+  "name": "__common__"
  }, 
  {
   "doctype": "DocField", 
@@ -35,6 +32,7 @@
   "oldfieldname": "rule_field", 
   "oldfieldtype": "Select", 
   "options": "[]", 
+  "print_width": "200px", 
   "width": "200px"
  }, 
  {
@@ -53,6 +51,7 @@
   "label": "Value", 
   "oldfieldname": "value", 
   "oldfieldtype": "Data", 
+  "print_width": "100px", 
   "width": "100px"
  }, 
  {
@@ -70,6 +69,7 @@
   "label": "Message when Cond. False", 
   "oldfieldname": "message", 
   "oldfieldtype": "Data", 
+  "print_width": "200px", 
   "width": "200px"
  }, 
  {
diff --git a/stock/doctype/delivery_note/delivery_note.py b/stock/doctype/delivery_note/delivery_note.py
index 35d008b..c0b9916 100644
--- a/stock/doctype/delivery_note/delivery_note.py
+++ b/stock/doctype/delivery_note/delivery_note.py
@@ -17,7 +17,7 @@
 from __future__ import unicode_literals
 import webnotes
 
-from webnotes.utils import cstr, flt, getdate
+from webnotes.utils import cstr, flt, getdate, cint
 from webnotes.model.bean import getlist
 from webnotes.model.code import get_obj
 from webnotes import msgprint
@@ -251,6 +251,8 @@
 		self.update_stock_ledger(update_stock = 1)
 
 		self.credit_limit()
+		
+		self.make_gl_entries()
 
 		# set DN status
 		webnotes.conn.set(self.doc, 'status', 'Submitted')
@@ -293,6 +295,8 @@
 		self.update_stock_ledger(update_stock = -1)
 		webnotes.conn.set(self.doc, 'status', 'Cancelled')
 		self.cancel_packing_slips()
+		
+		self.make_gl_entries()
 
 
 	def check_next_docstatus(self):
@@ -389,4 +393,71 @@
 		self.doclist = get_obj('Sales Common').make_packing_list(self,'delivery_note_details')
 		sl = get_obj('Stock Ledger')
 		sl.scrub_serial_nos(self)
-		sl.scrub_serial_nos(self, 'packing_details')
\ No newline at end of file
+		sl.scrub_serial_nos(self, 'packing_details')
+		
+	def make_gl_entries(self):
+		if not cint(webnotes.defaults.get_global_default("auto_inventory_accounting")):
+			return
+		
+		abbr = webnotes.conn.get_value("Company", self.doc.company, "abbr")
+		stock_delivered_account = "Stock Delivered But Not Billed - %s" % (abbr,)
+		stock_in_hand_account = self.get_stock_in_hand_account()
+		
+		total_buying_amount = self.get_total_buying_amount()
+		if total_buying_amount:
+			gl_entries = [
+				# credit stock in hand account
+				self.get_gl_dict({
+					"account": stock_in_hand_account,
+					"against": stock_delivered_account,
+					"credit": total_buying_amount,
+					"remarks": self.doc.remarks or "Accounting Entry for Stock",
+				}, self.doc.docstatus == 2),
+				
+				# debit stock received but not billed account
+				self.get_gl_dict({
+					"account": stock_delivered_account,
+					"against": stock_in_hand_account,
+					"debit": total_buying_amount,
+					"remarks": self.doc.remarks or "Accounting Entry for Stock",
+				}, self.doc.docstatus == 2),
+			]
+			from accounts.general_ledger import make_gl_entries
+			make_gl_entries(gl_entries, cancel=self.doc.docstatus == 2)
+			
+	def get_total_buying_amount(self):
+		from stock.utils import get_buying_amount, get_sales_bom
+		stock_ledger_entries = self.get_stock_ledger_entries()
+		item_sales_bom = get_sales_bom()
+		total_buying_amount = 0
+		
+		if stock_ledger_entries:
+			for item in self.doclist.get({"parentfield": "delivery_note_details"}):
+				buying_amount = get_buying_amount(item.item_code, item.warehouse, item.qty, 
+					self.doc.name, item.name, stock_ledger_entries, item_sales_bom)
+				total_buying_amount += buying_amount
+			
+		return total_buying_amount
+		
+	def get_stock_ledger_entries(self):
+		item_list, warehouse_list = self.get_distinct_item_warehouse()
+		if item_list and warehouse_list:
+			return webnotes.conn.sql("""select item_code, voucher_type, voucher_no,
+				voucher_detail_no, posting_date, posting_time, stock_value,
+				warehouse, actual_qty as qty from `tabStock Ledger Entry` 
+				where ifnull(`is_cancelled`, "No") = "No" and company = %s 
+				and item_code in (%s) and warehouse in (%s)
+				order by item_code desc, warehouse desc, posting_date desc, 
+				posting_time desc, name desc""" % 
+				('%s', ', '.join(['%s']*len(item_list)), ', '.join(['%s']*len(warehouse_list))), 
+				tuple([self.doc.company] + item_list + warehouse_list), as_dict=1)
+
+	def get_distinct_item_warehouse(self):
+		item_list = []
+		warehouse_list = []
+		for item in self.doclist.get({"parentfield": "delivery_note_details"}) \
+				+ self.doclist.get({"parentfield": "packing_details"}):
+			item_list.append(item.item_code)
+			warehouse_list.append(item.warehouse)
+			
+		return list(set(item_list)), list(set(warehouse_list))
\ No newline at end of file
diff --git a/stock/doctype/delivery_note/test_delivery_note.py b/stock/doctype/delivery_note/test_delivery_note.py
index 4666360..c2bb5d0 100644
--- a/stock/doctype/delivery_note/test_delivery_note.py
+++ b/stock/doctype/delivery_note/test_delivery_note.py
@@ -1,3 +1,89 @@
+# ERPNext - web based ERP (http://erpnext.com)
+# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+from __future__ import unicode_literals
+import unittest
+import webnotes
+import webnotes.defaults
+from webnotes.utils import cint
+
+class TestDeliveryNote(unittest.TestCase):
+	def _insert_purchase_receipt(self):
+		from stock.doctype.purchase_receipt.test_purchase_receipt import test_records as pr_test_records
+		pr = webnotes.bean(copy=pr_test_records[0])
+		pr.run_method("calculate_taxes_and_totals")
+		pr.insert()
+		pr.submit()
+	
+	def test_delivery_note_no_gl_entry(self):
+		webnotes.conn.sql("""delete from `tabBin`""")
+		webnotes.defaults.set_global_default("auto_inventory_accounting", 0)
+		self.assertEqual(cint(webnotes.defaults.get_global_default("auto_inventory_accounting")), 0)
+		
+		self._insert_purchase_receipt()
+		
+		dn = webnotes.bean(copy=test_records[0])
+		dn.insert()
+		dn.submit()
+		
+		gl_entries = webnotes.conn.sql("""select account, debit, credit
+			from `tabGL Entry` where voucher_type='Delivery Note' and voucher_no=%s
+			order by account desc""", dn.doc.name, as_dict=1)
+			
+		self.assertTrue(not gl_entries)
+		
+	def test_delivery_note_gl_entry(self):
+		webnotes.conn.sql("""delete from `tabBin`""")
+		webnotes.defaults.set_global_default("auto_inventory_accounting", 1)
+		self.assertEqual(cint(webnotes.defaults.get_global_default("auto_inventory_accounting")), 1)
+		
+		self._insert_purchase_receipt()
+		
+		dn = webnotes.bean(copy=test_records[0])
+		stock_in_hand_account = webnotes.conn.get_value("Company", dn.doc.company, 
+			"stock_in_hand_account")
+		
+		from accounts.utils import get_balance_on
+		prev_bal = get_balance_on(stock_in_hand_account, dn.doc.posting_date)
+			
+		dn.insert()
+		dn.submit()
+		
+		gl_entries = webnotes.conn.sql("""select account, debit, credit
+			from `tabGL Entry` where voucher_type='Delivery Note' and voucher_no=%s
+			order by account asc""", dn.doc.name, as_dict=1)
+		self.assertTrue(gl_entries)
+		
+		expected_values = sorted([
+			[stock_in_hand_account, 0.0, 375.0],
+			["Stock Delivered But Not Billed - _TC", 375.0, 0.0]
+		])
+		
+		for i, gle in enumerate(gl_entries):
+			self.assertEquals(expected_values[i][0], gle.account)
+			self.assertEquals(expected_values[i][1], gle.debit)
+			self.assertEquals(expected_values[i][2], gle.credit)
+		
+		# check stock in hand balance
+		bal = get_balance_on(stock_in_hand_account, dn.doc.posting_date)
+		self.assertEquals(bal, prev_bal - 375.0)
+		
+		webnotes.defaults.set_global_default("auto_inventory_accounting", 0)
+
 test_records = [
 	[
 		{
@@ -15,18 +101,19 @@
 			"price_list_name": "_Test Price List", 
 			"status": "Draft", 
 			"territory": "_Test Territory",
+			"net_total": 500.0,
 			"grand_total": 500.0, 
 			"grand_total_export": 500.0,
 		}, 
 		{
 			"description": "CPU", 
 			"doctype": "Delivery Note Item", 
-			"item_code": "_Test Item Home Desktop 100", 
+			"item_code": "_Test Item", 
 			"item_name": "CPU", 
 			"parentfield": "delivery_note_details", 
-			"qty": 4.0, 
-			"basic_rate": 50.0,
-			"export_rate": 50.0,
+			"qty": 5.0, 
+			"basic_rate": 100.0,
+			"export_rate": 100.0,
 			"amount": 500.0,
 			"warehouse": "_Test Warehouse",
 			"stock_uom": "No."
diff --git a/stock/doctype/delivery_note_item/delivery_note_item.txt b/stock/doctype/delivery_note_item/delivery_note_item.txt
index 9f18568..985a072 100644
--- a/stock/doctype/delivery_note_item/delivery_note_item.txt
+++ b/stock/doctype/delivery_note_item/delivery_note_item.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:26", 
+  "creation": "2013-02-22 01:28:00", 
   "docstatus": 0, 
-  "modified": "2013-01-29 16:27:56", 
+  "modified": "2013-03-07 07:03:20", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -41,6 +41,7 @@
   "oldfieldname": "item_code", 
   "oldfieldtype": "Link", 
   "options": "Item", 
+  "print_width": "150px", 
   "reqd": 1, 
   "search_index": 1, 
   "width": "150px"
@@ -62,6 +63,7 @@
   "oldfieldname": "item_name", 
   "oldfieldtype": "Data", 
   "print_hide": 1, 
+  "print_width": "150px", 
   "reqd": 1, 
   "width": "150px"
  }, 
@@ -72,6 +74,7 @@
   "label": "Description", 
   "oldfieldname": "description", 
   "oldfieldtype": "Small Text", 
+  "print_width": "300px", 
   "reqd": 1, 
   "width": "300px"
  }, 
@@ -83,6 +86,7 @@
   "label": "Quantity", 
   "oldfieldname": "qty", 
   "oldfieldtype": "Currency", 
+  "print_width": "100px", 
   "reqd": 1, 
   "width": "100px"
  }, 
@@ -94,6 +98,7 @@
   "oldfieldname": "stock_uom", 
   "oldfieldtype": "Data", 
   "print_hide": 0, 
+  "print_width": "50px", 
   "read_only": 1, 
   "reqd": 1, 
   "width": "50px"
@@ -109,6 +114,7 @@
   "oldfieldtype": "Currency", 
   "options": "currency", 
   "print_hide": 1, 
+  "print_width": "100px", 
   "reqd": 0, 
   "width": "100px"
  }, 
@@ -121,6 +127,7 @@
   "oldfieldname": "adj_rate", 
   "oldfieldtype": "Float", 
   "print_hide": 1, 
+  "print_width": "100px", 
   "width": "100px"
  }, 
  {
@@ -132,6 +139,7 @@
   "oldfieldtype": "Currency", 
   "options": "currency", 
   "print_hide": 0, 
+  "print_width": "150px", 
   "reqd": 0, 
   "width": "150px"
  }, 
@@ -144,6 +152,7 @@
   "oldfieldtype": "Currency", 
   "options": "currency", 
   "print_hide": 0, 
+  "print_width": "100px", 
   "read_only": 1, 
   "reqd": 0, 
   "width": "100px"
@@ -157,6 +166,7 @@
   "oldfieldtype": "Currency", 
   "options": "Company:company:default_currency", 
   "print_hide": 1, 
+  "print_width": "100px", 
   "read_only": 1, 
   "width": "100px"
  }, 
@@ -170,6 +180,7 @@
   "oldfieldtype": "Currency", 
   "options": "Company:company:default_currency", 
   "print_hide": 1, 
+  "print_width": "150px", 
   "reqd": 0, 
   "width": "150px"
  }, 
@@ -182,6 +193,7 @@
   "oldfieldtype": "Currency", 
   "options": "Company:company:default_currency", 
   "print_hide": 1, 
+  "print_width": "100px", 
   "read_only": 1, 
   "reqd": 0, 
   "width": "100px"
@@ -195,6 +207,7 @@
   "oldfieldtype": "Link", 
   "options": "Warehouse", 
   "print_hide": 1, 
+  "print_width": "100px", 
   "width": "100px"
  }, 
  {
@@ -240,6 +253,7 @@
   "oldfieldtype": "Link", 
   "options": "Brand", 
   "print_hide": 1, 
+  "print_width": "150px", 
   "read_only": 1, 
   "width": "150px"
  }, 
@@ -252,6 +266,7 @@
   "oldfieldname": "actual_qty", 
   "oldfieldtype": "Currency", 
   "print_hide": 1, 
+  "print_width": "150px", 
   "read_only": 1, 
   "width": "150px"
  }, 
@@ -263,6 +278,7 @@
   "no_copy": 1, 
   "options": "currency", 
   "print_hide": 1, 
+  "print_width": "100px", 
   "read_only": 1, 
   "width": "100px"
  }, 
@@ -275,6 +291,7 @@
   "oldfieldname": "installed_qty", 
   "oldfieldtype": "Currency", 
   "print_hide": 1, 
+  "print_width": "150px", 
   "read_only": 1, 
   "width": "150px"
  }, 
@@ -299,6 +316,7 @@
   "oldfieldname": "prevdoc_doctype", 
   "oldfieldtype": "Data", 
   "print_hide": 1, 
+  "print_width": "150px", 
   "read_only": 1, 
   "search_index": 1, 
   "width": "150px"
@@ -314,6 +332,7 @@
   "oldfieldname": "prevdoc_docname", 
   "oldfieldtype": "Data", 
   "print_hide": 1, 
+  "print_width": "150px", 
   "read_only": 1, 
   "search_index": 1, 
   "width": "150px"
@@ -340,6 +359,7 @@
   "oldfieldname": "prevdoc_detail_docname", 
   "oldfieldtype": "Data", 
   "print_hide": 1, 
+  "print_width": "150px", 
   "read_only": 1, 
   "search_index": 0, 
   "width": "150px"
diff --git a/stock/doctype/delivery_note_packing_item/delivery_note_packing_item.txt b/stock/doctype/delivery_note_packing_item/delivery_note_packing_item.txt
index 853e94e..defd39d 100644
--- a/stock/doctype/delivery_note_packing_item/delivery_note_packing_item.txt
+++ b/stock/doctype/delivery_note_packing_item/delivery_note_packing_item.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:27", 
+  "creation": "2013-02-22 01:28:00", 
   "docstatus": 0, 
-  "modified": "2013-01-22 14:46:40", 
+  "modified": "2013-03-07 07:03:20", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -74,6 +74,7 @@
   "label": "Description", 
   "oldfieldname": "description", 
   "oldfieldtype": "Text", 
+  "print_width": "300px", 
   "read_only": 1, 
   "width": "300px"
  }, 
diff --git a/stock/doctype/featured_item/featured_item.txt b/stock/doctype/featured_item/featured_item.txt
index a08e282..5c91e87 100644
--- a/stock/doctype/featured_item/featured_item.txt
+++ b/stock/doctype/featured_item/featured_item.txt
@@ -1,33 +1,33 @@
 [
  {
-  "owner": "Administrator", 
+  "creation": "2013-02-22 01:28:00", 
   "docstatus": 0, 
-  "creation": "2012-12-07 14:28:33", 
+  "modified": "2013-03-07 07:03:21", 
   "modified_by": "Administrator", 
-  "modified": "2012-12-07 14:28:33"
+  "owner": "Administrator"
  }, 
  {
-  "istable": 1, 
   "description": "Featured Item in Item Group", 
   "doctype": "DocType", 
+  "istable": 1, 
   "module": "Stock", 
   "name": "__common__"
  }, 
  {
-  "parent": "Featured Item", 
   "doctype": "DocField", 
-  "name": "__common__", 
-  "label": "Item", 
-  "parenttype": "DocType", 
-  "options": "Item", 
   "fieldname": "item", 
   "fieldtype": "Link", 
-  "permlevel": 0, 
-  "parentfield": "fields"
+  "label": "Item", 
+  "name": "__common__", 
+  "options": "Item", 
+  "parent": "Featured Item", 
+  "parentfield": "fields", 
+  "parenttype": "DocType", 
+  "permlevel": 0
  }, 
  {
-  "name": "Featured Item", 
-  "doctype": "DocType"
+  "doctype": "DocType", 
+  "name": "Featured Item"
  }, 
  {
   "doctype": "DocField"
diff --git a/stock/doctype/item/item.txt b/stock/doctype/item/item.txt
index 1a48368..036b9d5 100644
--- a/stock/doctype/item/item.txt
+++ b/stock/doctype/item/item.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2013-02-21 14:54:43", 
   "docstatus": 0, 
-  "modified": "2013-02-28 10:43:02", 
+  "modified": "2013-03-06 16:02:47", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -404,18 +404,6 @@
  }, 
  {
   "depends_on": "eval:doc.is_purchase_item==\"Yes\"", 
-  "description": "Buying Cost will be updated from Purchase Orders and Purchase Receipts. <br>The buying cost will calculated by moving average method.", 
-  "doctype": "DocField", 
-  "fieldname": "buying_cost", 
-  "fieldtype": "Float", 
-  "label": "Buying Cost", 
-  "no_copy": 1, 
-  "oldfieldname": "buying_cost", 
-  "oldfieldtype": "Currency", 
-  "read_only": 1
- }, 
- {
-  "depends_on": "eval:doc.is_purchase_item==\"Yes\"", 
   "doctype": "DocField", 
   "fieldname": "last_purchase_rate", 
   "fieldtype": "Float", 
diff --git a/stock/doctype/item_customer_detail/item_customer_detail.txt b/stock/doctype/item_customer_detail/item_customer_detail.txt
index 8535f1697..2ee9450 100644
--- a/stock/doctype/item_customer_detail/item_customer_detail.txt
+++ b/stock/doctype/item_customer_detail/item_customer_detail.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2012-03-27 14:36:33", 
+  "creation": "2013-02-22 01:28:01", 
   "docstatus": 0, 
-  "modified": "2012-03-27 14:36:33", 
+  "modified": "2013-03-07 07:03:22", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -14,10 +14,7 @@
   "istable": 1, 
   "module": "Stock", 
   "name": "__common__", 
-  "read_only": 0, 
-  "section_style": "Tray", 
-  "show_in_menu": 0, 
-  "version": 7
+  "read_only": 0
  }, 
  {
   "doctype": "DocField", 
@@ -42,6 +39,7 @@
   "oldfieldname": "price_list_name", 
   "oldfieldtype": "Select", 
   "options": "Customer", 
+  "print_width": "180px", 
   "width": "180px"
  }, 
  {
@@ -51,6 +49,7 @@
   "label": "Ref Code", 
   "oldfieldname": "ref_rate", 
   "oldfieldtype": "Currency", 
+  "print_width": "120px", 
   "width": "120px"
  }
 ]
\ No newline at end of file
diff --git a/stock/doctype/item_price/item_price.txt b/stock/doctype/item_price/item_price.txt
index 687a35a..863ca25 100644
--- a/stock/doctype/item_price/item_price.txt
+++ b/stock/doctype/item_price/item_price.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-21 18:19:14", 
+  "creation": "2013-02-22 01:28:01", 
   "docstatus": 0, 
-  "modified": "2013-01-23 16:57:49", 
+  "modified": "2013-03-07 07:03:22", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
diff --git a/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt b/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt
index be9f99b..8233ede 100644
--- a/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt
+++ b/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2012-03-27 14:36:33", 
+  "creation": "2013-02-22 01:28:01", 
   "docstatus": 0, 
-  "modified": "2012-03-27 14:36:33", 
+  "modified": "2013-03-07 07:03:22", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -11,10 +11,7 @@
   "doctype": "DocType", 
   "istable": 1, 
   "module": "Stock", 
-  "name": "__common__", 
-  "section_style": "Simple", 
-  "show_in_menu": 0, 
-  "version": 1
+  "name": "__common__"
  }, 
  {
   "doctype": "DocField", 
@@ -36,6 +33,7 @@
   "in_filter": 0, 
   "label": "Parameter", 
   "oldfieldname": "specification", 
+  "print_width": "200px", 
   "reqd": 1, 
   "search_index": 0, 
   "width": "200px"
diff --git a/stock/doctype/item_reorder/item_reorder.txt b/stock/doctype/item_reorder/item_reorder.txt
index ca429af..43ed4fe 100644
--- a/stock/doctype/item_reorder/item_reorder.txt
+++ b/stock/doctype/item_reorder/item_reorder.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-02-18 12:48:07", 
+  "creation": "2013-02-22 01:28:01", 
   "docstatus": 0, 
-  "modified": "2013-02-18 12:54:46", 
+  "modified": "2013-03-07 07:03:22", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
diff --git a/stock/doctype/item_supplier/item_supplier.txt b/stock/doctype/item_supplier/item_supplier.txt
index 3569d25..3129504 100644
--- a/stock/doctype/item_supplier/item_supplier.txt
+++ b/stock/doctype/item_supplier/item_supplier.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2012-03-27 14:36:33", 
+  "creation": "2013-02-22 01:28:01", 
   "docstatus": 0, 
-  "modified": "2012-03-27 14:36:33", 
+  "modified": "2013-03-07 07:03:22", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -10,10 +10,7 @@
   "doctype": "DocType", 
   "istable": 1, 
   "module": "Stock", 
-  "name": "__common__", 
-  "section_style": "Simple", 
-  "show_in_menu": 0, 
-  "version": 3
+  "name": "__common__"
  }, 
  {
   "doctype": "DocField", 
@@ -39,6 +36,7 @@
   "fieldname": "supplier_part_no", 
   "fieldtype": "Data", 
   "label": "Supplier Part Number", 
+  "print_width": "200px", 
   "width": "200px"
  }
 ]
\ No newline at end of file
diff --git a/stock/doctype/item_tax/item_tax.txt b/stock/doctype/item_tax/item_tax.txt
index a0bfb57..343f965 100644
--- a/stock/doctype/item_tax/item_tax.txt
+++ b/stock/doctype/item_tax/item_tax.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:27", 
+  "creation": "2013-02-22 01:28:01", 
   "docstatus": 0, 
-  "modified": "2013-01-23 16:54:25", 
+  "modified": "2013-03-07 07:03:22", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
diff --git a/stock/doctype/item_website_specification/item_website_specification.txt b/stock/doctype/item_website_specification/item_website_specification.txt
index db2bc9f..1b371c7 100644
--- a/stock/doctype/item_website_specification/item_website_specification.txt
+++ b/stock/doctype/item_website_specification/item_website_specification.txt
@@ -1,42 +1,44 @@
 [
  {
-  "owner": "Administrator", 
+  "creation": "2013-02-22 01:28:01", 
   "docstatus": 0, 
-  "creation": "2012-12-07 15:42:25", 
+  "modified": "2013-03-07 07:03:22", 
   "modified_by": "Administrator", 
-  "modified": "2012-12-17 15:29:37"
+  "owner": "Administrator"
  }, 
  {
-  "istable": 1, 
   "description": "Table for Item that will be shown in Web Site", 
   "doctype": "DocType", 
+  "istable": 1, 
   "module": "Stock", 
   "name": "__common__"
  }, 
  {
+  "doctype": "DocField", 
   "name": "__common__", 
   "parent": "Item Website Specification", 
-  "doctype": "DocField", 
+  "parentfield": "fields", 
   "parenttype": "DocType", 
-  "permlevel": 0, 
-  "parentfield": "fields"
+  "permlevel": 0
  }, 
  {
-  "name": "Item Website Specification", 
-  "doctype": "DocType"
+  "doctype": "DocType", 
+  "name": "Item Website Specification"
  }, 
  {
   "doctype": "DocField", 
-  "label": "Label", 
-  "width": "150px", 
   "fieldname": "label", 
-  "fieldtype": "Data"
+  "fieldtype": "Data", 
+  "label": "Label", 
+  "print_width": "150px", 
+  "width": "150px"
  }, 
  {
   "doctype": "DocField", 
-  "label": "Description", 
-  "width": "300px", 
   "fieldname": "description", 
-  "fieldtype": "Text"
+  "fieldtype": "Text", 
+  "label": "Description", 
+  "print_width": "300px", 
+  "width": "300px"
  }
 ]
\ No newline at end of file
diff --git a/stock/doctype/landed_cost_item/landed_cost_item.txt b/stock/doctype/landed_cost_item/landed_cost_item.txt
index b299a27..1563fac 100644
--- a/stock/doctype/landed_cost_item/landed_cost_item.txt
+++ b/stock/doctype/landed_cost_item/landed_cost_item.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:27", 
+  "creation": "2013-02-22 01:28:02", 
   "docstatus": 0, 
-  "modified": "2013-01-23 16:55:26", 
+  "modified": "2013-03-07 07:03:23", 
   "modified_by": "Administrator", 
   "owner": "wasim@webnotestech.com"
  }, 
@@ -42,6 +42,7 @@
   "label": "Description", 
   "oldfieldname": "description", 
   "oldfieldtype": "Data", 
+  "print_width": "300px", 
   "width": "300px"
  }, 
  {
diff --git a/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt b/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt
index 993c4f4..8b80559 100644
--- a/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt
+++ b/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2012-03-27 14:36:34", 
+  "creation": "2013-02-22 01:28:02", 
   "docstatus": 0, 
-  "modified": "2012-03-27 14:36:34", 
+  "modified": "2013-03-07 07:03:23", 
   "modified_by": "Administrator", 
   "owner": "wasim@webnotestech.com"
  }, 
@@ -10,10 +10,7 @@
   "doctype": "DocType", 
   "istable": 1, 
   "module": "Stock", 
-  "name": "__common__", 
-  "section_style": "Simple", 
-  "show_in_menu": 0, 
-  "version": 5
+  "name": "__common__"
  }, 
  {
   "doctype": "DocField", 
@@ -35,6 +32,7 @@
   "oldfieldname": "purchase_receipt_no", 
   "oldfieldtype": "Link", 
   "options": "Purchase Receipt", 
+  "print_width": "220px", 
   "width": "220px"
  }, 
  {
@@ -44,6 +42,7 @@
   "label": "Select PR", 
   "oldfieldname": "include_in_landed_cost", 
   "oldfieldtype": "Check", 
+  "print_width": "120px", 
   "width": "120px"
  }
 ]
\ No newline at end of file
diff --git a/stock/doctype/material_request_item/material_request_item.txt b/stock/doctype/material_request_item/material_request_item.txt
index d608743..7d9a417 100644
--- a/stock/doctype/material_request_item/material_request_item.txt
+++ b/stock/doctype/material_request_item/material_request_item.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-02-20 13:25:31", 
+  "creation": "2013-02-22 01:28:02", 
   "docstatus": 0, 
-  "modified": "2013-02-20 14:06:58", 
+  "modified": "2013-03-07 07:03:25", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -35,6 +35,7 @@
   "oldfieldname": "schedule_date", 
   "oldfieldtype": "Date", 
   "print_hide": 0, 
+  "print_width": "100px", 
   "reqd": 1, 
   "width": "100px"
  }, 
@@ -47,6 +48,7 @@
   "oldfieldname": "item_code", 
   "oldfieldtype": "Link", 
   "options": "Item", 
+  "print_width": "100px", 
   "reqd": 1, 
   "search_index": 1, 
   "width": "100px"
@@ -58,6 +60,7 @@
   "label": "Description", 
   "oldfieldname": "description", 
   "oldfieldtype": "Text", 
+  "print_width": "250px", 
   "reqd": 1, 
   "width": "250px"
  }, 
@@ -70,6 +73,7 @@
   "oldfieldtype": "Link", 
   "options": "Warehouse", 
   "print_hide": 0, 
+  "print_width": "100px", 
   "reqd": 0, 
   "width": "100px"
  }, 
@@ -82,6 +86,7 @@
   "no_copy": 0, 
   "oldfieldname": "qty", 
   "oldfieldtype": "Currency", 
+  "print_width": "80px", 
   "reqd": 1, 
   "width": "80px"
  }, 
@@ -94,6 +99,7 @@
   "oldfieldname": "uom", 
   "oldfieldtype": "Link", 
   "options": "UOM", 
+  "print_width": "70px", 
   "read_only": 1, 
   "reqd": 1, 
   "width": "70px"
@@ -117,6 +123,7 @@
   "label": "Item Name", 
   "oldfieldname": "item_name", 
   "oldfieldtype": "Data", 
+  "print_width": "100px", 
   "reqd": 1, 
   "search_index": 1, 
   "width": "100px"
@@ -145,6 +152,7 @@
   "oldfieldtype": "Link", 
   "options": "Brand", 
   "print_hide": 1, 
+  "print_width": "100px", 
   "read_only": 1, 
   "width": "100px"
  }, 
@@ -157,6 +165,7 @@
   "oldfieldname": "min_order_qty", 
   "oldfieldtype": "Currency", 
   "print_hide": 1, 
+  "print_width": "70px", 
   "read_only": 1, 
   "reqd": 0, 
   "width": "70px"
@@ -170,6 +179,7 @@
   "oldfieldname": "projected_qty", 
   "oldfieldtype": "Currency", 
   "print_hide": 1, 
+  "print_width": "70px", 
   "read_only": 1, 
   "width": "70px"
  }, 
diff --git a/stock/doctype/packing_slip_item/packing_slip_item.py b/stock/doctype/packing_slip_item/packing_slip_item.py
new file mode 100644
index 0000000..928aa9f
--- /dev/null
+++ b/stock/doctype/packing_slip_item/packing_slip_item.py
@@ -0,0 +1,8 @@
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import webnotes
+
+class DocType:
+	def __init__(self, d, dl):
+		self.doc, self.doclist = d, dl
\ No newline at end of file
diff --git a/stock/doctype/packing_slip_item/packing_slip_item.txt b/stock/doctype/packing_slip_item/packing_slip_item.txt
index c1e6abb..40ff066 100644
--- a/stock/doctype/packing_slip_item/packing_slip_item.txt
+++ b/stock/doctype/packing_slip_item/packing_slip_item.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:28", 
+  "creation": "2013-02-22 01:28:02", 
   "docstatus": 0, 
-  "modified": "2013-01-22 14:47:04", 
+  "modified": "2013-03-07 07:03:26", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -31,6 +31,7 @@
   "fieldtype": "Link", 
   "label": "Item Code", 
   "options": "Item", 
+  "print_width": "100px", 
   "reqd": 1, 
   "width": "100px"
  }, 
@@ -39,6 +40,7 @@
   "fieldname": "item_name", 
   "fieldtype": "Data", 
   "label": "Item Name", 
+  "print_width": "200px", 
   "read_only": 1, 
   "width": "200px"
  }, 
@@ -47,6 +49,7 @@
   "fieldname": "qty", 
   "fieldtype": "Float", 
   "label": "Quantity", 
+  "print_width": "100px", 
   "reqd": 1, 
   "width": "100px"
  }, 
@@ -55,6 +58,7 @@
   "fieldname": "stock_uom", 
   "fieldtype": "Data", 
   "label": "UOM", 
+  "print_width": "100px", 
   "read_only": 1, 
   "width": "100px"
  }, 
@@ -63,6 +67,7 @@
   "fieldname": "net_weight", 
   "fieldtype": "Float", 
   "label": "Net Weight", 
+  "print_width": "100px", 
   "read_only": 1, 
   "width": "100px"
  }, 
@@ -72,6 +77,7 @@
   "fieldtype": "Link", 
   "label": "Weight UOM", 
   "options": "UOM", 
+  "print_width": "100px", 
   "read_only": 1, 
   "width": "100px"
  }, 
diff --git a/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt b/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt
index 8c20d4c..7f4e827 100755
--- a/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt
+++ b/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-02-07 08:28:23", 
+  "creation": "2013-02-22 01:28:03", 
   "docstatus": 0, 
-  "modified": "2013-02-11 08:13:11", 
+  "modified": "2013-03-07 07:03:28", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
diff --git a/stock/doctype/sales_bom_item/sales_bom_item.txt b/stock/doctype/sales_bom_item/sales_bom_item.txt
index 0a77211..98285af 100644
--- a/stock/doctype/sales_bom_item/sales_bom_item.txt
+++ b/stock/doctype/sales_bom_item/sales_bom_item.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:29", 
+  "creation": "2013-02-22 01:28:03", 
   "docstatus": 0, 
-  "modified": "2013-01-23 16:56:21", 
+  "modified": "2013-03-07 07:03:30", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -50,6 +50,7 @@
   "label": "Description", 
   "oldfieldname": "description", 
   "oldfieldtype": "Text", 
+  "print_width": "300px", 
   "width": "300px"
  }, 
  {
diff --git a/stock/doctype/stock_entry_detail/stock_entry_detail.txt b/stock/doctype/stock_entry_detail/stock_entry_detail.txt
index bb8610c..2c59dd7 100644
--- a/stock/doctype/stock_entry_detail/stock_entry_detail.txt
+++ b/stock/doctype/stock_entry_detail/stock_entry_detail.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-29 19:25:45", 
+  "creation": "2013-02-22 01:28:04", 
   "docstatus": 0, 
-  "modified": "2013-02-20 16:46:26", 
+  "modified": "2013-03-07 07:03:32", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
diff --git a/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt b/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt
index f0edf03..381c7f7 100644
--- a/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt
+++ b/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2012-03-27 14:36:40", 
+  "creation": "2013-02-22 01:28:04", 
   "docstatus": 0, 
-  "modified": "2012-03-27 14:36:40", 
+  "modified": "2013-03-07 07:03:34", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -11,10 +11,7 @@
   "doctype": "DocType", 
   "istable": 1, 
   "module": "Stock", 
-  "name": "__common__", 
-  "section_style": "Tray", 
-  "show_in_menu": 0, 
-  "version": 1
+  "name": "__common__"
  }, 
  {
   "doctype": "DocField", 
diff --git a/stock/doctype/warehouse_user/warehouse_user.txt b/stock/doctype/warehouse_user/warehouse_user.txt
index 6cb02ae..6912e30 100644
--- a/stock/doctype/warehouse_user/warehouse_user.txt
+++ b/stock/doctype/warehouse_user/warehouse_user.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-02-04 11:33:57", 
+  "creation": "2013-02-22 01:28:05", 
   "docstatus": 0, 
-  "modified": "2013-02-04 11:36:16", 
+  "modified": "2013-03-07 07:03:34", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -24,6 +24,7 @@
   "parentfield": "fields", 
   "parenttype": "DocType", 
   "permlevel": 0, 
+  "print_width": "200px", 
   "width": "200px"
  }, 
  {
diff --git a/stock/utils.py b/stock/utils.py
index 6fac0fd..9055cee 100644
--- a/stock/utils.py
+++ b/stock/utils.py
@@ -163,4 +163,37 @@
 			elif webnotes.session.user in warehouse_users:
 				wlist.append([w])
 	return wlist
-	
\ No newline at end of file
+
+def get_buying_amount(item_code, warehouse, qty, voucher_no, voucher_detail_no, 
+		stock_ledger_entries, item_sales_bom):
+	if item_sales_bom.get(item_code):
+		# sales bom item
+		buying_amount = 0.0
+		for bom_item in item_sales_bom[item_code]:
+			buying_amount += _get_buying_amount(voucher_no, "[** No Item Row **]",
+				item_code, warehouse, bom_item.qty * qty, stock_ledger_entries)
+		return buying_amount
+	else:
+		# doesn't have sales bom
+		return _get_buying_amount(voucher_no, voucher_detail_no, item_code, warehouse, qty, 
+			stock_ledger_entries)
+		
+def _get_buying_amount(voucher_no, item_row, item_code, warehouse, qty, stock_ledger_entries):
+	for i, sle in enumerate(stock_ledger_entries):
+		if sle.voucher_type == "Delivery Note" and sle.voucher_no == voucher_no:
+			if (sle.voucher_detail_no == item_row) or \
+				(sle.item_code == item_code and sle.warehouse == warehouse and \
+				abs(flt(sle.qty)) == qty):
+					buying_amount = flt(stock_ledger_entries[i+1].stock_value) - flt(sle.stock_value)
+
+					return buying_amount
+					
+	return 0.0
+
+def get_sales_bom():
+	item_sales_bom = {}
+	for r in webnotes.conn.sql("""select parent, item_code, qty from `tabSales BOM Item`""",
+	 	as_dict=1):
+			item_sales_bom.setdefault(r.parent, []).append(r)
+			
+	return item_sales_bom
\ No newline at end of file
diff --git a/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt b/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt
index ba30be4..0aa4d0d 100644
--- a/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt
+++ b/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:31", 
+  "creation": "2013-02-22 01:28:05", 
   "docstatus": 0, 
-  "modified": "2013-02-04 10:30:18", 
+  "modified": "2013-03-07 07:03:23", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -94,6 +94,7 @@
   "no_copy": 0, 
   "oldfieldname": "serial_no", 
   "oldfieldtype": "Small Text", 
+  "print_width": "160px", 
   "read_only": 1, 
   "search_index": 0, 
   "width": "160px"
diff --git a/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt b/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt
index 490eb72..3a95b2c 100644
--- a/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt
+++ b/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:31", 
+  "creation": "2013-02-22 01:28:05", 
   "docstatus": 0, 
-  "modified": "2013-01-22 14:47:03", 
+  "modified": "2013-03-07 07:03:24", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -53,6 +53,7 @@
   "label": "Description", 
   "oldfieldname": "description", 
   "oldfieldtype": "Data", 
+  "print_width": "300px", 
   "read_only": 1, 
   "width": "300px"
  }, 
@@ -126,6 +127,7 @@
   "oldfieldname": "prevdoc_docname", 
   "oldfieldtype": "Data", 
   "print_hide": 1, 
+  "print_width": "150px", 
   "read_only": 1, 
   "search_index": 1, 
   "width": "150px"
diff --git a/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt b/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt
index 131076c..694f871 100644
--- a/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt
+++ b/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-01-10 16:34:31", 
+  "creation": "2013-02-22 01:28:06", 
   "docstatus": 0, 
-  "modified": "2013-01-22 14:47:03", 
+  "modified": "2013-03-07 07:03:24", 
   "modified_by": "Administrator", 
   "owner": "ashwini@webnotestech.com"
  }, 
@@ -32,6 +32,7 @@
   "label": "Description", 
   "oldfieldname": "description", 
   "oldfieldtype": "Small Text", 
+  "print_width": "300px", 
   "reqd": 1, 
   "width": "300px"
  }, 
@@ -90,6 +91,7 @@
   "oldfieldname": "prevdoc_docname", 
   "oldfieldtype": "Data", 
   "print_hide": 1, 
+  "print_width": "160px", 
   "read_only": 1, 
   "report_hide": 1, 
   "width": "160px"
@@ -104,6 +106,7 @@
   "oldfieldname": "prevdoc_detail_docname", 
   "oldfieldtype": "Data", 
   "print_hide": 1, 
+  "print_width": "160px", 
   "read_only": 1, 
   "report_hide": 1, 
   "width": "160px"
@@ -118,6 +121,7 @@
   "oldfieldname": "prevdoc_doctype", 
   "oldfieldtype": "Data", 
   "print_hide": 1, 
+  "print_width": "150px", 
   "read_only": 1, 
   "report_hide": 1, 
   "width": "150px"
diff --git a/utilities/doctype/gl_mapper_detail/gl_mapper_detail.txt b/utilities/doctype/gl_mapper_detail/gl_mapper_detail.txt
index bd1ecd6..079a4a1 100644
--- a/utilities/doctype/gl_mapper_detail/gl_mapper_detail.txt
+++ b/utilities/doctype/gl_mapper_detail/gl_mapper_detail.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2012-03-27 14:36:46", 
+  "creation": "2013-02-22 01:28:07", 
   "docstatus": 0, 
-  "modified": "2012-03-27 14:36:46", 
+  "modified": "2013-03-07 07:03:21", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -11,10 +11,7 @@
   "doctype": "DocType", 
   "istable": 1, 
   "module": "Utilities", 
-  "name": "__common__", 
-  "section_style": "Tray", 
-  "show_in_menu": 0, 
-  "version": 4
+  "name": "__common__"
  }, 
  {
   "doctype": "DocField", 
diff --git a/utilities/doctype/sms_receiver/sms_receiver.txt b/utilities/doctype/sms_receiver/sms_receiver.txt
index 4e0831c..1075d21 100644
--- a/utilities/doctype/sms_receiver/sms_receiver.txt
+++ b/utilities/doctype/sms_receiver/sms_receiver.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2012-03-27 14:36:47", 
+  "creation": "2013-02-22 01:28:07", 
   "docstatus": 0, 
-  "modified": "2012-03-27 14:36:47", 
+  "modified": "2013-03-07 07:03:32", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -10,9 +10,7 @@
   "doctype": "DocType", 
   "istable": 1, 
   "module": "Utilities", 
-  "name": "__common__", 
-  "section_style": "Tray", 
-  "version": 2
+  "name": "__common__"
  }, 
  {
   "doctype": "DocField", 
@@ -39,6 +37,7 @@
   "fieldname": "receiver_name", 
   "label": "Receiver Name", 
   "oldfieldname": "receiver_name", 
+  "print_width": "350px", 
   "width": "350px"
  }, 
  {
@@ -46,6 +45,7 @@
   "fieldname": "mobile_no", 
   "label": "Mobile No", 
   "oldfieldname": "mobile_no", 
+  "print_width": "200px", 
   "reqd": 1, 
   "width": "200px"
  }
diff --git a/website/doctype/about_us_team_member/about_us_team_member.txt b/website/doctype/about_us_team_member/about_us_team_member.txt
index a68ddcf..ec77dd7 100644
--- a/website/doctype/about_us_team_member/about_us_team_member.txt
+++ b/website/doctype/about_us_team_member/about_us_team_member.txt
@@ -1,33 +1,34 @@
 [
  {
-  "owner": "Administrator", 
+  "creation": "2013-02-22 01:28:07", 
   "docstatus": 0, 
-  "creation": "2012-12-27 14:28:45", 
+  "modified": "2013-03-07 07:03:18", 
   "modified_by": "Administrator", 
-  "modified": "2012-12-27 14:49:44"
+  "owner": "Administrator"
  }, 
  {
-  "istable": 1, 
-  "name": "__common__", 
   "doctype": "DocType", 
-  "module": "Website"
+  "istable": 1, 
+  "module": "Website", 
+  "name": "__common__"
  }, 
  {
-  "parent": "About Us Team Member", 
   "doctype": "DocField", 
-  "name": "__common__", 
-  "label": "Employee", 
-  "width": "300px", 
-  "parenttype": "DocType", 
-  "options": "Employee", 
   "fieldname": "employee", 
   "fieldtype": "Link", 
+  "label": "Employee", 
+  "name": "__common__", 
+  "options": "Employee", 
+  "parent": "About Us Team Member", 
+  "parentfield": "fields", 
+  "parenttype": "DocType", 
   "permlevel": 0, 
-  "parentfield": "fields"
+  "print_width": "300px", 
+  "width": "300px"
  }, 
  {
-  "name": "About Us Team Member", 
-  "doctype": "DocType"
+  "doctype": "DocType", 
+  "name": "About Us Team Member"
  }, 
  {
   "doctype": "DocField"
diff --git a/website/doctype/company_history/company_history.txt b/website/doctype/company_history/company_history.txt
index 64fe6c2..544845d 100644
--- a/website/doctype/company_history/company_history.txt
+++ b/website/doctype/company_history/company_history.txt
@@ -1,40 +1,41 @@
 [
  {
-  "owner": "Administrator", 
+  "creation": "2013-02-22 01:28:08", 
   "docstatus": 0, 
-  "creation": "2012-12-27 14:25:38", 
+  "modified": "2013-03-07 07:03:19", 
   "modified_by": "Administrator", 
-  "modified": "2012-12-27 14:25:38"
+  "owner": "Administrator"
  }, 
  {
-  "istable": 1, 
-  "name": "__common__", 
   "doctype": "DocType", 
-  "module": "Website"
+  "istable": 1, 
+  "module": "Website", 
+  "name": "__common__"
  }, 
  {
+  "doctype": "DocField", 
   "name": "__common__", 
   "parent": "Company History", 
-  "doctype": "DocField", 
+  "parentfield": "fields", 
   "parenttype": "DocType", 
-  "permlevel": 0, 
-  "parentfield": "fields"
+  "permlevel": 0
  }, 
  {
-  "name": "Company History", 
-  "doctype": "DocType"
+  "doctype": "DocType", 
+  "name": "Company History"
  }, 
  {
   "doctype": "DocField", 
-  "label": "Year", 
   "fieldname": "year", 
-  "fieldtype": "Data"
+  "fieldtype": "Data", 
+  "label": "Year"
  }, 
  {
   "doctype": "DocField", 
-  "label": "Highlight", 
-  "width": "300px", 
   "fieldname": "highlight", 
-  "fieldtype": "Text"
+  "fieldtype": "Text", 
+  "label": "Highlight", 
+  "print_width": "300px", 
+  "width": "300px"
  }
 ]
\ No newline at end of file
diff --git a/website/doctype/related_page/related_page.txt b/website/doctype/related_page/related_page.txt
index a4a0983..2f21cbd 100644
--- a/website/doctype/related_page/related_page.txt
+++ b/website/doctype/related_page/related_page.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2012-03-27 14:36:48", 
+  "creation": "2013-02-22 01:28:08", 
   "docstatus": 0, 
-  "modified": "2012-03-27 14:36:48", 
+  "modified": "2013-03-07 07:03:30", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -10,10 +10,7 @@
   "doctype": "DocType", 
   "istable": 1, 
   "module": "Website", 
-  "name": "__common__", 
-  "section_style": "Simple", 
-  "show_in_menu": 0, 
-  "version": 3
+  "name": "__common__"
  }, 
  {
   "doctype": "DocField", 
diff --git a/website/doctype/top_bar_item/top_bar_item.txt b/website/doctype/top_bar_item/top_bar_item.txt
index bc78928..0076f7f 100644
--- a/website/doctype/top_bar_item/top_bar_item.txt
+++ b/website/doctype/top_bar_item/top_bar_item.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2012-04-02 16:02:43", 
+  "creation": "2013-02-22 01:28:08", 
   "docstatus": 0, 
-  "modified": "2012-05-07 15:21:00", 
+  "modified": "2013-03-07 07:03:34", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -10,10 +10,7 @@
   "doctype": "DocType", 
   "istable": 1, 
   "module": "Website", 
-  "name": "__common__", 
-  "section_style": "Simple", 
-  "show_in_menu": 0, 
-  "version": 1
+  "name": "__common__"
  }, 
  {
   "doctype": "DocField", 
@@ -32,6 +29,7 @@
   "fieldname": "label", 
   "fieldtype": "Data", 
   "label": "Label", 
+  "print_width": "120px", 
   "width": "120px"
  }, 
  {
@@ -39,6 +37,7 @@
   "fieldname": "url", 
   "fieldtype": "Data", 
   "label": "URL", 
+  "print_width": "200px", 
   "width": "200px"
  }, 
  {
diff --git a/website/doctype/website_item_group/website_item_group.txt b/website/doctype/website_item_group/website_item_group.txt
index 31c4c1f..0b64306 100644
--- a/website/doctype/website_item_group/website_item_group.txt
+++ b/website/doctype/website_item_group/website_item_group.txt
@@ -1,34 +1,34 @@
 [
  {
-  "owner": "Administrator", 
+  "creation": "2013-02-22 01:28:09", 
   "docstatus": 0, 
-  "creation": "2012-12-25 13:52:11", 
+  "modified": "2013-03-07 07:03:34", 
   "modified_by": "Administrator", 
-  "modified": "2012-12-25 13:52:11"
+  "owner": "Administrator"
  }, 
  {
-  "istable": 1, 
   "description": "Cross Listing of Item in multiple groups", 
   "doctype": "DocType", 
-  "module": "Website", 
   "document_type": "Other", 
+  "istable": 1, 
+  "module": "Website", 
   "name": "__common__"
  }, 
  {
-  "parent": "Website Item Group", 
   "doctype": "DocField", 
-  "name": "__common__", 
-  "label": "Item Group", 
-  "parenttype": "DocType", 
-  "options": "Item Group", 
   "fieldname": "item_group", 
   "fieldtype": "Link", 
-  "permlevel": 0, 
-  "parentfield": "fields"
+  "label": "Item Group", 
+  "name": "__common__", 
+  "options": "Item Group", 
+  "parent": "Website Item Group", 
+  "parentfield": "fields", 
+  "parenttype": "DocType", 
+  "permlevel": 0
  }, 
  {
-  "name": "Website Item Group", 
-  "doctype": "DocType"
+  "doctype": "DocType", 
+  "name": "Website Item Group"
  }, 
  {
   "doctype": "DocField"
diff --git a/website/doctype/website_product_category/website_product_category.txt b/website/doctype/website_product_category/website_product_category.txt
index 6625b47..d0b3db8 100644
--- a/website/doctype/website_product_category/website_product_category.txt
+++ b/website/doctype/website_product_category/website_product_category.txt
@@ -1,43 +1,43 @@
 [
  {
-  "owner": "Administrator", 
+  "creation": "2013-02-22 01:28:09", 
   "docstatus": 0, 
-  "creation": "2012-12-20 14:21:35", 
+  "modified": "2013-03-07 07:03:34", 
   "modified_by": "Administrator", 
-  "modified": "2012-12-20 15:00:25"
+  "owner": "Administrator"
  }, 
  {
-  "istable": 1, 
   "description": "Product Category for website", 
   "doctype": "DocType", 
-  "module": "Website", 
   "document_type": "Transaction", 
+  "istable": 1, 
+  "module": "Website", 
   "name": "__common__"
  }, 
  {
+  "doctype": "DocField", 
   "name": "__common__", 
   "parent": "Website Product Category", 
-  "doctype": "DocField", 
+  "parentfield": "fields", 
   "parenttype": "DocType", 
-  "permlevel": 0, 
-  "parentfield": "fields"
+  "permlevel": 0
  }, 
  {
-  "name": "Website Product Category", 
-  "doctype": "DocType"
+  "doctype": "DocType", 
+  "name": "Website Product Category"
  }, 
  {
   "doctype": "DocField", 
-  "label": "Item Group", 
   "fieldname": "item_group", 
   "fieldtype": "Link", 
+  "label": "Item Group", 
   "options": "Item Group"
  }, 
  {
   "doctype": "DocField", 
-  "label": "Indent", 
   "fieldname": "indent", 
   "fieldtype": "Select", 
+  "label": "Indent", 
   "options": "0\n1\n2\n3\n4\n5"
  }
 ]
\ No newline at end of file
diff --git a/website/doctype/website_slideshow_item/website_slideshow_item.txt b/website/doctype/website_slideshow_item/website_slideshow_item.txt
index d74005e..aa98745 100644
--- a/website/doctype/website_slideshow_item/website_slideshow_item.txt
+++ b/website/doctype/website_slideshow_item/website_slideshow_item.txt
@@ -1,59 +1,61 @@
 [
  {
-  "owner": "Administrator", 
+  "creation": "2013-02-22 01:28:09", 
   "docstatus": 0, 
-  "creation": "2012-12-25 16:48:49", 
+  "modified": "2013-03-07 07:03:34", 
   "modified_by": "Administrator", 
-  "modified": "2012-12-25 16:55:40"
+  "owner": "Administrator"
  }, 
  {
-  "istable": 1, 
   "allow_attach": 0, 
   "doctype": "DocType", 
-  "module": "Website", 
+  "istable": 1, 
   "max_attachments": 10, 
+  "module": "Website", 
   "name": "__common__"
  }, 
  {
+  "doctype": "DocField", 
   "name": "__common__", 
   "parent": "Website Slideshow Item", 
-  "doctype": "DocField", 
+  "parentfield": "fields", 
   "parenttype": "DocType", 
-  "permlevel": 0, 
-  "parentfield": "fields"
+  "permlevel": 0
  }, 
  {
-  "name": "Website Slideshow Item", 
-  "doctype": "DocType"
+  "doctype": "DocType", 
+  "name": "Website Slideshow Item"
  }, 
  {
   "doctype": "DocField", 
-  "label": "Image", 
   "fieldname": "image", 
   "fieldtype": "Select", 
+  "label": "Image", 
   "options": "attach_files:"
  }, 
  {
   "doctype": "DocField", 
-  "label": "Heading", 
-  "width": "200px", 
   "fieldname": "heading", 
-  "fieldtype": "Data"
+  "fieldtype": "Data", 
+  "label": "Heading", 
+  "print_width": "200px", 
+  "width": "200px"
  }, 
  {
   "doctype": "DocField", 
-  "label": "Description", 
-  "width": "200px", 
   "fieldname": "description", 
-  "fieldtype": "Text"
+  "fieldtype": "Text", 
+  "label": "Description", 
+  "print_width": "200px", 
+  "width": "200px"
  }, 
  {
-  "print_hide": 1, 
-  "no_copy": 1, 
   "doctype": "DocField", 
-  "label": "File List", 
   "fieldname": "file_list", 
   "fieldtype": "Text", 
-  "hidden": 1
+  "hidden": 1, 
+  "label": "File List", 
+  "no_copy": 1, 
+  "print_hide": 1
  }
 ]
\ No newline at end of file