[merge edge]
diff --git a/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt b/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt
index ac30346..68019cb 100644
--- a/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt
+++ b/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2013-02-22 01:27:39", 
   "docstatus": 0, 
-  "modified": "2013-03-07 07:03:23", 
+  "modified": "2013-04-17 14:05:18", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -58,6 +58,7 @@
   "options": "Company:company:default_currency"
  }, 
  {
+  "default": ":Company", 
   "doctype": "DocField", 
   "fieldname": "cost_center", 
   "fieldtype": "Link", 
diff --git a/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt b/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt
index 5e9daf7..e33ab7c 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-03-07 11:42:55", 
+  "creation": "2013-04-10 08:35:38", 
   "docstatus": 0, 
-  "modified": "2013-03-29 13:44:37", 
+  "modified": "2013-04-17 14:05:20", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -170,6 +170,7 @@
   "width": "120px"
  }, 
  {
+  "default": ":Company", 
   "doctype": "DocField", 
   "fieldname": "cost_center", 
   "fieldtype": "Link", 
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 b593b81..5767307 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-03-08 15:36:47", 
+  "creation": "2013-03-26 06:51:12", 
   "docstatus": 0, 
-  "modified": "2013-03-22 16:45:28", 
+  "modified": "2013-04-17 14:05:19", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -58,6 +58,7 @@
   "reqd": 1
  }, 
  {
+  "default": ":Company", 
   "doctype": "DocField", 
   "fieldname": "cost_center", 
   "fieldtype": "Link", 
diff --git a/accounts/doctype/sales_invoice_item/sales_invoice_item.txt b/accounts/doctype/sales_invoice_item/sales_invoice_item.txt
index 98962b5..2a6384d 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-03-29 18:21:58", 
+  "creation": "2013-04-10 08:35:44", 
   "docstatus": 0, 
-  "modified": "2013-03-29 19:32:32", 
+  "modified": "2013-04-17 14:05:20", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -219,6 +219,7 @@
   "width": "120px"
  }, 
  {
+  "default": ":Company", 
   "doctype": "DocField", 
   "fieldname": "cost_center", 
   "fieldtype": "Link", 
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 3b32524..161eb00 100644
--- a/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt
+++ b/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2013-02-22 01:27:41", 
   "docstatus": 0, 
-  "modified": "2013-03-07 07:03:31", 
+  "modified": "2013-04-17 14:05:18", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -48,6 +48,7 @@
   "search_index": 1
  }, 
  {
+  "default": ":Company", 
   "doctype": "DocField", 
   "fieldname": "cost_center_other_charges", 
   "fieldtype": "Link", 
diff --git a/accounts/page/accounts_browser/accounts_browser.html b/accounts/page/accounts_browser/accounts_browser.html
index 91a1e26..ab487d2 100644
--- a/accounts/page/accounts_browser/accounts_browser.html
+++ b/accounts/page/accounts_browser/accounts_browser.html
@@ -1,4 +1,4 @@
-<div class="layout-wrapper layout-wrapper-background">
+<div class="appframe span12">
 	<div class="appframe-area"></div>
 	<div class="layout-main">
 		<div class="tree-area"></div>
diff --git a/accounts/page/financial_statements/financial_statements.html b/accounts/page/financial_statements/financial_statements.html
index e6735fa..1a11950 100644
--- a/accounts/page/financial_statements/financial_statements.html
+++ b/accounts/page/financial_statements/financial_statements.html
@@ -1,28 +1,5 @@
-<div class="layout_wrapper">
+<div class="appframe span12">
 <div id="fs_header"></div>
-<!--  table.statement td {    vertical-align: middle;  }  table.statement td select {    width: 100px;  }  table.stmt_table {    table-layout: fixed;    border-collapse: collapse;  }  table.stmt_table td {    vertical-align: middle;    padding: 2px;  }  td.stmt_level0 {    font-weight: bold;    font-size: 14px;    border-bottom: 1px solid #AAA;  }  td.stmt_level1 {    font-weight: bold;    font-size: 12px;  }  td.stmt_level2 {    font-size: 11px;  }  td.stmt_level3 {    font-size: 11px;  }  td.stmt_level4 {    font-size: 12px;    font-weight: bold;    border-bottom: 1px solid #000;  }  td.stmt_level5 {    color: BLUE;    font-size: 11px;  }  --> <!--
-<div style="border: 1px solid #cccccc; padding: 4px; margin-top: 8px; background-color: #eeeeee; width: 98%;">
-<table class="statement" border="0" cellspacing="2px">
-<tbody>
-<tr>
-<td>Statement:</td>
-<td style="padding-right: 8px;" mce_style="padding-right: 8px;"><select id="stmt_type"></select></td>
-<td>Company:</td>
-<td style="padding-right: 8px;" mce_style="padding-right: 8px;"><select id="stmt_company"></select></td>
-<td>Period Type:</td>
-<td style="padding-right: 8px;" mce_style="padding-right: 8px;"><select id="stmt_period"></select></td>
-<td>Fiscal Year:</td>
-<td style="padding-right: 8px;" mce_style="padding-right: 8px;"><select id="stmt_fiscal_year"></select></td>
-<td style="padding-right: 8px;" mce_style="padding-right: 8px;">
-<div id="stmt_new"></div>
-</td>
-</tr>
-</tbody>
-</table>
-</div>
---> <!--
-<div style="margin:10px 0px 10px 0px" mce_style="margin:10px 0px 10px 0px"><button class="button" onclick="pscript.print_statement();">Print</button></div>
--->
 <div id="print_html">
 	<div id="stmt_title1" style="margin:16px 0px 4px 0px; font-size: 16px; font-weight: bold; color: #888;"></div>
 	<div id="stmt_title2" style="margin:0px 0px 8px 0px; font-size: 16px; font-weight: bold;"></div>
diff --git a/home/page/activity/activity.html b/home/page/activity/activity.html
index 9fb910c..63695df 100644
--- a/home/page/activity/activity.html
+++ b/home/page/activity/activity.html
@@ -1,4 +1,4 @@
-<div class="layout-wrapper layout-wrapper-appframe">
+<div class="appframe span12">
 	<div class="layout-appframe"></div>
 	<div class="layout-main">
 		<div id="activity-list">
diff --git a/home/page/attributions/attributions.html b/home/page/attributions/attributions.html
index 2d08c79..f614bb1 100644
--- a/home/page/attributions/attributions.html
+++ b/home/page/attributions/attributions.html
@@ -1,4 +1,4 @@
-<div class="layout-wrapper layout-wrapper-appframe layout-attributions">
+<div class="appframe span12 layout-attributions">
 	<div class="layout-appframe"></div>
 	<div class="layout-main">
 	<h3>ERPNext is made using these Awesome Open Source Projects <i class="icon-heart" style="color: red"></i></h3>
diff --git a/home/page/latest_updates/latest_updates.js b/home/page/latest_updates/latest_updates.js
index 1e35a92..80571c1 100644
--- a/home/page/latest_updates/latest_updates.js
+++ b/home/page/latest_updates/latest_updates.js
@@ -1,6 +1,6 @@
 erpnext.updates = [
-	["10th April", ["Redesigned File Uploads and added File Manager in Setup"]],
 	["12th April", ["Employee: List of Leave Approvers who can approve the Employee's Leave Applications"]],
+	["10th April", ["Redesigned File Uploads and added File Manager in Setup"]],
 	["27th March", ["Rename multiple items together. Go to Setup > Rename Tool"]],
 	["26th March", ["Added project to Stock Ledger and Balance",
 		"Added Default Cash Account in Company."]],
diff --git a/hr/doctype/job_applicant/job_applicant.js b/hr/doctype/job_applicant/job_applicant.js
index c301250..220ff18 100644
--- a/hr/doctype/job_applicant/job_applicant.js
+++ b/hr/doctype/job_applicant/job_applicant.js
@@ -3,7 +3,7 @@
 cur_frm.cscript = {
 	onload: function(doc, dt, dn) {
 		if(in_list(user_roles,'System Manager')) {
-			cur_frm.page_layout.footer.help_area.innerHTML = '<hr>\
+			cur_frm.footer.help_area.innerHTML = '<hr>\
 				<p><a href="#Form/Jobs Email Settings">Jobs Email Settings</a><br>\
 				<span class="help">Automatically extract Job Applicants from a mail box e.g. "jobs@example.com"</span></p>';
 		}
diff --git a/patches/patch_list.py b/patches/patch_list.py
index b9566d9..698b062 100644
--- a/patches/patch_list.py
+++ b/patches/patch_list.py
@@ -231,7 +231,6 @@
 	"patches.march_2013.p12_set_item_tax_rate_in_json",
 	"patches.march_2013.p07_update_valuation_rate",
 	"patches.march_2013.p08_create_aii_accounts",
-	# "patches.march_2013.p03_update_buying_amount",
 	"patches.april_2013.p01_update_serial_no_valuation_rate",
 	"patches.april_2013.p02_add_country_and_currency",
 	"patches.april_2013.p03_fixes_for_lead_in_quotation",
@@ -244,5 +243,5 @@
 	"patches.april_2013.p05_update_file_data",
 	"patches.april_2013.p06_update_file_size",
 	"patches.april_2013.p05_fixes_in_reverse_modules",
-	"execute:webnotes.reload_doc('stock', 'DocType Mapper', 'Delivery Note-Packing Slip')"
+	"execute:webnotes.delete_doc('DocType Mapper', 'Delivery Note-Packing Slip')"
 ]
\ No newline at end of file
diff --git a/public/js/startup.css b/public/js/startup.css
index 88ebedd..bfcbe84 100644
--- a/public/js/startup.css
+++ b/public/js/startup.css
@@ -4,7 +4,6 @@
 
 body {
 	font-family: Arial, Helvetica, sans-serif;
-	font-size: 13px;
 }
 
 span, div, td, input, textarea, button, select {
diff --git a/selling/doctype/lead/lead.js b/selling/doctype/lead/lead.js
index d8d322d..0d30674 100644
--- a/selling/doctype/lead/lead.js
+++ b/selling/doctype/lead/lead.js
@@ -50,7 +50,7 @@
 	}
 
 	if(in_list(user_roles,'System Manager')) {
-		cur_frm.page_layout.footer.help_area.innerHTML = '<hr>\
+		cur_frm.footer.help_area.innerHTML = '<hr>\
 			<p><a href="#Form/Sales Email Settings">Sales Email Settings</a><br>\
 			<span class="help">Automatically extract Leads from a mail box e.g. "sales@example.com"</span></p>';
 	}
diff --git a/selling/page/sales_browser/sales_browser.html b/selling/page/sales_browser/sales_browser.html
index 4683a07..08eb9f9 100644
--- a/selling/page/sales_browser/sales_browser.html
+++ b/selling/page/sales_browser/sales_browser.html
@@ -1,4 +1,4 @@
-<div class="layout-wrapper layout-wrapper-background">
+<div class="appframe span12">
 	<div class="appframe-area"></div>
 	<div class="layout-main-section">
 		<div class="tree-area"></div>
diff --git a/setup/doctype/company/company.py b/setup/doctype/company/company.py
index 964b886..78be538 100644
--- a/setup/doctype/company/company.py
+++ b/setup/doctype/company/company.py
@@ -245,6 +245,9 @@
 		for cc in cc_list:
 			add_cc(cc)
 			
+		webnotes.conn.set_value("Company", self.doc.name, "cost_center",
+			"Default CC Ledger - " + self.doc.abbr)
+			
 	def on_update(self):
 		self.set_letter_head()
 
diff --git a/setup/doctype/company/company.txt b/setup/doctype/company/company.txt
index a49a7e0..c4176d8 100644
--- a/setup/doctype/company/company.txt
+++ b/setup/doctype/company/company.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-03-26 11:03:08", 
+  "creation": "2013-04-10 08:35:39", 
   "docstatus": 0, 
-  "modified": "2013-03-28 16:04:27", 
+  "modified": "2013-04-17 14:07:46", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -142,6 +142,15 @@
   "read_only": 0
  }, 
  {
+  "depends_on": "eval:!doc.__islocal", 
+  "doctype": "DocField", 
+  "fieldname": "cost_center", 
+  "fieldtype": "Link", 
+  "label": "Cost Center", 
+  "no_copy": 1, 
+  "options": "Cost Center"
+ }, 
+ {
   "doctype": "DocField", 
   "fieldname": "column_break0", 
   "fieldtype": "Column Break", 
diff --git a/startup/boot.py b/startup/boot.py
index 4774a90..9ed20ff 100644
--- a/startup/boot.py
+++ b/startup/boot.py
@@ -36,7 +36,8 @@
 		for key in ['max_users', 'expires_on', 'max_space', 'status', 'developer_mode']:
 			if hasattr(conf, key): bootinfo[key] = getattr(conf, key)
 
-		bootinfo['docs'] += webnotes.conn.sql("select name, default_currency from `tabCompany`", 
+		bootinfo['docs'] += webnotes.conn.sql("""select name, default_currency, cost_center,
+			cost_center as 'cost_center_other_charges' from `tabCompany`""", 
 			as_dict=1, update={"doctype":":Company"})
 			
 def get_letter_heads():
diff --git a/stock/doctype/delivery_note/delivery_note.js b/stock/doctype/delivery_note/delivery_note.js
index f47040d..8d09cbd 100644
--- a/stock/doctype/delivery_note/delivery_note.js
+++ b/stock/doctype/delivery_note/delivery_note.js
@@ -158,7 +158,6 @@
 }
 
 
-// ****************************** DELIVERY TYPE ************************************
 cur_frm.cscript.delivery_type = function(doc, cdt, cdn) {
 	if (doc.delivery_type = 'Sample') cfn_set_fields(doc, cdt, cdn);
 }
@@ -185,7 +184,6 @@
 	return 'SELECT DISTINCT `tabSupplier`.`name` FROM `tabSupplier` WHERE `tabSupplier`.supplier_type = "transporter" AND `tabSupplier`.docstatus != 2 AND `tabSupplier`.%(key)s LIKE "%s" ORDER BY `tabSupplier`.`name` LIMIT 50';
 }
 
-//-----------------------------------Make Sales Invoice----------------------------------------------
 cur_frm.cscript['Make Sales Invoice'] = function() {
 	var doc = cur_frm.doc
 	n = wn.model.make_new_doc_and_get_name('Sales Invoice');
@@ -201,7 +199,6 @@
 	);
 }
 
-//-----------------------------------Make Installation Note----------------------------------------------
 cur_frm.cscript['Make Installation Note'] = function() {
 	var doc = cur_frm.doc;
 	if(doc.per_installed < 99.99){
@@ -221,31 +218,19 @@
 		msgprint("Item installation is already completed")
 }
 
-//-----------------------------------Make Sales Invoice----------------------------------------------
 cur_frm.cscript['Make Packing Slip'] = function() {
-	var doc = cur_frm.doc
 	n = wn.model.make_new_doc_and_get_name('Packing Slip');
-	$c('dt_map', args={
-		'docs':wn.model.compress([locals['Packing Slip'][n]]),
-		'from_doctype':doc.doctype,
-		'to_doctype':'Packing Slip',
-		'from_docname':doc.name,
-		'from_to_list':"[['Delivery Note','Packing Slip'],['Delivery Note Item','Packing Slip Item']]"
-		}, function(r,rt) {
-			 loaddoc('Packing Slip', n);
-		}
-	);
+	ps = locals["Packing Slip"][n];
+	ps.delivery_note = cur_frm.doc.name;
+	loaddoc('Packing Slip', n);
 }
 
 
 //get query select Territory
-//=======================================================================================================================
 cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
 	return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s"	ORDER BY	`tabTerritory`.`name` ASC LIMIT 50';
 }
 
-//------------------------for printing without amount----------
-
 var set_print_hide= function(doc, cdt, cdn){
 	var dn_fields = wn.meta.docfield_map['Delivery Note'];
 	var dn_item_fields = wn.meta.docfield_map['Delivery Note Item'];
diff --git a/stock/doctype/delivery_note/delivery_note.py b/stock/doctype/delivery_note/delivery_note.py
index 0019698..15e24ef 100644
--- a/stock/doctype/delivery_note/delivery_note.py
+++ b/stock/doctype/delivery_note/delivery_note.py
@@ -20,7 +20,7 @@
 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
+from webnotes import msgprint, _
 import webnotes.defaults
 
 
@@ -333,17 +333,15 @@
 		"""
 			Cancel submitted packing slips related to this delivery note
 		"""
-		res = webnotes.conn.sql("""\
-			SELECT name, count(*) FROM `tabPacking Slip`
-			WHERE delivery_note = %s AND docstatus = 1
-			""", self.doc.name)
+		res = webnotes.conn.sql("""SELECT name FROM `tabPacking Slip` WHERE delivery_note = %s 
+			AND docstatus = 1""", self.doc.name)
 
-		if res and res[0][1]>0:
+		if res:
 			from webnotes.model.bean import Bean
 			for r in res:
 				ps = Bean(dt='Packing Slip', dn=r[0])
 				ps.cancel()
-			webnotes.msgprint("%s Packing Slip(s) Cancelled" % res[0][1])
+			webnotes.msgprint(_("Packing Slip(s) Cancelled"))
 
 
 	def update_stock_ledger(self, update_stock):
@@ -421,4 +419,4 @@
 				
 		if gl_entries:
 			from accounts.general_ledger import make_gl_entries
-			make_gl_entries(gl_entries)
+			make_gl_entries(gl_entries)
\ No newline at end of file
diff --git a/stock/doctype/delivery_note_item/delivery_note_item.txt b/stock/doctype/delivery_note_item/delivery_note_item.txt
index fb3dd41..1073f0c 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-03-26 11:03:09", 
+  "creation": "2013-04-01 10:49:21", 
   "docstatus": 0, 
-  "modified": "2013-03-28 15:42:41", 
+  "modified": "2013-04-17 17:20:58", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -257,6 +257,7 @@
   "width": "120px"
  }, 
  {
+  "default": ":Company", 
   "doctype": "DocField", 
   "fieldname": "cost_center", 
   "fieldtype": "Link", 
@@ -333,17 +334,6 @@
   "width": "150px"
  }, 
  {
-  "allow_on_submit": 1, 
-  "default": "0", 
-  "doctype": "DocField", 
-  "fieldname": "packed_qty", 
-  "fieldtype": "Float", 
-  "label": "Packed Quantity", 
-  "no_copy": 1, 
-  "print_hide": 1, 
-  "read_only": 1
- }, 
- {
   "doctype": "DocField", 
   "fieldname": "prevdoc_doctype", 
   "fieldtype": "Data", 
diff --git a/stock/doctype/packing_slip/packing_slip.js b/stock/doctype/packing_slip/packing_slip.js
index 5ece164..18a2486 100644
--- a/stock/doctype/packing_slip/packing_slip.js
+++ b/stock/doctype/packing_slip/packing_slip.js
@@ -23,52 +23,36 @@
 		function(doc, cdt, cdn) {
 	var query = 'SELECT name, item_name, description FROM `tabItem` WHERE name IN ( \
 		SELECT item_code FROM `tabDelivery Note Item` dnd \
-		WHERE parent="'	+ doc.delivery_note + '" AND IFNULL(qty, 0) > IFNULL(packed_qty, 0)) AND %(key)s LIKE "%s" LIMIT 50';
+		WHERE parent="'	+ doc.delivery_note + '" AND IFNULL(qty, 0) > IFNULL(packed_qty, 0)) \
+		AND %(key)s LIKE "%s" LIMIT 50';
 	return query;
 }
 
-
-// Fetch item details
-cur_frm.add_fetch("item_code", "item_name", "item_name");
-cur_frm.add_fetch("item_code", "stock_uom", "stock_uom");
-cur_frm.add_fetch("item_code", "net_weight", "net_weight");
-cur_frm.add_fetch("item_code", "weight_uom", "weight_uom");
-
 cur_frm.cscript.onload_post_render = function(doc, cdt, cdn) {
 	if(doc.delivery_note && doc.__islocal) {
-		var ps_detail = getchildren('Packing Slip Item', doc.name, 'item_details');
-		if(!(flt(ps_detail.net_weight) && cstr(ps_detail.weight_uom))) {
-			cur_frm.cscript.update_item_details(doc);
-		}
+			cur_frm.cscript.get_items(doc, cdt, cdn);
 	}
 }
 
-cur_frm.cscript.refresh = function(doc, dt, dn) {
-	if(!doc.amended_from) {
-		hide_field('misc_details');
-	} else {
-		unhide_field('misc_details');
-	}
-}
-
-
-cur_frm.cscript.update_item_details = function(doc) {
-	$c_obj(make_doclist(doc.doctype, doc.name), 'update_item_details', '', function(r, rt) {
-		if(r.exc) {
-			msgprint(r.exc);
-		} else {
-			refresh_many(['item_details', 'naming_series', 'from_case_no', 'to_case_no'])
+cur_frm.cscript.get_items = function(doc, cdt, cdn) {
+	this.frm.call({
+		doc: this.frm.doc,
+		method: "get_items",
+		callback: function(r) {
+			if(!r.exc) cur_frm.refresh();
 		}
 	});
 }
 
+cur_frm.cscript.refresh = function(doc, dt, dn) {
+	cur_frm.toggle_display("misc_details", doc.amended_from);
+}
 
 cur_frm.cscript.validate = function(doc, cdt, cdn) {
 	cur_frm.cscript.validate_case_nos(doc);
 	cur_frm.cscript.validate_calculate_item_details(doc);
 }
 
-
 // To Case No. cannot be less than From Case No.
 cur_frm.cscript.validate_case_nos = function(doc) {
 	doc = locals[doc.doctype][doc.name];
@@ -99,7 +83,7 @@
 cur_frm.cscript.validate_duplicate_items = function(doc, ps_detail) {
 	for(var i=0; i<ps_detail.length; i++) {
 		for(var j=0; j<ps_detail.length; j++) {
-			if(i!=j && ps_detail[i].dn_detail && ps_detail[i].dn_detail==ps_detail[j].dn_detail) {
+			if(i!=j && ps_detail[i].item_code && ps_detail[i].item_code==ps_detail[j].item_code) {
 				msgprint("You have entered duplicate items. Please rectify and try again.");
 				validated = false;
 				return;
diff --git a/stock/doctype/packing_slip/packing_slip.py b/stock/doctype/packing_slip/packing_slip.py
index 2632199..1375108 100644
--- a/stock/doctype/packing_slip/packing_slip.py
+++ b/stock/doctype/packing_slip/packing_slip.py
@@ -16,13 +16,14 @@
 
 from __future__ import unicode_literals
 import webnotes
-from webnotes.utils import flt, cint, now
+from webnotes.utils import flt, cint
+from webnotes import msgprint, _
+from webnotes.model.doc import addchild
 
 class DocType:
 	def __init__(self, d, dl):
 		self.doc, self.doclist = d, dl
 
-
 	def validate(self):
 		"""
 			* Validate existence of submitted Delivery Note
@@ -32,48 +33,48 @@
 			It is necessary to validate case nos before checking quantity
 		"""
 		self.validate_delivery_note()
+		self.validate_items_mandatory()
 		self.validate_case_nos()
 		self.validate_qty()
 
-
 	def validate_delivery_note(self):
 		"""
-			Validates if delivery note has status as submitted
+			Validates if delivery note has status as draft
 		"""
-		res = webnotes.conn.sql("""SELECT docstatus FROM `tabDelivery Note` 
-			WHERE name=%(delivery_note)s""", self.doc.fields)
-
-		if not(res and res[0][0]==0):
-			webnotes.msgprint("""Invalid Delivery Note. Delivery Note should exist 
-				and should be in draft state. Please rectify and try again.""", raise_exception=1)
-
+		if cint(webnotes.conn.get_value("Delivery Note", self.doc.delivery_note, "docstatus")) != 0:
+			msgprint(_("""Invalid Delivery Note. Delivery Note should exist and should be in 
+				draft state. Please rectify and try again."""), raise_exception=1)
+	
+	def validate_items_mandatory(self):
+		rows = [d.item_code for d in self.doclist.get({"parentfield": "item_details"})]
+		if not rows:
+			webnotes.msgprint(_("No Items to Pack"), raise_exception=1)
 
 	def validate_case_nos(self):
 		"""
-			Validate if case nos overlap
-			If they do, recommend next case no.
+			Validate if case nos overlap. If they do, recommend next case no.
 		"""
 		if not cint(self.doc.from_case_no):
-			webnotes.msgprint("Please specify a valid 'From Case No.'", raise_exception=1)
+			webnotes.msgprint(_("Please specify a valid 'From Case No.'"), raise_exception=1)
 		elif not self.doc.to_case_no:
 			self.doc.to_case_no = self.doc.from_case_no
 		elif self.doc.from_case_no > self.doc.to_case_no:
-			webnotes.msgprint("'To Case No.' cannot be less than 'From Case No.'",
+			webnotes.msgprint(_("'To Case No.' cannot be less than 'From Case No.'"),
 				raise_exception=1)
 		
 		
 		res = webnotes.conn.sql("""SELECT name FROM `tabPacking Slip`
 			WHERE delivery_note = %(delivery_note)s AND docstatus = 1 AND
 			(from_case_no BETWEEN %(from_case_no)s AND %(to_case_no)s
-			OR to_case_no BETWEEN %(from_case_no)s AND %(to_case_no)s)
+			OR to_case_no BETWEEN %(from_case_no)s AND %(to_case_no)s
+			OR %(from_case_no)s BETWEEN from_case_no AND to_case_no)
 			""", self.doc.fields)
 
 		if res:
-			webnotes.msgprint("""Case No(s). already in use. Please rectify and try again.
-				Recommended <b>From Case No. = %s</b>""" % self.get_recommended_case_no(),
+			webnotes.msgprint(_("""Case No(s) already in use. Please rectify and try again.
+				Recommended <b>From Case No. = %s</b>""") % self.get_recommended_case_no(),
 				raise_exception=1)
 
-
 	def validate_qty(self):
 		"""
 			Check packed qty across packing slips and delivery note
@@ -82,8 +83,9 @@
 		dn_details, ps_item_qty, no_of_cases = self.get_details_for_packing()
 
 		for item in dn_details:
-			new_packed_qty = (flt(ps_item_qty[item['item_code']]) * no_of_cases) + flt(item['packed_qty'])
-			if new_packed_qty > flt(item['qty']):
+			new_packed_qty = (flt(ps_item_qty[item['item_code']]) * no_of_cases) + \
+			 	flt(item['packed_qty'])
+			if new_packed_qty > flt(item['qty']) and no_of_cases:
 				self.recommend_new_qty(item, ps_item_qty, no_of_cases)
 
 
@@ -95,26 +97,25 @@
 			* No. of Cases of this packing slip
 		"""
 		
-		items = [d.item_code for d in self.doclist.get({"parentfield": "item_details"})]
+		rows = [d.item_code for d in self.doclist.get({"parentfield": "item_details"})]
 		
-		if not items: webnotes.msgprint("No Items to Pack",
-				raise_exception=1)
+		condition = ""
+		if rows:
+			condition = " and item_code in (%s)" % (", ".join(["%s"]*len(rows)))
 		
 		# gets item code, qty per item code, latest packed qty per item code and stock uom
 		res = webnotes.conn.sql("""select item_code, ifnull(sum(qty), 0) as qty,
 			(select sum(ifnull(psi.qty, 0) * (abs(ps.to_case_no - ps.from_case_no) + 1))
 				from `tabPacking Slip` ps, `tabPacking Slip Item` psi
 				where ps.name = psi.parent and ps.docstatus = 1
-				and ps.delivery_note = dni.parent and psi.item_code=dni.item_code)
-					as packed_qty,
-			stock_uom
+				and ps.delivery_note = dni.parent and psi.item_code=dni.item_code) as packed_qty,
+			stock_uom, item_name
 			from `tabDelivery Note Item` dni
-			where parent=%s and item_code in (%s)
-			group by item_code""" % ("%s", ", ".join(["%s"]*len(items))),
-			tuple([self.doc.delivery_note] + items), as_dict=1)
-			
-		ps_item_qty = dict([[d.item_code, d.qty] for d in self.doclist])
+			where parent=%s %s 
+			group by item_code""" % ("%s", condition),
+			tuple([self.doc.delivery_note] + rows), as_dict=1)
 
+		ps_item_qty = dict([[d.item_code, d.qty] for d in self.doclist])
 		no_of_cases = cint(self.doc.to_case_no) - cint(self.doc.from_case_no) + 1
 
 		return res, ps_item_qty, no_of_cases
@@ -134,45 +135,6 @@
 			<b>Recommended quantity for %(item_code)s = %(recommended_qty)s 
 			%(stock_uom)s</b>""" % item, raise_exception=1)
 
-
-	def on_submit(self):
-		"""
-			* Update packed qty for all items
-		"""
-		self.update_packed_qty(event='submit')
-
-
-	def on_cancel(self):
-		"""
-			* Update packed qty for all items
-		"""
-		self.update_packed_qty(event='cancel')
-
-
-	def update_packed_qty(self, event=''):
-		"""
-			Updates packed qty for all items
-		"""
-		if event not in ['submit', 'cancel']:
-			raise Exception('update_packed_quantity can only be called on submit or cancel')
-
-		# Get Delivery Note Items, Item Quantity Dict and No. of Cases for this Packing slip
-		dn_details, ps_item_qty, no_of_cases = self.get_details_for_packing()
-
-		for item in dn_details:
-			new_packed_qty = flt(item['packed_qty'])
-			if (new_packed_qty < 0) or (new_packed_qty > flt(item['qty'])):
-				webnotes.msgprint("""Invalid new packed quantity for item %s. 
-					Please try again or contact support@erpnext.com""" % 
-					item['item_code'], raise_exception=1)
-			
-			webnotes.conn.sql("""UPDATE `tabDelivery Note Item`
-				SET packed_qty = %s WHERE parent = %s AND item_code = %s""",
-				(new_packed_qty, self.doc.delivery_note, item['item_code']))
-				
-			webnotes.conn.set_value("Delivery Note", self.doc.delivery_note, "modified", now())
-
-
 	def update_item_details(self):
 		"""
 			Fill empty columns in Packing Slip Item
@@ -181,17 +143,12 @@
 			self.doc.from_case_no = self.get_recommended_case_no()
 
 		for d in self.doclist.get({"parentfield": "item_details"}):
-			self.set_item_details(d)
-
-
-	def set_item_details(self, row):
-		res = webnotes.conn.sql("""SELECT net_weight, weight_uom FROM `tabItem`
-			WHERE name=%s""", row.item_code, as_dict=1)
+			res = webnotes.conn.get_value("Item", d.item_code, 
+				["net_weight", "weight_uom"], as_dict=True)
 			
-		if res and len(res)>0:
-			row.net_weight = res[0]["net_weight"]
-			row.weight_uom = res[0]["weight_uom"]
-
+			if res and len(res)>0:
+				d.net_weight = res["net_weight"]
+				d.weight_uom = res["weight_uom"]
 
 	def get_recommended_case_no(self):
 		"""
@@ -200,5 +157,18 @@
 		"""
 		recommended_case_no = webnotes.conn.sql("""SELECT MAX(to_case_no) FROM `tabPacking Slip`
 			WHERE delivery_note = %(delivery_note)s AND docstatus=1""", self.doc.fields)
-
-		return cint(recommended_case_no[0][0]) + 1
\ No newline at end of file
+		
+		return cint(recommended_case_no[0][0]) + 1
+		
+	def get_items(self):
+		self.doclist = self.doc.clear_table(self.doclist, "item_details", 1)
+		
+		dn_details = self.get_details_for_packing()[0]
+		for item in dn_details:
+			if flt(item.qty) > flt(item.packed_qty):
+				ch = addchild(self.doc, 'item_details', 'Packing Slip Item', self.doclist)
+				ch.item_code = item.item_code
+				ch.item_name = item.item_name
+				ch.stock_uom = item.stock_uom
+				ch.qty = flt(item.qty) - flt(item.packed_qty)
+		self.update_item_details()
\ No newline at end of file
diff --git a/stock/doctype/packing_slip/packing_slip.txt b/stock/doctype/packing_slip/packing_slip.txt
index 32ac16b..f13b971 100644
--- a/stock/doctype/packing_slip/packing_slip.txt
+++ b/stock/doctype/packing_slip/packing_slip.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-03-07 18:50:31", 
+  "creation": "2013-04-11 15:32:24", 
   "docstatus": 0, 
-  "modified": "2013-04-05 15:40:59", 
+  "modified": "2013-04-16 17:33:38", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -132,6 +132,12 @@
  }, 
  {
   "doctype": "DocField", 
+  "fieldname": "get_items", 
+  "fieldtype": "Button", 
+  "label": "Get Items"
+ }, 
+ {
+  "doctype": "DocField", 
   "fieldname": "item_details", 
   "fieldtype": "Table", 
   "label": "Items", 
diff --git a/stock/doctype/stock_ledger/stock_ledger.py b/stock/doctype/stock_ledger/stock_ledger.py
index 469c94b..3c83de3 100644
--- a/stock/doctype/stock_ledger/stock_ledger.py
+++ b/stock/doctype/stock_ledger/stock_ledger.py
@@ -84,7 +84,6 @@
 		item_details = webnotes.conn.sql("""select item_group, warranty_period 
 			from `tabItem` where name = '%s' and (ifnull(end_of_life,'')='' or 
 			end_of_life = '0000-00-00' or end_of_life > now()) """ %(d.item_code), as_dict=1)
-		webnotes.errprint([d.item_code, d.valuation_rate])
 		
 		s.purchase_document_type	=	obj.doc.doctype
 		s.purchase_document_no		=	obj.doc.name
diff --git a/support/doctype/support_ticket/support_ticket.js b/support/doctype/support_ticket/support_ticket.js
index 3da81d9..4d59f42 100644
--- a/support/doctype/support_ticket/support_ticket.js
+++ b/support/doctype/support_ticket/support_ticket.js
@@ -19,7 +19,7 @@
 $.extend(cur_frm.cscript, {
 	onload: function(doc, dt, dn) {
 		if(in_list(user_roles,'System Manager')) {
-			cur_frm.page_layout.footer.help_area.innerHTML = '<hr>\
+			cur_frm.footer.help_area.innerHTML = '<hr>\
 				<p><a href="#Form/Email Settings/Email Settings">Email Settings</a><br>\
 				<span class="help">Integrate incoming support emails to Support Ticket</span></p>';
 		}
diff --git a/utilities/page/markdown_reference/markdown_reference.html b/utilities/page/markdown_reference/markdown_reference.html
index cdf646c..b9e4c6e 100644
--- a/utilities/page/markdown_reference/markdown_reference.html
+++ b/utilities/page/markdown_reference/markdown_reference.html
@@ -1,4 +1,4 @@
-<div class="layout-wrapper layout-wrapper-background">
+<div class="appframe span12">
 	<div class="layout-appframe">
 		<div class="appframe-titlebar">
 			<span class="appframe-title">Markdown Reference</span>
diff --git a/utilities/page/question_view/question_view.html b/utilities/page/question_view/question_view.html
index b091d95..f5f8eb4 100644
--- a/utilities/page/question_view/question_view.html
+++ b/utilities/page/question_view/question_view.html
@@ -1,4 +1,4 @@
-<div class="layout-wrapper layout-wrapper-appframe">
+<div class="appframe span12">
 	<div class="layout-appframe"></div>
 	<div class="layout-main" style="min-height: 400px">
 		<div class="qv-question-wrapper">
diff --git a/utilities/page/questions/questions.html b/utilities/page/questions/questions.html
index bec483e..3138e9c 100644
--- a/utilities/page/questions/questions.html
+++ b/utilities/page/questions/questions.html
@@ -1,4 +1,4 @@
-<div class="layout-wrapper layout-wrapper-background">
+<div class="appframe span12">
 	<div class="layout-appframe"></div>
 	<div class="layout-main-section">
 		<div class="kb-search-wrapper">
diff --git a/utilities/page/trash/__init__.py b/utilities/page/trash/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/utilities/page/trash/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/utilities/page/trash/trash.html b/utilities/page/trash/trash.html
deleted file mode 100644
index b17e475..0000000
--- a/utilities/page/trash/trash.html
+++ /dev/null
@@ -1,4 +0,0 @@
-<div class="layout_wrapper">
-<div id="trash_header"></div>
-<div id="trash_div" style="margin: 0px;"></div>
-</div>
\ No newline at end of file
diff --git a/utilities/page/trash/trash.js b/utilities/page/trash/trash.js
deleted file mode 100644
index b30626d..0000000
--- a/utilities/page/trash/trash.js
+++ /dev/null
@@ -1,144 +0,0 @@
-// 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/>.
-
-pscript['onload_Trash'] = function() {
-
-  // header and toolbar
-  var h = new PageHeader('trash_header','Trash Bin','Restore the documents that you have trashed')
-  
-  if(!pscript.trash_bin) pscript.trash_bin = new pscript.Trash();
-}
-
-pscript.Trash = function() {
-  // create UI elements
-  this.wrapper = $i('trash_div');
-  
-  this.head = $a(this.wrapper, 'div');
-  this.body = $a(this.wrapper, 'div');
-  $y(this.body, {margin:'8px'})
-
-  this.make_head();
-  this.load_masters();
-}
-
-// Make Button
-// ------------
-pscript.Trash.prototype.make_button = function(label, area){
-  var me = this;
-  var w = $a(area, 'div', '', {margin:'8px'});
-  var t = make_table(w,1,1,'400px',['50%','50%']);
-  var s = $a($td(t,0,0),'button');
-  s.innerHTML = label;
-  s.wrapper = w;
-  return s;
-}
-
-
-// Make Head
-// -------------
-pscript.Trash.prototype.make_head = function() {
-  var me = this;
-  
-  var make_select = function(label) {
-    var w = $a(me.head, 'div', '', {margin:'8px'});
-    var t = make_table(w,1,2,'400px',['50%','50%']);
-    $td(t,0,0).innerHTML = label;
-    var s = $a($td(t,0,1),'select','',{width:'140px'});
-    s.wrapper = w;
-    return s;
-  }
-  
-  // Select Master Name
-  this.master_select = make_select('Select Master');
-    
-  var me = this;
-  // Get Records
-  this.get_records_button = me.make_button('Get Records', me.head);
-  this.get_records_button.onclick = function() {
-    me.get_records();
-  }
-}
-
-
-// Load Masters
-// -------------
-pscript.Trash.prototype.load_masters = function(){
-  var me = this;
-  var callback = function(r, rt){
-    // Masters
-    empty_select(me.master_select);
-    add_sel_options(me.master_select,add_lists(['All'], r.message), 'All');
-  }
-  $c_obj('Trash Control','get_masters','',callback);
-}
-
-
-// Get Records
-// -----------
-pscript.Trash.prototype.get_records = function(){
-  var me = this;
-  me.body.innerHTML = '';
-  var callback = function(r, rt){
-    if(r.message) me.generate_trash_records(r.message);
-    else msgprint("No Records Found");
-  }
-  $c_obj('Trash Control','get_trash_records',sel_val(me.master_select),callback);
-}
-
-
-// Generate Trash Records
-// -----------------------
-pscript.Trash.prototype.generate_trash_records = function(rec_dict){
-  var me = this;
-  pscript.all_checkboxes = [];
-  mnames = keys(rec_dict).sort();
-  for(var i = 0; i < mnames.length; i ++){
-    var head = $a(me.body, 'h3'); head.innerHTML = mnames[i];
-    var rec_table = make_table(me.body,rec_dict[mnames[i]].length,2,'375px',['350px','25px'],{border:'1px solid #AAA',padding:'2px'});
-    for(var j = 0; j < rec_dict[mnames[i]].length; j++){
-      $a_input($td(rec_table,j,0), 'data');
-      $td(rec_table,j,0).innerHTML = rec_dict[mnames[i]][j];
-      var chk = $a_input($td(rec_table,j,1), 'checkbox');
-      chk.master = mnames[i];
-      chk.record = rec_dict[mnames[i]][j];
-      pscript.all_checkboxes.push(chk);
-    }
-  }
-  this.restore_button = me.make_button('Restore Selected', me.body);
-  this.restore_button.onclick = function() {
-    me.restore_records(0);
-  }
-  this.restore_all_button = me.make_button('Restore All', me.body);
-  this.restore_all_button.onclick = function() {
-    me.restore_records(1);
-  }
-}
-
-
-// Restore Records
-// ---------------
-pscript.Trash.prototype.restore_records = function(restore_all){
-  var me = this;
-  var out = {};
-  for(i in pscript.all_checkboxes) {
-    c = pscript.all_checkboxes[i];
-    if (restore_all || (!restore_all && c.checked)) {
-      if(!out[c.master]) out[c.master] = [c.record];
-      else {out[c.master].push(c.record);}
-    }
-  }
-  $c_obj('Trash Control','restore_records',JSON.stringify(out),function(r, rt){me.get_records();})
-}
\ No newline at end of file
diff --git a/utilities/page/trash/trash.txt b/utilities/page/trash/trash.txt
deleted file mode 100644
index a13e1b6..0000000
--- a/utilities/page/trash/trash.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-[
- {
-  "owner": "Administrator", 
-  "docstatus": 0, 
-  "creation": "2010-10-12 15:19:32", 
-  "modified_by": "Administrator", 
-  "modified": "2010-12-30 11:44:36"
- }, 
- {
-  "name": "__common__", 
-  "module": "Utilities", 
-  "page_name": "Trash", 
-  "doctype": "Page", 
-  "standard": "Yes"
- }, 
- {
-  "name": "__common__", 
-  "parent": "Trash", 
-  "doctype": "Page Role", 
-  "parenttype": "Page", 
-  "parentfield": "roles"
- }, 
- {
-  "name": "Trash", 
-  "doctype": "Page"
- }, 
- {
-  "role": "Administrator", 
-  "doctype": "Page Role"
- }, 
- {
-  "role": "Sales Master Manager", 
-  "doctype": "Page Role"
- }, 
- {
-  "role": "Material Master Manager", 
-  "doctype": "Page Role"
- }, 
- {
-  "role": "Purchase Master Manager", 
-  "doctype": "Page Role"
- }, 
- {
-  "role": "Accounts Manager", 
-  "doctype": "Page Role"
- }
-]
\ No newline at end of file
diff --git a/website/doctype/website_settings/website_settings.txt b/website/doctype/website_settings/website_settings.txt
index 615c0a5..7eaa50e 100644
--- a/website/doctype/website_settings/website_settings.txt
+++ b/website/doctype/website_settings/website_settings.txt
@@ -1,8 +1,7 @@
 [
- {
   "creation": "2013-03-26 06:51:18", 
   "docstatus": 0, 
-  "modified": "2013-04-17 11:51:30", 
+  "modified": "2013-04-17 11:51:24", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  },