Merge branch 'v5.0' into foreign_currency_calc
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/in_indian_chart_template_schedule6.json b/erpnext/accounts/doctype/account/chart_of_accounts/in_indian_chart_template_schedule6.json
deleted file mode 100644
index b450cad..0000000
--- a/erpnext/accounts/doctype/account/chart_of_accounts/in_indian_chart_template_schedule6.json
+++ /dev/null
@@ -1,349 +0,0 @@
-{
-    "country_code": "in",
-    "name": "Indian Chart of Accounts - Schedule VI",
-	"is_active": "Yes",
-    "tree": {
-        "Assets": {
-            "Current Assets": {
-                "Cash And Cash Equivalent": {
-                    "Bank Balance": {
-                        "Balance Account": {},
-                        "Balance Account 9876543211": {}
-                    },
-                    "Cash-In-Hand": {
-                        "Cash Balance": {
-                            "account_type": "Cash"
-                        },
-                        "Petty Cash Balance": {
-                            "account_type": "Cash"
-                        },
-                        "account_type": "Cash"
-                    },
-                    "Cheques On Hand": {
-                        "Cheque With Account": {}
-                    }
-                },
-                "Current Investment": {
-                    "In Short Term Fixed Deposits": {},
-                    "Investment In Debentures And Bonds": {},
-                    "Investment In Equity": {},
-                    "Investment In Government Securities": {},
-                    "Investment In Mutual Fund": {},
-                    "Investment In Partnership Firm": {},
-                    "Investment In Preference Shares": {}
-                },
-                "Inventories": {
-	                "account_type": "Stock",
-					"group_or_ledger": "Group"
-                },
-                "Other Current Assets": {
-                    "Duties and Taxes": {
-                        "Excise Duty Receivable": {
-                            "Education Cess Receivable On Excise Duty": {},
-                            "Excise Duty Receivable": {},
-                            "Higher Education Cess Receivable On Excise Duty": {}
-                        },
-                        "Sales Tax Receivable": {},
-                        "Service Tax Receivable": {
-                            "Education Cess Receivable On Service Tax": {},
-                            "Higher Education Cess Receivable On Service Tax": {},
-                            "Service Tax Receivable": {}
-                        },
-                        "TDS Receivable": {},
-                        "VAT Receivable": {}
-                    },
-                    "Miscellaneous Expense to the Extent Not Written Off": {
-                        "Preliminary Expense": {}
-                    }
-                },
-                "Short Terms Loans And Advances": {
-                    "Advances with Revenue Authority": {
-                        "Advance Income Tax/Refund Due": {},
-                        "Advance To Suppliers": {},
-                        "Balance With Revenue Authorities (Indirect Taxes)": {},
-                        "Prepaid Expenses": {}
-                    },
-                    "Loans And Advances From Related Parties": {
-                        "Doubtful": {},
-                        "Other Advances Unsecured and Considered as Good": {
-                            "Unsecured Recoverable in Cash or in Kind or for Value to be Received": {}
-                        },
-                        "Secured, Considered Good": {
-                            "Advance To Associate Concerns": {}
-                        }
-                    }
-                },
-                "Trade Recievables": {
-                    "Others": {
-                        "Doubtful": {},
-                        "Secured, Considered Good": {},
-                        "Unsecured, Considered Good": {}
-                    },
-                    "Outstanding For More Than Six Months": {
-                        "Doubtful": {},
-                        "Secured, Considered Good": {},
-                        "Unsecured, Considered Good": {}
-                    },
-                    "Sundry Debtors": {
-                        "account_type": "Receivable"
-                    }
-                }
-            },
-            "Non-Current Assets": {
-                "Deferred Tax Assets (Net)": {},
-                "Fixed Assets": {
-                    "Capital Work-In-Progress": {
-                        "Building Under Construction": {}
-                    },
-                    "Intangible Assets": {
-                        "Goodwill": {}
-                    },
-                    "Intangible Assets Under Development": {},
-                    "Tangible Assets": {
-                        "Buildings": {},
-                        "Computer/Laptops": {},
-                        "Furnitures And Fixtures": {},
-                        "Land": {},
-                        "Office Equipments": {},
-                        "Plant And Equipments": {},
-                        "Vehicles": {}
-                    }
-                },
-                "Long Term Loans And Advances": {
-                    "Capital Assets": {
-                        "Doubtful": {},
-                        "Secured, Considered Good": {},
-                        "Unsecured, Considered Good": {}
-                    },
-                    "Loans And Advances To Related Parties": {},
-                    "Other Loans And Advances": {},
-                    "Security Deposit": {
-                        "Doubtful": {},
-                        "Secured, Considered Good": {
-                            "Earnest Money Deposit": {},
-                            "Other Deposit": {}
-                        },
-                        "Unsecured, Considered Good": {}
-                    }
-                },
-                "Non-Current Investments": {
-                    "Investment In Debentures And Bonds": {},
-                    "Investment In Equity Instrument": {},
-                    "Investment In Government Or Trust Securities": {},
-                    "Investment In Mutual Fund": {},
-                    "Investment In Partnership Firm": {},
-                    "Investment In Preference Shares": {},
-                    "Investment In Property": {},
-                    "Other": {
-                        "Fixed Deposit With Banks-Earmarked": {},
-                        "Gold": {}
-                    }
-                },
-                "Other Non Current Assets": {
-                    "Long Term Trade Recievables": {
-                        "Doubtful": {},
-                        "Secured, Considered Good": {},
-                        "Unsecured, Considered Good": {}
-                    },
-                    "Miscellaneous Exps to the Extent Not Written Off": {
-                        "Preliminery Expense": {},
-                        "Software": {}
-                    },
-                    "Others": {}
-                }
-            },
-			"root_type": "Asset"
-        },
-        "Equity And Liabilities": {
-            "Current Liabilities": {
-                "Other Current Liabilities": {
-                    "Advance From Customers": {},
-                    "Duties and Taxes": {
-                        "Central Sales Tax Payable": {},
-                        "Excise Duty Payable": {
-                            "Education Cess Payable On Excise Duty": {},
-                            "Excise Duty Payable": {},
-                            "Higher Education Cess Payable On Excise Duty": {}
-                        },
-                        "Service Tax Payable": {
-                            "Education Cess Payable On Service Tax": {},
-                            "Higher Education Cess Payable On Service Tax": {},
-                            "Service Tax Payable": {}
-                        },
-                        "TDS Paybale": {},
-                        "VAT Payable": {}
-                    },
-                    "Out Standing Cheques for Clearance": {}
-                },
-                "Short Term Borrowings": {
-                    "Depsoits": {},
-                    "Loans And Advances From Related Parties": {},
-                    "Others": {},
-                    "Secured Loans From Bank": {
-                        "Bank Loan (Short Term)": {}
-                    }
-                },
-                "Short Term Provisions": {
-                    "Other Provisions": {
-                        "Electricity And Power Charges Payable": {},
-                        "Employee Providend Fund Payable": {},
-                        "Internet Expenses Payable": {},
-                        "Mobile Expenses Payable": {},
-                        "Provision For Expenses": {},
-                        "Provision For Taxation": {},
-                        "Secueity Expenses Payable": {},
-                        "Telephone Expenses Payable": {},
-                        "Wages Payable": {}
-                    },
-                    "Provision For Employees Benefit": {
-                        "EPF Payable": {},
-                        "Unpaid Remuneration": {}
-                    }
-                },
-                "Trade Payables": {
-                    "Sundry Creditors For Material/Supplies": {
-                        "account_type": "Payable"
-                    },
-                    "Sundry Creditors For Services": {
-                        "account_type": "Payable"
-                    }
-                }
-            },
-            "Non-Current Liabilities": {
-                "Deferred Tax Liabilities (Net)": {},
-                "Long Term Borrowings": {
-                    "Secured Loans From Bank": {
-                        "Bank Loan (Long Term)": {}
-                    },
-                    "Unsecured Loans": {
-                        "From Others": {}
-                    }
-                },
-                "Long Term Provisions": {},
-                "Other Long Term Liabilities": {}
-            },
-            "Share Application Money Pending Allotment": {
-                "Share Application Money Pending Allotment": {}
-            },
-            "Shareholder's Funds": {
-                "Money Received Against Share Warrants": {},
-                "Reserve And Surplus": {
-                    "Capital Redemption Reserve": {},
-                    "Capital Reserve": {},
-                    "Debenture Redeemption Reserve": {},
-                    "Other Reserve": {},
-                    "Revaluation Reserve": {},
-                    "Securities Premium Reserve": {},
-                    "Shares Option Outstanding Account": {},
-                    "Surplus (Profit and Loss Account)": {}
-                },
-                "Share Capital": {
-                    "Authorised Share Capital": {},
-                    "Issued, Subscribed And Paid Up Capital": {}
-                }
-            },
-			"root_type": "Liability"
-        },
-        "Total Expenses": {
-            "Changes In Inventories of Finished Goods, Work-In-Progress And Stock-In-Trade": {},
-            "Cost of Materials Consumed": {
-                "Closing Stock": {},
-                "Opening Stock": {},
-                "Purchases of Raw Materials And Stores": {
-                    "Raw Material": {},
-                    "Stores And Consumables": {}
-                }
-            },
-            "Depreciation And Amortization Expense": {
-                "Depreciation": {},
-                "Preliminary Expenses": {}
-            },
-            "Employement Benefit Expenses": {
-                "Commision To Joint M.D": {},
-                "Commision To M.D": {},
-                "Directors Remuneration": {},
-                "Directors Setting Fees": {},
-                "Salaries, Bonus, PF And ESIC": {},
-                "Staff Welfare Expense": {}
-            },
-            "Financial Cost": {
-                "Bank Charges": {},
-                "Bank Gurantee Charges": {},
-                "Interest On Car Loan": {},
-                "Interest On Cash Credit Facality": {},
-                "Interest On Other Loans": {}
-            },
-            "Other Expenses": {
-                "Administrative and Selling Expenses": {
-                    "Advertisement And Publicity": {},
-                    "Annual Service Fees": {},
-                    "Auditors Remuneration": {},
-                    "Car Expenses (Including Insurance)": {},
-                    "Computer Maintenace": {},
-                    "Conveyance Expense": {},
-                    "Custom Duty": {},
-                    "Donation": {},
-                    "Excise/ Service Tax Expenses": {},
-                    "Export Expenses": {},
-                    "General Expenses": {},
-                    "Insurance Expenses": {},
-                    "Interest On Delayed Payment of Taxes": {},
-                    "Internal Audit Fee": {},
-                    "Internet And Website Expenses": {},
-                    "Labour Welfare Expenses": {},
-                    "Legal Expenses": {},
-                    "Loan Processing Fees": {},
-                    "Office Cleaning Expense": {},
-                    "Packing and Forwarding Expense": {},
-                    "Post and Courrier Charges": {},
-                    "Postage And Telegram": {},
-                    "Prelimenary Expense W/Off": {},
-                    "Professional Charges": {},
-                    "Rent Rates And Taxes": {},
-                    "Repair And Maintenance Building": {},
-                    "Security Expesnes": {},
-                    "Software Expense W/Off": {},
-                    "Stamping Charge": {},
-                    "Stationery Expenses": {},
-                    "Telephone Expense": {},
-                    "Tender Fee And Testing Charges": {},
-                    "Travelling Expenses (Including Foreign Travelling)": {}
-                },
-                "Direct Expenses": {
-                    "Centeral Sales Tax": {},
-                    "Electrical Repairing Expense": {},
-                    "Freight Forwarding and Octroi Expenses (Local)": {},
-                    "Jobwork Charges": {},
-                    "Machinery Repair and Maintenance": {},
-                    "Material Testing Expense": {},
-                    "Measuring Expense": {},
-                    "Packing Material Expense": {},
-                    "Power and Fuel Charges": {},
-                    "Processing Labour Charges": {},
-                    "Stores and Spares": {},
-                    "Workshop Expense": {}
-                }
-            },
-            "Purchase of Stock-In-Trade": {
-                "Purchase of Stock-In-Trade": {}
-            },
-			"root_type": "Expense"
-        },
-        "Total Revenue": {
-            "Other Income": {
-                "Interest": {},
-                "Other Financial Services": {},
-                "Other Non Operating Income": {}
-            },
-            "Revenue From Operations": {
-                "Central Sales(Exclusive of Excise Duty)": {},
-                "Export Sales": {},
-                "Job Work Receipts": {},
-                "Other Operating Income": {},
-                "Product Sales": {},
-                "Sales of Services": {}
-            },
-			"root_type": "Income"
-        }
-    }
-}
diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py
index 4549498..3459918 100644
--- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py
+++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py
@@ -35,7 +35,7 @@
 
 		if (getdate(self.year_end_date) - getdate(self.year_start_date)).days > 366:
 			frappe.throw(_("Fiscal Year Start Date and Fiscal Year End Date cannot be more than a year apart."))
-	
+
 		check_duplicate_fiscal_year(self)
 
 @frappe.whitelist()
@@ -60,7 +60,7 @@
 			start_year = new_fy.year_start_date[:4]
 			end_year = new_fy.year_end_date[:4]
 			new_fy.year = start_year if start_year==end_year else (start_year + "-" + end_year)
-			
+
 			new_fy.insert()
-		except:
-			pass
\ No newline at end of file
+		except frappe.NameError:
+			pass
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
index c2632bf..95bfad5 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
@@ -109,7 +109,7 @@
 	},
 
 	on_submit: function() {
-		$.each(this.frm.doc["items"], function(i, row) {
+		$.each(this.frm.doc["items"] || [], function(i, row) {
 			if(row.purchase_receipt) frappe.model.clear_doc("Purchase Receipt", row.purchase_receipt)
 		})
 	}
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js
index 6f19476..efc3eb4 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js
@@ -14,5 +14,6 @@
 		} else if (doc.outstanding_amount > 0 && doc.due_date <= frappe.datetime.get_today()) {
 			return [__("Overdue"), "red", "oustanding_amount,>,0|due_date,<=,Today"]
 		}
-	}
+	},
+	right_column: "grand_total_export"
 };
diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.js b/erpnext/accounts/page/accounts_browser/accounts_browser.js
index efbb13a..98fc58e 100644
--- a/erpnext/accounts/page/accounts_browser/accounts_browser.js
+++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js
@@ -15,7 +15,7 @@
 
 	frappe.add_breadcrumbs("Accounts");
 
-	var main = $(wrapper).find(".layout-main"),
+	var main = wrapper.page.main,
 		chart_area = $("<div>")
 			.css({"margin-bottom": "15px", "min-height": "200px"})
 			.appendTo(main),
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.js b/erpnext/accounts/report/general_ledger/general_ledger.js
index b4f283e..cae4cc5 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.js
+++ b/erpnext/accounts/report/general_ledger/general_ledger.js
@@ -28,9 +28,6 @@
 			"width": "60px"
 		},
 		{
-			"fieldtype": "Break",
-		},
-		{
 			"fieldname":"account",
 			"label": __("Account"),
 			"fieldtype": "Link",
@@ -38,7 +35,7 @@
 			"get_query": function() {
 				var company = frappe.query_report.filters_by_name.company.get_value();
 				return {
-					"doctype": "Account", 
+					"doctype": "Account",
 					"filters": {
 						"company": company,
 					}
@@ -51,6 +48,9 @@
 			"fieldtype": "Data",
 		},
 		{
+			"fieldtype": "Break",
+		},
+		{
 			"fieldname":"group_by_voucher",
 			"label": __("Group by Voucher"),
 			"fieldtype": "Check",
@@ -62,4 +62,4 @@
 			"fieldtype": "Check",
 		}
 	]
-}
\ No newline at end of file
+}
diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js
index 1651e15..544a17a 100644
--- a/erpnext/buying/doctype/purchase_common/purchase_common.js
+++ b/erpnext/buying/doctype/purchase_common/purchase_common.js
@@ -154,7 +154,7 @@
 	project_name: function(doc, cdt, cdn) {
 		var item = frappe.get_doc(cdt, cdn);
 		if(item.project_name) {
-			$.each(this.frm.doc["items"],
+			$.each(this.frm.doc["items"] || [],
 				function(i, other_item) {
 					if(!other_item.project_name) {
 						other_item.project_name = item.project_name;
@@ -180,7 +180,7 @@
 	calculate_item_values: function() {
 		var me = this;
 
-		$.each(this.frm.doc["items"], function(i, item) {
+		$.each(this.frm.doc["items"] || [], function(i, item) {
 			frappe.model.round_floats_in(item);
 			item.amount = flt(item.rate * item.qty, precision("amount", item));
 			item.item_tax_amount = 0.0;
@@ -196,7 +196,7 @@
 		var me = this;
 
 		this.frm.doc.net_total = this.frm.doc.net_total_import = 0.0;
-		$.each(this.frm.doc["items"], function(i, item) {
+		$.each(this.frm.doc["items"] || [], function(i, item) {
 			me.frm.doc.net_total += item.base_amount;
 			me.frm.doc.net_total_import += item.amount;
 		});
@@ -205,7 +205,7 @@
 	},
 
 	calculate_totals: function() {
-		var tax_count = this.frm.doc["taxes"].length;
+		var tax_count = this.frm.doc["taxes"] ? this.frm.doc["taxes"].length : 0;
 		this.frm.doc.grand_total = flt(tax_count ?
 			this.frm.doc["taxes"][tax_count - 1].total : this.frm.doc.net_total);
 		this.frm.doc.grand_total_import = flt(tax_count ?
@@ -255,7 +255,7 @@
 
 		if(this.frm.doc["items"].length) {
 			if(!frappe.meta.get_docfield(this.frm.doc["items"][0].doctype, "item_tax_amount", this.frm.doctype)) {
-				$.each(this.frm.doc["items"], function(i, item) {
+				$.each(this.frm.doc["items"] || [], function(i, item) {
 					delete item["item_tax_amount"];
 				});
 			}
@@ -263,7 +263,7 @@
 
 		if(this.frm.doc["taxes"].length) {
 			if(!frappe.meta.get_docfield(this.frm.doc["taxes"][0].doctype, "tax_amount_after_discount_amount", this.frm.doctype)) {
-				$.each(this.frm.doc["taxes"], function(i, tax) {
+				$.each(this.frm.doc["taxes"] || [], function(i, tax) {
 					delete tax["tax_amount_after_discount_amount"];
 				});
 			}
diff --git a/erpnext/config/desktop.py b/erpnext/config/desktop.py
index 968473e..7d2a620 100644
--- a/erpnext/config/desktop.py
+++ b/erpnext/config/desktop.py
@@ -56,13 +56,5 @@
 			"icon": "icon-phone",
 			"icon": "octicon octicon-issue-opened",
 			"type": "module"
-		},
-		"Shopping Cart": {
-			"color": "#B7E090",
-			"icon": "icon-shopping-cart",
-			"icon": "octicon octicon-gift",
-			"label": _("Shopping Cart"),
-			"link": "Form/Shopping Cart Settings",
-			"type": "module"
 		}
 	}
diff --git a/erpnext/config/website.py b/erpnext/config/website.py
new file mode 100644
index 0000000..45fad66
--- /dev/null
+++ b/erpnext/config/website.py
@@ -0,0 +1,18 @@
+from frappe import _
+
+def get_data():
+	return [
+		{
+			"label": _("Shopping Cart"),
+			"icon": "icon-wrench",
+			"items": [
+				{
+					"type": "doctype",
+					"name": "Shopping Cart Settings",
+					"label": _("Shopping Cart Settings"),
+					"description": _("Settings for online shopping cart such as shipping rules, price list etc."),
+					"hide_count": True
+				}
+			]
+		}
+	]
diff --git a/erpnext/patches/v5_0/update_companywise_payment_account.py b/erpnext/patches/v5_0/update_companywise_payment_account.py
index 71d7552..0c1705f 100644
--- a/erpnext/patches/v5_0/update_companywise_payment_account.py
+++ b/erpnext/patches/v5_0/update_companywise_payment_account.py
@@ -6,6 +6,7 @@
 
 def execute():
 	frappe.reload_doc('accounts', 'doctype', 'mode_of_payment')
+	frappe.reload_doc('accounts', 'doctype', 'mode_of_payment_account')
 
 	mode_of_payment_list = frappe.db.sql("""select name, default_account
 		from `tabMode of Payment`""", as_dict=1)
@@ -14,7 +15,7 @@
 		if d.get("default_account"):
 			parent_doc = frappe.get_doc("Mode of Payment", d.get("name"))
 
-			parent_doc.set("mode_of_payment_details",
+			parent_doc.set("accounts",
 				[{"company": frappe.db.get_value("Account", d.get("default_account"), "company"),
 				"default_account": d.get("default_account")}])
 			parent_doc.save()
diff --git a/erpnext/public/js/conf.js b/erpnext/public/js/conf.js
index ac896b8..397c36b 100644
--- a/erpnext/public/js/conf.js
+++ b/erpnext/public/js/conf.js
@@ -7,7 +7,7 @@
 $(document).bind('toolbar_setup', function() {
 	frappe.app.name = "ERPNext";
 
-	$('.navbar-brand').html('ERPNext');
+	$('.navbar-brand').html('<i class="octicon octicon-home visible-xs"></i><span class="hidden-xs">ERPNext</span>');
 
 	$('[data-link="docs"]').attr("href", "https://erpnext.com/user-guide")
 });
diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js
index e5fef9c..f202fb7 100644
--- a/erpnext/public/js/transaction.js
+++ b/erpnext/public/js/transaction.js
@@ -363,7 +363,7 @@
 		if (item) {
 			append_item(item);
 		} else {
-			$.each(this.frm.doc["items"], function(i, d) {
+			$.each(this.frm.doc["items"] || [], function(i, d) {
 				append_item(d);
 			});
 		}
@@ -478,7 +478,7 @@
 		var tax_accounts = [];
 		var company_currency = this.get_company_currency();
 
-		$.each(this.frm.doc["taxes"], function(i, tax) {
+		$.each(this.frm.doc["taxes"] || [], function(i, tax) {
 			var tax_amount_precision = precision("tax_amount", tax);
 			var tax_rate_precision = precision("rate", tax);
 			$.each(JSON.parse(tax.item_wise_tax_detail || '{}'),
@@ -507,7 +507,7 @@
 
 		var distinct_item_names = [];
 		var distinct_items = [];
-		$.each(this.frm.doc["items"], function(i, item) {
+		$.each(this.frm.doc["items"] || [], function(i, item) {
 			if(distinct_item_names.indexOf(item.item_code || item.item_name)===-1) {
 				distinct_item_names.push(item.item_code || item.item_name);
 				distinct_items.push(item);
@@ -592,7 +592,7 @@
 	initialize_taxes: function() {
 		var me = this;
 
-		$.each(this.frm.doc["taxes"], function(i, tax) {
+		$.each(this.frm.doc["taxes"] || [], function(i, tax) {
 			tax.item_wise_tax_detail = {};
 			tax_fields = ["total", "tax_amount_after_discount_amount",
 				"tax_amount_for_current_item", "grand_total_for_current_item",
@@ -614,16 +614,16 @@
 		var actual_tax_dict = {};
 
 		// maintain actual tax rate based on idx
-		$.each(this.frm.doc["taxes"], function(i, tax) {
+		$.each(this.frm.doc["taxes"] || [], function(i, tax) {
 			if (tax.charge_type == "Actual") {
 				actual_tax_dict[tax.idx] = flt(tax.rate, precision("tax_amount", tax));
 			}
 		});
 
-		$.each(this.frm.doc["items"], function(n, item) {
+		$.each(this.frm.doc["items"] || [], function(n, item) {
 			var item_tax_map = me._load_item_tax_rate(item.item_tax_rate);
 
-			$.each(me.frm.doc["taxes"], function(i, tax) {
+			$.each(me.frm.doc["taxes"] || [], function(i, tax) {
 				// tax_amount represents the amount of tax for the current step
 				var current_tax_amount = me.get_current_tax_amount(item, tax, item_tax_map);
 
@@ -726,7 +726,7 @@
 	},
 
 	_cleanup: function() {
-		$.each(this.frm.doc["taxes"], function(i, tax) {
+		$.each(this.frm.doc["taxes"] || [], function(i, tax) {
 			$.each(["tax_amount_for_current_item", "grand_total_for_current_item",
 				"tax_fraction_for_current_item", "grand_total_fraction_for_current_item"],
 				function(i, fieldname) { delete tax[fieldname]; });
diff --git a/erpnext/selling/page/sales_browser/sales_browser.js b/erpnext/selling/page/sales_browser/sales_browser.js
index f716b84..5ad60f1 100644
--- a/erpnext/selling/page/sales_browser/sales_browser.js
+++ b/erpnext/selling/page/sales_browser/sales_browser.js
@@ -21,12 +21,10 @@
 			callback: function(r) {
 				var root = r.message[0]["value"];
 				erpnext.sales_chart = new erpnext.SalesChart(ctype, root, page,
-					$(wrapper)
-						.find(".layout-main-section")
-						.css({
-							"min-height": "300px",
-							"padding-bottom": "25px"
-						}));
+					page.main.css({
+						"min-height": "300px",
+						"padding-bottom": "25px"
+					}));
 			}
 		});
 	}
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index 48c378f..3c04874 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -248,7 +248,7 @@
 		var me = this;
 
 		if (!this.discount_amount_applied) {
-			$.each(this.frm.doc["items"], function(i, item) {
+			$.each(this.frm.doc["items"] || [], function(i, item) {
 				frappe.model.round_floats_in(item);
 				item.amount = flt(item.rate * item.qty, precision("amount", item));
 
@@ -261,11 +261,11 @@
 
 	determine_exclusive_rate: function() {
 		var me = this;
-		$.each(me.frm.doc["items"], function(n, item) {
+		$.each(me.frm.doc["items"] || [], function(n, item) {
 			var item_tax_map = me._load_item_tax_rate(item.item_tax_rate);
 			var cumulated_tax_fraction = 0.0;
 
-			$.each(me.frm.doc["taxes"], function(i, tax) {
+			$.each(me.frm.doc["taxes"] || [], function(i, tax) {
 				tax.tax_fraction_for_current_item = me.get_current_tax_fraction(tax, item_tax_map);
 
 				if(i==0) {
@@ -325,7 +325,7 @@
 		var me = this;
 		this.frm.doc.net_total = this.frm.doc.net_total_export = 0.0;
 
-		$.each(this.frm.doc["items"], function(i, item) {
+		$.each(this.frm.doc["items"] || [], function(i, item) {
 			me.frm.doc.net_total += item.base_amount;
 			me.frm.doc.net_total_export += item.amount;
 		});
@@ -335,7 +335,7 @@
 
 	calculate_totals: function() {
 		var me = this;
-		var tax_count = this.frm.doc["taxes"].length;
+		var tax_count = this.frm.doc["taxes"] ? this.frm.doc["taxes"].length: 0;
 
 		this.frm.doc.grand_total = flt(tax_count ? this.frm.doc["taxes"][tax_count - 1].total : this.frm.doc.net_total);
 		this.frm.doc.grand_total_export = flt(this.frm.doc.grand_total / this.frm.doc.conversion_rate);
@@ -364,7 +364,7 @@
 			var grand_total_for_discount_amount = this.get_grand_total_for_discount_amount();
 			// calculate item amount after Discount Amount
 			if (grand_total_for_discount_amount) {
-				$.each(this.frm.doc["items"], function(i, item) {
+				$.each(this.frm.doc["items"] || [], function(i, item) {
 					distributed_amount = flt(me.frm.doc.base_discount_amount) * item.base_amount / grand_total_for_discount_amount;
 					item.base_amount = flt(item.base_amount - distributed_amount, precision("base_amount", item));
 				});
@@ -382,7 +382,7 @@
 		var total_actual_tax = 0.0;
 		var actual_taxes_dict = {};
 
-		$.each(this.frm.doc["taxes"], function(i, tax) {
+		$.each(this.frm.doc["taxes"] || [], function(i, tax) {
 			if (tax.charge_type == "Actual")
 				actual_taxes_dict[tax.idx] = tax.tax_amount;
 			else if (actual_taxes_dict[tax.row_id] !== null) {
diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.js b/erpnext/setup/page/setup_wizard/setup_wizard.js
index 9a557c2..2ba6dd4 100644
--- a/erpnext/setup/page/setup_wizard/setup_wizard.js
+++ b/erpnext/setup/page/setup_wizard/setup_wizard.js
@@ -43,7 +43,7 @@
 			<p class="text-center">' +
 			__('Sit tight while your system is being setup. This may take a few moments.') +
 			'</p>' },
-		complete_html: function() { return '<h1 class="text-muted text-center"><i class="icon-thumbs-up"></i></h1>\
+		complete_html: function() { return '<h1 class="text-muted text-center"></h1>\
 			<h2 class="text-center">'+__('Setup Complete')+'</h2>\
 			<p class="text-center">' +
 			__('Your setup is complete. Refreshing...') +
@@ -210,6 +210,8 @@
 						placeholder: __('e.g. "My Company LLC"')},
 					{fieldname:'company_abbr', label: __('Company Abbreviation'), fieldtype:'Data',
 						description: __('Max 5 characters'), placeholder: __('e.g. "MC"'), reqd:1},
+					{fieldname:'bank_account', label: __('Bank Account'), fieldtype:'Data',
+						placeholder: __('e.g. "XYZ National Bank"'), reqd:1 },
 					{fieldname:'fy_start_date', label:__('Financial Year Start Date'), fieldtype:'Date',
 						description: __('Your financial year begins on'), reqd:1},
 					{fieldname:'fy_end_date', label:__('Financial Year End Date'), fieldtype:'Date',
@@ -236,7 +238,7 @@
 						var year_end_date =
 							frappe.datetime.add_days(frappe.datetime.add_months(
 								frappe.datetime.user_to_obj(slide.get_input("fy_start_date").val()), 12), -1);
-						slide.get_field("fy_end_date").set_input(frappe.datetime.obj_to_user(year_end_date));
+						slide.get_field("fy_end_date").set_input(year_end_date);
 
 					});
 				}
@@ -371,12 +373,11 @@
 		frappe.set_route(this.page_name, "0");
 	},
 	make: function() {
-		frappe.ui.set_user_background(null, "#page-setup-wizard");
 		this.parent = $('<div class="setup-wizard-wrapper">').appendTo(this.parent);
 	},
 	get_message: function(html) {
-		return $(repl('<div class="panel panel-default" data-state="setup-complete">\
-			<div class="panel-body" style="padding: 40px;">%(html)s</div>\
+		return $(repl('<div data-state="setup-complete">\
+			<div style="padding: 40px;" class="text-center">%(html)s</div>\
 		</div>', {html:html}))
 	},
 	show_working: function() {
diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.py b/erpnext/setup/page/setup_wizard/setup_wizard.py
index bf0793b..d234f4f 100644
--- a/erpnext/setup/page/setup_wizard/setup_wizard.py
+++ b/erpnext/setup/page/setup_wizard/setup_wizard.py
@@ -142,6 +142,8 @@
 		'chart_of_accounts': args.get(('chart_of_accounts')),
 	}).insert()
 
+	# Bank Account
+
 	args["curr_fiscal_year"] = curr_fiscal_year
 
 def create_price_lists(args):
diff --git a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.js b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.js
index e29dde0..6cc68e7 100644
--- a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.js
+++ b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.js
@@ -73,7 +73,7 @@
 
 	set_total_taxes_and_charges: function() {
 		total_taxes_and_charges = 0.0;
-		$.each(this.frm.doc.taxes, function(i, d) {
+		$.each(this.frm.doc.taxes || [], function(i, d) {
 			total_taxes_and_charges += flt(d.amount)
 		});
 		cur_frm.set_value("total_taxes_and_charges", total_taxes_and_charges);
@@ -83,11 +83,11 @@
 		var me = this;
 		if(this.frm.doc.taxes.length) {
 			var total_item_cost = 0.0;
-			$.each(this.frm.doc.items, function(i, d) {
+			$.each(this.frm.doc.items || [], function(i, d) {
 				total_item_cost += flt(d.amount)
 			});
 
-			$.each(this.frm.doc.items, function(i, item) {
+			$.each(this.frm.doc.items || [], function(i, item) {
 				item.applicable_charges = flt(item.amount) *  flt(me.frm.doc.total_taxes_and_charges) / flt(total_item_cost)
 			});
 			refresh_field("items");
diff --git a/erpnext/templates/form_grid/item_grid.html b/erpnext/templates/form_grid/item_grid.html
index 2803550..939d880 100644
--- a/erpnext/templates/form_grid/item_grid.html
+++ b/erpnext/templates/form_grid/item_grid.html
@@ -2,14 +2,14 @@
 
 {% if(!doc) { %}
 	<div class="row">
-		<div class="col-sm-6">{%= __("Items") %}</div>
-		<div class="col-sm-2 text-right">{%= __("Qty") %}</div>
-		<div class="col-sm-2 text-right">{%= __("Rate") %}</div>
-		<div class="col-sm-2 text-right">{%= __("Amount") %}</div>
+		<div class="col-sm-6 col-xs-8">{%= __("Items") %}</div>
+		<div class="col-sm-2 hidden-xs text-right">{%= __("Qty") %}</div>
+		<div class="col-sm-2 hidden-xs text-right">{%= __("Rate") %}</div>
+		<div class="col-sm-2 col-xs-4 text-right">{%= __("Amount") %}</div>
 	</div>
 {% } else { %}
 	<div class="row">
-		<div class="col-sm-6"><strong>{%= doc.item_code %}</strong>
+		<div class="col-sm-6 col-xs-8"><strong>{%= doc.item_code %}</strong>
 			{% if(doc.item_name != doc.item_code) { %}
 				<br>{%= doc.item_name %}{% } %}
 			{% if(doc.item_name != doc.description) { %}
@@ -56,7 +56,7 @@
 		</div>
 
 		<!-- qty -->
-		<div class="col-sm-2 text-right">
+		<div class="col-sm-2 hidden-xs text-right">
 			{%= doc.get_formatted("qty") %}
 			<br><small>{%= doc.uom || doc.stock_uom %}</small>
 			{% if(in_list(["Sales Order Item", "Purchase Order Item"],
@@ -72,7 +72,7 @@
 		</div>
 
 		<!-- rate -->
-		<div class="col-sm-2 text-right">
+		<div class="col-sm-2 hidden-xs text-right">
 			{% if (!frappe.perm.is_visible("rate", doc, frm.perm)) { %}
 				<span class="text-muted">{%= __("hidden") %}</span>
 			{% } else { %}
@@ -86,7 +86,7 @@
 		</div>
 
 		<!-- amount -->
-		<div class="col-sm-2 text-right">
+		<div class="col-sm-2 col-xs-4 text-right">
 			{% if (!frappe.perm.is_visible("amount", doc, frm.perm)) { %}
 				<span class="text-muted">{%= __("hidden") %}</span>
 			{% } else { %}
@@ -102,6 +102,13 @@
 				<br><small>&nbsp;</small>
 				{% include "templates/form_grid/includes/progress.html" %}
 			{% } %}
+
+			{% if (frappe.perm.is_visible("rate", doc, frm.perm)) { %}
+			<div class="visible-xs text-muted">
+				{%= doc.get_formatted("qty") %} <small>{%= doc.uom || doc.stock_uom %}</small>
+				x {%= doc.get_formatted("rate") %}
+			</div>
+			{% } %}
 		</div>
 	</div>
 {% } %}
diff --git a/erpnext/templates/form_grid/stock_entry_grid.html b/erpnext/templates/form_grid/stock_entry_grid.html
index 9f91308..cf9b260 100644
--- a/erpnext/templates/form_grid/stock_entry_grid.html
+++ b/erpnext/templates/form_grid/stock_entry_grid.html
@@ -5,13 +5,13 @@
 
 {% if(!doc) { %}
 	<div class="row">
-		<div class="col-sm-8">{%= __("Item") %}</div>
-		<div class="col-sm-2 text-right">{%= __("Qty") %}</div>
-		<div class="col-sm-2 text-right">{%= __("Amount") %}</div>
+		<div class="col-sm-8 col-xs-6">{%= __("Item") %}</div>
+		<div class="col-sm-2 col-xs-2 text-right">{%= __("Qty") %}</div>
+		<div class="col-sm-2 col-xs-4 text-right">{%= __("Amount") %}</div>
 	</div>
 {% } else { %}
 	<div class="row">
-		<div class="col-sm-8"><strong>{%= doc.item_code %}</strong>
+		<div class="col-sm-8 col-xs-6"><strong>{%= doc.item_code %}</strong>
 			{% if(doc.item_name != doc.item_code) { %}
 				<br>{%= doc.item_name %}{% } %}
 			{% if(doc.item_name != doc.description) { %}
@@ -31,13 +31,13 @@
 		</div>
 
 		<!-- qty -->
-		<div class="col-sm-2 text-right">
+		<div class="col-sm-2 col-xs-2 text-right">
 			{%= doc.get_formatted("qty") %}
 			<br><small>{%= doc.uom || doc.stock_uom %}</small>
 		</div>
 
 		<!-- amount -->
-		<div class="col-sm-2 text-right">
+		<div class="col-sm-2 col-xs-4 text-right">
 			{%= doc.get_formatted("amount") %}
 			<div class="small text-muted">
 				{%= doc.get_formatted("incoming_rate") %}
diff --git a/erpnext/templates/includes/transactions.html b/erpnext/templates/includes/transactions.html
index b0eda19..fb570cd 100644
--- a/erpnext/templates/includes/transactions.html
+++ b/erpnext/templates/includes/transactions.html
@@ -6,9 +6,7 @@
 	<p id="msgprint-alert" class="alert alert-danger"
 		style="display: none;">&nbsp;</p>
 	<div class="list-group transaction-list">
-		<div class="progress progress-striped active">
-			<div class="progress-bar progress-bar-info" style="width: 100%;"></div>
-		</div>
+		<div class="text-muted progress">{{ _("Loading") }}...</div>
 	</div>
 	<div class="text-center">
 		<button class="btn btn-default btn-show-more hide">More</button>
diff --git a/erpnext/templates/pages/addresses.html b/erpnext/templates/pages/addresses.html
index 5cb56c0..997143a 100644
--- a/erpnext/templates/pages/addresses.html
+++ b/erpnext/templates/pages/addresses.html
@@ -9,9 +9,7 @@
 	<p><a class="btn btn-default" href="address"><i class="icon-plus"> New Address</i></a></p>
 	<hr>
 	<div id="address-list">
-		<div class="progress progress-striped active">
-			<div class="progress-bar progress-bar-info" style="width: 100%;"></div>
-		</div>
+		<div class="text-muted progress">{{ _("Loading") }}...</div>
 	</div>
 </div>
 
diff --git a/erpnext/templates/pages/cart.html b/erpnext/templates/pages/cart.html
index a8dc03e..07e9560 100644
--- a/erpnext/templates/pages/cart.html
+++ b/erpnext/templates/pages/cart.html
@@ -6,9 +6,7 @@
 
 {% block content %}
 <div class="cart-content">
-	<div class="progress progress-striped active">
-		<div class="progress-bar progress-bar-info" style="width: 100%;"></div>
-	</div>
+	<div class="text-muted progress">{{ _("Loading") }}...</div>
 	<div id="cart-container" class="hide">
 		<p class="pull-right"><button class="btn btn-success btn-place-order" type="button">Place Order</button></p>
 		<div class="clearfix"></div>