Merge pull request #4431 from nabinhait/leave_fix

[fix] Don't validate balance for lwp and in balance consider all leaves in the allocation period
diff --git a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.json b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.json
index d510f63..5d74c3f 100644
--- a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.json
+++ b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.json
@@ -193,7 +193,7 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "in_filter": 0, 
-   "in_list_view": 1, 
+   "in_list_view": 0, 
    "label": "Cheque Date", 
    "length": 0, 
    "no_copy": 0, 
@@ -233,6 +233,29 @@
    "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
+  }, 
+  {
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "fieldname": "data_10", 
+   "fieldtype": "Data", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
   }
  ], 
  "hide_heading": 0, 
@@ -245,7 +268,7 @@
  "istable": 1, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2015-11-30 12:52:01.090839", 
+ "modified": "2015-12-04 11:01:24.286320", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Bank Reconciliation Detail", 
diff --git a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py
index d57bf07..6ff1eea 100644
--- a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py
+++ b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py
@@ -22,8 +22,8 @@
 
 	total_debit, total_credit = 0,0
 	for d in data:
-		total_debit += flt(d.debit_in_account_currency)
-		total_credit += flt(d.credit_in_account_currency)
+		total_debit += flt(d.debit)
+		total_credit += flt(d.credit)
 
 	amounts_not_reflected_in_system = frappe.db.sql("""
 		select sum(jvd.debit_in_account_currency - jvd.credit_in_account_currency)
diff --git a/erpnext/hr/print_format/offer_letter/offer_letter.json b/erpnext/hr/print_format/offer_letter/offer_letter.json
index 40a3fe1..5764863 100644
--- a/erpnext/hr/print_format/offer_letter/offer_letter.json
+++ b/erpnext/hr/print_format/offer_letter/offer_letter.json
@@ -5,8 +5,9 @@
  "doc_type": "Offer Letter", 
  "docstatus": 0, 
  "doctype": "Print Format", 
- "html": "{% set terms_exist = (doc.terms|striptags).strip() %}\n\n{% if letter_head and not no_letterhead -%}\n    <div class=\"letter-head\">{{ letter_head }}</div>\n    <hr>\n{%- endif %}\n\n<div {% if terms_exist -%} class=\"page-break\" {%- endif %}>\n<p>\n\n<!-- offer letter content starts here, <br> is used to create new lines -->\nDate: {{ doc.offer_date }}\n<br><br>\n\nDear {{ doc.applicant_name }}, \n\n<br><br>\n\nWe are pleased to appoint you in the services of {{ doc.company }} on the terms and conditions detailed in this letter.\n\n<br><br>\n\nYour designation shall be <b>{{ doc.designation }}</b>.\n\n<br><br>\n\n<!-- offer letter terms and description from the table -->\n\n{%- if doc.offer_terms -%}\n    {%- for row in doc.offer_terms -%}\n        <b>{{ row.offer_term }}:</b> {{ row.value }}\n\n        <br>\n    {%- endfor -%}\n{%- endif -%}\n\n<br>\n\n<!-- offer letter content continues -->\n\n\nPlease read the detailed terms as below. If you have any queries, feel free to get in touch with us.\nWe look forward to your long and fruitful career association with our organisation.\nIf you decide to join us, 'Welcome to {{ doc.company }} !'\n\n<br><br>\n\n<p class=\"strong\">\n\nYours truly,\n\n<br><br><br><br>\n\nAuthorized Signatory\n\n<br>\n\n{{ doc.company }}\n\n<!-- offer letter content ends here -->\n\n</p>\n</div>\n\n<!-- offer letter terms and conditions -->\n{% if terms_exist %}\n<div> {{ doc.terms }} </div>\n{% endif %}", 
- "modified": "2015-11-18 12:53:04.997745", 
+ "html": "{% set terms_exist = doc.terms and (doc.terms|striptags).strip() or \"\" %}\n\n{% if letter_head and not no_letterhead -%}\n    <div class=\"letter-head\">{{ letter_head }}</div>\n    <hr>\n{%- endif %}\n\n<div {% if terms_exist -%} class=\"page-break\" {%- endif %}>\n<p>\n\n<!-- offer letter content starts here, <br> is used to create new lines -->\nDate: {{ doc.offer_date }}\n<br><br>\n\nDear {{ doc.applicant_name }}, \n\n<br><br>\n\nWe are pleased to appoint you in the services of {{ doc.company }} on the terms and conditions detailed in this letter.\n\n<br><br>\n\nYour designation shall be <b>{{ doc.designation }}</b>.\n\n<br><br>\n\n<!-- offer letter terms and description from the table -->\n\n{%- if doc.offer_terms -%}\n    {%- for row in doc.offer_terms -%}\n        <b>{{ row.offer_term }}:</b> {{ row.value }}\n\n        <br>\n    {%- endfor -%}\n{%- endif -%}\n\n<br>\n\n<!-- offer letter content continues -->\n\n\nPlease read the detailed terms as below. If you have any queries, feel free to get in touch with us.\nWe look forward to your long and fruitful career association with our organisation.\nIf you decide to join us, 'Welcome to {{ doc.company }} !'\n\n<br><br>\n\n<p class=\"strong\">\n\nYours truly,\n\n<br><br><br><br>\n\nAuthorized Signatory\n\n<br>\n\n{{ doc.company }}\n\n<!-- offer letter content ends here -->\n\n</p>\n</div>\n\n<!-- offer letter terms and conditions -->\n{% if terms_exist %}\n<div> {{ doc.terms }} </div>\n{% endif %}", 
+ "idx": 0, 
+ "modified": "2015-12-04 11:46:28.897657", 
  "modified_by": "Administrator", 
  "name": "Offer Letter", 
  "owner": "Administrator", 
diff --git a/erpnext/setup/utils.py b/erpnext/setup/utils.py
index e44a53f..c3bd452 100644
--- a/erpnext/setup/utils.py
+++ b/erpnext/setup/utils.py
@@ -63,6 +63,9 @@
 
 @frappe.whitelist()
 def get_exchange_rate(from_currency, to_currency):
+	if from_currency == to_currency:
+		return 1
+	
 	exchange = "%s-%s" % (from_currency, to_currency)
 	value = flt(frappe.db.get_value("Currency Exchange", exchange, "exchange_rate"))