Merge branch 'multi-company-transations' of https://github.com/shreyashah115/erpnext into shreyashah115-multi-company-transations
diff --git a/erpnext/accounts/doctype/account/account.json b/erpnext/accounts/doctype/account/account.json
index 7e118f0..668164c 100644
--- a/erpnext/accounts/doctype/account/account.json
+++ b/erpnext/accounts/doctype/account/account.json
@@ -1,711 +1,738 @@
 {
- "allow_copy": 1,
- "allow_guest_to_view": 0,
- "allow_import": 1,
- "allow_rename": 1,
- "beta": 0,
- "creation": "2013-01-30 12:49:46",
- "custom": 0,
- "description": "Heads (or groups) against which Accounting Entries are made and balances are maintained.",
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "Setup",
- "editable_grid": 0,
+ "allow_copy": 1, 
+ "allow_guest_to_view": 0, 
+ "allow_import": 1, 
+ "allow_rename": 1, 
+ "beta": 0, 
+ "creation": "2013-01-30 12:49:46", 
+ "custom": 0, 
+ "description": "Heads (or groups) against which Accounting Entries are made and balances are maintained.", 
+ "docstatus": 0, 
+ "doctype": "DocType", 
+ "document_type": "Setup", 
+ "editable_grid": 0, 
  "fields": [
   {
-   "allow_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "properties",
-   "fieldtype": "Section Break",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldtype": "Section Break",
-   "permlevel": 0,
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "remember_last_selected_value": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
-   "translatable": 0,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "properties", 
+   "fieldtype": "Section Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldtype": "Section Break", 
+   "permlevel": 0, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "column_break0",
-   "fieldtype": "Column Break",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "remember_last_selected_value": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
-   "translatable": 0,
-   "unique": 0,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "column_break0", 
+   "fieldtype": "Column Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
+   "unique": 0, 
    "width": "50%"
-  },
+  }, 
   {
-   "allow_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "account_name",
-   "fieldtype": "Data",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 1,
-   "in_standard_filter": 0,
-   "label": "Account Name",
-   "length": 0,
-   "no_copy": 1,
-   "oldfieldname": "account_name",
-   "oldfieldtype": "Data",
-   "permlevel": 0,
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "remember_last_selected_value": 0,
-   "report_hide": 0,
-   "reqd": 1,
-   "search_index": 0,
-   "set_only_once": 0,
-   "translatable": 0,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "account_name", 
+   "fieldtype": "Data", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 1, 
+   "in_standard_filter": 0, 
+   "label": "Account Name", 
+   "length": 0, 
+   "no_copy": 1, 
+   "oldfieldname": "account_name", 
+   "oldfieldtype": "Data", 
+   "permlevel": 0, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 1, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "account_number",
-   "fieldtype": "Data",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 1,
-   "in_standard_filter": 1,
-   "label": "Account Number",
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 1,
-   "remember_last_selected_value": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
-   "translatable": 0,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "account_number", 
+   "fieldtype": "Data", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 1, 
+   "in_standard_filter": 1, 
+   "label": "Account Number", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "default": "0",
-   "fieldname": "is_group",
-   "fieldtype": "Check",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Is Group",
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "remember_last_selected_value": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
-   "translatable": 0,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "default": "0", 
+   "fieldname": "is_group", 
+   "fieldtype": "Check", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Is Group", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "company",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 1,
-   "label": "Company",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "company",
-   "oldfieldtype": "Link",
-   "options": "Company",
-   "permlevel": 0,
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 1,
-   "remember_last_selected_value": 1,
-   "report_hide": 0,
-   "reqd": 1,
-   "search_index": 0,
-   "set_only_once": 0,
-   "translatable": 0,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "company", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 1, 
+   "label": "Company", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "company", 
+   "oldfieldtype": "Link", 
+   "options": "Company", 
+   "permlevel": 0, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "remember_last_selected_value": 1, 
+   "report_hide": 0, 
+   "reqd": 1, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "root_type",
-   "fieldtype": "Select",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 1,
-   "label": "Root Type",
-   "length": 0,
-   "no_copy": 0,
-   "options": "\nAsset\nLiability\nIncome\nExpense\nEquity",
-   "permlevel": 0,
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 1,
-   "remember_last_selected_value": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
-   "translatable": 0,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "root_type", 
+   "fieldtype": "Select", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 1, 
+   "label": "Root Type", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "\nAsset\nLiability\nIncome\nExpense\nEquity", 
+   "permlevel": 0, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "report_type",
-   "fieldtype": "Select",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 1,
-   "label": "Report Type",
-   "length": 0,
-   "no_copy": 0,
-   "options": "\nBalance Sheet\nProfit and Loss",
-   "permlevel": 0,
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 1,
-   "remember_last_selected_value": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
-   "translatable": 0,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "report_type", 
+   "fieldtype": "Select", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 1, 
+   "label": "Report Type", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "\nBalance Sheet\nProfit and Loss", 
+   "permlevel": 0, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "eval:doc.is_group==0",
-   "fieldname": "account_currency",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Currency",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Currency",
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "remember_last_selected_value": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
-   "translatable": 0,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval:doc.is_group==0", 
+   "fieldname": "account_currency", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Currency", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Currency", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "column_break1",
-   "fieldtype": "Column Break",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "remember_last_selected_value": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
-   "translatable": 0,
-   "unique": 0,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "default": "0", 
+   "fieldname": "inter_company_account", 
+   "fieldtype": "Check", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Inter Company Account", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "column_break1", 
+   "fieldtype": "Column Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
+   "unique": 0, 
    "width": "50%"
-  },
+  }, 
   {
-   "allow_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "parent_account",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 1,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Parent Account",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "parent_account",
-   "oldfieldtype": "Link",
-   "options": "Account",
-   "permlevel": 0,
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "remember_last_selected_value": 0,
-   "report_hide": 0,
-   "reqd": 1,
-   "search_index": 1,
-   "set_only_once": 0,
-   "translatable": 0,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "parent_account", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 1, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Parent Account", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "parent_account", 
+   "oldfieldtype": "Link", 
+   "options": "Account", 
+   "permlevel": 0, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 1, 
+   "search_index": 1, 
+   "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "description": "Setting Account Type helps in selecting this Account in transactions.",
-   "fieldname": "account_type",
-   "fieldtype": "Select",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 1,
-   "label": "Account Type",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "account_type",
-   "oldfieldtype": "Select",
-   "options": "\nAccumulated Depreciation\nBank\nCash\nChargeable\nCost of Goods Sold\nDepreciation\nEquity\nExpense Account\nExpenses Included In Valuation\nFixed Asset\nIncome Account\nPayable\nReceivable\nRound Off\nStock\nStock Adjustment\nStock Received But Not Billed\nTax\nTemporary",
-   "permlevel": 0,
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "remember_last_selected_value": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
-   "translatable": 0,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "description": "Setting Account Type helps in selecting this Account in transactions.", 
+   "fieldname": "account_type", 
+   "fieldtype": "Select", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 1, 
+   "label": "Account Type", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "account_type", 
+   "oldfieldtype": "Select", 
+   "options": "\nAccumulated Depreciation\nBank\nCash\nChargeable\nCost of Goods Sold\nDepreciation\nEquity\nExpense Account\nExpenses Included In Valuation\nFixed Asset\nIncome Account\nPayable\nReceivable\nRound Off\nStock\nStock Adjustment\nStock Received But Not Billed\nTax\nTemporary", 
+   "permlevel": 0, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "description": "Rate at which this tax is applied",
-   "fieldname": "tax_rate",
-   "fieldtype": "Float",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Rate",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "tax_rate",
-   "oldfieldtype": "Currency",
-   "permlevel": 0,
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "remember_last_selected_value": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
-   "translatable": 0,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "description": "Rate at which this tax is applied", 
+   "fieldname": "tax_rate", 
+   "fieldtype": "Float", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Rate", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "tax_rate", 
+   "oldfieldtype": "Currency", 
+   "permlevel": 0, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "description": "If the account is frozen, entries are allowed to restricted users.",
-   "fieldname": "freeze_account",
-   "fieldtype": "Select",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Frozen",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "freeze_account",
-   "oldfieldtype": "Select",
-   "options": "No\nYes",
-   "permlevel": 0,
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "remember_last_selected_value": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
-   "translatable": 0,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "description": "If the account is frozen, entries are allowed to restricted users.", 
+   "fieldname": "freeze_account", 
+   "fieldtype": "Select", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Frozen", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "freeze_account", 
+   "oldfieldtype": "Select", 
+   "options": "No\nYes", 
+   "permlevel": 0, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "balance_must_be",
-   "fieldtype": "Select",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Balance must be",
-   "length": 0,
-   "no_copy": 0,
-   "options": "\nDebit\nCredit",
-   "permlevel": 0,
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "remember_last_selected_value": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
-   "translatable": 0,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "balance_must_be", 
+   "fieldtype": "Select", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Balance must be", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "\nDebit\nCredit", 
+   "permlevel": 0, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "lft",
-   "fieldtype": "Int",
-   "hidden": 1,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Lft",
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "print_hide": 1,
-   "print_hide_if_no_value": 0,
-   "read_only": 1,
-   "remember_last_selected_value": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 1,
-   "set_only_once": 0,
-   "translatable": 0,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "lft", 
+   "fieldtype": "Int", 
+   "hidden": 1, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Lft", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 1, 
+   "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "rgt",
-   "fieldtype": "Int",
-   "hidden": 1,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Rgt",
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "print_hide": 1,
-   "print_hide_if_no_value": 0,
-   "read_only": 1,
-   "remember_last_selected_value": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 1,
-   "set_only_once": 0,
-   "translatable": 0,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "rgt", 
+   "fieldtype": "Int", 
+   "hidden": 1, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Rgt", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 1, 
+   "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "old_parent",
-   "fieldtype": "Data",
-   "hidden": 1,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Old Parent",
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "print_hide": 1,
-   "print_hide_if_no_value": 0,
-   "read_only": 1,
-   "remember_last_selected_value": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
-   "translatable": 0,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "old_parent", 
+   "fieldtype": "Data", 
+   "hidden": 1, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Old Parent", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "icon": "fa fa-money",
- "idx": 1,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2018-04-04 03:23:20.011949",
- "modified_by": "Administrator",
- "module": "Accounts",
- "name": "Account",
- "owner": "Administrator",
+ ], 
+ "has_web_view": 0, 
+ "hide_heading": 0, 
+ "hide_toolbar": 0, 
+ "icon": "fa fa-money", 
+ "idx": 1, 
+ "image_view": 0, 
+ "in_create": 0, 
+ "is_submittable": 0, 
+ "issingle": 0, 
+ "istable": 0, 
+ "max_attachments": 0, 
+ "modified": "2018-05-02 11:00:34.108490", 
+ "modified_by": "Administrator", 
+ "module": "Accounts", 
+ "name": "Account", 
+ "owner": "Administrator", 
  "permissions": [
   {
-   "amend": 0,
-   "apply_user_permissions": 0,
-   "cancel": 0,
-   "create": 1,
-   "delete": 1,
-   "email": 1,
-   "export": 1,
-   "if_owner": 0,
-   "import": 1,
-   "permlevel": 0,
-   "print": 1,
-   "read": 1,
-   "report": 1,
-   "role": "Accounts User",
-   "set_user_permissions": 0,
-   "share": 1,
-   "submit": 0,
+   "amend": 0, 
+   "cancel": 0, 
+   "create": 1, 
+   "delete": 1, 
+   "email": 1, 
+   "export": 1, 
+   "if_owner": 0, 
+   "import": 1, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Accounts User", 
+   "set_user_permissions": 0, 
+   "share": 1, 
+   "submit": 0, 
    "write": 1
-  },
+  }, 
   {
-   "amend": 0,
-   "apply_user_permissions": 0,
-   "cancel": 0,
-   "create": 0,
-   "delete": 0,
-   "email": 1,
-   "export": 0,
-   "if_owner": 0,
-   "import": 0,
-   "permlevel": 0,
-   "print": 1,
-   "read": 1,
-   "report": 1,
-   "role": "Auditor",
-   "set_user_permissions": 0,
-   "share": 0,
-   "submit": 0,
+   "amend": 0, 
+   "cancel": 0, 
+   "create": 0, 
+   "delete": 0, 
+   "email": 1, 
+   "export": 0, 
+   "if_owner": 0, 
+   "import": 0, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Auditor", 
+   "set_user_permissions": 0, 
+   "share": 0, 
+   "submit": 0, 
    "write": 0
-  },
+  }, 
   {
-   "amend": 0,
-   "apply_user_permissions": 0,
-   "cancel": 0,
-   "create": 0,
-   "delete": 0,
-   "email": 1,
-   "export": 0,
-   "if_owner": 0,
-   "import": 0,
-   "permlevel": 0,
-   "print": 1,
-   "read": 1,
-   "report": 1,
-   "role": "Sales User",
-   "set_user_permissions": 0,
-   "share": 0,
-   "submit": 0,
+   "amend": 0, 
+   "cancel": 0, 
+   "create": 0, 
+   "delete": 0, 
+   "email": 1, 
+   "export": 0, 
+   "if_owner": 0, 
+   "import": 0, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Sales User", 
+   "set_user_permissions": 0, 
+   "share": 0, 
+   "submit": 0, 
    "write": 0
-  },
+  }, 
   {
-   "amend": 0,
-   "apply_user_permissions": 0,
-   "cancel": 0,
-   "create": 0,
-   "delete": 0,
-   "email": 1,
-   "export": 0,
-   "if_owner": 0,
-   "import": 0,
-   "permlevel": 0,
-   "print": 1,
-   "read": 1,
-   "report": 1,
-   "role": "Purchase User",
-   "set_user_permissions": 0,
-   "share": 0,
-   "submit": 0,
+   "amend": 0, 
+   "cancel": 0, 
+   "create": 0, 
+   "delete": 0, 
+   "email": 1, 
+   "export": 0, 
+   "if_owner": 0, 
+   "import": 0, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Purchase User", 
+   "set_user_permissions": 0, 
+   "share": 0, 
+   "submit": 0, 
    "write": 0
-  },
+  }, 
   {
-   "amend": 0,
-   "apply_user_permissions": 0,
-   "cancel": 0,
-   "create": 1,
-   "delete": 1,
-   "email": 1,
-   "export": 1,
-   "if_owner": 0,
-   "import": 1,
-   "permlevel": 0,
-   "print": 1,
-   "read": 1,
-   "report": 1,
-   "role": "Accounts Manager",
-   "set_user_permissions": 1,
-   "share": 1,
-   "submit": 0,
+   "amend": 0, 
+   "cancel": 0, 
+   "create": 1, 
+   "delete": 1, 
+   "email": 1, 
+   "export": 1, 
+   "if_owner": 0, 
+   "import": 1, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Accounts Manager", 
+   "set_user_permissions": 1, 
+   "share": 1, 
+   "submit": 0, 
    "write": 1
   }
- ],
- "quick_entry": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "search_fields": "account_number",
- "show_name_in_global_search": 1,
- "sort_order": "ASC",
- "track_changes": 1,
+ ], 
+ "quick_entry": 0, 
+ "read_only": 0, 
+ "read_only_onload": 0, 
+ "search_fields": "account_number", 
+ "show_name_in_global_search": 1, 
+ "sort_order": "ASC", 
+ "track_changes": 1, 
  "track_seen": 0
 }
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js
index 9302a24..dd44450 100644
--- a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js
+++ b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js
@@ -3,6 +3,97 @@
 
 frappe.ui.form.on('Exchange Rate Revaluation', {
 	refresh: function(frm) {
+		if(frm.doc.docstatus==1) {
+			frm.add_custom_button(__('Make Journal Entry'), function() {
+				return frm.events.make_jv(frm);
+			});
+		}
+	},
 
+	get_entries: function(frm) {
+		frappe.call({
+			method: "get_accounts_data",
+			doc: cur_frm.doc,
+			callback: function(r){
+				frappe.model.clear_table(frm.doc, "accounts");
+				if(r.message) {
+					r.message.forEach((d) => {
+						cur_frm.add_child("accounts",d);
+					});
+					frm.events.get_total_gain_loss(frm);
+					refresh_field("accounts");
+				}
+			}
+		});
+	},
+
+	get_total_gain_loss: function(frm) {
+		if(!(frm.doc.accounts && frm.doc.accounts.length)) return;
+
+		let total_gain_loss = 0;
+		frm.doc.accounts.forEach((d) => {
+			d.gain_loss = flt(d.new_balance_in_base_currency, precision("new_balance_in_base_currency", d)) - flt(d.balance_in_base_currency, precision("balance_in_base_currency", d));
+			total_gain_loss += flt(d.gain_loss, precision("gain_loss", d));
+		});
+		
+		frm.set_value("total_gain_loss", flt(total_gain_loss, precision("total_gain_loss")));
+		frm.refresh_fields();
+	},
+
+	make_jv : function(frm) {
+		frappe.call({
+			method: "make_jv_entry",
+			doc: frm.doc,
+			callback: function(r){
+				if (r.message)
+					var doc = frappe.model.sync(r.message)[0];
+				frappe.set_route("Form", doc.doctype, doc.name);
+			}
+		});
 	}
 });
+
+frappe.ui.form.on("Exchange Rate Revaluation Account", {
+	new_exchange_rate: function(frm, cdt, cdn) {
+		var row = frappe.get_doc(cdt, cdn);
+		row.new_balance_in_base_currency = flt(row.new_exchange_rate * flt(row.balance_in_account_currency),
+			precision("new_balance_in_base_currency", row));
+		row.gain_loss = row.new_balance_in_base_currency - flt(row.balance_in_base_currency);
+		refresh_field("accounts");
+		frm.events.get_total_gain_loss(frm);
+	},
+
+	account: function(frm, cdt, cdn) {
+		get_account_details(frm, cdt, cdn);
+	},
+
+	party: function(frm, cdt, cdn) {
+		get_account_details(frm, cdt, cdn);
+	},
+
+	accounts_remove: function(frm) {
+		frm.events.get_total_gain_loss(frm);
+	}
+});
+
+var get_account_details = function(frm, cdt, cdn) {
+	var row = frappe.get_doc(cdt, cdn);
+	if(!frm.doc.company || !frm.doc.posting_date) {
+		frappe.throw(__("Please select Company and Posting Date to getting entries"));
+	}
+	frappe.call({
+		method: "erpnext.accounts.doctype.exchange_rate_revaluation.exchange_rate_revaluation.get_account_details",
+		args:{
+			account: row.account,
+			company: frm.doc.company,
+			posting_date: frm.doc.posting_date,
+			party_type: row.party_type,
+			party: row.party
+		},
+		callback: function(r){
+			$.extend(row, r.message);
+			refresh_field("accounts");
+			frm.events.get_total_gain_loss(frm);
+		}
+	});
+};
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.json b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.json
index 3d30292..b37c67e 100644
--- a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.json
+++ b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.json
@@ -19,6 +19,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "default": "Today", 
    "fieldname": "posting_date", 
    "fieldtype": "Date", 
    "hidden": 0, 
@@ -173,7 +174,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "exchange_rate_revaluation_account", 
+   "fieldname": "accounts", 
    "fieldtype": "Table", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -184,7 +185,7 @@
    "in_standard_filter": 0, 
    "label": "Exchange Rate Revaluation Account", 
    "length": 0, 
-   "no_copy": 0, 
+   "no_copy": 1, 
    "options": "Exchange Rate Revaluation Account", 
    "permlevel": 0, 
    "precision": "", 
@@ -302,7 +303,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2018-04-13 19:19:01.029331", 
+ "modified": "2018-05-05 17:50:56.352167", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Exchange Rate Revaluation", 
diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py
index 46abddc..aa19a9e 100644
--- a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py
+++ b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py
@@ -3,8 +3,168 @@
 # For license information, please see license.txt
 
 from __future__ import unicode_literals
-import frappe
+import frappe, erpnext
+from frappe import _
+from frappe.utils import flt
 from frappe.model.document import Document
+from frappe.model.meta import get_field_precision
+from erpnext.setup.utils import get_exchange_rate
+from erpnext.accounts.doctype.journal_entry.journal_entry import get_balance_on
 
 class ExchangeRateRevaluation(Document):
-	pass
+	def validate(self):
+		self.set_total_gain_loss()
+
+	def set_total_gain_loss(self):
+		total_gain_loss = 0
+		for d in self.accounts:
+			d.gain_loss = flt(d.new_balance_in_base_currency, d.precision("new_balance_in_base_currency")) \
+				- flt(d.balance_in_base_currency, d.precision("balance_in_base_currency"))
+			total_gain_loss += flt(d.gain_loss, d.precision("gain_loss"))
+		self.total_gain_loss = flt(total_gain_loss, self.precision("total_gain_loss"))
+	
+	def validate_mandatory(self):
+		if not (self.company and self.posting_date):
+			frappe.throw(_("Please select Company and Posting Date to getting entries"))
+
+	def get_accounts_data(self, account=None):
+		accounts = []
+		self.validate_mandatory()
+		company_currency = erpnext.get_company_currency(self.company)
+		precision = get_field_precision(frappe.get_meta("Exchange Rate Revaluation Account")
+			.get_field("new_balance_in_base_currency"), company_currency)
+		for d in self.get_accounts_from_gle():
+			
+			current_exchange_rate = d.balance / d.balance_in_account_currency \
+				if d.balance_in_account_currency else 0
+			new_exchange_rate = get_exchange_rate(d.account_currency, company_currency, self.posting_date)
+			new_balance_in_base_currency = flt(d.balance_in_account_currency * new_exchange_rate)
+			gain_loss = flt(new_balance_in_base_currency, precision) - flt(d.balance, precision)
+			if gain_loss:
+				accounts.append({
+					"account": d.account,
+					"party_type": d.party_type,
+					"party": d.party,
+					"account_currency": d.account_currency,
+					"balance_in_base_currency": d.balance,
+					"balance_in_account_currency": d.balance_in_account_currency,
+					"current_exchange_rate": current_exchange_rate,
+					"new_exchange_rate": new_exchange_rate,
+					"new_balance_in_base_currency": new_balance_in_base_currency
+				})
+		return accounts
+
+	def get_accounts_from_gle(self):
+		company_currency = erpnext.get_company_currency(self.company)
+		accounts = frappe.db.sql_list("""
+			select name
+			from tabAccount
+			where is_group = 0
+				and report_type = 'Balance Sheet'
+				and root_type in ('Asset', 'Liability', 'Equity')
+				and account_type != 'Stock'
+				and company=%s
+				and account_currency != %s
+			order by name""",(self.company, company_currency))
+
+		account_details = frappe.db.sql("""
+			select 
+				account, party_type, party, account_currency,
+				sum(debit_in_account_currency) - sum(credit_in_account_currency) as balance_in_account_currency,
+				sum(debit) - sum(credit) as balance
+			from `tabGL Entry`
+			where account in (%s)
+			group by account, party_type, party
+			having sum(debit) != sum(credit)
+			order by account
+		""" % ', '.join(['%s']*len(accounts)), tuple(accounts), as_dict=1)
+
+		return account_details
+
+	def make_jv_entry(self):
+		if self.total_gain_loss == 0:
+			return
+
+		unrealized_exchange_gain_loss_account = frappe.db.get_value("Company", self.company,
+			"unrealized_exchange_gain_loss_account")
+		if not unrealized_exchange_gain_loss_account:
+			frappe.throw(_("Please set Unrealized Exchange Gain/Loss Account in Company {0}")
+				.format(self.company))
+
+		journal_entry = frappe.new_doc('Journal Entry')
+		journal_entry.voucher_type = 'Exchange Rate Revaluation'
+		journal_entry.company = self.company
+		journal_entry.posting_date = self.posting_date
+		journal_entry.multi_currency = 1
+
+		journal_entry_accounts = []
+		for d in self.accounts:
+			dr_or_cr = "debit_in_account_currency" \
+				if d.get("balance_in_account_currency") > 0 else "credit_in_account_currency"
+
+			reverse_dr_or_cr = "debit_in_account_currency" \
+				if dr_or_cr=="credit_in_account_currency" else "credit_in_account_currency"
+
+			journal_entry_accounts.append({
+				"account": d.get("account"),
+				"party_type": d.get("party_type"),
+				"party": d.get("party"),
+				"account_currency": d.get("account_currency"),
+				"balance": d.get("balance_in_account_currency"),
+				dr_or_cr: abs(d.get("balance_in_account_currency")),
+				"exchange_rate":d.get("new_exchange_rate"),
+				"reference_type": "Exchange Rate Revaluation",
+				"reference_name": self.name,
+				})
+			journal_entry_accounts.append({
+				"account": d.get("account"),
+				"party_type": d.get("party_type"),
+				"party": d.get("party"),
+				"account_currency": d.get("account_currency"),
+				"balance": d.get("balance_in_account_currency"),
+				reverse_dr_or_cr: abs(d.get("balance_in_account_currency")),
+				"exchange_rate": d.get("current_exchange_rate"),
+				"reference_type": "Exchange Rate Revaluation",
+				"reference_name": self.name
+				})
+
+		journal_entry_accounts.append({
+			"account": unrealized_exchange_gain_loss_account,
+			"balance": get_balance_on(unrealized_exchange_gain_loss_account),
+			"debit_in_account_currency": abs(self.total_gain_loss) if self.total_gain_loss < 0 else 0,
+			"credit_in_account_currency": self.total_gain_loss if self.total_gain_loss > 0 else 0,
+			"exchange_rate": 1,
+			"reference_type": "Exchange Rate Revaluation",
+			"reference_name": self.name,
+			})
+
+		journal_entry.set("accounts", journal_entry_accounts)
+		journal_entry.set_amounts_in_company_currency()
+		journal_entry.set_total_debit_credit()
+		return journal_entry.as_dict()
+
+@frappe.whitelist()
+def get_account_details(account, company, posting_date, party_type=None, party=None):
+	account_currency, account_type = frappe.db.get_value("Account", account,
+		["account_currency", "account_type"])
+	if account_type in ["Receivable", "Payable"] and not (party_type and party):
+		frappe.throw(_("Party Type and Party is mandatory for {0} account").format(account_type))
+
+	account_details = {}
+	company_currency = erpnext.get_company_currency(company)
+	balance = get_balance_on(account, party_type=party_type, party=party, in_account_currency=False)
+	if balance:
+		balance_in_account_currency = get_balance_on(account, party_type=party_type, party=party)
+		current_exchange_rate = balance / balance_in_account_currency if balance_in_account_currency else 0
+		new_exchange_rate = get_exchange_rate(account_currency, company_currency, posting_date)
+		new_balance_in_base_currency = balance_in_account_currency * new_exchange_rate
+		account_details = {
+			"account_currency": account_currency,
+			"balance_in_base_currency": balance,
+			"balance_in_account_currency": balance_in_account_currency,
+			"current_exchange_rate": current_exchange_rate,
+			"new_exchange_rate": new_exchange_rate,
+			"new_balance_in_base_currency": new_balance_in_base_currency
+		}
+
+	return account_details
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation_account/exchange_rate_revaluation_account.json b/erpnext/accounts/doctype/exchange_rate_revaluation_account/exchange_rate_revaluation_account.json
index 66561a0..e834266 100644
--- a/erpnext/accounts/doctype/exchange_rate_revaluation_account/exchange_rate_revaluation_account.json
+++ b/erpnext/accounts/doctype/exchange_rate_revaluation_account/exchange_rate_revaluation_account.json
@@ -50,16 +50,142 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "balance_in_base_currency", 
+   "fieldname": "party_type", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Party Type", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "DocType", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "party", 
+   "fieldtype": "Dynamic Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Party", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "party_type", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "column_break_2", 
+   "fieldtype": "Column Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "account_currency", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Account Currency", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Currency", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "balance_in_account_currency", 
    "fieldtype": "Currency", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_global_search": 0, 
-   "in_list_view": 1, 
+   "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Balance In Base Currency", 
+   "label": "Balance In Account Currency", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -81,8 +207,8 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "balance_in_alternate_currency", 
-   "fieldtype": "Currency", 
+   "fieldname": "balances", 
+   "fieldtype": "Section Break", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -90,14 +216,14 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Balance In Alternate Currency", 
+   "label": "", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
-   "read_only": 1, 
+   "read_only": 0, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
@@ -143,6 +269,67 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "fieldname": "balance_in_base_currency", 
+   "fieldtype": "Currency", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 1, 
+   "in_standard_filter": 0, 
+   "label": "Balance In Base Currency", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "column_break_9", 
+   "fieldtype": "Column Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
    "fieldname": "new_exchange_rate", 
    "fieldtype": "Float", 
    "hidden": 0, 
@@ -205,7 +392,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "difference", 
+   "fieldname": "gain_loss", 
    "fieldtype": "Currency", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -214,7 +401,7 @@
    "in_global_search": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
-   "label": "Difference", 
+   "label": "Gain/Loss", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -241,7 +428,7 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2018-04-13 18:30:57.531401", 
+ "modified": "2018-05-05 17:03:03.512559", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Exchange Rate Revaluation Account", 
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js
index 98f68d5..9aa8de1 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.js
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js
@@ -37,6 +37,55 @@
 
 		// hide /unhide fields based on currency
 		erpnext.journal_entry.toggle_fields_based_on_currency(frm);
+
+		if ((frm.doc.voucher_type == "Inter Company Journal Entry") && (frm.doc.docstatus == 1) && (!frm.doc.inter_company_journal_entry_reference)) {
+			frm.add_custom_button(__("Make Inter Company Journal Entry"),
+				function() {
+					frm.trigger("make_inter_company_journal_entry");
+				}
+			);
+		}
+	},
+
+	make_inter_company_journal_entry: function(frm) {
+		var d = new frappe.ui.Dialog({
+			title: __("Select Company"),
+			fields: [
+				{
+					'fieldname': 'company',
+					'fieldtype': 'Link',
+					'label': __('Company'),
+					'options': 'Company',
+					"get_query": function () {
+						return {
+							filters: [
+								["Company", "name", "!=", frm.doc.company]
+							]
+						};
+					},
+					'reqd': 1
+				}
+			],
+		});
+		d.set_primary_action(__("Make"), function() {
+			d.hide();
+			var args = d.get_values();
+			frappe.call({
+				args: {
+					"name": frm.doc.name,
+					"voucher_type": frm.doc.voucher_type,
+					"company": args.company
+				},
+				method: "erpnext.accounts.doctype.journal_entry.journal_entry.make_inter_company_journal_entry",
+				callback: function (r) {
+					if (r.message) {
+						var doc = frappe.model.sync(r.message)[0];
+						frappe.set_route("Form", doc.doctype, doc.name);
+					}
+				}
+			});
+		});
+		d.show();
 	},
 
 	multi_currency: function(frm) {
@@ -549,9 +598,15 @@
 	},
 
 	account_query: function(frm) {
+		var inter_company = 0;
+		if (frm.doc.voucher_type == "Inter Company Journal Entry") {
+			inter_company = 1;
+		}
+
 		var filters = {
 			company: frm.doc.company,
-			is_group: 0
+			is_group: 0,
+			inter_company_account: inter_company
 		};
 		if(!frm.doc.multi_currency) {
 			$.extend(filters, {
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.json b/erpnext/accounts/doctype/journal_entry/journal_entry.json
index 2ae085d..916c71f 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.json
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.json
@@ -96,7 +96,7 @@
    "no_copy": 0, 
    "oldfieldname": "voucher_type", 
    "oldfieldtype": "Select", 
-   "options": "Journal Entry\nBank Entry\nCash Entry\nCredit Card Entry\nDebit Note\nCredit Note\nContra Entry\nExcise Entry\nWrite Off Entry\nOpening Entry\nDepreciation Entry", 
+   "options": "Journal Entry\nInter Company Journal Entry\nBank Entry\nCash Entry\nCredit Card Entry\nDebit Note\nCredit Note\nContra Entry\nExcise Entry\nWrite Off Entry\nOpening Entry\nDepreciation Entry\nExchange Rate Revaluation", 
    "permlevel": 0, 
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
@@ -830,7 +830,7 @@
    "no_copy": 0, 
    "permlevel": 0, 
    "precision": "", 
-   "print_hide": 0, 
+   "print_hide": 1, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "remember_last_selected_value": 0, 
@@ -847,6 +847,39 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "depends_on": "eval:doc.voucher_type== \"Inter Company Journal Entry\"", 
+   "fieldname": "inter_company_journal_entry_reference", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Inter Company Journal Entry Reference", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Journal Entry", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
    "fieldname": "column_break98", 
    "fieldtype": "Column Break", 
    "hidden": 0, 
@@ -1520,7 +1553,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2018-04-16 17:34:38.429196", 
+ "modified": "2018-05-05 13:11:33.696498", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Journal Entry", 
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index 2e4dd83..f9ffbcd 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -3,7 +3,7 @@
 
 from __future__ import unicode_literals
 import frappe, erpnext, json
-from frappe.utils import cstr, flt, fmt_money, formatdate, getdate
+from frappe.utils import cstr, flt, fmt_money, formatdate, getdate, nowdate
 from frappe import msgprint, _, scrub
 from erpnext.controllers.accounts_controller import AccountsController
 from erpnext.accounts.utils import get_balance_on, get_account_currency
@@ -40,15 +40,17 @@
 		self.validate_credit_debit_note()
 		self.validate_empty_accounts_table()
 		self.set_account_and_party_balance()
+		self.validate_inter_company_accounts()
 		if not self.title:
 			self.title = self.get_title()
 
 	def on_submit(self):
 		self.check_credit_limit()
 		self.make_gl_entries()
-		self.update_loan()
 		self.update_advance_paid()
 		self.update_expense_claim()
+		self.update_loan()
+		self.update_inter_company_jv()
 
 	def get_title(self):
 		return self.pay_to_recd_from or self.accounts[0].account
@@ -64,6 +66,20 @@
 			for voucher_no in list(set(order_list)):
 				frappe.get_doc(voucher_type, voucher_no).set_total_advance_paid()
 
+	def validate_inter_company_accounts(self):
+		if self.voucher_type == "Inter Company Journal Entry" and self.inter_company_journal_entry_reference:
+			doc = frappe.get_doc("Journal Entry", self.inter_company_journal_entry_reference)
+			account_currency = frappe.db.get_value("Company", self.company, "default_currency")
+			previous_account_currency = frappe.db.get_value("Company", doc.company, "default_currency")
+			if account_currency == previous_account_currency:
+				if self.total_credit != doc.total_debit or self.total_debit != doc.total_credit:
+					frappe.throw(_("Total Credit/ Debit Amount should be same as linked Journal Entry"))
+
+	def update_inter_company_jv(self):
+		if self.voucher_type == "Inter Company Journal Entry" and self.inter_company_journal_entry_reference:
+			frappe.db.set_value("Journal Entry", self.inter_company_journal_entry_reference,\
+				"inter_company_journal_entry_reference", self.name)
+
 	def on_cancel(self):
 		from erpnext.accounts.utils import unlink_ref_doc_from_payment_entries
 		from erpnext.hr.doctype.salary_slip.salary_slip import unlink_ref_doc_from_salary_slip
@@ -75,6 +91,7 @@
 		self.update_loan()
 		self.unlink_advance_entry_reference()
 		self.unlink_asset_reference()
+		self.unlink_inter_company_jv()
 
 	def unlink_advance_entry_reference(self):
 		for d in self.get("accounts"):
@@ -97,6 +114,13 @@
 						asset.db_set("value_after_depreciation", asset.value_after_depreciation)
 						asset.set_status()
 
+	def unlink_inter_company_jv(self):
+		if self.voucher_type == "Inter Company Journal Entry" and self.inter_company_journal_entry_reference:
+			frappe.db.set_value("Journal Entry", self.inter_company_journal_entry_reference,\
+				"inter_company_journal_entry_reference", "")
+			frappe.db.set_value("Journal Entry", self.name,\
+				"inter_company_journal_entry_reference", "")
+
 	def validate_party(self):
 		for d in self.get("accounts"):
 			account_type = frappe.db.get_value("Account", d.account, "account_type")
@@ -127,7 +151,7 @@
 				if (d.party_type == 'Customer' and flt(d.credit) > 0) or \
 						(d.party_type == 'Supplier' and flt(d.debit) > 0):
 					if d.is_advance=="No":
-						msgprint(_("Row {0}: Please check 'Is Advance' against Account {1} if this is an advance entry.").format(d.idx, d.account))
+						msgprint(_("Row {0}: Please check 'Is Advance' against Account {1} if this is an advance entry.").format(d.idx, d.account), alert=True)
 					elif d.reference_type in ("Sales Order", "Purchase Order") and d.is_advance != "Yes":
 						frappe.throw(_("Row {0}: Payment against Sales/Purchase Order should always be marked as advance").format(d.idx))
 
@@ -907,4 +931,13 @@
 		bank_balance_in_company_currency = get_balance_on(account, in_account_currency=False)
 		exchange_rate = bank_balance_in_company_currency / bank_balance_in_account_currency
 
-	return exchange_rate
\ No newline at end of file
+	return exchange_rate
+
+@frappe.whitelist()
+def make_inter_company_journal_entry(name, voucher_type, company):
+	journal_entry = frappe.new_doc('Journal Entry')
+	journal_entry.voucher_type = voucher_type
+	journal_entry.company = company
+	journal_entry.posting_date = nowdate()
+	journal_entry.inter_company_journal_entry_reference = name
+	return journal_entry.as_dict()
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json
index 98a2a29..eddcd5e 100644
--- a/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json
+++ b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json
@@ -44,6 +44,7 @@
    "reqd": 1, 
    "search_index": 1, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0, 
    "width": "250px"
   }, 
@@ -75,6 +76,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -107,6 +109,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -142,6 +145,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0, 
    "width": "180px"
   }, 
@@ -171,6 +175,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -201,6 +206,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -231,6 +237,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -262,6 +269,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -294,6 +302,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -325,6 +334,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -354,6 +364,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -384,6 +395,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -413,6 +425,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -444,6 +457,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -477,6 +491,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -505,6 +520,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -536,6 +552,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -569,6 +586,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -598,6 +616,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -618,7 +637,7 @@
    "label": "Reference Type", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "\nSales Invoice\nPurchase Invoice\nJournal Entry\nSales Order\nPurchase Order\nExpense Claim\nAsset\nLoan\nPayroll Entry\nEmployee Advance", 
+   "options": "\nSales Invoice\nPurchase Invoice\nJournal Entry\nSales Order\nPurchase Order\nExpense Claim\nAsset\nLoan\nPayroll Entry\nEmployee Advance\nExchange Rate Revaluation", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -629,6 +648,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -660,8 +680,42 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
-  },
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval:doc.reference_type&&!in_list(doc.reference_type, ['Expense Claim', 'Asset', 'Employee Loan', 'Employee Advance'])", 
+   "fieldname": "reference_due_date", 
+   "fieldtype": "Select", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Reference Due Date", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
+   "unique": 0
+  }, 
   {
    "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
@@ -691,6 +745,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -719,6 +774,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -751,6 +807,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -782,6 +839,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }
  ], 
@@ -795,7 +853,7 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-12-07 19:54:19.851534", 
+ "modified": "2018-05-05 17:50:25.961397", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Journal Entry Account", 
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.html b/erpnext/accounts/report/general_ledger/general_ledger.html
index 9a2205a..40469ae 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.html
+++ b/erpnext/accounts/report/general_ledger/general_ledger.html
@@ -2,7 +2,7 @@
 <h4 class="text-center">
 	{% if (filters.party_name) { %}
 		{%= filters.party_name %}
-	{% } else if (filters.party) { %}
+	{% } else if (filters.party && filters.show_name) { %}
 		{%= filters.party %}
 	{% } else if (filters.account) { %}
 		{%= filters.account %}
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.js b/erpnext/accounts/report/general_ledger/general_ledger.js
index 6438263..5e8f9cf 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.js
+++ b/erpnext/accounts/report/general_ledger/general_ledger.js
@@ -72,31 +72,60 @@
 		{
 			"fieldname":"party",
 			"label": __("Party"),
-			"fieldtype": "Dynamic Link",
-			"get_options": function() {
+			"fieldtype": "MultiSelect",
+			get_data: function() {
+				if(!frappe.query_report_filters_by_name) return;
+
 				var party_type = frappe.query_report_filters_by_name.party_type.get_value();
-				var party = frappe.query_report_filters_by_name.party.get_value();
-				if(party && !party_type) {
+				var parties = frappe.query_report_filters_by_name.party.get_value();
+				if(!party_type) {
 					frappe.throw(__("Please select Party Type first"));
 				}
-				return party_type;
+
+				const values = parties.split(/\s*,\s*/).filter(d => d);
+				const txt = parties.match(/[^,\s*]*$/)[0] || '';
+				let data = [];
+
+				frappe.call({
+					type: "GET",
+					method:'frappe.desk.search.search_link',
+					async: false,
+					no_spinner: true,
+					args: {
+						doctype: frappe.query_report_filters_by_name.party_type.get_value(),
+						txt: txt,
+						filters: {
+							"name": ["not in", values]
+						}
+					},
+					callback: function(r) {
+						data = r.results;
+					}
+				});
+				return data;
 			},
 			on_change: function() {
 				var party_type = frappe.query_report_filters_by_name.party_type.get_value();
-				var party = frappe.query_report_filters_by_name.party.get_value();
-				if(!party_type || !party) {
-					frappe.query_report_filters_by_name.party_name.set_value("");
-					return;
-				}
-				var fieldname = erpnext.utils.get_party_name(party_type) || "name";
-				frappe.db.get_value(party_type, party, fieldname, function(value) {
-					frappe.query_report_filters_by_name.party_name.set_value(value[fieldname]);
-				});
+				var parties = frappe.query_report_filters_by_name.party.get_value();
+				const values = parties.split(/\s*,\s*/).filter(d => d);
 
-				if (party_type === "Customer" || party_type === "Supplier") {
-					frappe.db.get_value(party_type, party, "tax_id", function(value) {
-						frappe.query_report_filters_by_name.tax_id.set_value(value["tax_id"]);
+				if(!party_type || !parties || values.length>1) {
+					frappe.query_report_filters_by_name.party_name.set_value("");
+					frappe.query_report_filters_by_name.tax_id.set_value("");
+					return;
+				} else {
+					var party = values[0];
+					frappe.query_report_filters_by_name.show_name = true;
+					var fieldname = erpnext.utils.get_party_name(party_type) || "name";
+					frappe.db.get_value(party_type, party, fieldname, function(value) {
+						frappe.query_report_filters_by_name.party_name.set_value(value[fieldname]);
 					});
+
+					if (party_type === "Customer" || party_type === "Supplier") {
+						frappe.db.get_value(party_type, party, "tax_id", function(value) {
+							frappe.query_report_filters_by_name.tax_id.set_value(value["tax_id"]);
+						});
+					}
 				}
 			}
 		},
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py
index d6972b9..7fd653e 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.py
+++ b/erpnext/accounts/report/general_ledger/general_ledger.py
@@ -20,6 +20,10 @@
 	for acc in frappe.db.sql("""select name, is_group from tabAccount""", as_dict=1):
 		account_details.setdefault(acc.name, acc)
 
+	if filters.get('party'):
+		parties = str(filters.get("party")).strip()
+		filters.party = [d.strip() for d in parties.split(',') if d]
+
 	validate_filters(filters, account_details)
 
 	validate_party(filters)
@@ -57,14 +61,13 @@
 	if party:
 		if not party_type:
 			frappe.throw(_("To filter based on Party, select Party Type first"))
-		elif not frappe.db.exists(party_type, party):
-			frappe.throw(_("Invalid {0}: {1}").format(party_type, party))
-
+		else:
+			for d in party:
+				if not frappe.db.exists(party_type, d):
+					frappe.throw(_("Invalid {0}: {1}").format(party_type, d))
 
 def set_account_currency(filters):
-	if not (filters.get("account") or filters.get("party")):
-		return filters
-	else:
+	if filters.get("account") or (filters.get('party') and len(filters.party) == 1):
 		filters["company_currency"] = frappe.db.get_value("Company", filters.company, "default_currency")
 		account_currency = None
 
@@ -73,7 +76,7 @@
 		elif filters.get("party"):
 			gle_currency = frappe.db.get_value(
 				"GL Entry", {
-					"party_type": filters.party_type, "party": filters.party, "company": filters.company
+					"party_type": filters.party_type, "party": filters.party[0], "company": filters.company
 				},
 				"account_currency"
 			)
@@ -82,14 +85,14 @@
 				account_currency = gle_currency
 			else:
 				account_currency = None if filters.party_type in ["Employee", "Student", "Shareholder"] else \
-					frappe.db.get_value(filters.party_type, filters.party, "default_currency")
+					frappe.db.get_value(filters.party_type, filters.party[0], "default_currency")
 
 		filters["account_currency"] = account_currency or filters.company_currency
 
 		if filters.account_currency != filters.company_currency:
 			filters["show_in_account_currency"] = 1
 
-		return filters
+	return filters
 
 def get_result(filters, account_details):
 	gl_entries = get_gl_entries(filters)
@@ -151,7 +154,7 @@
 		conditions.append("party_type=%(party_type)s")
 
 	if filters.get("party"):
-		conditions.append("party=%(party)s")
+		conditions.append("party in %(party)s")
 
 	if not (filters.get("account") or filters.get("party") or
 		filters.get("group_by") in ["Group by Account", "Group by Party"]):
diff --git a/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/exchange-rate-revaluation-submit.png b/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/exchange-rate-revaluation-submit.png
new file mode 100644
index 0000000..98f629f
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/exchange-rate-revaluation-submit.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/exchange-rate-revaluation.png b/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/exchange-rate-revaluation.png
new file mode 100644
index 0000000..fbd584b
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/exchange-rate-revaluation.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/field_set_company.png b/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/field_set_company.png
new file mode 100644
index 0000000..94484f6
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/field_set_company.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/journal-entry.png b/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/journal-entry.png
new file mode 100644
index 0000000..cf204bb
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/journal-entry.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/inter-company-jv-submit.png b/erpnext/docs/assets/img/accounts/inter-company-jv-submit.png
new file mode 100644
index 0000000..bde53da
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/inter-company-jv-submit.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/inter-company-jv.png b/erpnext/docs/assets/img/accounts/inter-company-jv.png
new file mode 100644
index 0000000..c8041fb
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/inter-company-jv.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/internal-account.png b/erpnext/docs/assets/img/accounts/internal-account.png
new file mode 100644
index 0000000..eb990ac
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/internal-account.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/linked-jv.png b/erpnext/docs/assets/img/accounts/linked-jv.png
new file mode 100644
index 0000000..9f44486
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/linked-jv.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/select-company-jv.png b/erpnext/docs/assets/img/accounts/select-company-jv.png
new file mode 100644
index 0000000..d005658
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/select-company-jv.png
Binary files differ
diff --git a/erpnext/docs/assets/img/human-resources/employee_promotion.png b/erpnext/docs/assets/img/human-resources/employee_promotion.png
new file mode 100644
index 0000000..d9ca321
--- /dev/null
+++ b/erpnext/docs/assets/img/human-resources/employee_promotion.png
Binary files differ
diff --git a/erpnext/docs/assets/img/human-resources/employee_promotion_1.png b/erpnext/docs/assets/img/human-resources/employee_promotion_1.png
new file mode 100644
index 0000000..a0bc9cc
--- /dev/null
+++ b/erpnext/docs/assets/img/human-resources/employee_promotion_1.png
Binary files differ
diff --git a/erpnext/docs/assets/img/human-resources/employee_transfer.png b/erpnext/docs/assets/img/human-resources/employee_transfer.png
new file mode 100644
index 0000000..edc641e
--- /dev/null
+++ b/erpnext/docs/assets/img/human-resources/employee_transfer.png
Binary files differ
diff --git a/erpnext/docs/assets/img/human-resources/employee_transfer_1.png b/erpnext/docs/assets/img/human-resources/employee_transfer_1.png
new file mode 100644
index 0000000..f9f87e6
--- /dev/null
+++ b/erpnext/docs/assets/img/human-resources/employee_transfer_1.png
Binary files differ
diff --git a/erpnext/docs/user/manual/en/accounts/exchange-rate-revaluation.md b/erpnext/docs/user/manual/en/accounts/exchange-rate-revaluation.md
new file mode 100644
index 0000000..d4887d0
--- /dev/null
+++ b/erpnext/docs/user/manual/en/accounts/exchange-rate-revaluation.md
@@ -0,0 +1,35 @@
+# Exchange Rate Revaluation
+
+In ERPNext, you can make accounting entries in multiple currency. For example, if you have a bank account in foreign currency, you can make transactions in that currency and system will show bank balance in that specific currency only.
+
+## Setup
+
+To get started with multi-currency accounting, you need to assign accounting currency in Account record. You can define Currency from Chart of Accounts while creating Account.
+
+<img class="screenshot" alt="Set Currency from Chart of Accounts"  	src="{{docs_base_url}}/assets/img/accounts/multi-currency/chart-of-accounts.png">
+
+You can also assign / modify the currency by opening specific Account record for existing Accounts.
+
+<img class="screenshot" alt="Modify Account Currency"  	src="{{docs_base_url}}/assets/img/accounts/multi-currency/account.png">
+
+### Exchange Rate Revaluation
+
+Exchange Rate Revaluation feature is for dealing the situation when you have a multiple currency accounts in one company's chart of accounts
+
+Steps :
+
+1. Set the 'Unrealized Exchange / Gain Loss Account' field in Company DocType. This aacount is to balance the difference of total credit and total debit.
+
+<img class="screenshot" alt="Field Set for Comapny"  	src="{{docs_base_url}}/assets/img/accounts/exchange-rate-revaluation/field_set_company.png">
+
+2. Select the Company.
+
+3. Click the Get Entries button. It shows the accounts which having different currency as compare to 'Default Currency' in Company DocType. It will fetch the new exchange rate automatically if not set in Currency Exchange DocType for that currency else it will fetch the 'Exchange Rate' from Currency Exchange DocType
+
+<img class="screenshot" alt="Exchange Rate Revaluation"  	src="{{docs_base_url}}/assets/img/accounts/exchange-rate-revaluation/exchange-rate-revaluation.png">
+
+4. On Submitting, 'Make Journal Entry' button will appear. This will create a journal entry for the Exchange Rate Revaluation.
+
+<img class="screenshot" alt="Exchange Rate Revaluation Submitting"  	src="{{docs_base_url}}/assets/img/accounts/exchange-rate-revaluation/exchange-rate-revaluation-submit.png">
+
+<img class="screenshot" alt="Journal Entry"  	src="{{docs_base_url}}/assets/img/accounts/exchange-rate-revaluation/journal-entry.png">
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/accounts/index.txt b/erpnext/docs/user/manual/en/accounts/index.txt
index 41cb243..a7e27cd 100644
--- a/erpnext/docs/user/manual/en/accounts/index.txt
+++ b/erpnext/docs/user/manual/en/accounts/index.txt
@@ -5,6 +5,7 @@
 purchase-invoice
 payments
 journal-entry
+inter-company-journal-entry
 payment-entry
 subscription
 multi-currency-accounting
diff --git a/erpnext/docs/user/manual/en/accounts/inter-company-journal-entry.md b/erpnext/docs/user/manual/en/accounts/inter-company-journal-entry.md
new file mode 100644
index 0000000..6bc2e5b
--- /dev/null
+++ b/erpnext/docs/user/manual/en/accounts/inter-company-journal-entry.md
@@ -0,0 +1,45 @@
+# Inter Company Journal Entry
+
+You can also create Inter Company Journal Entry if you are making transactions with multiple Companies.
+You can select the Accounts which you wish to use in the Inter Company transactions.
+Just go to,
+
+> Accounts > Company and Accounts > Chart Of Accounts
+
+Select the Account which you would like to set as an Internal Account for the transaction, and check the **Inter Company Account** checkbox. It can now be used for Inter Company Journal Entry Transactions.
+
+<img class="screenshot" alt="Internal Account" src="{{docs_base_url}}/assets/img/accounts/internal-account.png">
+
+You need to do the same for all the Companies' Accounts which you want to use for Inter Company Journal Entry transactions.
+
+Now, to create an Inter Company Journal Entry go to:
+
+> Accounts > Company and Accounts > Journal Entry > New
+
+<img class="screenshot" alt="Inter Company Journal Entry" src="{{docs_base_url}}/assets/img/accounts/inter-company-jv.png">
+
+In the Journal Entry, you must select,
+
+* Type of Voucher - **Inter Company Journal Entry**.
+* Add rows for the individual accounting entries. In each row, you must specify:
+  * The Internal account that will be affected. 
+  * The amount to Debit or Credit.
+  * The Cost Center (If it is an Income or Expense).
+
+On submitting the Journal Entry, you will find a button on the top right corner, **Make Inter Company Journal Entry**.
+
+<img class="screenshot" alt="Submitted Inter Company Journal Entry" src="{{docs_base_url}}/assets/img/accounts/inter-company-jv-submit.png">
+
+Click on the button, you will be asked to select the Company against which you wish to create the linked Journal Entry.
+
+<img class="screenshot" alt="Select Company" src="{{docs_base_url}}/assets/img/accounts/select-company-jv.png">
+
+On selecting the Company, you will be routed to another Journal Entry where the relevant fields will be mapped, i.e. Company, Voucher Type, Inter Company Journal Entry Reference etc. 
+
+<img class="screenshot" alt="Linked Journal Entry" src="{{docs_base_url}}/assets/img/accounts/linked-jv.png">
+
+Select the Internal accounts for the Company selected and submit the Journal Entry, make sure the total Debit and Credit Amounts are same as the previously created Journal Entry's total Credit and Debit Amounts respectively.
+
+You can also find the reference link at the bottom, which will be added in both the linked Journal Entries and will be removed if any of the Journal Entries are cancelled.
+
+{next}
diff --git a/erpnext/docs/user/manual/en/human-resources/employee_promption.md b/erpnext/docs/user/manual/en/human-resources/employee_promption.md
new file mode 100644
index 0000000..a3f1c2d
--- /dev/null
+++ b/erpnext/docs/user/manual/en/human-resources/employee_promption.md
@@ -0,0 +1,15 @@
+# Employee Promotion
+
+You can manage Employee Promotions using this document.
+
+To record an Employee Promotion go to
+
+> Human Resource > Employee Promotion > New Employee Promotion
+
+Select Employee and add all details to be updated to Promotion Details table.
+
+<img class="screenshot" alt="Employee Promotion" src="{{docs_base_url}}/assets/img/human-resources/employee_promotion.png">
+
+Promotion document can be submitted on or after Promotion Date. Once submitted all the changes added to Promotion Details table will applied to Employee.
+
+<img class="screenshot" alt="Employee Promotion" src="{{docs_base_url}}/assets/img/human-resources/employee_promotion_1.png">
diff --git a/erpnext/docs/user/manual/en/human-resources/employee_transfer.md b/erpnext/docs/user/manual/en/human-resources/employee_transfer.md
new file mode 100644
index 0000000..307f9b9
--- /dev/null
+++ b/erpnext/docs/user/manual/en/human-resources/employee_transfer.md
@@ -0,0 +1,17 @@
+# Employee Transfer
+
+You can transfer Employees to different Company or Department by using Employee Transfer.
+
+To reocord an Employee Transfer go to
+
+> Human Resource > Employee Transfer > New Employee Transfer
+
+Select Employee and add all details to be updated to Transfer Details table.
+
+<img class="screenshot" alt="Employee Transfer" src="{{docs_base_url}}/assets/img/human-resources/employee_transfer.png">
+
+Transfer document can be submitted on or after Transfer Date. Once submitted all the changes added to Transfer Details table will applied to Employee.
+
+<img class="screenshot" alt="Employee Transfer" src="{{docs_base_url}}/assets/img/human-resources/employee_transfer_1.png">
+
+> Note : If Create New Employee ID is checked, a new Employee will be created with property changes in Transfer Details table and old Employee will be marked as releived. Leave allocations for the new Employee has to be manually created from Leave Period.
diff --git a/erpnext/docs/user/manual/en/human-resources/index.txt b/erpnext/docs/user/manual/en/human-resources/index.txt
index 479e2dd..758cdaa 100644
--- a/erpnext/docs/user/manual/en/human-resources/index.txt
+++ b/erpnext/docs/user/manual/en/human-resources/index.txt
@@ -18,4 +18,6 @@
 daily-work-summary
 fleet-management
 loan-management
+employee-promotion
+employee-transfer
 articles
diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py
index 0f11639..4cf28a1 100755
--- a/erpnext/hr/doctype/employee/employee.py
+++ b/erpnext/hr/doctype/employee/employee.py
@@ -156,6 +156,9 @@
 	def on_trash(self):
 		self.update_nsm_model()
 		delete_events(self.doctype, self.name)
+		if frappe.db.exists("Employee Transfer", {'new_employee_id': self.name, 'docstatus': 1}):
+			emp_transfer = frappe.get_doc("Employee Transfer", {'new_employee_id': self.name, 'docstatus': 1})
+			emp_transfer.db_set("new_employee_id", '')
 
 	def validate_preferred_email(self):
 		if self.prefered_contact_email and not self.get(scrub(self.prefered_contact_email)):
diff --git a/erpnext/hr/doctype/employee/employee_dashboard.py b/erpnext/hr/doctype/employee/employee_dashboard.py
index 0f95020..e1e1fce 100644
--- a/erpnext/hr/doctype/employee/employee_dashboard.py
+++ b/erpnext/hr/doctype/employee/employee_dashboard.py
@@ -25,6 +25,10 @@
 			{
 				'label': _('Evaluation'),
 				'items': ['Appraisal']
+			},
+			{
+				'label': _('Employee Lifecycle'),
+				'items': ['Employee Transfer', 'Employee Promotion']
 			}
 		]
 	}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_promotion/employee_promotion.js b/erpnext/hr/doctype/employee_promotion/employee_promotion.js
index c1bb788..54e06f4 100644
--- a/erpnext/hr/doctype/employee_promotion/employee_promotion.js
+++ b/erpnext/hr/doctype/employee_promotion/employee_promotion.js
@@ -1,6 +1,8 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
+{% include 'erpnext/hr/employee_property_update.js' %}
+
 frappe.ui.form.on('Employee Promotion', {
 	refresh: function(frm) {
 
diff --git a/erpnext/hr/doctype/employee_promotion/employee_promotion.json b/erpnext/hr/doctype/employee_promotion/employee_promotion.json
index a7d49bc..1e3081a 100644
--- a/erpnext/hr/doctype/employee_promotion/employee_promotion.json
+++ b/erpnext/hr/doctype/employee_promotion/employee_promotion.json
@@ -83,6 +83,36 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "fieldname": "column_break_3", 
+   "fieldtype": "Column Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
    "fieldname": "promotion_date", 
    "fieldtype": "Date", 
    "hidden": 0, 
@@ -102,7 +132,7 @@
    "read_only": 0, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
-   "reqd": 0, 
+   "reqd": 1, 
    "search_index": 0, 
    "set_only_once": 0, 
    "translatable": 0, 
@@ -189,7 +219,7 @@
    "label": "Employee Promotion Detail", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "Employee Promotion Detail", 
+   "options": "Employee Property History", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -245,7 +275,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2018-04-14 15:42:49.452085", 
+ "modified": "2018-04-27 17:31:26.902394", 
  "modified_by": "Administrator", 
  "module": "HR", 
  "name": "Employee Promotion", 
diff --git a/erpnext/hr/doctype/employee_promotion/employee_promotion.py b/erpnext/hr/doctype/employee_promotion/employee_promotion.py
index 564f1ad..5fcceed 100644
--- a/erpnext/hr/doctype/employee_promotion/employee_promotion.py
+++ b/erpnext/hr/doctype/employee_promotion/employee_promotion.py
@@ -4,7 +4,27 @@
 
 from __future__ import unicode_literals
 import frappe
+from frappe import _
 from frappe.model.document import Document
+from frappe.utils import getdate
+from erpnext.hr.utils import update_employee
 
 class EmployeePromotion(Document):
-	pass
+	def validate(self):
+		if frappe.get_value("Employee", self.employee, "status") == "Left":
+			frappe.throw(_("Cannot promote Employee with status Left"))
+
+	def before_submit(self):
+		if getdate(self.promotion_date) > getdate():
+			frappe.throw(_("Employee Promotion cannot be submitted before Promotion Date "),
+				frappe.DocstatusTransitionError)
+
+	def on_submit(self):
+		employee = frappe.get_doc("Employee", self.employee)
+		employee = update_employee(employee, self.promotion_details)
+		employee.save()
+
+	def on_cancel(self):
+		employee = frappe.get_doc("Employee", self.employee)
+		employee = update_employee(employee, self.promotion_details, True)
+		employee.save()
diff --git a/erpnext/hr/doctype/employee_promotion/test_employee_promotion.py b/erpnext/hr/doctype/employee_promotion/test_employee_promotion.py
index 8b668e7..420bbe6 100644
--- a/erpnext/hr/doctype/employee_promotion/test_employee_promotion.py
+++ b/erpnext/hr/doctype/employee_promotion/test_employee_promotion.py
@@ -5,6 +5,31 @@
 
 import frappe
 import unittest
+from frappe.utils import getdate, add_days
+from erpnext.hr.doctype.salary_structure.test_salary_structure import make_employee
 
 class TestEmployeePromotion(unittest.TestCase):
-	pass
+	def setUp(self):
+		self.employee = make_employee("employee@promotions.com")
+		frappe.db.sql("""delete from `tabEmployee Promotion`""")
+
+	def test_submit_before_promotion_date(self):
+		promotion_obj = frappe.get_doc({
+			"doctype": "Employee Promotion",
+			"employee": self.employee,
+			"promotion_details" :[
+				{
+				"property": "Designation",
+				"current": "Software Developer",
+				"new": "Project Manager",
+				"fieldname": "designation"
+				}
+			]
+		})
+		promotion_obj.promotion_date = add_days(getdate(), 1)
+		promotion_obj.save()
+		self.assertRaises(frappe.DocstatusTransitionError, promotion_obj.submit)
+		promotion = frappe.get_doc("Employee Promotion", promotion_obj.name)
+		promotion.promotion_date = getdate()
+		promotion.submit()
+		self.assertEqual(promotion.docstatus, 1)
diff --git a/erpnext/hr/doctype/employee_property_history/employee_property_history.json b/erpnext/hr/doctype/employee_property_history/employee_property_history.json
index 7a416b2..0a51579 100644
--- a/erpnext/hr/doctype/employee_property_history/employee_property_history.json
+++ b/erpnext/hr/doctype/employee_property_history/employee_property_history.json
@@ -34,13 +34,12 @@
    "precision": "", 
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
-   "read_only": 0, 
+   "read_only": 1, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
-   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -65,13 +64,12 @@
    "precision": "", 
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
-   "read_only": 0, 
+   "read_only": 1, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
-   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -96,13 +94,42 @@
    "precision": "", 
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
-   "read_only": 0, 
+   "read_only": 1, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
-   "translatable": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "fieldname", 
+   "fieldtype": "Data", 
+   "hidden": 1, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Field Name", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
   }
  ], 
@@ -116,7 +143,7 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2018-04-14 11:44:36.458039", 
+ "modified": "2018-05-02 18:19:54.436391", 
  "modified_by": "Administrator", 
  "module": "HR", 
  "name": "Employee Property History", 
diff --git a/erpnext/hr/doctype/employee_transfer/employee_transfer.js b/erpnext/hr/doctype/employee_transfer/employee_transfer.js
index 1d694bd..af751a7 100644
--- a/erpnext/hr/doctype/employee_transfer/employee_transfer.js
+++ b/erpnext/hr/doctype/employee_transfer/employee_transfer.js
@@ -1,6 +1,8 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
+{% include 'erpnext/hr/employee_property_update.js' %}
+
 frappe.ui.form.on('Employee Transfer', {
 	refresh: function(frm) {
 
diff --git a/erpnext/hr/doctype/employee_transfer/employee_transfer.json b/erpnext/hr/doctype/employee_transfer/employee_transfer.json
index 55fa073..ace9f93 100644
--- a/erpnext/hr/doctype/employee_transfer/employee_transfer.json
+++ b/erpnext/hr/doctype/employee_transfer/employee_transfer.json
@@ -42,7 +42,6 @@
    "reqd": 1, 
    "search_index": 0, 
    "set_only_once": 0, 
-   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -74,7 +73,6 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
-   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -102,10 +100,38 @@
    "read_only": 0, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
+   "reqd": 1, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "column_break_3", 
+   "fieldtype": "Column Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
-   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -137,7 +163,6 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
-   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -169,7 +194,6 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
-   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -200,7 +224,6 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
-   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -221,7 +244,7 @@
    "label": "Employee Transfer Detail", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "Employee Transfer Detail", 
+   "options": "Employee Property History", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -232,7 +255,6 @@
    "reqd": 1, 
    "search_index": 0, 
    "set_only_once": 0, 
-   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -243,7 +265,7 @@
    "columns": 0, 
    "fieldname": "reallocate_leaves", 
    "fieldtype": "Check", 
-   "hidden": 0, 
+   "hidden": 1, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
@@ -263,7 +285,6 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
-   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -294,7 +315,37 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
-   "translatable": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 1, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "new_employee_id", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "New Employee ID", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Employee", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
   }, 
   {
@@ -325,7 +376,6 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
-   "translatable": 0, 
    "unique": 0
   }
  ], 
@@ -339,7 +389,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2018-04-14 15:42:31.098910", 
+ "modified": "2018-05-05 13:10:32.660537", 
  "modified_by": "Administrator", 
  "module": "HR", 
  "name": "Employee Transfer", 
@@ -348,6 +398,7 @@
  "permissions": [
   {
    "amend": 0, 
+   "apply_user_permissions": 0, 
    "cancel": 0, 
    "create": 0, 
    "delete": 0, 
@@ -367,6 +418,7 @@
   }, 
   {
    "amend": 0, 
+   "apply_user_permissions": 0, 
    "cancel": 0, 
    "create": 1, 
    "delete": 0, 
@@ -386,6 +438,7 @@
   }, 
   {
    "amend": 1, 
+   "apply_user_permissions": 0, 
    "cancel": 1, 
    "create": 1, 
    "delete": 1, 
diff --git a/erpnext/hr/doctype/employee_transfer/employee_transfer.py b/erpnext/hr/doctype/employee_transfer/employee_transfer.py
index 96645c4..b58d334 100644
--- a/erpnext/hr/doctype/employee_transfer/employee_transfer.py
+++ b/erpnext/hr/doctype/employee_transfer/employee_transfer.py
@@ -4,7 +4,63 @@
 
 from __future__ import unicode_literals
 import frappe
+from frappe import _
 from frappe.model.document import Document
+from frappe.utils import getdate
+from erpnext.hr.utils import update_employee
 
 class EmployeeTransfer(Document):
-	pass
+	def validate(self):
+		if frappe.get_value("Employee", self.employee, "status") == "Left":
+			frappe.throw(_("Cannot transfer Employee with status Left"))
+		if self.new_company and self.company == self.new_company:
+			frappe.throw_("New Company must be different from current company")
+
+	def before_submit(self):
+		if getdate(self.transfer_date) > getdate():
+			frappe.throw(_("Employee Transfer cannot be submitted before Transfer Date "),
+				frappe.DocstatusTransitionError)
+
+	def on_submit(self):
+		employee = frappe.get_doc("Employee", self.employee)
+		if self.create_new_employee_id:
+			new_employee = frappe.copy_doc(employee)
+			new_employee.name = None
+			new_employee.employee_number = None
+			new_employee = update_employee(new_employee, self.transfer_details)
+			if self.new_company:
+				new_employee.company = self.new_company
+			#move user_id to new employee before insert
+			if employee.user_id and not self.validate_user_in_details():
+				new_employee.user_id = employee.user_id
+				employee.db_set("user_id", "")
+			new_employee.insert()
+			self.db_set("new_employee_id", new_employee.name)
+			#relieve the old employee
+			employee.db_set("relieving_date", self.transfer_date)
+			employee.db_set("status", "Left")
+		else:
+			employee = update_employee(employee, self.transfer_details)
+			if self.new_company:
+				employee.company = self.new_company
+			employee.save()
+
+	def on_cancel(self):
+		employee = frappe.get_doc("Employee", self.employee)
+		if self.create_new_employee_id:
+			if self.new_employee_id:
+				frappe.throw(_("Please delete the Employee <a href='#Form/Employee/{0}'>{0}</a>\
+					to cancel this document").format(self.new_employee_id))
+			#mark the employee as active
+			employee.status = "Active"
+			employee.relieving_date = ''
+			employee.save()
+		else:
+			employee = update_employee(employee, self.transfer_details, True)
+			employee.save()
+
+	def validate_user_in_details(self):
+		for item in self.transfer_details:
+			if item.fieldname == "user_id" and item.new != item.current:
+				return True
+		return False
diff --git a/erpnext/hr/doctype/employee_transfer/test_employee_transfer.py b/erpnext/hr/doctype/employee_transfer/test_employee_transfer.py
index 049273e..3dae1a9 100644
--- a/erpnext/hr/doctype/employee_transfer/test_employee_transfer.py
+++ b/erpnext/hr/doctype/employee_transfer/test_employee_transfer.py
@@ -5,6 +5,52 @@
 
 import frappe
 import unittest
+from frappe.utils import getdate, add_days
+from erpnext.hr.doctype.salary_structure.test_salary_structure import make_employee
 
 class TestEmployeeTransfer(unittest.TestCase):
-	pass
+	def setUp(self):
+		make_employee("employee2@transfers.com")
+		make_employee("employee3@transfers.com")
+		frappe.db.sql("""delete from `tabEmployee Transfer`""")
+
+	def test_submit_before_transfer_date(self):
+		transfer_obj = frappe.get_doc({
+			"doctype": "Employee Transfer",
+			"employee": frappe.get_value("Employee", {"user_id":"employee2@transfers.com"}, "name"),
+			"transfer_details" :[
+				{
+				"property": "Designation",
+				"current": "Software Developer",
+				"new": "Project Manager",
+				"fieldname": "designation"
+				}
+			]
+		})
+		transfer_obj.transfer_date = add_days(getdate(), 1)
+		transfer_obj.save()
+		self.assertRaises(frappe.DocstatusTransitionError, transfer_obj.submit)
+		transfer = frappe.get_doc("Employee Transfer", transfer_obj.name)
+		transfer.transfer_date = getdate()
+		transfer.submit()
+		self.assertEqual(transfer.docstatus, 1)
+
+	def test_new_employee_creation(self):
+		transfer = frappe.get_doc({
+			"doctype": "Employee Transfer",
+			"employee": frappe.get_value("Employee", {"user_id":"employee3@transfers.com"}, "name"),
+			"create_new_employee_id": 1,
+			"transfer_date": getdate(),
+			"transfer_details" :[
+				{
+				"property": "Designation",
+				"current": "Software Developer",
+				"new": "Project Manager",
+				"fieldname": "designation"
+				}
+			]
+		}).insert()
+		transfer.submit()
+		self.assertTrue(transfer.new_employee_id)
+		self.assertEqual(frappe.get_value("Employee", transfer.new_employee_id, "status"), "Active")
+		self.assertEqual(frappe.get_value("Employee", transfer.employee, "status"), "Left")
diff --git a/erpnext/hr/employee_property_update.js b/erpnext/hr/employee_property_update.js
new file mode 100644
index 0000000..473916c
--- /dev/null
+++ b/erpnext/hr/employee_property_update.js
@@ -0,0 +1,147 @@
+frappe.ui.form.on(cur_frm.doctype, {
+	setup: function(frm) {
+		frm.set_query("employee", function() {
+			return {
+				filters: {
+					"status": "Active"
+				}
+			};
+		});
+	},
+	onload: function(frm){
+		if(frm.doc.__islocal){
+			if(frm.doctype == "Employee Promotion"){
+				frm.doc.promotion_details = [];
+			}else if (frm.doctype == "Employee Transfer") {
+				frm.doc.transfer_details = [];
+			}
+		}
+	},
+	employee: function(frm) {
+		frm.add_fetch("employee", "company", "company");
+	},
+	refresh: function(frm) {
+		var table;
+		if(frm.doctype == "Employee Promotion"){
+			table = "promotion_details";
+		}else if (frm.doctype == "Employee Transfer") {
+			table = "transfer_details";
+		}
+		if(!table){return;}
+		cur_frm.fields_dict[table].grid.wrapper.find('.grid-add-row').hide();
+		cur_frm.fields_dict[table].grid.add_custom_button(__('Add Row'), () => {
+			if(!frm.doc.employee){
+				frappe.msgprint(__("Please select Employee"));
+				return;
+			}
+			frappe.call({
+				method: 'erpnext.hr.utils.get_employee_fields_label',
+				callback: function(r) {
+					if(r.message){
+						show_dialog(frm, table, r.message);
+					}
+				}
+			});
+		});
+	}
+});
+
+var show_dialog = function(frm, table, field_labels) {
+	var d = new frappe.ui.Dialog({
+		title: "Update Property",
+		fields: [
+			{fieldname: "property", label: __('Select Property'), fieldtype:"Select", options: field_labels},
+			{fieldname: "current", fieldtype: "Data", label:__('Current'), read_only: true},
+			{fieldname: "field_html", fieldtype: "HTML"}
+		],
+		primary_action_label: __('Add to Details'),
+		primary_action: () => {
+			d.get_primary_btn().attr('disabled', true);
+			if(d.data){
+				add_to_details(frm, d, table);
+			}
+		}
+	});
+	d.fields_dict["property"].df.onchange = () => {
+		let property = d.get_values().property;
+		d.data.fieldname = property;
+		if(!property){return;}
+		frappe.call({
+			method: 'erpnext.hr.utils.get_employee_field_property',
+			args: {employee: frm.doc.employee, fieldname: property},
+			callback: function(r) {
+				if(r.message){
+					d.data.current = r.message.value;
+					d.data.property = r.message.label;
+					d.fields_dict.field_html.$wrapper.html("");
+					d.set_value('current', r.message.value);
+					render_dynamic_field(d, r.message.datatype, r.message.options, property);
+					d.get_primary_btn().attr('disabled', false);
+				}
+			}
+		});
+	};
+	d.get_primary_btn().attr('disabled', true);
+	d.data = {};
+	d.show();
+};
+
+var render_dynamic_field = function(d, fieldtype, options, fieldname) {
+	d.data.new = null;
+	var dynamic_field = frappe.ui.form.make_control({
+		df: {
+			"fieldtype": fieldtype,
+			"fieldname": fieldname,
+			"options": options || ''
+		},
+		parent: d.fields_dict.field_html.wrapper,
+		only_input: false
+	});
+	dynamic_field.make_input();
+	$(dynamic_field.label_area).text(__("New"));
+	dynamic_field.$input.on("change", function(e) {
+		d.data.new = e.target.value;
+	}).on("awesomplete-close", function(e) {
+		d.data.new = e.target.value;
+	});
+};
+
+var add_to_details = function(frm, d, table) {
+	let data = d.data;
+	if(data.fieldname){
+		if(validate_duplicate(frm, table, data.fieldname)){
+			frappe.show_alert({message:__("Property already added"), indicator:'orange'});
+			return false;
+		}
+		if(data.current == data.new){
+			frappe.show_alert({message:__("Nothing to change"), indicator:'orange'});
+			d.get_primary_btn().attr('disabled', false);
+			return false;
+		}
+		frm.add_child(table, {
+			fieldname: data.fieldname,
+			property: data.property,
+			current: data.current,
+			new: data.new
+		});
+		frm.refresh_field(table);
+		d.fields_dict.field_html.$wrapper.html("");
+		d.set_value("property", "");
+		d.set_value('current', "");
+		frappe.show_alert({message:__("Added to details"),indicator:'green'});
+		d.data = {};
+	}else {
+		frappe.show_alert({message:__("Value missing"),indicator:'red'});
+	}
+};
+
+var validate_duplicate =  function(frm, table, fieldname){
+	let duplicate = false;
+	$.each(frm.doc[table], function(i, detail) {
+		if(detail.fieldname === fieldname){
+			duplicate = true;
+			return;
+		}
+	});
+	return duplicate;
+};
diff --git a/erpnext/hr/utils.py b/erpnext/hr/utils.py
index aa456aa..057f406 100644
--- a/erpnext/hr/utils.py
+++ b/erpnext/hr/utils.py
@@ -4,7 +4,48 @@
 from __future__ import unicode_literals
 import frappe
 from frappe import _
+from frappe.utils import formatdate, format_datetime
+from frappe.utils import getdate, get_datetime
 
 def set_employee_name(doc):
 	if doc.employee and not doc.employee_name:
 		doc.employee_name = frappe.db.get_value("Employee", doc.employee, "employee_name")
+
+@frappe.whitelist()
+def get_employee_fields_label():
+	fields = []
+	for df in frappe.get_meta("Employee").get("fields"):
+		if df.fieldtype in ["Data", "Date", "Datetime", "Float", "Int",
+		"Link", "Percent", "Select", "Small Text"] and df.fieldname not in ["lft", "rgt", "old_parent"]:
+			fields.append({"value": df.fieldname, "label": df.label})
+	return fields
+
+@frappe.whitelist()
+def get_employee_field_property(employee, fieldname):
+	if employee and fieldname:
+		field = frappe.get_meta("Employee").get_field(fieldname)
+		value = frappe.db.get_value("Employee", employee, fieldname)
+		options = field.options
+		if field.fieldtype == "Date":
+			value = formatdate(value)
+		elif field.fieldtype == "Datetime":
+			value = format_datetime(value)
+		return {
+			"value" : value,
+			"datatype" : field.fieldtype,
+			"label" : field.label,
+			"options" : options
+		}
+	else:
+		return False
+
+def update_employee(employee, details, cancel=False):
+	for item in details:
+		fieldtype = frappe.get_meta("Employee").get_field(item.fieldname).fieldtype
+		new_data = item.new if not cancel else item.current
+		if fieldtype == "Date" and new_data:
+			new_data = getdate(new_data)
+		elif fieldtype =="Datetime" and new_data:
+			new_data = get_datetime(new_data)
+		setattr(employee, item.fieldname, new_data)
+	return employee
diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py
index 78f892b..239b532 100644
--- a/erpnext/selling/doctype/customer/customer.py
+++ b/erpnext/selling/doctype/customer/customer.py
@@ -7,7 +7,7 @@
 from frappe import _, msgprint, throw
 import frappe.defaults
 from frappe.utils import flt, cint, cstr
-from frappe.desk.reportview import build_match_conditions
+from frappe.desk.reportview import build_match_conditions, get_filters_cond
 from erpnext.utilities.transaction_base import TransactionBase
 from erpnext.accounts.party import validate_party_accounts, get_dashboard_info, get_timeline_data # keep this
 from frappe.contacts.address_and_contact import load_address_and_contact, delete_contact_and_address
@@ -179,7 +179,7 @@
 			frappe.db.set(self, "customer_name", newdn)
 
 
-def get_customer_list(doctype, txt, searchfield, start, page_len, filters):
+def get_customer_list(doctype, txt, searchfield, start, page_len, filters=None):
 	if frappe.db.get_default("cust_master_name") == "Customer Name":
 		fields = ["name", "customer_group", "territory"]
 	else:
@@ -188,6 +188,10 @@
 	match_conditions = build_match_conditions("Customer")
 	match_conditions = "and {}".format(match_conditions) if match_conditions else ""
 
+	if filters:
+		filter_conditions = get_filters_cond(doctype, filters, [])
+		match_conditions += "{}".format(filter_conditions)
+
 	return frappe.db.sql("""select %s from `tabCustomer` where docstatus < 2
 		and (%s like %s or customer_name like %s)
 		{match_conditions}
diff --git a/erpnext/setup/doctype/company/company.js b/erpnext/setup/doctype/company/company.js
index 7c060d8..e164d69 100644
--- a/erpnext/setup/doctype/company/company.js
+++ b/erpnext/setup/doctype/company/company.js
@@ -197,6 +197,7 @@
 		["round_off_account", {"root_type": "Expense"}],
 		["write_off_account", {"root_type": "Expense"}],
 		["exchange_gain_loss_account", {"root_type": "Expense"}],
+		["unrealized_exchange_gain_loss_account", {"root_type": "Expense"}],
 		["accumulated_depreciation_account",
 			{"root_type": "Asset", "account_type": "Accumulated Depreciation"}],
 		["depreciation_expense_account", {"root_type": "Expense", "account_type": "Depreciation"}],
diff --git a/erpnext/setup/doctype/company/company.json b/erpnext/setup/doctype/company/company.json
index 1a21887..66b1433 100644
--- a/erpnext/setup/doctype/company/company.json
+++ b/erpnext/setup/doctype/company/company.json
@@ -42,6 +42,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -73,6 +74,7 @@
    "reqd": 1, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -105,6 +107,7 @@
    "reqd": 1, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -135,6 +138,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -165,6 +169,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -193,6 +198,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -223,6 +229,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -254,6 +261,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -284,6 +292,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -314,6 +323,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -345,6 +355,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -374,6 +385,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -405,6 +417,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -434,6 +447,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -465,6 +479,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -496,6 +511,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -526,6 +542,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -556,6 +573,7 @@
    "reqd": 1, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -585,6 +603,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -615,6 +634,7 @@
    "reqd": 1, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -646,6 +666,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -678,6 +699,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -710,6 +732,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -740,6 +763,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -770,6 +794,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -800,6 +825,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -833,6 +859,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -864,6 +891,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -897,6 +925,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -928,6 +957,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -959,6 +989,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -990,6 +1021,39 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "unrealized_exchange_gain_loss_account", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Unrealized Exchange Gain/Loss Account", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Account", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1019,6 +1083,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0, 
    "width": "50%"
   }, 
@@ -1053,6 +1118,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1084,6 +1150,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1115,6 +1182,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1146,6 +1214,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1178,6 +1247,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1209,6 +1279,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1238,6 +1309,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1269,6 +1341,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1298,6 +1371,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1331,6 +1405,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1363,6 +1438,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1393,6 +1469,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1424,6 +1501,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1455,6 +1533,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1485,6 +1564,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1514,6 +1594,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1544,6 +1625,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1574,6 +1656,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1604,6 +1687,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1635,6 +1719,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1666,6 +1751,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1696,6 +1782,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1725,6 +1812,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1756,6 +1844,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1787,6 +1876,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1817,6 +1907,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1847,6 +1938,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1876,6 +1968,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1905,6 +1998,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0, 
    "width": "50%"
   }, 
@@ -1937,6 +2031,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -1969,6 +2064,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -2001,6 +2097,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -2033,6 +2130,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -2064,6 +2162,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -2095,6 +2194,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0, 
    "width": "50%"
   }, 
@@ -2128,6 +2228,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -2158,6 +2259,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -2188,6 +2290,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -2218,6 +2321,7 @@
    "reqd": 0, 
    "search_index": 1, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -2248,6 +2352,7 @@
    "reqd": 0, 
    "search_index": 1, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }, 
   {
@@ -2278,6 +2383,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
+   "translatable": 0, 
    "unique": 0
   }
  ], 
@@ -2294,7 +2400,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2018-04-18 19:45:22.357643", 
+ "modified": "2018-05-05 13:08:07.351655", 
  "modified_by": "Administrator", 
  "module": "Setup", 
  "name": "Company", 
@@ -2302,7 +2408,6 @@
  "permissions": [
   {
    "amend": 0, 
-   "apply_user_permissions": 0, 
    "cancel": 0, 
    "create": 1, 
    "delete": 1, 
@@ -2322,7 +2427,6 @@
   }, 
   {
    "amend": 0, 
-   "apply_user_permissions": 0, 
    "cancel": 0, 
    "create": 0, 
    "delete": 0, 
@@ -2342,7 +2446,6 @@
   }, 
   {
    "amend": 0, 
-   "apply_user_permissions": 0, 
    "cancel": 0, 
    "create": 0, 
    "delete": 0, 
@@ -2362,7 +2465,6 @@
   }, 
   {
    "amend": 0, 
-   "apply_user_permissions": 0, 
    "cancel": 0, 
    "create": 0, 
    "delete": 0, 
@@ -2382,7 +2484,6 @@
   }, 
   {
    "amend": 0, 
-   "apply_user_permissions": 0, 
    "cancel": 0, 
    "create": 0, 
    "delete": 0, 
@@ -2402,7 +2503,6 @@
   }, 
   {
    "amend": 0, 
-   "apply_user_permissions": 0, 
    "cancel": 0, 
    "create": 0, 
    "delete": 0, 
@@ -2422,7 +2522,6 @@
   }, 
   {
    "amend": 0, 
-   "apply_user_permissions": 0, 
    "cancel": 0, 
    "create": 0, 
    "delete": 0,