Merge branch 'latest' of github.com:webnotes/erpnext into latest
diff --git a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js
index 386f462..139a42a 100644
--- a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js
+++ b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js
@@ -21,19 +21,15 @@
 		if(!doc.currency && sys_defaults.currency) set_multiple(dt,dn,{currency:sys_defaults.currency});
 		if(!doc.price_list_currency) set_multiple(dt, dn, {price_list_currency: doc.currency, plc_conversion_rate: 1});
 
- 		hide_field(['customer_address', 'contact_person', 'customer_name', 'address_display', 'contact_display', 'contact_mobile', 'contact_email', 'territory', 'customer_group']);
-
-		//for previously created sales invoice, set required field related to pos
-		if(doc.is_pos ==1) cur_frm.cscript.is_pos(doc, dt, dn);
-
+ 		hide_field(['customer_address', 'contact_person','customer_name','address_display', 'contact_display', 'contact_mobile', 'contact_email', 'territory', 'customer_group']);
 	}
 }
 
 cur_frm.cscript.onload_post_render = function(doc, dt, dn) {
-	var callback = null;
+	var callback2 = null;
 	if(doc.customer && doc.__islocal) {
 		// called from mapper, update the account names for items and customer
-		callback = function(doc, dt, dn) {
+		callback2 = function(doc, dt, dn) {
 			$c_obj(make_doclist(doc.doctype,doc.name),
 				'load_default_accounts','',
 				function(r,rt) {
@@ -44,15 +40,20 @@
 		}
 	}
 	// defined in sales_common.js
-	cur_frm.cscript.update_item_details(doc, cdt, cdn, callback);		
+	var callback1 = function(doc, dt, dn) {
+		//for previously created sales invoice, set required field related to pos	
+		cur_frm.cscript.update_item_details(doc, dt, dn, callback2);
+	}
 		
+	if(doc.is_pos ==1) cur_frm.cscript.is_pos(doc, dt, dn,callback1);
+	else cur_frm.cscript.update_item_details(doc, dt, dn, callback2);
 }
 
 
 // Hide Fields
 // ------------
 cur_frm.cscript.hide_fields = function(doc, cdt, cdn) {
-	par_flds	=['project_name', 'due_date', 'posting_time', 'sales_order_main', 'delivery_note_main', 'Get Items', 'is_opening', 'conversion_rate', 'source', 'cancel_reason', 'total_advance', 'gross_profit', 'gross_profit_percent', 'Get Advances Received', 'advance_adjustment_details', 'sales_partner', 'commission_rate', 'total_commission', 'Repair Outstanding Amt'];
+	par_flds = ['project_name', 'due_date', 'posting_time', 'sales_order_main', 'delivery_note_main', 'Get Items', 'is_opening', 'conversion_rate', 'source', 'cancel_reason', 'total_advance', 'gross_profit', 'gross_profit_percent', 'Get Advances Received', 'advance_adjustment_details', 'sales_partner', 'commission_rate', 'total_commission', 'Repair Outstanding Amt'];
 	
 	ch_flds = {'entries': ['sales_order', 'delivery_note']}
 	
@@ -107,7 +108,7 @@
 
 //fetch retail transaction related fields
 //--------------------------------------------
-cur_frm.cscript.is_pos = function(doc,dt,dn){
+cur_frm.cscript.is_pos = function(doc,dt,dn,callback){
 	cur_frm.cscript.hide_fields(doc, cdt, cdn);
 	if(doc.is_pos == 1){
 		if (!doc.company) {
@@ -116,10 +117,11 @@
 			refresh_field('is_pos');
 		}
 		else {
-			var callback = function(r,rt){
+			var callback1 = function(r,rt){
+				if(callback) callback(doc, dt, dn);
 				cur_frm.refresh();
 			}
-			$c_obj(make_doclist(dt,dn),'set_pos_fields','',callback);
+			$c_obj(make_doclist(dt,dn),'set_pos_fields','',callback1);
 		}
 	}
 }
diff --git a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py
index d8eb761..6b9b740 100644
--- a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py
+++ b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py
@@ -72,9 +72,12 @@
 			if not dtl:
 				dtl = webnotes.conn.sql("select income_account, warehouse, cost_center from `tabPOS Setting` where ifnull(user,'') = '' and company = '%s'" % (self.doc.company), as_dict=1)
 			for d in getlist(self.doclist,'entries'):
-				if dtl and dtl[0]['income_account']: d.income_account = dtl[0]['income_account']
-				if dtl and dtl[0]['cost_center']: d.cost_center = dtl[0]['cost_center']
-				if dtl and dtl[0]['warehouse']: d.warehouse = dtl[0]['warehouse']
+				# overwrite if mentioned in item
+				item = webnotes.conn.sql("select default_income_account, default_sales_cost_center, default_warehouse from tabItem where name = '%s'" %(d.item_code), as_dict=1)
+				d.income_account = item and item[0]['default_income_account'] or dtl and dtl[0]['income_account'] or ''
+				d.cost_center = item and item[0]['default_sales_cost_center'] or dtl and dtl[0]['cost_center'] or ''
+				d.warehouse = item and item[0]['default_warehouse'] or dtl and dtl[0]['warehouse'] or ''
+
 
 			
 	# Get Account Head to which amount needs to be Debited based on Customer
@@ -168,9 +171,9 @@
 			dtl = webnotes.conn.sql("select income_account, warehouse, cost_center from `tabPOS Setting` where user = '%s' and company = '%s'" % (session['user'], self.doc.company), as_dict=1)				 
 			if not dtl:
 				dtl = webnotes.conn.sql("select income_account, warehouse, cost_center from `tabPOS Setting` where ifnull(user,'') = '' and company = '%s'" % (self.doc.company), as_dict=1)
-			if dtl and dtl[0]['income_account']: ret['income_account'] = dtl and dtl[0]['income_account']
-			if dtl and dtl[0]['cost_center']: ret['cost_center'] = dtl and dtl[0]['cost_center']
-			if dtl and dtl[0]['warehouse']: ret['warehouse'] = dtl and dtl[0]['warehouse']
+			if dtl and not ret['income_account'] and dtl[0]['income_account']: ret['income_account'] = dtl and dtl[0]['income_account']
+			if dtl and not ret['cost_center'] and dtl[0]['cost_center']: ret['cost_center'] = dtl and dtl[0]['cost_center']
+			if dtl and not ret['warehouse'] and dtl[0]['warehouse']: ret['warehouse'] = dtl and dtl[0]['warehouse']
 			if ret['warehouse']:
 				actual_qty = webnotes.conn.sql("select actual_qty from `tabBin` where item_code = '%s' and warehouse = '%s'" % (item_code, ret['warehouse']))		
 				ret['actual_qty']= actual_qty and flt(actual_qty[0][0]) or 0
diff --git a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.txt b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.txt
index 2d89038..66e5a6c 100644
--- a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.txt
+++ b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.txt
@@ -5,61 +5,61 @@
 	{
 		'creation': '2010-08-08 17:09:18',
 		'docstatus': 0,
-		'modified': '2012-01-09 16:52:22',
-		'modified_by': 'Administrator',
-		'owner': 'Administrator'
+		'modified': '2012-02-15 14:24:14',
+		'modified_by': u'Administrator',
+		'owner': u'Administrator'
 	},
 
 	# These values are common for all DocField
 	{
-		'doctype': 'DocField',
+		'doctype': u'DocField',
 		'name': '__common__',
-		'parent': 'Receivable Voucher',
-		'parentfield': 'fields',
-		'parenttype': 'DocType'
+		'parent': u'Receivable Voucher',
+		'parentfield': u'fields',
+		'parenttype': u'DocType'
 	},
 
 	# These values are common for all DocType
 	{
-		'_last_update': '1326105583',
-		'change_log': '1. Change in pull_details method dt.-26-06-2009',
-		'colour': 'White:FFF',
-		'default_print_format': 'Standard',
+		'_last_update': u'1329295537',
+		'change_log': u'1. Change in pull_details method dt.-26-06-2009',
+		'colour': u'White:FFF',
+		'default_print_format': u'Standard',
 		'doctype': 'DocType',
-		'module': 'Accounts',
+		'module': u'Accounts',
 		'name': '__common__',
 		'read_only_onload': 1,
-		'search_fields': 'posting_date, due_date, debit_to, fiscal_year, grand_total, outstanding_amount',
-		'section_style': 'Tabbed',
-		'server_code_error': ' ',
+		'search_fields': u'posting_date, due_date, debit_to, fiscal_year, grand_total, outstanding_amount',
+		'section_style': u'Tabbed',
+		'server_code_error': u' ',
 		'show_in_menu': 0,
-		'subject': 'To %(customer_name)s worth %(currency)s %(grand_total_export)s due on %(due_date)s | %(outstanding_amount)s outstanding',
+		'subject': u'To %(customer_name)s worth %(currency)s %(grand_total_export)s due on %(due_date)s | %(outstanding_amount)s outstanding',
 		'version': 394
 	},
 
 	# These values are common for all DocFormat
 	{
-		'doctype': 'DocFormat',
+		'doctype': u'DocFormat',
 		'name': '__common__',
-		'parent': 'Receivable Voucher',
-		'parentfield': 'formats',
-		'parenttype': 'DocType'
+		'parent': u'Receivable Voucher',
+		'parentfield': u'formats',
+		'parenttype': u'DocType'
 	},
 
 	# These values are common for all DocPerm
 	{
-		'doctype': 'DocPerm',
+		'doctype': u'DocPerm',
 		'name': '__common__',
-		'parent': 'Receivable Voucher',
-		'parentfield': 'permissions',
-		'parenttype': 'DocType',
+		'parent': u'Receivable Voucher',
+		'parentfield': u'permissions',
+		'parenttype': u'DocType',
 		'read': 1
 	},
 
 	# DocType, Receivable Voucher
 	{
 		'doctype': 'DocType',
-		'name': 'Receivable Voucher'
+		'name': u'Receivable Voucher'
 	},
 
 	# DocPerm
@@ -67,9 +67,9 @@
 		'amend': 0,
 		'cancel': 0,
 		'create': 0,
-		'doctype': 'DocPerm',
+		'doctype': u'DocPerm',
 		'permlevel': 1,
-		'role': 'Accounts Manager',
+		'role': u'Accounts Manager',
 		'submit': 0,
 		'write': 0
 	},
@@ -79,9 +79,9 @@
 		'amend': 1,
 		'cancel': 1,
 		'create': 1,
-		'doctype': 'DocPerm',
+		'doctype': u'DocPerm',
 		'permlevel': 0,
-		'role': 'Accounts Manager',
+		'role': u'Accounts Manager',
 		'submit': 1,
 		'write': 1
 	},
@@ -91,9 +91,9 @@
 		'amend': 1,
 		'cancel': 1,
 		'create': 1,
-		'doctype': 'DocPerm',
+		'doctype': u'DocPerm',
 		'permlevel': 0,
-		'role': 'Accounts User',
+		'role': u'Accounts User',
 		'submit': 1,
 		'write': 1
 	},
@@ -103,9 +103,9 @@
 		'amend': 0,
 		'cancel': 0,
 		'create': 0,
-		'doctype': 'DocPerm',
+		'doctype': u'DocPerm',
 		'permlevel': 1,
-		'role': 'Accounts User',
+		'role': u'Accounts User',
 		'submit': 0,
 		'write': 0
 	},
@@ -115,77 +115,77 @@
 		'amend': 0,
 		'cancel': 0,
 		'create': 0,
-		'doctype': 'DocPerm',
-		'match': 'customer',
+		'doctype': u'DocPerm',
+		'match': u'customer',
 		'permlevel': 0,
-		'role': 'Customer',
+		'role': u'Customer',
 		'submit': 0,
 		'write': 0
 	},
 
 	# DocFormat
 	{
-		'doctype': 'DocFormat',
-		'format': 'POS Invoice'
+		'doctype': u'DocFormat',
+		'format': u'POS Invoice'
 	},
 
 	# DocFormat
 	{
-		'doctype': 'DocFormat',
-		'format': 'POS Invoice'
+		'doctype': u'DocFormat',
+		'format': u'POS Invoice'
 	},
 
 	# DocFormat
 	{
-		'doctype': 'DocFormat',
-		'format': 'Sales Invoice Classic'
+		'doctype': u'DocFormat',
+		'format': u'Sales Invoice Classic'
 	},
 
 	# DocFormat
 	{
-		'doctype': 'DocFormat',
-		'format': 'Sales Invoice Modern'
+		'doctype': u'DocFormat',
+		'format': u'Sales Invoice Modern'
 	},
 
 	# DocFormat
 	{
-		'doctype': 'DocFormat',
-		'format': 'Sales Invoice Spartan'
+		'doctype': u'DocFormat',
+		'format': u'Sales Invoice Spartan'
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'Section Break',
-		'label': 'Basic Info',
-		'oldfieldtype': 'Section Break',
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
+		'label': u'Basic Info',
+		'oldfieldtype': u'Section Break',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'Column Break',
-		'oldfieldtype': 'Column Break',
+		'doctype': u'DocField',
+		'fieldtype': u'Column Break',
+		'oldfieldtype': u'Column Break',
 		'permlevel': 0,
 		'print_hide': 0,
-		'width': '50%'
+		'width': u'50%'
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'depends_on': 'eval:doc.retail_transaction!="Yes"',
-		'description': 'To manage multiple series please go to Setup > Manage Series',
-		'doctype': 'DocField',
-		'fieldname': 'naming_series',
-		'fieldtype': 'Select',
-		'label': 'Series',
+		'colour': u'White:FFF',
+		'depends_on': u'eval:doc.retail_transaction!="Yes"',
+		'description': u'To manage multiple series please go to Setup > Manage Series',
+		'doctype': u'DocField',
+		'fieldname': u'naming_series',
+		'fieldtype': u'Select',
+		'label': u'Series',
 		'no_copy': 1,
-		'oldfieldname': 'naming_series',
-		'oldfieldtype': 'Select',
-		'options': '\nINV\nINV/10-11/',
+		'oldfieldname': u'naming_series',
+		'oldfieldtype': u'Select',
+		'options': u'\nINV\nINV/10-11/',
 		'permlevel': 0,
 		'print_hide': 1,
 		'reqd': 1
@@ -193,158 +193,159 @@
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'is_pos',
-		'fieldtype': 'Check',
-		'label': 'Is POS',
-		'oldfieldname': 'is_pos',
-		'oldfieldtype': 'Check',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'is_pos',
+		'fieldtype': u'Check',
+		'label': u'Is POS',
+		'oldfieldname': u'is_pos',
+		'oldfieldtype': u'Check',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'default': '1',
-		'depends_on': 'eval:doc.is_pos==1',
-		'doctype': 'DocField',
-		'fieldname': 'update_stock',
-		'fieldtype': 'Check',
-		'label': 'Update Stock',
-		'oldfieldname': 'update_stock',
-		'oldfieldtype': 'Check',
+		'default': u'1',
+		'depends_on': u'eval:doc.is_pos==1',
+		'doctype': u'DocField',
+		'fieldname': u'update_stock',
+		'fieldtype': u'Check',
+		'label': u'Update Stock',
+		'oldfieldname': u'update_stock',
+		'oldfieldtype': u'Check',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'description': 'The account to which you will pay (have paid) the money to.',
-		'doctype': 'DocField',
-		'fieldname': 'debit_to',
-		'fieldtype': 'Link',
+		'colour': u'White:FFF',
+		'description': u'The account to which you will pay (have paid) the money to.',
+		'doctype': u'DocField',
+		'fieldname': u'debit_to',
+		'fieldtype': u'Link',
 		'in_filter': 1,
-		'label': 'Debit To',
-		'oldfieldname': 'debit_to',
-		'oldfieldtype': 'Link',
-		'options': 'Account',
+		'label': u'Debit To',
+		'oldfieldname': u'debit_to',
+		'oldfieldtype': u'Link',
+		'options': u'Account',
 		'permlevel': 0,
 		'print_hide': 1,
 		'reqd': 1,
 		'search_index': 1,
-		'trigger': 'Client'
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldname': 'customer',
-		'fieldtype': 'Link',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'customer',
+		'fieldtype': u'Link',
 		'hidden': 0,
-		'label': 'Customer',
+		'label': u'Customer',
 		'no_copy': 0,
-		'oldfieldname': 'customer',
-		'oldfieldtype': 'Link',
-		'options': 'Customer',
+		'oldfieldname': u'customer',
+		'oldfieldtype': u'Link',
+		'options': u'Customer',
 		'permlevel': 0,
 		'print_hide': 1,
-		'trigger': 'Client'
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'customer_address',
-		'fieldtype': 'Link',
-		'label': 'Customer Address',
-		'options': 'Address',
+		'doctype': u'DocField',
+		'fieldname': u'customer_address',
+		'fieldtype': u'Link',
+		'label': u'Customer Address',
+		'options': u'Address',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'contact_person',
-		'fieldtype': 'Link',
-		'label': 'Contact Person',
-		'options': 'Contact',
+		'doctype': u'DocField',
+		'fieldname': u'contact_person',
+		'fieldtype': u'Link',
+		'label': u'Contact Person',
+		'options': u'Contact',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'customer_name',
-		'fieldtype': 'Data',
-		'label': 'Name',
-		'oldfieldname': 'customer_name',
-		'oldfieldtype': 'Data',
+		'doctype': u'DocField',
+		'fieldname': u'customer_name',
+		'fieldtype': u'Data',
+		'label': u'Name',
+		'oldfieldname': u'customer_name',
+		'oldfieldtype': u'Data',
 		'permlevel': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'address_display',
-		'fieldtype': 'Small Text',
-		'label': 'Address',
+		'doctype': u'DocField',
+		'fieldname': u'address_display',
+		'fieldtype': u'Small Text',
+		'label': u'Address',
 		'permlevel': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'contact_display',
-		'fieldtype': 'Small Text',
-		'label': 'Contact',
+		'doctype': u'DocField',
+		'fieldname': u'contact_display',
+		'fieldtype': u'Small Text',
+		'label': u'Contact',
 		'permlevel': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'contact_mobile',
-		'fieldtype': 'Text',
-		'label': 'Mobile No',
+		'doctype': u'DocField',
+		'fieldname': u'contact_mobile',
+		'fieldtype': u'Text',
+		'label': u'Mobile No',
 		'permlevel': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'contact_email',
-		'fieldtype': 'Text',
-		'label': 'Contact Email',
+		'doctype': u'DocField',
+		'fieldname': u'contact_email',
+		'fieldtype': u'Text',
+		'label': u'Contact Email',
 		'permlevel': 1,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldtype': 'Column Break',
-		'oldfieldtype': 'Column Break',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldtype': u'Column Break',
+		'oldfieldtype': u'Column Break',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'default': 'Today',
-		'description': "This is the date on which this voucher is made in the system. Today's date comes by default.",
-		'doctype': 'DocField',
-		'fieldname': 'voucher_date',
-		'fieldtype': 'Date',
+		'colour': u'White:FFF',
+		'default': u'Today',
+		'description': u"This is the date on which this voucher is made in the system. Today's date comes by default.",
+		'doctype': u'DocField',
+		'fieldname': u'voucher_date',
+		'fieldtype': u'Date',
 		'in_filter': 1,
-		'label': 'Voucher Date',
+		'label': u'Voucher Date',
 		'no_copy': 1,
-		'oldfieldname': 'voucher_date',
-		'oldfieldtype': 'Date',
+		'oldfieldname': u'voucher_date',
+		'oldfieldtype': u'Date',
 		'permlevel': 0,
 		'reqd': 1,
 		'search_index': 0
@@ -352,17 +353,17 @@
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'default': 'Today',
-		'description': 'Enter the date by which payments from customer is expected against this invoice.',
-		'doctype': 'DocField',
-		'fieldname': 'due_date',
-		'fieldtype': 'Date',
+		'colour': u'White:FFF',
+		'default': u'Today',
+		'description': u'Enter the date by which payments from customer is expected against this invoice.',
+		'doctype': u'DocField',
+		'fieldname': u'due_date',
+		'fieldtype': u'Date',
 		'in_filter': 1,
-		'label': 'Due Date',
+		'label': u'Due Date',
 		'no_copy': 1,
-		'oldfieldname': 'due_date',
-		'oldfieldtype': 'Date',
+		'oldfieldname': u'due_date',
+		'oldfieldtype': u'Date',
 		'permlevel': 0,
 		'reqd': 1,
 		'search_index': 0
@@ -370,17 +371,17 @@
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'default': 'Today',
-		'description': 'The date at which current entry will get or has actually executed.',
-		'doctype': 'DocField',
-		'fieldname': 'posting_date',
-		'fieldtype': 'Date',
+		'colour': u'White:FFF',
+		'default': u'Today',
+		'description': u'The date at which current entry will get or has actually executed.',
+		'doctype': u'DocField',
+		'fieldname': u'posting_date',
+		'fieldtype': u'Date',
 		'in_filter': 1,
-		'label': 'Posting Date',
+		'label': u'Posting Date',
 		'no_copy': 1,
-		'oldfieldname': 'posting_date',
-		'oldfieldtype': 'Date',
+		'oldfieldname': u'posting_date',
+		'oldfieldtype': u'Date',
 		'permlevel': 0,
 		'print_hide': 1,
 		'reqd': 1,
@@ -389,65 +390,65 @@
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'posting_time',
-		'fieldtype': 'Time',
-		'label': 'Posting Time',
+		'doctype': u'DocField',
+		'fieldname': u'posting_time',
+		'fieldtype': u'Time',
+		'label': u'Posting Time',
 		'no_copy': 1,
-		'oldfieldname': 'posting_time',
-		'oldfieldtype': 'Time',
+		'oldfieldname': u'posting_time',
+		'oldfieldtype': u'Time',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'description': 'The date at which current entry is corrected in the system.',
-		'doctype': 'DocField',
-		'fieldname': 'amendment_date',
-		'fieldtype': 'Date',
-		'label': 'Amendment Date',
+		'description': u'The date at which current entry is corrected in the system.',
+		'doctype': u'DocField',
+		'fieldname': u'amendment_date',
+		'fieldtype': u'Date',
+		'label': u'Amendment Date',
 		'no_copy': 1,
-		'oldfieldname': 'amendment_date',
-		'oldfieldtype': 'Date',
+		'oldfieldname': u'amendment_date',
+		'oldfieldtype': u'Date',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'amended_from',
-		'fieldtype': 'Link',
-		'label': 'Amended From',
+		'doctype': u'DocField',
+		'fieldname': u'amended_from',
+		'fieldtype': u'Link',
+		'label': u'Amended From',
 		'no_copy': 1,
-		'oldfieldname': 'amended_from',
-		'oldfieldtype': 'Link',
-		'options': 'Receivable Voucher',
+		'oldfieldname': u'amended_from',
+		'oldfieldtype': u'Link',
+		'options': u'Receivable Voucher',
 		'permlevel': 1,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'mode_of_payment',
-		'fieldtype': 'Select',
-		'label': 'Mode of Payment',
-		'oldfieldname': 'mode_of_payment',
-		'oldfieldtype': 'Select',
-		'options': 'link:Mode of Payment',
+		'doctype': u'DocField',
+		'fieldname': u'mode_of_payment',
+		'fieldtype': u'Select',
+		'label': u'Mode of Payment',
+		'oldfieldname': u'mode_of_payment',
+		'oldfieldtype': u'Select',
+		'options': u'link:Mode of Payment',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'territory',
-		'fieldtype': 'Link',
+		'doctype': u'DocField',
+		'fieldname': u'territory',
+		'fieldtype': u'Link',
 		'in_filter': 1,
-		'label': 'Territory',
-		'options': 'Territory',
+		'label': u'Territory',
+		'options': u'Territory',
 		'permlevel': 0,
 		'print_hide': 1,
 		'reqd': 1,
@@ -456,12 +457,12 @@
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'customer_group',
-		'fieldtype': 'Link',
+		'doctype': u'DocField',
+		'fieldname': u'customer_group',
+		'fieldtype': u'Link',
 		'in_filter': 1,
-		'label': 'Customer Group',
-		'options': 'Customer Group',
+		'label': u'Customer Group',
+		'options': u'Customer Group',
 		'permlevel': 0,
 		'print_hide': 1,
 		'search_index': 0
@@ -469,23 +470,23 @@
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldtype': 'Section Break',
-		'label': 'Items',
-		'oldfieldtype': 'Section Break',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
+		'label': u'Items',
+		'oldfieldtype': u'Section Break',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'price_list_name',
-		'fieldtype': 'Select',
-		'label': 'Price List',
-		'oldfieldname': 'price_list_name',
-		'oldfieldtype': 'Select',
-		'options': 'link:Price List',
+		'doctype': u'DocField',
+		'fieldname': u'price_list_name',
+		'fieldtype': u'Select',
+		'label': u'Price List',
+		'oldfieldname': u'price_list_name',
+		'oldfieldtype': u'Select',
+		'options': u'link:Price List',
 		'permlevel': 0,
 		'print_hide': 1,
 		'reqd': 1
@@ -493,13 +494,13 @@
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'description': 'Select the currency in which price list is maintained',
-		'doctype': 'DocField',
-		'fieldname': 'price_list_currency',
-		'fieldtype': 'Select',
-		'label': 'Price List Currency',
-		'options': 'link:Currency',
+		'colour': u'White:FFF',
+		'description': u'Select the currency in which price list is maintained',
+		'doctype': u'DocField',
+		'fieldname': u'price_list_currency',
+		'fieldtype': u'Select',
+		'label': u'Price List Currency',
+		'options': u'link:Currency',
 		'permlevel': 0,
 		'print_hide': 1,
 		'reqd': 1
@@ -507,12 +508,12 @@
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'description': 'Rate at which Price list currency is converted to your currency',
-		'doctype': 'DocField',
-		'fieldname': 'plc_conversion_rate',
-		'fieldtype': 'Currency',
-		'label': 'Price List Currency Conversion Rate',
+		'colour': u'White:FFF',
+		'description': u'Rate at which Price list currency is converted to your currency',
+		'doctype': u'DocField',
+		'fieldname': u'plc_conversion_rate',
+		'fieldtype': u'Currency',
+		'label': u'Price List Currency Conversion Rate',
 		'permlevel': 0,
 		'print_hide': 1,
 		'reqd': 1
@@ -520,21 +521,21 @@
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'Column Break',
+		'doctype': u'DocField',
+		'fieldtype': u'Column Break',
 		'permlevel': 0,
-		'width': '50%'
+		'width': u'50%'
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'currency',
-		'fieldtype': 'Select',
-		'label': 'Currency',
-		'oldfieldname': 'currency',
-		'oldfieldtype': 'Select',
-		'options': 'link:Currency',
+		'doctype': u'DocField',
+		'fieldname': u'currency',
+		'fieldtype': u'Select',
+		'label': u'Currency',
+		'oldfieldname': u'currency',
+		'oldfieldtype': u'Select',
+		'options': u'link:Currency',
 		'permlevel': 0,
 		'print_hide': 1,
 		'reqd': 1
@@ -542,13 +543,13 @@
 
 	# DocField
 	{
-		'default': '1.00',
-		'doctype': 'DocField',
-		'fieldname': 'conversion_rate',
-		'fieldtype': 'Currency',
-		'label': 'Conversion Rate',
-		'oldfieldname': 'conversion_rate',
-		'oldfieldtype': 'Currency',
+		'default': u'1.00',
+		'doctype': u'DocField',
+		'fieldname': u'conversion_rate',
+		'fieldtype': u'Currency',
+		'label': u'Conversion Rate',
+		'oldfieldname': u'conversion_rate',
+		'oldfieldtype': u'Currency',
 		'permlevel': 0,
 		'print_hide': 1,
 		'reqd': 1
@@ -556,102 +557,102 @@
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'description': 'Select Items from Sales Order',
-		'doctype': 'DocField',
-		'fieldname': 'sales_order_main',
-		'fieldtype': 'Link',
-		'label': 'Sales Order',
-		'oldfieldname': 'sales_order_main',
-		'oldfieldtype': 'Link',
-		'options': 'Sales Order',
+		'colour': u'White:FFF',
+		'description': u'Select Items from Sales Order',
+		'doctype': u'DocField',
+		'fieldname': u'sales_order_main',
+		'fieldtype': u'Link',
+		'label': u'Sales Order',
+		'oldfieldname': u'sales_order_main',
+		'oldfieldtype': u'Link',
+		'options': u'Sales Order',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'description': 'Select Items from Delivery Note',
-		'doctype': 'DocField',
-		'fieldname': 'delivery_note_main',
-		'fieldtype': 'Link',
-		'label': 'Delivery Note',
-		'oldfieldname': 'delivery_note_main',
-		'oldfieldtype': 'Link',
-		'options': 'Delivery Note',
+		'colour': u'White:FFF',
+		'description': u'Select Items from Delivery Note',
+		'doctype': u'DocField',
+		'fieldname': u'delivery_note_main',
+		'fieldtype': u'Link',
+		'label': u'Delivery Note',
+		'oldfieldname': u'delivery_note_main',
+		'oldfieldtype': u'Link',
+		'options': u'Delivery Note',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'Button',
-		'label': 'Get Items',
-		'oldfieldtype': 'Button',
+		'doctype': u'DocField',
+		'fieldtype': u'Button',
+		'label': u'Get Items',
+		'oldfieldtype': u'Button',
 		'permlevel': 0,
 		'print_hide': 1,
-		'trigger': 'Client'
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'Section Break',
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
 		'allow_on_submit': 1,
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldname': 'entries',
-		'fieldtype': 'Table',
-		'label': 'Entries',
-		'oldfieldname': 'entries',
-		'oldfieldtype': 'Table',
-		'options': 'RV Detail',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'entries',
+		'fieldtype': u'Table',
+		'label': u'Entries',
+		'oldfieldname': u'entries',
+		'oldfieldtype': u'Table',
+		'options': u'RV Detail',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldtype': 'Button',
-		'label': 'Re-Calculate Values',
-		'oldfieldtype': 'Button',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldtype': u'Button',
+		'label': u'Re-Calculate Values',
+		'oldfieldtype': u'Button',
 		'permlevel': 0,
 		'print_hide': 1,
-		'trigger': 'Client'
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'Section Break',
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'Column Break',
+		'doctype': u'DocField',
+		'fieldtype': u'Column Break',
 		'permlevel': 0,
-		'width': '50%'
+		'width': u'50%'
 	},
 
 	# DocField
 	{
-		'description': 'Will be calculated automatically when you enter the details',
-		'doctype': 'DocField',
-		'fieldname': 'net_total',
-		'fieldtype': 'Currency',
-		'label': 'Net Total*',
-		'oldfieldname': 'net_total',
-		'oldfieldtype': 'Currency',
+		'description': u'Will be calculated automatically when you enter the details',
+		'doctype': u'DocField',
+		'fieldname': u'net_total',
+		'fieldtype': u'Currency',
+		'label': u'Net Total*',
+		'oldfieldname': u'net_total',
+		'oldfieldtype': u'Currency',
 		'permlevel': 1,
 		'print_hide': 0,
 		'reqd': 1
@@ -659,278 +660,278 @@
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'HTML',
-		'label': 'Rates HTML',
-		'oldfieldtype': 'HTML',
-		'options': '* Rates in standard currency',
+		'doctype': u'DocField',
+		'fieldtype': u'HTML',
+		'label': u'Rates HTML',
+		'oldfieldtype': u'HTML',
+		'options': u'* Rates in standard currency',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'depends_on': 'eval:doc.is_pos==1',
-		'doctype': 'DocField',
-		'fieldname': 'cash_bank_account',
-		'fieldtype': 'Link',
-		'label': 'Cash/Bank Account',
-		'oldfieldname': 'cash_bank_account',
-		'oldfieldtype': 'Link',
-		'options': 'Account',
+		'colour': u'White:FFF',
+		'depends_on': u'eval:doc.is_pos==1',
+		'doctype': u'DocField',
+		'fieldname': u'cash_bank_account',
+		'fieldtype': u'Link',
+		'label': u'Cash/Bank Account',
+		'oldfieldname': u'cash_bank_account',
+		'oldfieldtype': u'Link',
+		'options': u'Account',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'depends_on': 'eval:doc.is_pos==1',
-		'doctype': 'DocField',
-		'fieldname': 'paid_amount',
-		'fieldtype': 'Currency',
-		'label': 'Paid Amount',
-		'oldfieldname': 'paid_amount',
-		'oldfieldtype': 'Currency',
+		'colour': u'White:FFF',
+		'depends_on': u'eval:doc.is_pos==1',
+		'doctype': u'DocField',
+		'fieldname': u'paid_amount',
+		'fieldtype': u'Currency',
+		'label': u'Paid Amount',
+		'oldfieldname': u'paid_amount',
+		'oldfieldtype': u'Currency',
 		'permlevel': 0,
 		'print_hide': 1,
-		'trigger': 'Client'
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'Column Break',
+		'doctype': u'DocField',
+		'fieldtype': u'Column Break',
 		'permlevel': 0,
-		'width': '50%'
+		'width': u'50%'
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'depends_on': 'eval:doc.is_pos==1',
-		'doctype': 'DocField',
-		'fieldname': 'write_off_account',
-		'fieldtype': 'Link',
-		'label': 'Write Off Account',
-		'options': 'Account',
+		'colour': u'White:FFF',
+		'depends_on': u'eval:doc.is_pos==1',
+		'doctype': u'DocField',
+		'fieldname': u'write_off_account',
+		'fieldtype': u'Link',
+		'label': u'Write Off Account',
+		'options': u'Account',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'depends_on': 'eval:doc.is_pos==1',
-		'doctype': 'DocField',
-		'fieldname': 'write_off_cost_center',
-		'fieldtype': 'Link',
-		'label': 'Write Off Cost Center',
-		'options': 'Cost Center',
+		'colour': u'White:FFF',
+		'depends_on': u'eval:doc.is_pos==1',
+		'doctype': u'DocField',
+		'fieldname': u'write_off_cost_center',
+		'fieldtype': u'Link',
+		'label': u'Write Off Cost Center',
+		'options': u'Cost Center',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'depends_on': 'eval:doc.is_pos==1',
-		'doctype': 'DocField',
-		'fieldname': 'write_off_amount',
-		'fieldtype': 'Currency',
-		'label': 'Write Off Amount',
+		'colour': u'White:FFF',
+		'depends_on': u'eval:doc.is_pos==1',
+		'doctype': u'DocField',
+		'fieldname': u'write_off_amount',
+		'fieldtype': u'Currency',
+		'label': u'Write Off Amount',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'Section Break',
-		'label': 'Taxes',
-		'oldfieldtype': 'Section Break',
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
+		'label': u'Taxes',
+		'oldfieldtype': u'Section Break',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'charge',
-		'fieldtype': 'Link',
-		'label': 'Charge',
-		'oldfieldname': 'charge',
-		'oldfieldtype': 'Link',
-		'options': 'Other Charges',
+		'doctype': u'DocField',
+		'fieldname': u'charge',
+		'fieldtype': u'Link',
+		'label': u'Charge',
+		'oldfieldname': u'charge',
+		'oldfieldtype': u'Link',
+		'options': u'Other Charges',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'Button',
-		'label': 'Get Charges',
-		'oldfieldtype': 'Button',
+		'doctype': u'DocField',
+		'fieldtype': u'Button',
+		'label': u'Get Charges',
+		'oldfieldtype': u'Button',
 		'permlevel': 0,
 		'print_hide': 1,
-		'trigger': 'Client'
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
 		'allow_on_submit': 1,
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldname': 'other_charges',
-		'fieldtype': 'Table',
-		'label': 'Taxes1',
-		'oldfieldname': 'other_charges',
-		'oldfieldtype': 'Table',
-		'options': 'RV Tax Detail',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'other_charges',
+		'fieldtype': u'Table',
+		'label': u'Taxes1',
+		'oldfieldname': u'other_charges',
+		'oldfieldtype': u'Table',
+		'options': u'RV Tax Detail',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'Button',
-		'label': 'Calculate Charges',
-		'oldfieldtype': 'Button',
+		'doctype': u'DocField',
+		'fieldtype': u'Button',
+		'label': u'Calculate Charges',
+		'oldfieldtype': u'Button',
 		'permlevel': 0,
 		'print_hide': 1,
-		'trigger': 'Client'
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'other_charges_total',
-		'fieldtype': 'Currency',
-		'label': 'Total Charges',
-		'oldfieldname': 'other_charges_total',
-		'oldfieldtype': 'Currency',
+		'doctype': u'DocField',
+		'fieldname': u'other_charges_total',
+		'fieldtype': u'Currency',
+		'label': u'Total Charges',
+		'oldfieldname': u'other_charges_total',
+		'oldfieldtype': u'Currency',
 		'permlevel': 1,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'HTML',
-		'label': 'Other Charges Calculation',
-		'oldfieldtype': 'HTML',
+		'doctype': u'DocField',
+		'fieldtype': u'HTML',
+		'label': u'Other Charges Calculation',
+		'oldfieldtype': u'HTML',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldtype': 'Section Break',
-		'label': 'Terms',
-		'oldfieldtype': 'Section Break',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
+		'label': u'Terms',
+		'oldfieldtype': u'Section Break',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'tc_name',
-		'fieldtype': 'Link',
-		'label': 'Select Terms',
-		'oldfieldname': 'tc_name',
-		'oldfieldtype': 'Link',
-		'options': 'Term',
+		'doctype': u'DocField',
+		'fieldname': u'tc_name',
+		'fieldtype': u'Link',
+		'label': u'Select Terms',
+		'oldfieldname': u'tc_name',
+		'oldfieldtype': u'Link',
+		'options': u'Term',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldtype': 'Button',
-		'label': 'Get Terms',
-		'oldfieldtype': 'Button',
-		'options': 'get_tc_details',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldtype': u'Button',
+		'label': u'Get Terms',
+		'oldfieldtype': u'Button',
+		'options': u'get_tc_details',
 		'permlevel': 0,
 		'print_hide': 1,
-		'trigger': 'Server'
+		'trigger': u'Server'
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldtype': 'HTML',
-		'label': 'Terms HTML',
-		'oldfieldtype': 'HTML',
-		'options': 'You can add Terms and Notes that will be printed in the Transaction',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldtype': u'HTML',
+		'label': u'Terms HTML',
+		'oldfieldtype': u'HTML',
+		'options': u'You can add Terms and Notes that will be printed in the Transaction',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'terms',
-		'fieldtype': 'Text Editor',
-		'label': 'Term Details',
-		'oldfieldname': 'terms',
-		'oldfieldtype': 'Text Editor',
+		'doctype': u'DocField',
+		'fieldname': u'terms',
+		'fieldtype': u'Text Editor',
+		'label': u'Term Details',
+		'oldfieldname': u'terms',
+		'oldfieldtype': u'Text Editor',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldtype': 'Section Break',
-		'label': 'More Info',
-		'oldfieldtype': 'Section Break',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
+		'label': u'More Info',
+		'oldfieldtype': u'Section Break',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldtype': 'Column Break',
-		'oldfieldtype': 'Column Break',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldtype': u'Column Break',
+		'oldfieldtype': u'Column Break',
 		'permlevel': 0,
 		'print_hide': 1,
-		'width': '50%'
+		'width': u'50%'
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'default': 'No',
-		'doctype': 'DocField',
-		'fieldname': 'is_opening',
-		'fieldtype': 'Select',
+		'colour': u'White:FFF',
+		'default': u'No',
+		'doctype': u'DocField',
+		'fieldname': u'is_opening',
+		'fieldtype': u'Select',
 		'in_filter': 1,
-		'label': 'Is Opening',
-		'oldfieldname': 'is_opening',
-		'oldfieldtype': 'Select',
-		'options': 'No\nYes',
+		'label': u'Is Opening',
+		'oldfieldname': u'is_opening',
+		'oldfieldtype': u'Select',
+		'options': u'No\nYes',
 		'permlevel': 0,
 		'print_hide': 1,
 		'search_index': 0,
-		'trigger': 'Client'
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'aging_date',
-		'fieldtype': 'Date',
-		'label': 'Aging Date',
-		'oldfieldname': 'aging_date',
-		'oldfieldtype': 'Date',
+		'doctype': u'DocField',
+		'fieldname': u'aging_date',
+		'fieldtype': u'Date',
+		'label': u'Aging Date',
+		'oldfieldname': u'aging_date',
+		'oldfieldtype': u'Date',
 		'permlevel': 0,
 		'print_hide': 1
 	},
@@ -938,42 +939,42 @@
 	# DocField
 	{
 		'allow_on_submit': 1,
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldname': 'letter_head',
-		'fieldtype': 'Select',
-		'label': 'Letter Head',
-		'oldfieldname': 'letter_head',
-		'oldfieldtype': 'Select',
-		'options': 'link:Letter Head',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'letter_head',
+		'fieldtype': u'Select',
+		'label': u'Letter Head',
+		'oldfieldname': u'letter_head',
+		'oldfieldtype': u'Select',
+		'options': u'link:Letter Head',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'source',
-		'fieldtype': 'Select',
-		'label': 'Source',
-		'oldfieldname': 'source',
-		'oldfieldtype': 'Select',
-		'options': "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign",
+		'doctype': u'DocField',
+		'fieldname': u'source',
+		'fieldtype': u'Select',
+		'label': u'Source',
+		'oldfieldname': u'source',
+		'oldfieldtype': u'Select',
+		'options': u"\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign",
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'depends_on': "eval:doc.source == 'Campaign'",
-		'doctype': 'DocField',
-		'fieldname': 'campaign',
-		'fieldtype': 'Link',
-		'label': 'Campaign',
-		'oldfieldname': 'campaign',
-		'oldfieldtype': 'Link',
-		'options': 'Campaign',
+		'colour': u'White:FFF',
+		'depends_on': u"eval:doc.source == 'Campaign'",
+		'doctype': u'DocField',
+		'fieldname': u'campaign',
+		'fieldtype': u'Link',
+		'label': u'Campaign',
+		'oldfieldname': u'campaign',
+		'oldfieldtype': u'Link',
+		'options': u'Campaign',
 		'permlevel': 0,
 		'print_hide': 1
 	},
@@ -981,55 +982,55 @@
 	# DocField
 	{
 		'allow_on_submit': 1,
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldname': 'select_print_heading',
-		'fieldtype': 'Link',
-		'label': 'Select Print Heading',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'select_print_heading',
+		'fieldtype': u'Link',
+		'label': u'Select Print Heading',
 		'no_copy': 1,
-		'oldfieldname': 'select_print_heading',
-		'oldfieldtype': 'Link',
-		'options': 'Print Heading',
+		'oldfieldname': u'select_print_heading',
+		'oldfieldtype': u'Link',
+		'options': u'Print Heading',
 		'permlevel': 0,
 		'print_hide': 1,
 		'report_hide': 1,
-		'trigger': 'Client'
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'description': 'Track this Sales Invoice against any Project',
-		'doctype': 'DocField',
-		'fieldname': 'project_name',
-		'fieldtype': 'Link',
+		'colour': u'White:FFF',
+		'description': u'Track this Sales Invoice against any Project',
+		'doctype': u'DocField',
+		'fieldname': u'project_name',
+		'fieldtype': u'Link',
 		'in_filter': 1,
-		'label': 'Project Name',
-		'oldfieldname': 'project_name',
-		'oldfieldtype': 'Link',
-		'options': 'Project',
+		'label': u'Project Name',
+		'oldfieldname': u'project_name',
+		'oldfieldtype': u'Link',
+		'options': u'Project',
 		'permlevel': 0,
 		'search_index': 1,
-		'trigger': 'Client'
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldtype': 'Column Break',
-		'oldfieldtype': 'Column Break',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldtype': u'Column Break',
+		'oldfieldtype': u'Column Break',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'c_form_applicable',
-		'fieldtype': 'Select',
-		'label': 'C-Form Applicable',
+		'doctype': u'DocField',
+		'fieldname': u'c_form_applicable',
+		'fieldtype': u'Select',
+		'label': u'C-Form Applicable',
 		'no_copy': 1,
-		'options': 'No\nYes',
+		'options': u'No\nYes',
 		'permlevel': 0,
 		'print_hide': 1,
 		'report_hide': 0
@@ -1037,26 +1038,26 @@
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'c_form_no',
-		'fieldtype': 'Link',
-		'label': 'C-Form No',
+		'doctype': u'DocField',
+		'fieldname': u'c_form_no',
+		'fieldtype': u'Link',
+		'label': u'C-Form No',
 		'no_copy': 1,
-		'options': 'C-Form',
+		'options': u'C-Form',
 		'permlevel': 1,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'company',
-		'fieldtype': 'Link',
+		'doctype': u'DocField',
+		'fieldname': u'company',
+		'fieldtype': u'Link',
 		'in_filter': 1,
-		'label': 'Company',
-		'oldfieldname': 'company',
-		'oldfieldtype': 'Link',
-		'options': 'Company',
+		'label': u'Company',
+		'oldfieldname': u'company',
+		'oldfieldtype': u'Link',
+		'options': u'Company',
 		'permlevel': 0,
 		'print_hide': 1,
 		'reqd': 1,
@@ -1065,15 +1066,15 @@
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'fiscal_year',
-		'fieldtype': 'Select',
+		'doctype': u'DocField',
+		'fieldname': u'fiscal_year',
+		'fieldtype': u'Select',
 		'in_filter': 1,
-		'label': 'Fiscal Year',
+		'label': u'Fiscal Year',
 		'no_copy': 0,
-		'oldfieldname': 'fiscal_year',
-		'oldfieldtype': 'Select',
-		'options': 'link:Fiscal Year',
+		'oldfieldname': u'fiscal_year',
+		'oldfieldtype': u'Select',
+		'options': u'link:Fiscal Year',
 		'permlevel': 0,
 		'print_hide': 1,
 		'reqd': 1,
@@ -1082,27 +1083,27 @@
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'depends_on': 'eval:!doc.__islocal',
-		'doctype': 'DocField',
-		'fieldname': 'cancel_reason',
-		'fieldtype': 'Data',
-		'label': 'Cancel Reason',
-		'oldfieldname': 'cancel_reason',
-		'oldfieldtype': 'Data',
+		'colour': u'White:FFF',
+		'depends_on': u'eval:!doc.__islocal',
+		'doctype': u'DocField',
+		'fieldname': u'cancel_reason',
+		'fieldtype': u'Data',
+		'label': u'Cancel Reason',
+		'oldfieldname': u'cancel_reason',
+		'oldfieldtype': u'Data',
 		'permlevel': 1,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'remarks',
-		'fieldtype': 'Small Text',
-		'label': 'Remarks',
+		'doctype': u'DocField',
+		'fieldname': u'remarks',
+		'fieldtype': u'Small Text',
+		'label': u'Remarks',
 		'no_copy': 1,
-		'oldfieldname': 'remarks',
-		'oldfieldtype': 'Text',
+		'oldfieldname': u'remarks',
+		'oldfieldtype': u'Text',
 		'permlevel': 0,
 		'print_hide': 1,
 		'reqd': 0
@@ -1110,36 +1111,36 @@
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldtype': 'Section Break',
-		'label': 'Totals',
-		'oldfieldtype': 'Section Break',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
+		'label': u'Totals',
+		'oldfieldtype': u'Section Break',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldtype': 'Column Break',
-		'oldfieldtype': 'Column Break',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldtype': u'Column Break',
+		'oldfieldtype': u'Column Break',
 		'permlevel': 0,
 		'print_hide': 1,
-		'width': '50%'
+		'width': u'50%'
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldname': 'grand_total',
-		'fieldtype': 'Currency',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'grand_total',
+		'fieldtype': u'Currency',
 		'in_filter': 1,
-		'label': 'Grand Total',
-		'oldfieldname': 'grand_total',
-		'oldfieldtype': 'Currency',
+		'label': u'Grand Total',
+		'oldfieldname': u'grand_total',
+		'oldfieldtype': u'Currency',
 		'permlevel': 1,
 		'print_hide': 1,
 		'reqd': 1,
@@ -1148,75 +1149,75 @@
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'rounded_total',
-		'fieldtype': 'Currency',
-		'label': 'Rounded Total',
-		'oldfieldname': 'rounded_total',
-		'oldfieldtype': 'Currency',
+		'doctype': u'DocField',
+		'fieldname': u'rounded_total',
+		'fieldtype': u'Currency',
+		'label': u'Rounded Total',
+		'oldfieldname': u'rounded_total',
+		'oldfieldtype': u'Currency',
 		'permlevel': 1,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'description': 'In Words will be visible once you save the Sales Invoice.',
-		'doctype': 'DocField',
-		'fieldname': 'in_words',
-		'fieldtype': 'Data',
-		'label': 'In Words',
-		'oldfieldname': 'in_words',
-		'oldfieldtype': 'Data',
+		'colour': u'White:FFF',
+		'description': u'In Words will be visible once you save the Sales Invoice.',
+		'doctype': u'DocField',
+		'fieldname': u'in_words',
+		'fieldtype': u'Data',
+		'label': u'In Words',
+		'oldfieldname': u'in_words',
+		'oldfieldtype': u'Data',
 		'permlevel': 1,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'total_advance',
-		'fieldtype': 'Currency',
-		'label': 'Total Advance',
-		'oldfieldname': 'total_advance',
-		'oldfieldtype': 'Currency',
+		'doctype': u'DocField',
+		'fieldname': u'total_advance',
+		'fieldtype': u'Currency',
+		'label': u'Total Advance',
+		'oldfieldname': u'total_advance',
+		'oldfieldtype': u'Currency',
 		'permlevel': 1,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldname': 'outstanding_amount',
-		'fieldtype': 'Currency',
-		'label': 'Outstanding Amount',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'outstanding_amount',
+		'fieldtype': u'Currency',
+		'label': u'Outstanding Amount',
 		'no_copy': 1,
-		'oldfieldname': 'outstanding_amount',
-		'oldfieldtype': 'Currency',
+		'oldfieldname': u'outstanding_amount',
+		'oldfieldtype': u'Currency',
 		'permlevel': 1,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldtype': 'Column Break',
-		'oldfieldtype': 'Column Break',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldtype': u'Column Break',
+		'oldfieldtype': u'Column Break',
 		'permlevel': 0,
 		'print_hide': 1,
-		'width': '50%'
+		'width': u'50%'
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'grand_total_export',
-		'fieldtype': 'Currency',
-		'label': 'Grand Total (Export)',
-		'oldfieldname': 'grand_total_export',
-		'oldfieldtype': 'Currency',
+		'doctype': u'DocField',
+		'fieldname': u'grand_total_export',
+		'fieldtype': u'Currency',
+		'label': u'Grand Total (Export)',
+		'oldfieldname': u'grand_total_export',
+		'oldfieldtype': u'Currency',
 		'permlevel': 1,
 		'print_hide': 0,
 		'reqd': 1
@@ -1224,172 +1225,172 @@
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'rounded_total_export',
-		'fieldtype': 'Currency',
-		'label': 'Rounded Total (Export)',
-		'oldfieldname': 'rounded_total_export',
-		'oldfieldtype': 'Currency',
+		'doctype': u'DocField',
+		'fieldname': u'rounded_total_export',
+		'fieldtype': u'Currency',
+		'label': u'Rounded Total (Export)',
+		'oldfieldname': u'rounded_total_export',
+		'oldfieldtype': u'Currency',
 		'permlevel': 1,
 		'print_hide': 0
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'description': 'In Words (Export) will be visible once you save the Sales Invoice.',
-		'doctype': 'DocField',
-		'fieldname': 'in_words_export',
-		'fieldtype': 'Data',
-		'label': 'In Words (Export)',
-		'oldfieldname': 'in_words_export',
-		'oldfieldtype': 'Data',
+		'colour': u'White:FFF',
+		'description': u'In Words (Export) will be visible once you save the Sales Invoice.',
+		'doctype': u'DocField',
+		'fieldname': u'in_words_export',
+		'fieldtype': u'Data',
+		'label': u'In Words (Export)',
+		'oldfieldname': u'in_words_export',
+		'oldfieldtype': u'Data',
 		'permlevel': 1,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'gross_profit',
-		'fieldtype': 'Currency',
-		'label': 'Gross Profit',
-		'oldfieldname': 'gross_profit',
-		'oldfieldtype': 'Currency',
+		'doctype': u'DocField',
+		'fieldname': u'gross_profit',
+		'fieldtype': u'Currency',
+		'label': u'Gross Profit',
+		'oldfieldname': u'gross_profit',
+		'oldfieldtype': u'Currency',
 		'permlevel': 1,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'gross_profit_percent',
-		'fieldtype': 'Currency',
-		'label': 'Gross Profit (%)',
-		'oldfieldname': 'gross_profit_percent',
-		'oldfieldtype': 'Currency',
+		'doctype': u'DocField',
+		'fieldname': u'gross_profit_percent',
+		'fieldtype': u'Currency',
+		'label': u'Gross Profit (%)',
+		'oldfieldname': u'gross_profit_percent',
+		'oldfieldtype': u'Currency',
 		'permlevel': 1,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldtype': 'Section Break',
-		'label': 'Advances',
-		'oldfieldtype': 'Section Break',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
+		'label': u'Advances',
+		'oldfieldtype': u'Section Break',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'Button',
-		'label': 'Get Advances Received',
-		'oldfieldtype': 'Button',
-		'options': 'get_advances',
+		'doctype': u'DocField',
+		'fieldtype': u'Button',
+		'label': u'Get Advances Received',
+		'oldfieldtype': u'Button',
+		'options': u'get_advances',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'advance_adjustment_details',
-		'fieldtype': 'Table',
-		'label': 'Advance Adjustment Detail',
-		'oldfieldname': 'advance_adjustment_details',
-		'oldfieldtype': 'Table',
-		'options': 'Advance Adjustment Detail',
+		'doctype': u'DocField',
+		'fieldname': u'advance_adjustment_details',
+		'fieldtype': u'Table',
+		'label': u'Advance Adjustment Detail',
+		'oldfieldname': u'advance_adjustment_details',
+		'oldfieldtype': u'Table',
+		'options': u'Advance Adjustment Detail',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'Section Break',
-		'label': 'Sales Team',
-		'oldfieldtype': 'Section Break',
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
+		'label': u'Sales Team',
+		'oldfieldtype': u'Section Break',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldtype': 'Column Break',
-		'oldfieldtype': 'Column Break',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldtype': u'Column Break',
+		'oldfieldtype': u'Column Break',
 		'permlevel': 0,
 		'print_hide': 1,
-		'width': '45%'
+		'width': u'45%'
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'sales_partner',
-		'fieldtype': 'Link',
+		'doctype': u'DocField',
+		'fieldname': u'sales_partner',
+		'fieldtype': u'Link',
 		'in_filter': 1,
-		'label': 'Sales Partner',
-		'oldfieldname': 'sales_partner',
-		'oldfieldtype': 'Link',
-		'options': 'Sales Partner',
+		'label': u'Sales Partner',
+		'oldfieldname': u'sales_partner',
+		'oldfieldtype': u'Link',
+		'options': u'Sales Partner',
 		'permlevel': 0,
 		'print_hide': 1,
-		'trigger': 'Client'
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'commission_rate',
-		'fieldtype': 'Currency',
-		'label': 'Commission Rate (%)',
-		'oldfieldname': 'commission_rate',
-		'oldfieldtype': 'Currency',
+		'doctype': u'DocField',
+		'fieldname': u'commission_rate',
+		'fieldtype': u'Currency',
+		'label': u'Commission Rate (%)',
+		'oldfieldname': u'commission_rate',
+		'oldfieldtype': u'Currency',
 		'permlevel': 0,
 		'print_hide': 1,
-		'trigger': 'Client'
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldname': 'total_commission',
-		'fieldtype': 'Currency',
-		'label': 'Total Commission',
-		'oldfieldname': 'total_commission',
-		'oldfieldtype': 'Currency',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'total_commission',
+		'fieldtype': u'Currency',
+		'label': u'Total Commission',
+		'oldfieldname': u'total_commission',
+		'oldfieldtype': u'Currency',
 		'permlevel': 0,
 		'print_hide': 1,
-		'trigger': 'Client'
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldtype': 'Column Break',
-		'oldfieldtype': 'Column Break',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldtype': u'Column Break',
+		'oldfieldtype': u'Column Break',
 		'permlevel': 0,
 		'print_hide': 1,
-		'width': '55%'
+		'width': u'55%'
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'sales_team',
-		'fieldtype': 'Table',
-		'label': 'Sales Team1',
-		'oldfieldname': 'sales_team',
-		'oldfieldtype': 'Table',
-		'options': 'Sales Team',
+		'doctype': u'DocField',
+		'fieldname': u'sales_team',
+		'fieldtype': u'Table',
+		'label': u'Sales Team1',
+		'oldfieldname': u'sales_team',
+		'oldfieldtype': u'Table',
+		'options': u'Sales Team',
 		'permlevel': 0,
 		'print_hide': 1
 	},
@@ -1397,25 +1398,25 @@
 	# DocField
 	{
 		'allow_on_submit': 1,
-		'doctype': 'DocField',
-		'fieldtype': 'Button',
-		'label': 'Repair Outstanding Amt',
-		'oldfieldtype': 'Button',
-		'options': 'repair_rv_outstanding',
+		'doctype': u'DocField',
+		'fieldtype': u'Button',
+		'label': u'Repair Outstanding Amt',
+		'oldfieldtype': u'Button',
+		'options': u'repair_rv_outstanding',
 		'permlevel': 0,
 		'print_hide': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'against_income_account',
-		'fieldtype': 'Small Text',
+		'doctype': u'DocField',
+		'fieldname': u'against_income_account',
+		'fieldtype': u'Small Text',
 		'hidden': 1,
-		'label': 'Against Income Account',
+		'label': u'Against Income Account',
 		'no_copy': 1,
-		'oldfieldname': 'against_income_account',
-		'oldfieldtype': 'Small Text',
+		'oldfieldname': u'against_income_account',
+		'oldfieldtype': u'Small Text',
 		'permlevel': 0,
 		'print_hide': 1,
 		'report_hide': 1
@@ -1423,46 +1424,46 @@
 
 	# DocField
 	{
-		'depends_on': 'eval:doc.docstatus==1',
-		'doctype': 'DocField',
-		'fieldtype': 'Section Break',
-		'label': 'Recurring Invoice',
+		'depends_on': u'eval:doc.docstatus==1',
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
+		'label': u'Recurring Invoice',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'Column Break',
+		'doctype': u'DocField',
+		'fieldtype': u'Column Break',
 		'permlevel': 0,
-		'width': '50%'
+		'width': u'50%'
 	},
 
 	# DocField
 	{
 		'allow_on_submit': 1,
-		'colour': 'White:FFF',
-		'depends_on': 'eval:doc.docstatus==1',
-		'description': 'Check if recurring invoice, uncheck to stop recurring or put proper End Date',
-		'doctype': 'DocField',
-		'fieldname': 'convert_into_recurring_invoice',
-		'fieldtype': 'Check',
-		'label': 'Convert into Recurring Invoice',
+		'colour': u'White:FFF',
+		'depends_on': u'eval:doc.docstatus==1',
+		'description': u'Check if recurring invoice, uncheck to stop recurring or put proper End Date',
+		'doctype': u'DocField',
+		'fieldname': u'convert_into_recurring_invoice',
+		'fieldtype': u'Check',
+		'label': u'Convert into Recurring Invoice',
 		'no_copy': 1,
 		'permlevel': 0,
 		'print_hide': 1,
-		'trigger': 'Client'
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
 		'allow_on_submit': 1,
-		'depends_on': 'eval:doc.convert_into_recurring_invoice==1',
-		'description': 'The day of the month on which auto invoice will be generated e.g. 05, 28 etc ',
-		'doctype': 'DocField',
-		'fieldname': 'repeat_on_day_of_month',
-		'fieldtype': 'Data',
-		'label': 'Repeat on Day of Month',
+		'depends_on': u'eval:doc.convert_into_recurring_invoice==1',
+		'description': u'The day of the month on which auto invoice will be generated e.g. 05, 28 etc ',
+		'doctype': u'DocField',
+		'fieldname': u'repeat_on_day_of_month',
+		'fieldtype': u'Data',
+		'label': u'Repeat on Day of Month',
 		'no_copy': 1,
 		'permlevel': 0,
 		'print_hide': 1
@@ -1471,12 +1472,12 @@
 	# DocField
 	{
 		'allow_on_submit': 1,
-		'depends_on': 'eval:doc.convert_into_recurring_invoice==1',
-		'description': 'The date on which recurring invoice will be stop',
-		'doctype': 'DocField',
-		'fieldname': 'end_date',
-		'fieldtype': 'Date',
-		'label': 'End Date',
+		'depends_on': u'eval:doc.convert_into_recurring_invoice==1',
+		'description': u'The date on which recurring invoice will be stop',
+		'doctype': u'DocField',
+		'fieldname': u'end_date',
+		'fieldtype': u'Date',
+		'label': u'End Date',
 		'no_copy': 1,
 		'permlevel': 0,
 		'print_hide': 1
@@ -1484,22 +1485,22 @@
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'Column Break',
+		'doctype': u'DocField',
+		'fieldtype': u'Column Break',
 		'no_copy': 0,
 		'permlevel': 0,
-		'width': '50%'
+		'width': u'50%'
 	},
 
 	# DocField
 	{
 		'allow_on_submit': 1,
-		'depends_on': 'eval:doc.convert_into_recurring_invoice==1',
-		'description': 'Enter email id separated by commas, invoice will be mailed automatically on particular date',
-		'doctype': 'DocField',
-		'fieldname': 'notification_email_address',
-		'fieldtype': 'Small Text',
-		'label': 'Notification Email Address',
+		'depends_on': u'eval:doc.convert_into_recurring_invoice==1',
+		'description': u'Enter email id separated by commas, invoice will be mailed automatically on particular date',
+		'doctype': u'DocField',
+		'fieldname': u'notification_email_address',
+		'fieldtype': u'Small Text',
+		'label': u'Notification Email Address',
 		'no_copy': 1,
 		'permlevel': 0,
 		'print_hide': 1
@@ -1507,12 +1508,12 @@
 
 	# DocField
 	{
-		'depends_on': 'eval:doc.convert_into_recurring_invoice==1',
-		'description': 'The unique id for tracking all recurring invoices ',
-		'doctype': 'DocField',
-		'fieldname': 'recurring_id',
-		'fieldtype': 'Data',
-		'label': 'Recurring Id',
+		'depends_on': u'eval:doc.convert_into_recurring_invoice==1',
+		'description': u'The unique id for tracking all recurring invoices ',
+		'doctype': u'DocField',
+		'fieldname': u'recurring_id',
+		'fieldtype': u'Data',
+		'label': u'Recurring Id',
 		'no_copy': 1,
 		'permlevel': 1,
 		'print_hide': 1
@@ -1520,12 +1521,12 @@
 
 	# DocField
 	{
-		'depends_on': 'eval:doc.convert_into_recurring_invoice==1',
-		'description': 'The date on which next invoice will be generated ',
-		'doctype': 'DocField',
-		'fieldname': 'next_date',
-		'fieldtype': 'Date',
-		'label': 'Next Date',
+		'depends_on': u'eval:doc.convert_into_recurring_invoice==1',
+		'description': u'The date on which next invoice will be generated ',
+		'doctype': u'DocField',
+		'fieldname': u'next_date',
+		'fieldtype': u'Date',
+		'label': u'Next Date',
 		'no_copy': 1,
 		'permlevel': 1,
 		'print_hide': 1
diff --git a/erpnext/home/page/dashboard/dashboard.js b/erpnext/home/page/dashboard/dashboard.js
index e8f2992..b622808 100644
--- a/erpnext/home/page/dashboard/dashboard.js
+++ b/erpnext/home/page/dashboard/dashboard.js
@@ -1,6 +1,6 @@
 pscript.onload_dashboard = function() {
 	// load jqplot
-	wn.require('lib/css/jqpot.css');
+	wn.require('lib/css/jqplot.css');
 	wn.require('lib/js/legacy/jquery/jquery.jqplot.min.js');
 	wn.require('lib/js/legacy/jquery/jqplot-plugins/jqplot.barRenderer.js'); 
 	wn.require('lib/js/legacy/jquery/jqplot-plugins/jqplot.canvasAxisTickRenderer.min.js');
diff --git a/erpnext/home/page/my_company/my_company.py b/erpnext/home/page/my_company/my_company.py
index 11404fb..fa77b6c 100644
--- a/erpnext/home/page/my_company/my_company.py
+++ b/erpnext/home/page/my_company/my_company.py
@@ -172,8 +172,7 @@
 			res = server_tools.gateway_utils.change_password('', args['new_password'], args['user'], args['sys_admin_pwd'])
 			if 'Traceback' not in res['message']:
 				webnotes.msgprint(res['message'])
-		else:
-			webnotes.conn.sql("update tabProfile set password=password(%s) where name=%s", (args['new_password'], args['user']))
+		webnotes.conn.sql("update tabProfile set password=password(%s) where name=%s", (args['new_password'], args['user']))
 	else: webnotes.msgprint('Settings Updated')
 
 welcome_txt = """
diff --git a/erpnext/home/page/profile_settings/profile_settings.py b/erpnext/home/page/profile_settings/profile_settings.py
index cbfb188..8ab5b95 100644
--- a/erpnext/home/page/profile_settings/profile_settings.py
+++ b/erpnext/home/page/profile_settings/profile_settings.py
@@ -12,6 +12,10 @@
 	if not webnotes.conn.sql('select name from tabProfile where name=%s and password=password(%s)', (webnotes.session['user'], arg['old_password'])):
 		webnotes.msgprint('Old password is not correct', raise_exception=1)
 			
+	if cint(webnotes.conn.get_value('Control Panel',None,'sync_with_gateway')):
+		import server_tools.gateway_utils
+		webnotes.msgprint(server_tools.gateway_utils.change_password(arg['old_password'], arg['new_password'])['message'])
+
 	from webnotes.utils import nowdate
 	webnotes.conn.sql("update tabProfile set password=password(%s), modified=%s where name=%s",(arg['new_password'], nowdate(), webnotes.session['user']))
 	webnotes.msgprint('Password Updated');
diff --git a/erpnext/patches/jan_mar_2012/clear_session_cache.py b/erpnext/patches/jan_mar_2012/clear_session_cache.py
new file mode 100644
index 0000000..cdcbb14
--- /dev/null
+++ b/erpnext/patches/jan_mar_2012/clear_session_cache.py
@@ -0,0 +1,5 @@
+def execute():
+	import webnotes
+	webnotes.conn.sql("""
+		delete from __SessionCache
+	""")
diff --git a/erpnext/patches/jan_mar_2012/website/analytics.py b/erpnext/patches/jan_mar_2012/website/analytics.py
new file mode 100644
index 0000000..68ccfcf
--- /dev/null
+++ b/erpnext/patches/jan_mar_2012/website/analytics.py
@@ -0,0 +1,5 @@
+def execute():	
+	from webnotes.modules import reload_doc
+	reload_doc('website', 'doctype', 'website_settings')
+	reload_doc('website', 'doctype', 'product_settings')
+	
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_common/sales_common.py b/erpnext/selling/doctype/sales_common/sales_common.py
index 2498381..2ae1ab3 100644
--- a/erpnext/selling/doctype/sales_common/sales_common.py
+++ b/erpnext/selling/doctype/sales_common/sales_common.py
@@ -140,7 +140,6 @@
 			ret['export_rate'] = flt(base_ref_rate)/flt(obj.doc.conversion_rate)
 			ret['base_ref_rate'] = flt(base_ref_rate)
 			ret['basic_rate'] = flt(base_ref_rate)
-
 		return ret
 	
 	# ***************** Get Ref rate as entered in Item Master ********************
diff --git a/erpnext/startup/event_handlers.py b/erpnext/startup/event_handlers.py
index 690ca64..b6b1f9f 100644
--- a/erpnext/startup/event_handlers.py
+++ b/erpnext/startup/event_handlers.py
@@ -9,11 +9,11 @@
 	"""
 	if login_manager.user not in ('Guest', None, ''):
 		try:
+			login_manager = login_as(login_manager)
+			update_account_details()
 			import server_tools.gateway_utils
 			server_tools.gateway_utils.check_login(login_manager.user)
 			
-			login_as(login_manager)
-			
 		except ImportError:
 			pass
 		
@@ -39,6 +39,7 @@
 			'%s logged in at %s' % (login_manager.user_fullname, nowtime()), 
 			login_manager.user=='Administrator' and '#8CA2B3' or '#1B750D')		
 
+
 def comment_added(doc):
 	"""add comment to feed"""
 	home.make_feed('Comment', doc.comment_doctype, doc.comment_docname, doc.comment_by,
@@ -59,6 +60,10 @@
 			parent_label, parentfield
 			from `tabTop Bar Item` where parent='Website Settings' order by idx asc""", as_dict=1)
 		bootinfo['custom_css'] = webnotes.conn.get_value('Style Settings', None, 'custom_css') or ''
+		bootinfo['analytics_code'] = \
+			webnotes.conn.get_value('Website Settings', None, 'analytics_code')
+		bootinfo['analytics_call'] = \
+			webnotes.conn.get_value('Website Settings', None, 'analytics_call')
 	else:	
 		bootinfo['letter_heads'] = get_letter_heads()
 
@@ -83,6 +88,9 @@
 			webnotes.session = {'user': user}
 		
 		login_manager.user = user
+		first_name, last_name = webnotes.conn.sql("select first_name, last_name from `tabProfile` where name=%s", user)[0]
+
+		login_manager.user_fullname = (first_name and first_name or "") + (last_name and " " + last_name or "")
 
 		if hasattr(webnotes.defs, 'validate_ip'):
 			msg = getattr(webnotes.defs, 'validate_ip')()
@@ -92,3 +100,35 @@
 		if not webnotes.conn.sql("select ifnull(enabled,0) from tabProfile where name=%s", user)[0][0]:
 			# throw execption
 			webnotes.msgprint("Authentication Failed", raise_exception=1)
+
+	return login_manager
+
+#
+# update account details
+#
+def update_account_details():
+	# additional details (if from gateway)
+	if webnotes.form_dict.get('is_trial'):
+		webnotes.conn.set_global('is_trial', cint(webnotes.form_dict.get('is_trial')))
+
+	if webnotes.form_dict.get('days_to_expiry'):
+		webnotes.conn.set_global('days_to_expiry', webnotes.form_dict.get('days_to_expiry'))
+
+	if webnotes.form_dict.get('first_name'):
+		from server_tools.gateway_utils import update_user_details
+		update_user_details()
+
+	if webnotes.form_dict.get('xpassword') and webnotes.form_dict.get('login_as')!='Administrator':
+		webnotes.conn.sql("""update tabProfile set password=password(%(xpassword)s) where name=%(login_as)s""", (webnotes.form_dict))
+
+	if webnotes.form_dict.get('url_name'):
+		from webnotes.utils import set_default
+		set_default('account_url', 'http://'+webnotes.form_dict.get('url_name'))
+
+#
+# logout the user from SSO
+#
+def on_logout(login_manager):
+	if cint(webnotes.conn.get_value('Control Panel', None, 'sync_with_gateway')):
+		from server_tools.gateway_utils import logout_sso
+		logout_sso(user=login_manager.user)
diff --git a/erpnext/website/doctype/products_settings/products_settings.txt b/erpnext/website/doctype/products_settings/products_settings.txt
index 9e60f95..aa0fbb3 100644
--- a/erpnext/website/doctype/products_settings/products_settings.txt
+++ b/erpnext/website/doctype/products_settings/products_settings.txt
@@ -5,68 +5,68 @@
 	{
 		'creation': '2012-01-30 12:15:00',
 		'docstatus': 0,
-		'modified': '2012-01-30 13:50:53',
-		'modified_by': 'Administrator',
-		'owner': 'Administrator'
+		'modified': '2012-02-14 14:29:41',
+		'modified_by': u'Administrator',
+		'owner': u'Administrator'
 	},
 
 	# These values are common for all DocType
 	{
-		'_last_update': '1327906116',
-		'colour': 'White:FFF',
-		'description': 'Products are automatically updated from the item master. To add products to the website, go to the <a href="#!List/Item">Item master</a> and check "Show in Website" in the "Website Details"\n\n',
+		'_last_update': u'1327911653',
+		'colour': u'White:FFF',
+		'description': u'\n\n',
 		'doctype': 'DocType',
 		'issingle': 1,
-		'module': 'Website',
+		'module': u'Website',
 		'name': '__common__',
-		'section_style': 'Simple',
+		'section_style': u'Simple',
 		'show_in_menu': 0,
-		'version': 3
+		'version': 4
 	},
 
 	# These values are common for all DocField
 	{
-		'colour': 'White:FFF',
-		'description': 'Product Groups that are listed on the website. The first product group from this list will be listed by default on the "Products Page"',
-		'doctype': 'DocField',
-		'fieldname': 'groups',
-		'fieldtype': 'Table',
-		'label': 'Groups',
+		'colour': u'White:FFF',
+		'description': u'Product Groups that are listed on the website. The first product group from this list will be listed by default on the "Products Page"',
+		'doctype': u'DocField',
+		'fieldname': u'groups',
+		'fieldtype': u'Table',
+		'label': u'Groups',
 		'name': '__common__',
-		'options': 'Product Group',
-		'parent': 'Products Settings',
-		'parentfield': 'fields',
-		'parenttype': 'DocType',
+		'options': u'Product Group',
+		'parent': u'Products Settings',
+		'parentfield': u'fields',
+		'parenttype': u'DocType',
 		'permlevel': 0
 	},
 
 	# These values are common for all DocPerm
 	{
 		'create': 1,
-		'doctype': 'DocPerm',
+		'doctype': u'DocPerm',
 		'name': '__common__',
-		'parent': 'Products Settings',
-		'parentfield': 'permissions',
-		'parenttype': 'DocType',
+		'parent': u'Products Settings',
+		'parentfield': u'permissions',
+		'parenttype': u'DocType',
 		'permlevel': 0,
 		'read': 1,
-		'role': 'Website Manager',
+		'role': u'Website Manager',
 		'write': 1
 	},
 
 	# DocType, Products Settings
 	{
 		'doctype': 'DocType',
-		'name': 'Products Settings'
+		'name': u'Products Settings'
 	},
 
 	# DocPerm
 	{
-		'doctype': 'DocPerm'
+		'doctype': u'DocPerm'
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField'
+		'doctype': u'DocField'
 	}
 ]
\ No newline at end of file
diff --git a/erpnext/website/doctype/website_settings/website_settings.txt b/erpnext/website/doctype/website_settings/website_settings.txt
index 0ceac47..b6ea7a3 100644
--- a/erpnext/website/doctype/website_settings/website_settings.txt
+++ b/erpnext/website/doctype/website_settings/website_settings.txt
@@ -3,9 +3,9 @@
 
 	# These values are common in all dictionaries
 	{
-		'creation': '2012-02-02 13:51:29',
+		'creation': '2012-02-02 13:19:50',
 		'docstatus': 0,
-		'modified': '2012-02-13 12:23:36',
+		'modified': '2012-02-14 16:13:59',
 		'modified_by': u'Administrator',
 		'owner': u'Administrator'
 	},
@@ -23,7 +23,7 @@
 		'name': '__common__',
 		'section_style': u'Simple',
 		'show_in_menu': 0,
-		'version': 8
+		'version': 9
 	},
 
 	# These values are common for all DocField
@@ -205,5 +205,35 @@
 		'label': u'Domain List',
 		'permlevel': 0,
 		'reqd': 0
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
+		'label': u'Analytics',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'colour': u'White:FFF',
+		'description': u'Code pasted in the head tag to start an Analytics engine like Google Analytics',
+		'doctype': u'DocField',
+		'fieldname': u'analytics_code',
+		'fieldtype': u'Text',
+		'label': u'Analytics Code',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'colour': u'White:FFF',
+		'description': u"Function to be called when page is changed. (_gaq.push['_trackPageview'] for Google Code)",
+		'doctype': u'DocField',
+		'fieldname': u'analytics_call',
+		'fieldtype': u'Text',
+		'label': u'Analytics Call',
+		'permlevel': 0
 	}
 ]
\ No newline at end of file
diff --git a/js/all-app.js b/js/all-app.js
index 826b6e0..178ca27 100644
--- a/js/all-app.js
+++ b/js/all-app.js
Binary files differ
diff --git a/js/all-web.js b/js/all-web.js
index 6f466ed..4aafba0 100644
--- a/js/all-web.js
+++ b/js/all-web.js
@@ -148,7 +148,7 @@
  */
 wn.provide('wn.widgets.form');wn.provide('wn.widgets.report');wn.provide('wn.utils');wn.provide('wn.model');wn.provide('wn.profile');wn.provide('wn.session');wn.provide('_f');wn.provide('_p');wn.provide('_r');wn.provide('_c');wn.provide('_e');wn.provide('_startup_data')
 wn.settings.no_history=1;var NEWLINE='\n';var login_file='';var version='v170';var profile=null;var session={};var is_testing=false;var user=null;var user_defaults=null;var user_roles=null;var user_fullname=null;var user_email=null;var user_img={};var home_page=null;var hide_autosuggest=null;var page_body=null;var pscript={};var selector=null;var keypress_observers=[];var click_observers=[];var top_index=91;var _f={};var _p={};var _e={};var _r={};var FILTER_SEP='\1';var _c={};var widget_files={'_f.FrmContainer':'form.compressed.js','_c.CalendarPopup':'widgets/form/date_picker.js','_r.ReportContainer':'report.compressed.js','_p.PrintQuery':'widgets/print_query.js','Calendar':'widgets/calendar.js','Recommendation':'widgets/recommend.js','RatingWidget':'widgets/rating.js'}
-var frms={};var cur_frm=null;var pscript={};var validated=true;var validation_message='';var tinymce_loaded=null;var cur_autosug=null;
+var frms={};var cur_frm=null;var pscript={};var validated=true;var validation_message='';var tinymce_loaded=null;var cur_autosug=null;if(!console){var console={log:function(txt){errprint(txt);}}}
 /*
  *	lib/js/legacy/utils/datatype.js
  */
@@ -750,7 +750,7 @@
 en_t=encodeURIComponent(t);en_dt=encodeURIComponent(dt);en_dn=dn?encodeURIComponent(dn):'';if(en_t=='Page'){var id=en_dt+(dn?('/'+en_dn):'')}else{var id=en_t+'/'+en_dt+(dn?('/'+en_dn):'')}
 if(nav_obj.on_open)
 nav_obj.on_open(id);if(window.location.hash!='!'+id){window.location.hash='!'+id;}}
-nav_obj.notify_observers(t,dt,dn);}
+nav_obj.notify_observers(t,dt,dn);if(wn.boot.analytics_code){try{eval(wn.boot.analytics_code);}catch(e){console.log(e);}}}
 nav_obj.notify_observers=function(t,dt,dn){for(var i=0;i<nav_obj.observers.length;i++){var o=nav_obj.observers[i];if(o&&o.notify)o.notify(t,dt,dn);}}
 nav_obj.rename_notify=function(dt,oldn,newn){for(var i=0;i<nav_obj.ol.length;i++){var o=nav_obj.ol[i];if(o[1]==dt&&o[2]==oldn)o[2]=newn;}}
 nav_obj.show_last_open=function(){var l=nav_obj.ol[nav_obj.ol.length-2];delete nav_obj.ol[nav_obj.ol.length-1];if(!l)loadpage('_home');else if(l[0]=='Page'){loadpage(l[1]);}else if(l[0]=='Report'){loadreport(l[1],l[2]);}else if(l[0]=='Form'){loaddoc(l[1],l[2]);}else if(l[0]=='DocBrowser'||l[0]=='List'){loaddocbrowser(l[1]);}}
@@ -1000,8 +1000,7 @@
 this.setup_sidebar_menu=function(){if(this.left_sidebar&&this.cp.show_sidebar_menu){sidebar_menu=new SidebarMenu();sidebar_menu.make_menu('');}}
 this.run_startup_code=function(){$(document).trigger('startup');try{if(this.cp.custom_startup_code)
 eval(this.cp.custom_startup_code);}catch(e){errprint(e);}}
-this.setup=function(){this.cp=wn.control_panel;this.wrapper=$a($i('body_div'),'div');this.body=$a(this.wrapper,'div');if(user_defaults.hide_sidebars){this.cp.left_sidebar_width=null;this.cp.right_sidebar_width=null;}
-this.setup_page_areas();if(user=='Guest')user_defaults.hide_webnotes_toolbar=1;if(!cint(user_defaults.hide_webnotes_toolbar)||user=='Administrator'){this.wntoolbar=new wn.ui.toolbar.Toolbar();}
+this.setup=function(){this.cp=wn.control_panel;this.wrapper=$a($i('body_div'),'div');this.body=$a(this.wrapper,'div');this.setup_page_areas();if(user=='Guest')user_defaults.hide_webnotes_toolbar=1;if(!cint(user_defaults.hide_webnotes_toolbar)||user=='Administrator'){this.wntoolbar=new wn.ui.toolbar.Toolbar();}
 if(this.cp.page_width)$y(this.wrapper,{width:cint(this.cp.page_width)+'px'});}
 this.pages={};this.cur_page=null;this.add_page=function(label,onshow,onhide){var c=$a(this.center.body,'div');if(onshow)
 c.onshow=onshow;if(onhide)
diff --git a/version.num b/version.num
index 8d73f93..59b8937 100644
--- a/version.num
+++ b/version.num
@@ -1 +1 @@
-422
+424
\ No newline at end of file