Merge pull request #22577 from deepeshgarg007/coa_fiscal_year_fix

fix: Consider company fiscal year for getting balance
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index 63c34ed..02b4206 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -189,6 +189,8 @@
   {
    "fieldname": "customer_section",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "options": "fa fa-user"
   },
   {
@@ -197,6 +199,8 @@
    "fieldname": "title",
    "fieldtype": "Data",
    "hidden": 1,
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Title",
    "no_copy": 1,
    "print_hide": 1
@@ -205,6 +209,8 @@
    "bold": 1,
    "fieldname": "naming_series",
    "fieldtype": "Select",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Series",
    "no_copy": 1,
    "oldfieldname": "naming_series",
@@ -218,6 +224,8 @@
    "bold": 1,
    "fieldname": "customer",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "in_standard_filter": 1,
    "label": "Customer",
    "oldfieldname": "customer",
@@ -232,6 +240,8 @@
    "fetch_from": "customer.customer_name",
    "fieldname": "customer_name",
    "fieldtype": "Data",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "in_global_search": 1,
    "label": "Customer Name",
    "oldfieldname": "customer_name",
@@ -241,6 +251,8 @@
   {
    "fieldname": "tax_id",
    "fieldtype": "Data",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Tax Id",
    "print_hide": 1,
    "read_only": 1
@@ -248,6 +260,8 @@
   {
    "fieldname": "project",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "in_global_search": 1,
    "label": "Project",
    "oldfieldname": "project_name",
@@ -259,6 +273,8 @@
    "default": "0",
    "fieldname": "is_pos",
    "fieldtype": "Check",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Include Payment (POS)",
    "oldfieldname": "is_pos",
    "oldfieldtype": "Check",
@@ -268,6 +284,8 @@
    "depends_on": "is_pos",
    "fieldname": "pos_profile",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "POS Profile",
    "options": "POS Profile",
    "print_hide": 1
@@ -276,6 +294,8 @@
    "fieldname": "offline_pos_name",
    "fieldtype": "Data",
    "hidden": 1,
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Offline POS Name",
    "print_hide": 1,
    "read_only": 1
@@ -284,6 +304,8 @@
    "default": "0",
    "fieldname": "is_return",
    "fieldtype": "Check",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Is Return (Credit Note)",
    "no_copy": 1,
    "print_hide": 1
@@ -291,11 +313,15 @@
   {
    "fieldname": "column_break1",
    "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "oldfieldtype": "Column Break"
   },
   {
    "fieldname": "company",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "in_standard_filter": 1,
    "label": "Company",
    "oldfieldname": "company",
@@ -308,6 +334,8 @@
   {
    "fieldname": "cost_center",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Cost Center",
    "options": "Cost Center"
   },
@@ -316,6 +344,8 @@
    "default": "Today",
    "fieldname": "posting_date",
    "fieldtype": "Date",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Date",
    "no_copy": 1,
    "oldfieldname": "posting_date",
@@ -326,6 +356,8 @@
   {
    "fieldname": "posting_time",
    "fieldtype": "Time",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Posting Time",
    "no_copy": 1,
    "oldfieldname": "posting_time",
@@ -337,12 +369,16 @@
    "depends_on": "eval:doc.docstatus==0",
    "fieldname": "set_posting_time",
    "fieldtype": "Check",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Edit Posting Date and Time",
    "print_hide": 1
   },
   {
    "fieldname": "due_date",
    "fieldtype": "Date",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Payment Due Date",
    "no_copy": 1,
    "oldfieldname": "due_date",
@@ -351,6 +387,8 @@
   {
    "fieldname": "amended_from",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "ignore_user_permissions": 1,
    "label": "Amended From",
    "no_copy": 1,
@@ -364,12 +402,16 @@
    "depends_on": "return_against",
    "fieldname": "returns",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Returns"
   },
   {
    "depends_on": "return_against",
    "fieldname": "return_against",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Return Against Sales Invoice",
    "no_copy": 1,
    "options": "Sales Invoice",
@@ -379,13 +421,17 @@
   },
   {
    "fieldname": "column_break_21",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "default": "0",
    "depends_on": "eval: doc.is_return && doc.return_against",
    "fieldname": "update_billed_amount_in_sales_order",
    "fieldtype": "Check",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Update Billed Amount in Sales Order"
   },
   {
@@ -393,35 +439,47 @@
    "collapsible_depends_on": "po_no",
    "fieldname": "customer_po_details",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Customer PO Details"
   },
   {
    "allow_on_submit": 1,
    "fieldname": "po_no",
    "fieldtype": "Small Text",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Customer's Purchase Order",
    "no_copy": 1,
    "print_hide": 1
   },
   {
    "fieldname": "column_break_23",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "allow_on_submit": 1,
    "fieldname": "po_date",
    "fieldtype": "Date",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Customer's Purchase Order Date"
   },
   {
    "collapsible": 1,
    "fieldname": "address_and_contact",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Address and Contact"
   },
   {
    "fieldname": "customer_address",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Customer Address",
    "options": "Address",
    "print_hide": 1
@@ -429,12 +487,16 @@
   {
    "fieldname": "address_display",
    "fieldtype": "Small Text",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Address",
    "read_only": 1
   },
   {
    "fieldname": "contact_person",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "in_global_search": 1,
    "label": "Contact Person",
    "options": "Contact",
@@ -443,6 +505,8 @@
   {
    "fieldname": "contact_display",
    "fieldtype": "Small Text",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Contact",
    "read_only": 1
   },
@@ -450,6 +514,8 @@
    "fieldname": "contact_mobile",
    "fieldtype": "Small Text",
    "hidden": 1,
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Mobile No",
    "read_only": 1
   },
@@ -457,6 +523,8 @@
    "fieldname": "contact_email",
    "fieldtype": "Data",
    "hidden": 1,
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Contact Email",
    "options": "Email",
    "print_hide": 1,
@@ -465,17 +533,23 @@
   {
    "fieldname": "territory",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Territory",
    "options": "Territory",
    "print_hide": 1
   },
   {
    "fieldname": "col_break4",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "fieldname": "shipping_address_name",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Shipping Address Name",
    "options": "Address",
    "print_hide": 1
@@ -483,6 +557,8 @@
   {
    "fieldname": "shipping_address",
    "fieldtype": "Small Text",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Shipping Address",
    "print_hide": 1,
    "read_only": 1
@@ -490,6 +566,8 @@
   {
    "fieldname": "company_address",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Company Address Name",
    "options": "Address",
    "print_hide": 1
@@ -498,6 +576,8 @@
    "fieldname": "company_address_display",
    "fieldtype": "Small Text",
    "hidden": 1,
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Company Address",
    "print_hide": 1,
    "read_only": 1
@@ -507,11 +587,15 @@
    "depends_on": "customer",
    "fieldname": "currency_and_price_list",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Currency and Price List"
   },
   {
    "fieldname": "currency",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Currency",
    "oldfieldname": "currency",
    "oldfieldtype": "Select",
@@ -523,6 +607,8 @@
    "description": "Rate at which Customer Currency is converted to customer's base currency",
    "fieldname": "conversion_rate",
    "fieldtype": "Float",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Exchange Rate",
    "oldfieldname": "conversion_rate",
    "oldfieldtype": "Currency",
@@ -533,11 +619,15 @@
   {
    "fieldname": "column_break2",
    "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "width": "50%"
   },
   {
    "fieldname": "selling_price_list",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Price List",
    "oldfieldname": "price_list_name",
    "oldfieldtype": "Select",
@@ -548,6 +638,8 @@
   {
    "fieldname": "price_list_currency",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Price List Currency",
    "options": "Currency",
    "print_hide": 1,
@@ -558,6 +650,8 @@
    "description": "Rate at which Price list currency is converted to customer's base currency",
    "fieldname": "plc_conversion_rate",
    "fieldtype": "Float",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Price List Exchange Rate",
    "precision": "9",
    "print_hide": 1,
@@ -567,6 +661,8 @@
    "default": "0",
    "fieldname": "ignore_pricing_rule",
    "fieldtype": "Check",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Ignore Pricing Rule",
    "no_copy": 1,
    "permlevel": 1,
@@ -574,12 +670,16 @@
   },
   {
    "fieldname": "sec_warehouse",
-   "fieldtype": "Section Break"
+   "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "depends_on": "update_stock",
    "fieldname": "set_warehouse",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Set Source Warehouse",
    "options": "Warehouse",
    "print_hide": 1
@@ -587,6 +687,8 @@
   {
    "fieldname": "items_section",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "oldfieldtype": "Section Break",
    "options": "fa fa-shopping-cart"
   },
@@ -594,6 +696,8 @@
    "default": "0",
    "fieldname": "update_stock",
    "fieldtype": "Check",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Update Stock",
    "oldfieldname": "update_stock",
    "oldfieldtype": "Check",
@@ -602,12 +706,16 @@
   {
    "fieldname": "scan_barcode",
    "fieldtype": "Data",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Scan Barcode"
   },
   {
    "allow_bulk_edit": 1,
    "fieldname": "items",
    "fieldtype": "Table",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Items",
    "oldfieldname": "entries",
    "oldfieldtype": "Table",
@@ -617,11 +725,15 @@
   {
    "fieldname": "pricing_rule_details",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Pricing Rules"
   },
   {
    "fieldname": "pricing_rules",
    "fieldtype": "Table",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Pricing Rule Detail",
    "options": "Pricing Rule Detail",
    "read_only": 1
@@ -629,6 +741,8 @@
   {
    "fieldname": "packing_list",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Packing List",
    "options": "fa fa-suitcase",
    "print_hide": 1
@@ -636,6 +750,8 @@
   {
    "fieldname": "packed_items",
    "fieldtype": "Table",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Packed Items",
    "options": "Packed Item",
    "print_hide": 1
@@ -643,6 +759,8 @@
   {
    "fieldname": "product_bundle_help",
    "fieldtype": "HTML",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Product Bundle Help",
    "print_hide": 1
   },
@@ -651,11 +769,15 @@
    "collapsible_depends_on": "eval:doc.total_billing_amount > 0",
    "fieldname": "time_sheet_list",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Time Sheet List"
   },
   {
    "fieldname": "timesheets",
    "fieldtype": "Table",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Time Sheets",
    "options": "Sales Invoice Timesheet",
    "print_hide": 1
@@ -664,23 +786,31 @@
    "default": "0",
    "fieldname": "total_billing_amount",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Total Billing Amount",
    "print_hide": 1,
    "read_only": 1
   },
   {
    "fieldname": "section_break_30",
-   "fieldtype": "Section Break"
+   "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "fieldname": "total_qty",
    "fieldtype": "Float",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Total Quantity",
    "read_only": 1
   },
   {
    "fieldname": "base_total",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Total (Company Currency)",
    "options": "Company:company:default_currency",
    "print_hide": 1,
@@ -689,6 +819,8 @@
   {
    "fieldname": "base_net_total",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Net Total (Company Currency)",
    "oldfieldname": "net_total",
    "oldfieldtype": "Currency",
@@ -699,11 +831,15 @@
   },
   {
    "fieldname": "column_break_32",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "fieldname": "total",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Total",
    "options": "currency",
    "read_only": 1
@@ -711,6 +847,8 @@
   {
    "fieldname": "net_total",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Net Total",
    "options": "currency",
    "print_hide": 1,
@@ -719,6 +857,8 @@
   {
    "fieldname": "total_net_weight",
    "fieldtype": "Float",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Total Net Weight",
    "print_hide": 1,
    "read_only": 1
@@ -726,12 +866,16 @@
   {
    "fieldname": "taxes_section",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "oldfieldtype": "Section Break",
    "options": "fa fa-money"
   },
   {
    "fieldname": "taxes_and_charges",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Sales Taxes and Charges Template",
    "oldfieldname": "charge",
    "oldfieldtype": "Link",
@@ -740,11 +884,15 @@
   },
   {
    "fieldname": "column_break_38",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "fieldname": "shipping_rule",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Shipping Rule",
    "oldfieldtype": "Button",
    "options": "Shipping Rule",
@@ -753,17 +901,23 @@
   {
    "fieldname": "tax_category",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Tax Category",
    "options": "Tax Category",
    "print_hide": 1
   },
   {
    "fieldname": "section_break_40",
-   "fieldtype": "Section Break"
+   "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "fieldname": "taxes",
    "fieldtype": "Table",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Sales Taxes and Charges",
    "oldfieldname": "other_charges",
    "oldfieldtype": "Table",
@@ -773,11 +927,15 @@
    "collapsible": 1,
    "fieldname": "sec_tax_breakup",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Tax Breakup"
   },
   {
    "fieldname": "other_charges_calculation",
    "fieldtype": "Long Text",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Taxes and Charges Calculation",
    "no_copy": 1,
    "oldfieldtype": "HTML",
@@ -786,11 +944,15 @@
   },
   {
    "fieldname": "section_break_43",
-   "fieldtype": "Section Break"
+   "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "fieldname": "base_total_taxes_and_charges",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Total Taxes and Charges (Company Currency)",
    "oldfieldname": "other_charges_total",
    "oldfieldtype": "Currency",
@@ -800,11 +962,15 @@
   },
   {
    "fieldname": "column_break_47",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "fieldname": "total_taxes_and_charges",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Total Taxes and Charges",
    "options": "currency",
    "print_hide": 1,
@@ -814,12 +980,16 @@
    "collapsible": 1,
    "fieldname": "loyalty_points_redemption",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Loyalty Points Redemption"
   },
   {
    "depends_on": "redeem_loyalty_points",
    "fieldname": "loyalty_points",
    "fieldtype": "Int",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Loyalty Points",
    "no_copy": 1,
    "print_hide": 1
@@ -828,6 +998,8 @@
    "depends_on": "redeem_loyalty_points",
    "fieldname": "loyalty_amount",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Loyalty Amount",
    "no_copy": 1,
    "options": "Company:company:default_currency",
@@ -838,18 +1010,24 @@
    "default": "0",
    "fieldname": "redeem_loyalty_points",
    "fieldtype": "Check",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Redeem Loyalty Points",
    "no_copy": 1,
    "print_hide": 1
   },
   {
    "fieldname": "column_break_77",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "fetch_from": "customer.loyalty_program",
    "fieldname": "loyalty_program",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Loyalty Program",
    "no_copy": 1,
    "options": "Loyalty Program",
@@ -860,6 +1038,8 @@
    "depends_on": "redeem_loyalty_points",
    "fieldname": "loyalty_redemption_account",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Redemption Account",
    "no_copy": 1,
    "options": "Account"
@@ -868,6 +1048,8 @@
    "depends_on": "redeem_loyalty_points",
    "fieldname": "loyalty_redemption_cost_center",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Redemption Cost Center",
    "no_copy": 1,
    "options": "Cost Center"
@@ -877,12 +1059,16 @@
    "collapsible_depends_on": "discount_amount",
    "fieldname": "section_break_49",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Additional Discount"
   },
   {
    "default": "Grand Total",
    "fieldname": "apply_discount_on",
    "fieldtype": "Select",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Apply Additional Discount On",
    "options": "\nGrand Total\nNet Total",
    "print_hide": 1
@@ -890,6 +1076,8 @@
   {
    "fieldname": "base_discount_amount",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Additional Discount Amount (Company Currency)",
    "options": "Company:company:default_currency",
    "print_hide": 1,
@@ -897,17 +1085,23 @@
   },
   {
    "fieldname": "column_break_51",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "fieldname": "additional_discount_percentage",
    "fieldtype": "Float",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Additional Discount Percentage",
    "print_hide": 1
   },
   {
    "fieldname": "discount_amount",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Additional Discount Amount",
    "options": "currency",
    "print_hide": 1
@@ -915,6 +1109,8 @@
   {
    "fieldname": "totals",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "oldfieldtype": "Section Break",
    "options": "fa fa-money",
    "print_hide": 1
@@ -922,6 +1118,8 @@
   {
    "fieldname": "base_grand_total",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Grand Total (Company Currency)",
    "oldfieldname": "grand_total",
    "oldfieldtype": "Currency",
@@ -933,6 +1131,8 @@
   {
    "fieldname": "base_rounding_adjustment",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Rounding Adjustment (Company Currency)",
    "no_copy": 1,
    "options": "Company:company:default_currency",
@@ -942,6 +1142,8 @@
   {
    "fieldname": "base_rounded_total",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Rounded Total (Company Currency)",
    "oldfieldname": "rounded_total",
    "oldfieldtype": "Currency",
@@ -953,6 +1155,8 @@
    "description": "In Words will be visible once you save the Sales Invoice.",
    "fieldname": "base_in_words",
    "fieldtype": "Data",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "In Words (Company Currency)",
    "oldfieldname": "in_words",
    "oldfieldtype": "Data",
@@ -962,6 +1166,8 @@
   {
    "fieldname": "column_break5",
    "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "oldfieldtype": "Column Break",
    "print_hide": 1,
    "width": "50%"
@@ -970,6 +1176,8 @@
    "bold": 1,
    "fieldname": "grand_total",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "in_list_view": 1,
    "label": "Grand Total",
    "oldfieldname": "grand_total_export",
@@ -981,6 +1189,8 @@
   {
    "fieldname": "rounding_adjustment",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Rounding Adjustment",
    "no_copy": 1,
    "options": "currency",
@@ -991,6 +1201,8 @@
    "bold": 1,
    "fieldname": "rounded_total",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Rounded Total",
    "oldfieldname": "rounded_total_export",
    "oldfieldtype": "Currency",
@@ -1000,6 +1212,8 @@
   {
    "fieldname": "in_words",
    "fieldtype": "Data",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "In Words",
    "oldfieldname": "in_words_export",
    "oldfieldtype": "Data",
@@ -1009,6 +1223,8 @@
   {
    "fieldname": "total_advance",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Total Advance",
    "oldfieldname": "total_advance",
    "oldfieldtype": "Currency",
@@ -1019,6 +1235,8 @@
   {
    "fieldname": "outstanding_amount",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Outstanding Amount",
    "no_copy": 1,
    "oldfieldname": "outstanding_amount",
@@ -1032,6 +1250,8 @@
    "collapsible_depends_on": "advances",
    "fieldname": "advances_section",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Advance Payments",
    "oldfieldtype": "Section Break",
    "options": "fa fa-money",
@@ -1041,18 +1261,24 @@
    "default": "0",
    "fieldname": "allocate_advances_automatically",
    "fieldtype": "Check",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Allocate Advances Automatically (FIFO)"
   },
   {
    "depends_on": "eval:!doc.allocate_advances_automatically",
    "fieldname": "get_advances",
    "fieldtype": "Button",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Get Advances Received",
    "options": "set_advances"
   },
   {
    "fieldname": "advances",
    "fieldtype": "Table",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Advances",
    "oldfieldname": "advance_adjustment_details",
    "oldfieldtype": "Table",
@@ -1064,12 +1290,16 @@
    "collapsible_depends_on": "eval:(!doc.is_pos && !doc.is_return)",
    "fieldname": "payment_schedule_section",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Payment Terms"
   },
   {
    "depends_on": "eval:(!doc.is_pos && !doc.is_return)",
    "fieldname": "payment_terms_template",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Payment Terms Template",
    "no_copy": 1,
    "options": "Payment Terms Template",
@@ -1079,6 +1309,8 @@
    "depends_on": "eval:(!doc.is_pos && !doc.is_return)",
    "fieldname": "payment_schedule",
    "fieldtype": "Table",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Payment Schedule",
    "no_copy": 1,
    "options": "Payment Schedule",
@@ -1088,6 +1320,8 @@
    "depends_on": "eval:doc.is_pos===1||(doc.advances && doc.advances.length>0)",
    "fieldname": "payments_section",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Payments",
    "options": "fa fa-money"
   },
@@ -1096,6 +1330,8 @@
    "fieldname": "cash_bank_account",
    "fieldtype": "Link",
    "hidden": 1,
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Cash/Bank Account",
    "oldfieldname": "cash_bank_account",
    "oldfieldtype": "Link",
@@ -1106,17 +1342,23 @@
    "depends_on": "eval:doc.is_pos===1",
    "fieldname": "payments",
    "fieldtype": "Table",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Sales Invoice Payment",
    "options": "Sales Invoice Payment",
    "print_hide": 1
   },
   {
    "fieldname": "section_break_84",
-   "fieldtype": "Section Break"
+   "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "fieldname": "base_paid_amount",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Paid Amount (Company Currency)",
    "no_copy": 1,
    "options": "Company:company:default_currency",
@@ -1125,12 +1367,16 @@
   },
   {
    "fieldname": "column_break_86",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "depends_on": "eval: doc.is_pos || doc.redeem_loyalty_points",
    "fieldname": "paid_amount",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Paid Amount",
    "no_copy": 1,
    "oldfieldname": "paid_amount",
@@ -1141,12 +1387,16 @@
   },
   {
    "fieldname": "section_break_88",
-   "fieldtype": "Section Break"
+   "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "depends_on": "is_pos",
    "fieldname": "base_change_amount",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Base Change Amount (Company Currency)",
    "no_copy": 1,
    "options": "Company:company:default_currency",
@@ -1155,12 +1405,16 @@
   },
   {
    "fieldname": "column_break_90",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "depends_on": "is_pos",
    "fieldname": "change_amount",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Change Amount",
    "no_copy": 1,
    "options": "currency",
@@ -1170,6 +1424,8 @@
    "depends_on": "is_pos",
    "fieldname": "account_for_change_amount",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Account for Change Amount",
    "options": "Account",
    "print_hide": 1
@@ -1180,12 +1436,16 @@
    "depends_on": "grand_total",
    "fieldname": "column_break4",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Write Off",
    "width": "50%"
   },
   {
    "fieldname": "write_off_amount",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Write Off Amount",
    "no_copy": 1,
    "options": "currency",
@@ -1194,6 +1454,8 @@
   {
    "fieldname": "base_write_off_amount",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Write Off Amount (Company Currency)",
    "no_copy": 1,
    "options": "Company:company:default_currency",
@@ -1205,16 +1467,22 @@
    "depends_on": "is_pos",
    "fieldname": "write_off_outstanding_amount_automatically",
    "fieldtype": "Check",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Write Off Outstanding Amount",
    "print_hide": 1
   },
   {
    "fieldname": "column_break_74",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "fieldname": "write_off_account",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Write Off Account",
    "options": "Account",
    "print_hide": 1
@@ -1222,6 +1490,8 @@
   {
    "fieldname": "write_off_cost_center",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Write Off Cost Center",
    "options": "Cost Center",
    "print_hide": 1
@@ -1231,12 +1501,16 @@
    "collapsible_depends_on": "terms",
    "fieldname": "terms_section_break",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Terms and Conditions",
    "oldfieldtype": "Section Break"
   },
   {
    "fieldname": "tc_name",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Terms",
    "oldfieldname": "tc_name",
    "oldfieldtype": "Link",
@@ -1246,6 +1520,8 @@
   {
    "fieldname": "terms",
    "fieldtype": "Text Editor",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Terms and Conditions Details",
    "oldfieldname": "terms",
    "oldfieldtype": "Text Editor"
@@ -1254,12 +1530,16 @@
    "collapsible": 1,
    "fieldname": "edit_printing_settings",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Printing Settings"
   },
   {
    "allow_on_submit": 1,
    "fieldname": "letter_head",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Letter Head",
    "oldfieldname": "letter_head",
    "oldfieldtype": "Select",
@@ -1271,24 +1551,32 @@
    "default": "0",
    "fieldname": "group_same_items",
    "fieldtype": "Check",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Group same items",
    "print_hide": 1
   },
   {
    "fieldname": "language",
    "fieldtype": "Data",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Print Language",
    "print_hide": 1,
    "read_only": 1
   },
   {
    "fieldname": "column_break_84",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "allow_on_submit": 1,
    "fieldname": "select_print_heading",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Print Heading",
    "no_copy": 1,
    "oldfieldname": "select_print_heading",
@@ -1302,11 +1590,15 @@
    "depends_on": "customer",
    "fieldname": "more_information",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "More Information"
   },
   {
    "fieldname": "inter_company_invoice_reference",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Inter Company Invoice Reference",
    "options": "Purchase Invoice",
    "read_only": 1
@@ -1315,6 +1607,8 @@
    "fieldname": "customer_group",
    "fieldtype": "Link",
    "hidden": 1,
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Customer Group",
    "options": "Customer Group",
    "print_hide": 1
@@ -1322,6 +1616,8 @@
   {
    "fieldname": "campaign",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Campaign",
    "oldfieldname": "campaign",
    "oldfieldtype": "Link",
@@ -1332,6 +1628,8 @@
    "default": "0",
    "fieldname": "is_discounted",
    "fieldtype": "Check",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Is Discounted",
    "no_copy": 1,
    "read_only": 1
@@ -1339,12 +1637,16 @@
   {
    "fieldname": "col_break23",
    "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "width": "50%"
   },
   {
    "default": "Draft",
    "fieldname": "status",
    "fieldtype": "Select",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "in_standard_filter": 1,
    "label": "Status",
    "no_copy": 1,
@@ -1355,6 +1657,8 @@
   {
    "fieldname": "source",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Source",
    "oldfieldname": "source",
    "oldfieldtype": "Select",
@@ -1365,6 +1669,8 @@
    "collapsible": 1,
    "fieldname": "more_info",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Accounting Details",
    "oldfieldtype": "Section Break",
    "options": "fa fa-file-text",
@@ -1373,6 +1679,8 @@
   {
    "fieldname": "debit_to",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Debit To",
    "oldfieldname": "debit_to",
    "oldfieldtype": "Link",
@@ -1385,6 +1693,8 @@
    "fieldname": "party_account_currency",
    "fieldtype": "Link",
    "hidden": 1,
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Party Account Currency",
    "no_copy": 1,
    "options": "Currency",
@@ -1395,6 +1705,8 @@
    "default": "No",
    "fieldname": "is_opening",
    "fieldtype": "Select",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Is Opening Entry",
    "oldfieldname": "is_opening",
    "oldfieldtype": "Select",
@@ -1404,6 +1716,8 @@
   {
    "fieldname": "c_form_applicable",
    "fieldtype": "Select",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "C-Form Applicable",
    "no_copy": 1,
    "options": "No\nYes",
@@ -1412,6 +1726,8 @@
   {
    "fieldname": "c_form_no",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "C-Form No",
    "no_copy": 1,
    "options": "C-Form",
@@ -1421,12 +1737,16 @@
   {
    "fieldname": "column_break8",
    "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "oldfieldtype": "Column Break",
    "print_hide": 1
   },
   {
    "fieldname": "remarks",
    "fieldtype": "Small Text",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Remarks",
    "no_copy": 1,
    "oldfieldname": "remarks",
@@ -1438,6 +1758,8 @@
    "collapsible_depends_on": "sales_partner",
    "fieldname": "sales_team_section_break",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Commission",
    "oldfieldtype": "Section Break",
    "options": "fa fa-group",
@@ -1446,6 +1768,8 @@
   {
    "fieldname": "sales_partner",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Sales Partner",
    "oldfieldname": "sales_partner",
    "oldfieldtype": "Link",
@@ -1455,6 +1779,8 @@
   {
    "fieldname": "column_break10",
    "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "oldfieldtype": "Column Break",
    "print_hide": 1,
    "width": "50%"
@@ -1462,6 +1788,8 @@
   {
    "fieldname": "commission_rate",
    "fieldtype": "Float",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Commission Rate (%)",
    "oldfieldname": "commission_rate",
    "oldfieldtype": "Currency",
@@ -1470,6 +1798,8 @@
   {
    "fieldname": "total_commission",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Total Commission",
    "oldfieldname": "total_commission",
    "oldfieldtype": "Currency",
@@ -1481,6 +1811,8 @@
    "collapsible_depends_on": "sales_team",
    "fieldname": "section_break2",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Sales Team",
    "print_hide": 1
   },
@@ -1488,6 +1820,8 @@
    "allow_on_submit": 1,
    "fieldname": "sales_team",
    "fieldtype": "Table",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Sales Team1",
    "oldfieldname": "sales_team",
    "oldfieldtype": "Table",
@@ -1495,14 +1829,19 @@
    "print_hide": 1
   },
   {
+   "collapsible": 1,
    "fieldname": "subscription_section",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Subscription Section"
   },
   {
    "allow_on_submit": 1,
    "fieldname": "from_date",
    "fieldtype": "Date",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "From Date",
    "no_copy": 1,
    "print_hide": 1
@@ -1511,18 +1850,24 @@
    "allow_on_submit": 1,
    "fieldname": "to_date",
    "fieldtype": "Date",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "To Date",
    "no_copy": 1,
    "print_hide": 1
   },
   {
    "fieldname": "column_break_140",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "allow_on_submit": 1,
    "fieldname": "auto_repeat",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Auto Repeat",
    "no_copy": 1,
    "options": "Auto Repeat",
@@ -1534,12 +1879,16 @@
    "depends_on": "eval: doc.auto_repeat",
    "fieldname": "update_auto_repeat_reference",
    "fieldtype": "Button",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Update Auto Repeat Reference"
   },
   {
    "fieldname": "against_income_account",
    "fieldtype": "Small Text",
    "hidden": 1,
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Against Income Account",
    "no_copy": 1,
    "oldfieldname": "against_income_account",
@@ -1551,6 +1900,8 @@
    "fieldname": "pos_total_qty",
    "fieldtype": "Float",
    "hidden": 1,
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Total Qty",
    "print_hide": 1,
    "print_hide_if_no_value": 1,
@@ -1560,17 +1911,23 @@
    "collapsible": 1,
    "fieldname": "accounting_dimensions_section",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Accounting Dimensions"
   },
   {
    "fieldname": "dimension_col_break",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "default": "0",
    "fetch_from": "customer.is_internal_customer",
    "fieldname": "is_internal_customer",
    "fieldtype": "Check",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Is Internal Customer",
    "read_only": 1
   }
@@ -1579,7 +1936,7 @@
  "idx": 181,
  "is_submittable": 1,
  "links": [],
- "modified": "2020-05-19 17:00:57.208696",
+ "modified": "2020-06-30 12:00:03.890180",
  "modified_by": "Administrator",
  "module": "Accounts",
  "name": "Sales Invoice",
diff --git a/erpnext/assets/desk_page/assets/assets.json b/erpnext/assets/desk_page/assets/assets.json
index 94939fd..449a5fa 100644
--- a/erpnext/assets/desk_page/assets/assets.json
+++ b/erpnext/assets/desk_page/assets/assets.json
@@ -58,7 +58,7 @@
    "type": "Report"
   },
   {
-   "label": "Assets Dashboard",
+   "label": "Dashboard",
    "link_to": "Asset",
    "type": "Dashboard"
   }
diff --git a/erpnext/buying/desk_page/buying/buying.json b/erpnext/buying/desk_page/buying/buying.json
index bddb957..565d39c 100644
--- a/erpnext/buying/desk_page/buying/buying.json
+++ b/erpnext/buying/desk_page/buying/buying.json
@@ -33,7 +33,7 @@
   {
    "hidden": 0,
    "label": "Other Reports",
-   "links": "[\n    {\n        \"is_query_report\": true,\n        \"label\": \"Items To Be Requested\",\n        \"name\": \"Items To Be Requested\",\n        \"onboard\": 1,\n        \"reference_doctype\": \"Item\",\n        \"type\": \"report\"\n    },\n    {\n        \"is_query_report\": true,\n        \"label\": \"Item-wise Purchase History\",\n        \"name\": \"Item-wise Purchase History\",\n        \"onboard\": 1,\n        \"reference_doctype\": \"Item\",\n        \"type\": \"report\"\n    },\n    {\n        \"is_query_report\": true,\n        \"label\": \"Subcontracted Raw Materials To Be Transferred\",\n        \"name\": \"Subcontracted Raw Materials To Be Transferred\",\n        \"reference_doctype\": \"Purchase Order\",\n        \"type\": \"report\"\n    },\n    {\n        \"is_query_report\": true,\n        \"label\": \"Subcontracted Item To Be Received\",\n        \"name\": \"Subcontracted Item To Be Received\",\n        \"reference_doctype\": \"Purchase Order\",\n        \"type\": \"report\"\n    },\n    {\n        \"is_query_report\": true,\n        \"label\": \"Quoted Item Comparison\",\n        \"name\": \"Quoted Item Comparison\",\n         \"onboard\": 1,\n        \"reference_doctype\": \"Supplier Quotation\",\n        \"type\": \"report\"\n    },\n    {\n        \"is_query_report\": true,\n        \"label\": \"Material Requests for which Supplier Quotations are not created\",\n        \"name\": \"Material Requests for which Supplier Quotations are not created\",\n        \"reference_doctype\": \"Material Request\",\n        \"type\": \"report\"\n    },\n    {\n        \"is_query_report\": true,\n        \"label\": \"Supplier Addresses And Contacts\",\n        \"name\": \"Address And Contacts\",\n        \"reference_doctype\": \"Address\",\n        \"route_options\": {\n            \"party_type\": \"Supplier\"\n        },\n        \"type\": \"report\"\n    }\n]"
+   "links": "[\n    {\n        \"is_query_report\": true,\n        \"label\": \"Items To Be Requested\",\n        \"name\": \"Items To Be Requested\",\n        \"onboard\": 1,\n        \"reference_doctype\": \"Item\",\n        \"type\": \"report\"\n    },\n    {\n        \"is_query_report\": true,\n        \"label\": \"Item-wise Purchase History\",\n        \"name\": \"Item-wise Purchase History\",\n        \"onboard\": 1,\n        \"reference_doctype\": \"Item\",\n        \"type\": \"report\"\n    },\n    {\n        \"is_query_report\": true,\n        \"label\": \"Purchase Receipt Trends\",\n        \"name\": \"Purchase Receipt Trends\",\n        \"reference_doctype\": \"Purchase Receipt\",\n        \"type\": \"report\"\n    },\n    {\n        \"is_query_report\": true,\n        \"label\": \"Purchase Invoice Trends\",\n        \"name\": \"Purchase Invoice Trends\",\n        \"reference_doctype\": \"Purchase Invoice\",\n        \"type\": \"report\"\n    },\n    {\n        \"is_query_report\": true,\n        \"label\": \"Subcontracted Raw Materials To Be Transferred\",\n        \"name\": \"Subcontracted Raw Materials To Be Transferred\",\n        \"reference_doctype\": \"Purchase Order\",\n        \"type\": \"report\"\n    },\n    {\n        \"is_query_report\": true,\n        \"label\": \"Subcontracted Item To Be Received\",\n        \"name\": \"Subcontracted Item To Be Received\",\n        \"reference_doctype\": \"Purchase Order\",\n        \"type\": \"report\"\n    },\n    {\n        \"is_query_report\": true,\n        \"label\": \"Quoted Item Comparison\",\n        \"name\": \"Quoted Item Comparison\",\n         \"onboard\": 1,\n        \"reference_doctype\": \"Supplier Quotation\",\n        \"type\": \"report\"\n    },\n    {\n        \"is_query_report\": true,\n        \"label\": \"Material Requests for which Supplier Quotations are not created\",\n        \"name\": \"Material Requests for which Supplier Quotations are not created\",\n        \"reference_doctype\": \"Material Request\",\n        \"type\": \"report\"\n    },\n    {\n        \"is_query_report\": true,\n        \"label\": \"Supplier Addresses And Contacts\",\n        \"name\": \"Address And Contacts\",\n        \"reference_doctype\": \"Address\",\n        \"route_options\": {\n            \"party_type\": \"Supplier\"\n        },\n        \"type\": \"report\"\n    }\n]"
   },
   {
    "hidden": 0,
@@ -60,7 +60,7 @@
  "idx": 0,
  "is_standard": 1,
  "label": "Buying",
- "modified": "2020-05-28 13:32:49.960574",
+ "modified": "2020-06-29 19:30:24.983050",
  "modified_by": "Administrator",
  "module": "Buying",
  "name": "Buying",
diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
index 455bd68..4a937f7 100644
--- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
+++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
@@ -166,7 +166,8 @@
 				{	"fieldtype": "Select", "label": __("Supplier"),
 					"fieldname": "supplier",
 					"options": doc.suppliers.map(d => d.supplier),
-					"reqd": 1 },
+					"reqd": 1,
+					"default": doc.suppliers.length === 1 ? doc.suppliers[0].supplier_name : "" },
 				{	"fieldtype": "Button", "label": __('Create Supplier Quotation'),
 					"fieldname": "make_supplier_quotation", "cssClass": "btn-primary" },
 			]
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index 835d92e..70217dc 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -13,7 +13,7 @@
 app_logo_url = '/assets/erpnext/images/erp-icon.svg'
 
 
-develop_version = '12.x.x-develop'
+develop_version = '13.x.x-develop'
 
 app_include_js = "assets/js/erpnext.min.js"
 app_include_css = "assets/css/erpnext.css"
diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.js b/erpnext/hr/doctype/expense_claim/expense_claim.js
index fa63ec2..8f8dafd 100644
--- a/erpnext/hr/doctype/expense_claim/expense_claim.js
+++ b/erpnext/hr/doctype/expense_claim/expense_claim.js
@@ -300,6 +300,11 @@
 	cost_center: function(frm) {
 		frm.events.set_child_cost_center(frm);
 	},
+
+	validate: function(frm) {
+		frm.events.set_child_cost_center(frm);
+	},
+
 	set_child_cost_center: function(frm){
 		(frm.doc.expenses || []).forEach(function(d) {
 			if (!d.cost_center){
@@ -349,9 +354,6 @@
 });
 
 frappe.ui.form.on("Expense Claim Detail", {
-	expenses_add: function(frm, cdt, cdn) {
-		frm.events.set_child_cost_center(frm);
-	},
 	amount: function(frm, cdt, cdn) {
 		var child = locals[cdt][cdn];
 		frappe.model.set_value(cdt, cdn, 'sanctioned_amount', child.amount);
diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.py b/erpnext/hr/doctype/expense_claim/expense_claim.py
index ea469b8..5563c24 100644
--- a/erpnext/hr/doctype/expense_claim/expense_claim.py
+++ b/erpnext/hr/doctype/expense_claim/expense_claim.py
@@ -129,7 +129,7 @@
 					"debit": data.sanctioned_amount,
 					"debit_in_account_currency": data.sanctioned_amount,
 					"against": self.employee,
-					"cost_center": data.cost_center
+					"cost_center": data.cost_center or self.cost_center
 				}, item=data)
 			)
 
diff --git a/erpnext/hr/doctype/job_offer/job_offer.py b/erpnext/hr/doctype/job_offer/job_offer.py
index 9a2c4c6..f9ee44a 100644
--- a/erpnext/hr/doctype/job_offer/job_offer.py
+++ b/erpnext/hr/doctype/job_offer/job_offer.py
@@ -32,7 +32,8 @@
 		return frappe.get_all("Job Offer", filters={
 				"offer_date": ['between', (from_date, to_date)],
 				"designation": self.designation,
-				"company": self.company
+				"company": self.company,
+				"docstatus": 1
 			}, fields=['name'])
 
 def update_job_applicant(status, job_applicant):
diff --git a/erpnext/hr/doctype/leave_policy/leave_policy_dashboard.py b/erpnext/hr/doctype/leave_policy/leave_policy_dashboard.py
index 48a2045..ff5dc2f 100644
--- a/erpnext/hr/doctype/leave_policy/leave_policy_dashboard.py
+++ b/erpnext/hr/doctype/leave_policy/leave_policy_dashboard.py
@@ -1,4 +1,5 @@
 from __future__ import unicode_literals
+from frappe import _
 
 def get_data():
 	return {
@@ -8,13 +9,17 @@
 		},
 		'transactions': [
 			{
-				'items': ['Employee']
+				'label': _('Employees'),
+				'items': ['Employee', 'Employee Grade']
 			},
 			{
-				'items': ['Employee Grade']
-			},
-			{
+				'label': _('Leaves'),
 				'items': ['Leave Allocation']
 			},
 		]
-	}
\ No newline at end of file
+	}
+
+
+
+
+	
\ No newline at end of file
diff --git a/erpnext/loan_management/doctype/loan/loan.js b/erpnext/loan_management/doctype/loan/loan.js
index 9cd8b2e..ffef60b 100644
--- a/erpnext/loan_management/doctype/loan/loan.js
+++ b/erpnext/loan_management/doctype/loan/loan.js
@@ -45,15 +45,6 @@
 			});
 		})
 
-		frm.set_query('loan_security_pledge', function(doc, cdt, cdn) {
-			return {
-				filters: {
-					applicant: frm.doc.applicant,
-					docstatus: 1,
-					loan_application: frm.doc.loan_application || ''
-				}
-			};
-		});
 	},
 
 	refresh: function (frm) {
@@ -86,9 +77,6 @@
 		frm.toggle_display("repayment_periods", s1 - frm.doc.is_term_loan);
 	},
 
-	is_secured_loan: function(frm) {
-		frm.toggle_reqd("loan_security_pledge", frm.doc.is_secured_loan);
-	},
 
 	make_loan_disbursement: function (frm) {
 		frappe.call({
diff --git a/erpnext/loan_management/doctype/loan/loan.json b/erpnext/loan_management/doctype/loan/loan.json
index b04e822..192beee 100644
--- a/erpnext/loan_management/doctype/loan/loan.json
+++ b/erpnext/loan_management/doctype/loan/loan.json
@@ -25,15 +25,12 @@
   "disbursement_date",
   "disbursed_amount",
   "column_break_11",
+  "maximum_loan_amount",
   "is_term_loan",
   "repayment_method",
   "repayment_periods",
   "monthly_repayment_amount",
   "repayment_start_date",
-  "loan_security_details_section",
-  "loan_security_pledge",
-  "column_break_25",
-  "maximum_loan_value",
   "account_info",
   "mode_of_payment",
   "payment_account",
@@ -292,13 +289,8 @@
    "default": "0",
    "fieldname": "is_secured_loan",
    "fieldtype": "Check",
-   "label": "Is Secured Loan"
-  },
-  {
-   "depends_on": "is_secured_loan",
-   "fieldname": "loan_security_details_section",
-   "fieldtype": "Section Break",
-   "label": "Loan Security Details"
+   "label": "Is Secured Loan",
+   "read_only": 1
   },
   {
    "default": "0",
@@ -325,12 +317,6 @@
    "read_only": 1
   },
   {
-   "fieldname": "loan_security_pledge",
-   "fieldtype": "Link",
-   "label": "Loan Security Pledge",
-   "options": "Loan Security Pledge"
-  },
-  {
    "fieldname": "disbursed_amount",
    "fieldtype": "Currency",
    "label": "Disbursed Amount",
@@ -338,21 +324,17 @@
    "read_only": 1
   },
   {
-   "fetch_from": "loan_security_pledge.maximum_loan_value",
-   "fieldname": "maximum_loan_value",
+   "fetch_from": "loan_application.maximum_loan_amount",
+   "fieldname": "maximum_loan_amount",
    "fieldtype": "Currency",
-   "label": "Maximum Loan Value",
+   "label": "Maximum Loan Amount",
    "options": "Company:company:default_currency",
    "read_only": 1
-  },
-  {
-   "fieldname": "column_break_25",
-   "fieldtype": "Column Break"
   }
  ],
  "is_submittable": 1,
  "links": [],
- "modified": "2020-04-13 13:16:10.192624",
+ "modified": "2020-07-02 20:46:40.128142",
  "modified_by": "Administrator",
  "module": "Loan Management",
  "name": "Loan",
diff --git a/erpnext/loan_management/doctype/loan/loan.py b/erpnext/loan_management/doctype/loan/loan.py
index 4e805d4..e20b484 100644
--- a/erpnext/loan_management/doctype/loan/loan.py
+++ b/erpnext/loan_management/doctype/loan/loan.py
@@ -13,11 +13,9 @@
 class Loan(AccountsController):
 	def validate(self):
 		self.set_loan_amount()
-
+		self.validate_loan_amount()
 		self.set_missing_fields()
 		self.validate_accounts()
-		self.validate_loan_security_pledge()
-		self.validate_loan_amount()
 		self.check_sanctioned_amount_limit()
 		self.validate_repay_from_salary()
 
@@ -56,21 +54,6 @@
 		if self.repayment_method == "Repay Over Number of Periods":
 			self.monthly_repayment_amount = get_monthly_repayment_amount(self.repayment_method, self.loan_amount, self.rate_of_interest, self.repayment_periods)
 
-	def validate_loan_security_pledge(self):
-
-		if self.is_secured_loan and not self.loan_security_pledge:
-			frappe.throw(_("Loan Security Pledge is mandatory for secured loan"))
-
-		if self.loan_security_pledge:
-			loan_security_details = frappe.db.get_value("Loan Security Pledge", self.loan_security_pledge,
-					['loan', 'company'], as_dict=1)
-
-			if loan_security_details.loan:
-				frappe.throw(_("Loan Security Pledge already pledged against loan {0}").format(loan_security_details.loan))
-
-			if loan_security_details.company != self.company:
-				frappe.throw(_("Loan Security Pledge Company and Loan Company must be same"))
-
 	def check_sanctioned_amount_limit(self):
 		total_loan_amount = get_total_loan_amount(self.applicant_type, self.applicant, self.company)
 		sanctioned_amount_limit = get_sanctioned_amount_limit(self.applicant_type, self.applicant, self.company)
@@ -129,22 +112,29 @@
 			self.total_payment = self.loan_amount
 
 	def set_loan_amount(self):
+		if self.loan_application and not self.loan_amount:
+			self.loan_amount = frappe.db.get_value('Loan Application', self.loan_application, 'loan_amount')
 
-		if not self.loan_amount and self.is_secured_loan and self.loan_security_pledge:
-			self.loan_amount = self.maximum_loan_value
 
 	def validate_loan_amount(self):
-		if self.is_secured_loan and self.loan_amount > self.maximum_loan_value:
-			msg = _("Loan amount cannot be greater than {0}").format(self.maximum_loan_value)
+		if self.maximum_loan_amount and self.loan_amount > self.maximum_loan_amount:
+			msg = _("Loan amount cannot be greater than {0}").format(self.maximum_loan_amount)
 			frappe.throw(msg)
 
 		if not self.loan_amount:
 			frappe.throw(_("Loan amount is mandatory"))
 
 	def link_loan_security_pledge(self):
-		frappe.db.sql("""UPDATE `tabLoan Security Pledge` SET
-			loan = %s, status = 'Pledged', pledge_time = %s
-			where name = %s """, (self.name, now_datetime(), self.loan_security_pledge))
+		if self.is_secured_loan:
+			loan_security_pledge = frappe.db.get_value('Loan Security Pledge', {'loan_application': self.loan_application},
+				'name')
+
+			if loan_security_pledge:
+				frappe.db.set_value('Loan Security Pledge', loan_security_pledge, {
+					'loan': self.name,
+					'status': 'Pledged',
+					'pledge_time': now_datetime()
+				})
 
 	def unlink_loan_security_pledge(self):
 		frappe.db.sql("""UPDATE `tabLoan Security Pledge` SET
diff --git a/erpnext/loan_management/doctype/loan/test_loan.py b/erpnext/loan_management/doctype/loan/test_loan.py
index 3f37a26..c65996e 100644
--- a/erpnext/loan_management/doctype/loan/test_loan.py
+++ b/erpnext/loan_management/doctype/loan/test_loan.py
@@ -16,6 +16,7 @@
 from erpnext.loan_management.doctype.process_loan_security_shortfall.process_loan_security_shortfall import create_process_loan_security_shortfall
 from erpnext.loan_management.doctype.loan.loan import create_loan_security_unpledge
 from erpnext.loan_management.doctype.loan_security_unpledge.loan_security_unpledge import get_pledged_security_qty
+from erpnext.loan_management.doctype.loan_application.loan_application import create_pledge
 
 class TestLoan(unittest.TestCase):
 	def setUp(self):
@@ -72,31 +73,31 @@
 		self.assertEquals(loan.total_payment, 302712)
 
 	def test_loan_with_security(self):
-		pledges = []
-		pledges.append({
+
+		pledge = [{
 			"loan_security": "Test Security 1",
 			"qty": 4000.00,
-			"haircut": 50,
-			"loan_security_price": 500.00
-		})
+		}]
 
-		loan_security_pledge = create_loan_security_pledge(self.applicant2, pledges)
+		loan_application = create_loan_application('_Test Company', self.applicant2,
+			'Stock Loan', pledge, "Repay Over Number of Periods", 12)
+		create_pledge(loan_application)
 
-		loan = create_loan_with_security(self.applicant2, "Stock Loan", "Repay Over Number of Periods", 12, loan_security_pledge.name)
-
+		loan = create_loan_with_security(self.applicant2, "Stock Loan", "Repay Over Number of Periods",
+			12, loan_application)
 		self.assertEquals(loan.loan_amount, 1000000)
 
 	def test_loan_disbursement(self):
-		pledges = []
-		pledges.append({
+		pledge = [{
 			"loan_security": "Test Security 1",
-			"qty": 4000.00,
-			"haircut": 50
-		})
+			"qty": 4000.00
+		}]
 
-		loan_security_pledge = create_loan_security_pledge(self.applicant2, pledges)
+		loan_application = create_loan_application('_Test Company', self.applicant2, 'Stock Loan', pledge, "Repay Over Number of Periods", 12)
 
-		loan = create_loan_with_security(self.applicant2, "Stock Loan", "Repay Over Number of Periods", 12, loan_security_pledge.name)
+		create_pledge(loan_application)
+
+		loan = create_loan_with_security(self.applicant2, "Stock Loan", "Repay Over Number of Periods", 12, loan_application)
 		self.assertEquals(loan.loan_amount, 1000000)
 
 		loan.submit()
@@ -121,18 +122,15 @@
 		self.assertTrue(gl_entries2)
 
 	def test_regular_loan_repayment(self):
-		pledges = []
-		pledges.append({
+		pledge = [{
 			"loan_security": "Test Security 1",
-			"qty": 4000.00,
-			"haircut": 50
-		})
+			"qty": 4000.00
+		}]
 
-		loan_security_pledge = create_loan_security_pledge(self.applicant2, pledges)
+		loan_application = create_loan_application('_Test Company', self.applicant2, 'Demand Loan', pledge)
+		create_pledge(loan_application)
 
-		loan = create_demand_loan(self.applicant2, "Demand Loan", loan_security_pledge.name,
-			posting_date=get_first_day(nowdate()))
-
+		loan = create_demand_loan(self.applicant2, "Demand Loan", loan_application, posting_date=get_first_day(nowdate()))
 		loan.submit()
 
 		self.assertEquals(loan.loan_amount, 1000000)
@@ -166,16 +164,15 @@
 			 penalty_amount - amounts[0], 2))
 
 	def test_loan_closure_repayment(self):
-		pledges = []
-		pledges.append({
+		pledge = [{
 			"loan_security": "Test Security 1",
-			"qty": 4000.00,
-			"haircut": 50
-		})
+			"qty": 4000.00
+		}]
 
-		loan_security_pledge = create_loan_security_pledge(self.applicant2, pledges)
-		loan = create_demand_loan(self.applicant2, "Demand Loan", loan_security_pledge.name,
-			posting_date=get_first_day(nowdate()))
+		loan_application = create_loan_application('_Test Company', self.applicant2, 'Demand Loan', pledge)
+		create_pledge(loan_application)
+
+		loan = create_demand_loan(self.applicant2, "Demand Loan", loan_application, posting_date=get_first_day(nowdate()))
 		loan.submit()
 
 		self.assertEquals(loan.loan_amount, 1000000)
@@ -214,23 +211,21 @@
 		self.assertEquals(loan.status, "Loan Closure Requested")
 
 	def test_loan_repayment_for_term_loan(self):
-		pledges = []
-		pledges.append({
+		pledges = [{
 			"loan_security": "Test Security 2",
-			"qty": 4000.00,
-			"haircut": 50
-		})
-
-		pledges.append({
+			"qty": 4000.00
+		},
+		{
 			"loan_security": "Test Security 1",
-			"qty": 2000.00,
-			"haircut": 50
-		})
+			"qty": 2000.00
+		}]
 
-		loan_security_pledge = create_loan_security_pledge(self.applicant2, pledges)
+		loan_application = create_loan_application('_Test Company', self.applicant2, 'Stock Loan', pledges,
+			"Repay Over Number of Periods", 12)
+		create_pledge(loan_application)
 
-		loan = create_loan_with_security(self.applicant2, "Stock Loan", "Repay Over Number of Periods", 12,
-			loan_security_pledge.name, posting_date=add_months(nowdate(), -1))
+		loan = create_loan_with_security(self.applicant2, "Stock Loan", "Repay Over Number of Periods", 12, loan_application,
+			posting_date=add_months(nowdate(), -1))
 
 		loan.submit()
 
@@ -250,16 +245,18 @@
 		self.assertEquals(amounts[1], 78303.00)
 
 	def test_security_shortfall(self):
-		pledges = []
-		pledges.append({
+		pledges = [{
 			"loan_security": "Test Security 2",
 			"qty": 8000.00,
 			"haircut": 50,
-		})
+		}]
 
-		loan_security_pledge = create_loan_security_pledge(self.applicant2, pledges)
+		loan_application = create_loan_application('_Test Company', self.applicant2,
+			'Stock Loan', pledges, "Repay Over Number of Periods", 12)
 
-		loan = create_loan_with_security(self.applicant2, "Stock Loan", "Repay Over Number of Periods", 12, loan_security_pledge.name)
+		create_pledge(loan_application)
+
+		loan = create_loan_with_security(self.applicant2, "Stock Loan", "Repay Over Number of Periods", 12, loan_application)
 		loan.submit()
 
 		make_loan_disbursement_entry(loan.name, loan.loan_amount)
@@ -279,16 +276,15 @@
 			where loan_security='Test Security 2'""")
 
 	def test_loan_security_unpledge(self):
-		pledges = []
-		pledges.append({
+		pledge = [{
 			"loan_security": "Test Security 1",
-			"qty": 4000.00,
-			"haircut": 50
-		})
+			"qty": 4000.00
+		}]
 
-		loan_security_pledge = create_loan_security_pledge(self.applicant2, pledges)
-		loan = create_demand_loan(self.applicant2, "Demand Loan", loan_security_pledge.name,
-			posting_date=get_first_day(nowdate()))
+		loan_application = create_loan_application('_Test Company', self.applicant2, 'Demand Loan', pledge)
+		create_pledge(loan_application)
+
+		loan = create_demand_loan(self.applicant2, "Demand Loan", loan_application, posting_date=get_first_day(nowdate()))
 		loan.submit()
 
 		self.assertEquals(loan.loan_amount, 1000000)
@@ -446,12 +442,13 @@
 			"haircut": 50.00,
 		}).insert(ignore_permissions=True)
 
-def create_loan_security_pledge(applicant, pledges):
+def create_loan_security_pledge(applicant, pledges, loan_application):
 
 	lsp = frappe.new_doc("Loan Security Pledge")
 	lsp.applicant_type = 'Customer'
 	lsp.applicant = applicant
 	lsp.company = "_Test Company"
+	lsp.loan_application = loan_application
 
 	for pledge in pledges:
 		lsp.append('securities', {
@@ -510,6 +507,31 @@
 
 	return lr
 
+def create_loan_application(company, applicant, loan_type, proposed_pledges, repayment_method=None,
+	repayment_periods=None, posting_date=None):
+	loan_application = frappe.new_doc('Loan Application')
+	loan_application.applicant_type = 'Customer'
+	loan_application.company = company
+	loan_application.applicant = applicant
+	loan_application.loan_type = loan_type
+	loan_application.posting_date = posting_date or nowdate()
+	loan_application.is_secured_loan = 1
+
+	if repayment_method:
+		loan_application.repayment_method = repayment_method
+		loan_application.repayment_periods = repayment_periods
+
+	for pledge in proposed_pledges:
+		loan_application.append('proposed_pledges', pledge)
+
+	loan_application.save()
+	loan_application.submit()
+
+	loan_application.status = 'Approved'
+	loan_application.save()
+
+	return loan_application.name
+
 
 def create_loan(applicant, loan_type, loan_amount, repayment_method, repayment_periods,
 	repayment_start_date=None, posting_date=None):
@@ -531,14 +553,13 @@
 	loan.save()
 	return loan
 
-def create_loan_with_security(applicant, loan_type, repayment_method, repayment_periods, loan_security_pledge,
-	posting_date=None, repayment_start_date=None):
-
+def create_loan_with_security(applicant, loan_type, repayment_method, repayment_periods, loan_application, posting_date=None, repayment_start_date=None):
 	loan = frappe.get_doc({
 		"doctype": "Loan",
 		"company": "_Test Company",
 		"applicant_type": "Customer",
 		"posting_date": posting_date or nowdate(),
+		"loan_application": loan_application,
 		"applicant": applicant,
 		"loan_type": loan_type,
 		"is_term_loan": 1,
@@ -547,7 +568,6 @@
 		"repayment_periods": repayment_periods,
 		"repayment_start_date": repayment_start_date or nowdate(),
 		"mode_of_payment": frappe.db.get_value('Mode of Payment', {'type': 'Cash'}, 'name'),
-		"loan_security_pledge": loan_security_pledge,
 		"payment_account": 'Payment Account - _TC',
 		"loan_account": 'Loan Account - _TC',
 		"interest_income_account": 'Interest Income Account - _TC',
@@ -558,19 +578,19 @@
 
 	return loan
 
-def create_demand_loan(applicant, loan_type, loan_security_pledge, posting_date=None):
+def create_demand_loan(applicant, loan_type, loan_application, posting_date=None):
 
 	loan = frappe.get_doc({
 		"doctype": "Loan",
 		"company": "_Test Company",
 		"applicant_type": "Customer",
 		"posting_date": posting_date or nowdate(),
+		'loan_application': loan_application,
 		"applicant": applicant,
 		"loan_type": loan_type,
 		"is_term_loan": 0,
 		"is_secured_loan": 1,
 		"mode_of_payment": frappe.db.get_value('Mode of Payment', {'type': 'Cash'}, 'name'),
-		"loan_security_pledge": loan_security_pledge,
 		"payment_account": 'Payment Account - _TC',
 		"loan_account": 'Loan Account - _TC',
 		"interest_income_account": 'Interest Income Account - _TC',
diff --git a/erpnext/loan_management/doctype/loan_application/loan_application.py b/erpnext/loan_management/doctype/loan_application/loan_application.py
index d3b8164..f051755 100644
--- a/erpnext/loan_management/doctype/loan_application/loan_application.py
+++ b/erpnext/loan_management/doctype/loan_application/loan_application.py
@@ -103,10 +103,13 @@
 		if self.is_secured_loan and not self.proposed_pledges:
 			frappe.throw(_("Proposed Pledges are mandatory for secured Loans"))
 
-		if not self.loan_amount and self.is_secured_loan and self.proposed_pledges:
-			self.loan_amount = 0
+		if self.is_secured_loan and self.proposed_pledges:
+			self.maximum_loan_amount = 0
 			for security in self.proposed_pledges:
-				self.loan_amount += security.post_haircut_amount
+				self.maximum_loan_amount += security.post_haircut_amount
+
+		if not self.loan_amount and self.is_secured_loan and self.proposed_pledges:
+			self.loan_amount = self.maximum_loan_amount
 
 @frappe.whitelist()
 def create_loan(source_name, target_doc=None, submit=0):
@@ -116,7 +119,6 @@
 		 filters = {'name': source_doc.loan_type}
 		)[0]
 
-		loan_security_pledge = frappe.db.get_value("Loan Security Pledge", {"loan_application": source_name}, 'name')
 
 		target_doc.mode_of_payment = account_details.mode_of_payment
 		target_doc.payment_account = account_details.payment_account
@@ -124,9 +126,6 @@
 		target_doc.interest_income_account = account_details.interest_income_account
 		target_doc.penalty_income_account = account_details.penalty_income_account
 
-		if loan_security_pledge:
-			target_doc.is_secured_loan = 1
-			target_doc.loan_security_pledge = loan_security_pledge
 
 	doclist = get_mapped_doc("Loan Application", source_name, {
 		"Loan Application": {
diff --git a/erpnext/loan_management/doctype/loan_disbursement/test_loan_disbursement.py b/erpnext/loan_management/doctype/loan_disbursement/test_loan_disbursement.py
index 0c1578f..2cb2637 100644
--- a/erpnext/loan_management/doctype/loan_disbursement/test_loan_disbursement.py
+++ b/erpnext/loan_management/doctype/loan_disbursement/test_loan_disbursement.py
@@ -5,11 +5,12 @@
 import frappe
 import unittest
 from frappe.utils import (nowdate, add_days, get_datetime, get_first_day, get_last_day, date_diff, flt, add_to_date)
-from erpnext.loan_management.doctype.loan.test_loan import (create_loan_type, create_loan_security_pledge, create_repayment_entry,
+from erpnext.loan_management.doctype.loan.test_loan import (create_loan_type, create_loan_security_pledge, create_repayment_entry, create_loan_application,
 	make_loan_disbursement_entry, create_loan_accounts, create_loan_security_type, create_loan_security, create_demand_loan, create_loan_security_price)
 from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import process_loan_interest_accrual_for_demand_loans
 from erpnext.loan_management.doctype.loan_interest_accrual.loan_interest_accrual import days_in_year
 from erpnext.selling.doctype.customer.test_customer import get_customer_dict
+from erpnext.loan_management.doctype.loan_application.loan_application import create_pledge
 
 class TestLoanDisbursement(unittest.TestCase):
 
@@ -31,18 +32,15 @@
 		self.applicant = frappe.db.get_value("Customer", {'name': '_Test Loan Customer'}, 'name')
 
 	def test_loan_topup(self):
-		pledges = []
-		pledges.append({
+		pledge = [{
 			"loan_security": "Test Security 1",
-			"qty": 4000.00,
-			"haircut": 50,
-			"loan_security_price": 500.00
-		})
+			"qty": 4000.00
+		}]
 
-		loan_security_pledge = create_loan_security_pledge(self.applicant, pledges)
+		loan_application = create_loan_application('_Test Company', self.applicant, 'Demand Loan', pledge)
+		create_pledge(loan_application)
 
-		loan = create_demand_loan(self.applicant, "Demand Loan", loan_security_pledge.name,
-			posting_date=get_first_day(nowdate()))
+		loan = create_demand_loan(self.applicant, "Demand Loan", loan_application, posting_date=get_first_day(nowdate()))
 
 		loan.submit()
 
diff --git a/erpnext/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py b/erpnext/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py
index 2afed08..4b85b21 100644
--- a/erpnext/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py
+++ b/erpnext/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py
@@ -6,10 +6,11 @@
 import unittest
 from frappe.utils import (nowdate, add_days, get_datetime, get_first_day, get_last_day, date_diff, flt, add_to_date)
 from erpnext.loan_management.doctype.loan.test_loan import (create_loan_type, create_loan_security_pledge, create_loan_security_price,
-	make_loan_disbursement_entry, create_loan_accounts, create_loan_security_type, create_loan_security, create_demand_loan)
+	make_loan_disbursement_entry, create_loan_accounts, create_loan_security_type, create_loan_security, create_demand_loan, create_loan_application)
 from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import process_loan_interest_accrual_for_demand_loans
 from erpnext.loan_management.doctype.loan_interest_accrual.loan_interest_accrual import days_in_year
 from erpnext.selling.doctype.customer.test_customer import get_customer_dict
+from erpnext.loan_management.doctype.loan_application.loan_application import create_pledge
 
 class TestLoanInterestAccrual(unittest.TestCase):
 	def setUp(self):
@@ -29,17 +30,15 @@
 		self.applicant = frappe.db.get_value("Customer", {'name': '_Test Loan Customer'}, 'name')
 
 	def test_loan_interest_accural(self):
-		pledges = []
-		pledges.append({
+		pledge = [{
 			"loan_security": "Test Security 1",
-			"qty": 4000.00,
-			"haircut": 50,
-			"loan_security_price": 500.00
-		})
+			"qty": 4000.00
+		}]
 
-		loan_security_pledge = create_loan_security_pledge(self.applicant, pledges)
+		loan_application = create_loan_application('_Test Company', self.applicant, 'Demand Loan', pledge)
+		create_pledge(loan_application)
 
-		loan = create_demand_loan(self.applicant, "Demand Loan", loan_security_pledge.name,
+		loan = create_demand_loan(self.applicant, "Demand Loan", loan_application,
 			posting_date=get_first_day(nowdate()))
 
 		loan.submit()
diff --git a/erpnext/loan_management/doctype/loan_security_pledge/loan_security_pledge.json b/erpnext/loan_management/doctype/loan_security_pledge/loan_security_pledge.json
index 1553844..4572e99 100644
--- a/erpnext/loan_management/doctype/loan_security_pledge/loan_security_pledge.json
+++ b/erpnext/loan_management/doctype/loan_security_pledge/loan_security_pledge.json
@@ -1,4 +1,5 @@
 {
+ "actions": [],
  "autoname": "LS-.{applicant}.-.#####",
  "creation": "2019-08-29 18:48:51.371674",
  "doctype": "DocType",
@@ -6,10 +7,10 @@
  "engine": "InnoDB",
  "field_order": [
   "loan_details_section",
-  "loan_application",
-  "loan",
   "applicant_type",
   "applicant",
+  "loan",
+  "loan_application",
   "column_break_3",
   "company",
   "pledge_time",
@@ -55,15 +56,13 @@
    "fieldname": "loan",
    "fieldtype": "Link",
    "label": "Loan",
-   "options": "Loan",
-   "read_only": 1
+   "options": "Loan"
   },
   {
    "fieldname": "loan_application",
    "fieldtype": "Link",
    "label": "Loan Application",
-   "options": "Loan Application",
-   "read_only": 1
+   "options": "Loan Application"
   },
   {
    "fieldname": "total_security_value",
@@ -133,7 +132,8 @@
   }
  ],
  "is_submittable": 1,
- "modified": "2019-10-10 13:22:53.297519",
+ "links": [],
+ "modified": "2020-07-02 23:38:24.002382",
  "modified_by": "Administrator",
  "module": "Loan Management",
  "name": "Loan Security Pledge",
diff --git a/erpnext/manufacturing/dashboard_fixtures.py b/erpnext/manufacturing/dashboard_fixtures.py
index 64e4bc6..0e9a21c 100644
--- a/erpnext/manufacturing/dashboard_fixtures.py
+++ b/erpnext/manufacturing/dashboard_fixtures.py
@@ -192,7 +192,7 @@
 		]),
 		"function": "Count",
 		"is_public": 1,
-		"label": _("Monthly Total Work Order"),
+		"label": _("Monthly Total Work Orders"),
 		"show_percentage_stats": 1,
 		"stats_time_interval": "Weekly"
 	},
@@ -207,7 +207,7 @@
 		]),
 		"function": "Count",
 		"is_public": 1,
-		"label": _("Monthly Completed Work Order"),
+		"label": _("Monthly Completed Work Orders"),
 		"show_percentage_stats": 1,
 		"stats_time_interval": "Weekly"
 	},
@@ -221,7 +221,7 @@
 		]),
 		"function": "Count",
 		"is_public": 1,
-		"label": _("Ongoing Job Card"),
+		"label": _("Ongoing Job Cards"),
 		"show_percentage_stats": 1,
 		"stats_time_interval": "Weekly"
 	},
@@ -235,7 +235,7 @@
 		]),
 		"function": "Count",
 		"is_public": 1,
-		"label": _("Monthly Quality Inspection"),
+		"label": _("Monthly Quality Inspections"),
 		"show_percentage_stats": 1,
 		"stats_time_interval": "Weekly"
 	}]
\ No newline at end of file
diff --git a/erpnext/manufacturing/desk_page/manufacturing/manufacturing.json b/erpnext/manufacturing/desk_page/manufacturing/manufacturing.json
index 763f533..8d11294 100644
--- a/erpnext/manufacturing/desk_page/manufacturing/manufacturing.json
+++ b/erpnext/manufacturing/desk_page/manufacturing/manufacturing.json
@@ -94,12 +94,6 @@
    "type": "DocType"
   },
   {
-   "label": "Dashboard",
-   "link_to": "Manufacturing",
-   "restrict_to_domain": "Manufacturing",
-   "type": "Dashboard"
-  },
-  {
    "label": "Forecasting",
    "link_to": "Exponential Smoothing Forecasting",
    "type": "Report"
@@ -119,6 +113,12 @@
    "label": "Production Planning Report",
    "link_to": "Production Planning Report",
    "type": "Report"
-  }
+  },
+  {
+    "label": "Dashboard",
+    "link_to": "Manufacturing",
+    "restrict_to_domain": "Manufacturing",
+    "type": "Dashboard"
+   } 
  ]
 }
\ No newline at end of file
diff --git a/erpnext/manufacturing/module_onboarding/manufacturing/manufacturing.json b/erpnext/manufacturing/module_onboarding/manufacturing/manufacturing.json
index 952d1f0..a36b63a 100644
--- a/erpnext/manufacturing/module_onboarding/manufacturing/manufacturing.json
+++ b/erpnext/manufacturing/module_onboarding/manufacturing/manufacturing.json
@@ -19,7 +19,7 @@
  "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/manufacturing",
  "idx": 0,
  "is_complete": 0,
- "modified": "2020-05-19 12:51:42.744570",
+ "modified": "2020-06-29 20:25:36.899106",
  "modified_by": "Administrator",
  "module": "Manufacturing",
  "name": "Manufacturing",
@@ -52,6 +52,5 @@
  ],
  "subtitle": "Products, Raw Materials, BOM, Work Order and more.",
  "success_message": "Manufacturing module is all setup!",
- "title": "Let's Setup Manufacturing Module",
- "user_can_dismiss": 1
-}
\ No newline at end of file
+ "title": "Let's Set Up the Manufacturing Module"
+}
diff --git a/erpnext/payroll/doctype/payroll_period/payroll_period.json b/erpnext/payroll/doctype/payroll_period/payroll_period.json
index c919b4f..0e09484 100644
--- a/erpnext/payroll/doctype/payroll_period/payroll_period.json
+++ b/erpnext/payroll/doctype/payroll_period/payroll_period.json
@@ -53,7 +53,7 @@
   }
  ],
  "links": [],
- "modified": "2020-06-22 20:12:32.684189",
+ "modified": "2020-06-29 17:17:12.689089",
  "modified_by": "Administrator",
  "module": "Payroll",
  "name": "Payroll Period",
@@ -96,6 +96,7 @@
    "write": 1
   }
  ],
+ "quick_entry": 1,
  "sort_field": "modified",
  "sort_order": "DESC",
  "track_changes": 1
diff --git a/erpnext/payroll/doctype/salary_slip/salary_slip.py b/erpnext/payroll/doctype/salary_slip/salary_slip.py
index 2da19b0..1e2983e 100644
--- a/erpnext/payroll/doctype/salary_slip/salary_slip.py
+++ b/erpnext/payroll/doctype/salary_slip/salary_slip.py
@@ -207,7 +207,7 @@
 				frappe.throw(_("There are more holidays than working days this month."))
 
 		if not payroll_based_on:
-			frappe.throw(_("Please set Payroll based on in HR settings"))
+			frappe.throw(_("Please set Payroll based on in Payroll settings"))
 
 		if payroll_based_on == "Attendance":
 			actual_lwp, absent = self.calculate_lwp_and_absent_days_based_on_attendance(holidays)
@@ -244,15 +244,13 @@
 					for holiday in holidays:
 						if not frappe.db.exists("Attendance", {"employee": self.employee, "attendance_date": holiday, "docstatus": 1 }):
 							self.payment_days += 1
-
-
 		else:
 			self.payment_days = 0
 
 	def get_unmarked_days(self):
 		marked_days = frappe.get_all("Attendance", filters = {
-					"attendance_date": ["between", ['2020-05-1',"2020-05-30"]],
-					"employee": 'HR-EMP-00003',
+					"attendance_date": ["between", [self.start_date, self.end_date]],
+					"employee": self.employee,
 					"docstatus": 1
 				}, fields = ["COUNT(*) as marked_days"])[0].marked_days
 
diff --git a/erpnext/payroll/doctype/salary_slip/test_salary_slip.py b/erpnext/payroll/doctype/salary_slip/test_salary_slip.py
index be9a2d3..37cd89a 100644
--- a/erpnext/payroll/doctype/salary_slip/test_salary_slip.py
+++ b/erpnext/payroll/doctype/salary_slip/test_salary_slip.py
@@ -105,7 +105,7 @@
 		#Gross pay calculation based on attendances
 		gross_pay = 78000 - ((78000 / (days_in_month - no_of_holidays)) * flt(ss.leave_without_pay))
 
-		self.assertEqual(ss.gross_pay, gross_pay)
+		self.assertEqual(flt(ss.gross_pay, 2), flt(gross_pay, 2))
 
 		frappe.db.set_value("Payroll Settings", None, "payroll_based_on", "Leave")
 
diff --git a/erpnext/payroll/module_onboarding/payroll/payroll.json b/erpnext/payroll/module_onboarding/payroll/payroll.json
index a4ea536..7ed786f 100644
--- a/erpnext/payroll/module_onboarding/payroll/payroll.json
+++ b/erpnext/payroll/module_onboarding/payroll/payroll.json
@@ -13,7 +13,7 @@
  "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/human-resources/payroll-entry",
  "idx": 0,
  "is_complete": 0,
- "modified": "2020-06-04 16:35:30.650792",
+ "modified": "2020-06-29 17:00:25.113341",
  "modified_by": "Administrator",
  "module": "Payroll",
  "name": "Payroll",
diff --git a/erpnext/payroll/onboarding_step/create_payroll_period/create_payroll_period.json b/erpnext/payroll/onboarding_step/create_payroll_period/create_payroll_period.json
index 4bae675..b1a7cc2 100644
--- a/erpnext/payroll/onboarding_step/create_payroll_period/create_payroll_period.json
+++ b/erpnext/payroll/onboarding_step/create_payroll_period/create_payroll_period.json
@@ -8,7 +8,7 @@
  "is_mandatory": 1,
  "is_single": 0,
  "is_skipped": 0,
- "modified": "2020-06-01 11:53:54.553947",
+ "modified": "2020-06-29 11:53:54.553947",
  "modified_by": "Administrator",
  "name": "Create Payroll Period",
  "owner": "Administrator",
diff --git a/erpnext/payroll/onboarding_step/payroll_settings/payroll_settings.json b/erpnext/payroll/onboarding_step/payroll_settings/payroll_settings.json
index 946b8c8..a7cf7bf 100644
--- a/erpnext/payroll/onboarding_step/payroll_settings/payroll_settings.json
+++ b/erpnext/payroll/onboarding_step/payroll_settings/payroll_settings.json
@@ -1,19 +1,19 @@
 {
- "action": "Go to Page",
+ "action": "Update Settings",
  "creation": "2020-06-04 16:34:29.664917",
  "docstatus": 0,
  "doctype": "Onboarding Step",
  "idx": 0,
  "is_complete": 0,
  "is_mandatory": 0,
- "is_single": 0,
+ "is_single": 1,
  "is_skipped": 0,
- "modified": "2020-06-04 16:34:29.664917",
+ "modified": "2020-06-29 16:34:29.664917",
  "modified_by": "Administrator",
  "name": "Payroll Settings",
  "owner": "Administrator",
- "path": "#Form/Payroll Settings",
+ "reference_document": "Payroll Settings",
  "show_full_form": 0,
  "title": "Payroll Settings",
- "validate_action": 1
+ "validate_action": 0
 }
\ No newline at end of file
diff --git a/erpnext/payroll/report/bank_remittance/bank_remittance.py b/erpnext/payroll/report/bank_remittance/bank_remittance.py
index a35d8e5..4b052bf 100644
--- a/erpnext/payroll/report/bank_remittance/bank_remittance.py
+++ b/erpnext/payroll/report/bank_remittance/bank_remittance.py
@@ -152,6 +152,9 @@
 		company_accounts_map[acc.account] = acc
 
 	for entry in payroll_entries:
-		entry["company_account"] = company_accounts_map[entry.payment_account]['bank_account_no']
+		company_account = ''
+		if entry.payment_account in company_accounts_map:
+			company_account = company_accounts_map[entry.payment_account]['bank_account_no']
+		entry["company_account"] = company_account
 
 	return payroll_entries
diff --git a/erpnext/payroll/report/salary_payments_based_on_payment_mode/salary_payments_based_on_payment_mode.py b/erpnext/payroll/report/salary_payments_based_on_payment_mode/salary_payments_based_on_payment_mode.py
index 7f0c2e2..a0dab63 100644
--- a/erpnext/payroll/report/salary_payments_based_on_payment_mode/salary_payments_based_on_payment_mode.py
+++ b/erpnext/payroll/report/salary_payments_based_on_payment_mode/salary_payments_based_on_payment_mode.py
@@ -100,6 +100,8 @@
 	total_row = get_total_based_on_mode_of_payment(data, mode_of_payments)
 	total_deductions = gross_pay - total_row.get("total")
 
+	report_summary = []
+
 	if data:
 		data.append(total_row)
 		data.append({})
diff --git a/erpnext/projects/desk_page/projects/projects.json b/erpnext/projects/desk_page/projects/projects.json
index d91fe53..e24cf30 100644
--- a/erpnext/projects/desk_page/projects/projects.json
+++ b/erpnext/projects/desk_page/projects/projects.json
@@ -68,7 +68,7 @@
    "type": "Report"
   },
   {
-   "label": "Project Dashboard",
+   "label": "Dashboard",
    "link_to": "Project",
    "type": "Dashboard"
   }
diff --git a/erpnext/regional/report/provident_fund_deductions/provident_fund_deductions.py b/erpnext/regional/report/provident_fund_deductions/provident_fund_deductions.py
index 084890e..597072c 100644
--- a/erpnext/regional/report/provident_fund_deductions/provident_fund_deductions.py
+++ b/erpnext/regional/report/provident_fund_deductions/provident_fund_deductions.py
@@ -101,7 +101,7 @@
 				"employee": d.employee,
 				"employee_name": d.employee_name,
 				"pf_account": employee_account_dict.get(d.employee),
-				"component_type": d.amount
+				component_type: d.amount
 			})
 
 	return data_list
diff --git a/erpnext/regional/united_arab_emirates/utils.py b/erpnext/regional/united_arab_emirates/utils.py
index 772bbf5..a0425f6 100644
--- a/erpnext/regional/united_arab_emirates/utils.py
+++ b/erpnext/regional/united_arab_emirates/utils.py
@@ -11,14 +11,17 @@
 
 	for row in doc.items:
 		tax_rate = 0.0
-		item_tax_rate = frappe.parse_json(row.item_tax_rate)
+		item_tax_rate = 0.0
+
+		if row.item_tax_rate:
+			item_tax_rate = frappe.parse_json(row.item_tax_rate)
 
 		# First check if tax rate is present
 		# If not then look up in item_wise_tax_detail
 		if item_tax_rate:
 			for account, rate in iteritems(item_tax_rate):
 				tax_rate += rate
-		elif itemised_tax.get(row.item_code):
+		elif row.item_code and itemised_tax.get(row.item_code):
 			tax_rate = sum([tax.get('tax_rate', 0) for d, tax in itemised_tax.get(row.item_code).items()])
 
 		row.tax_rate = flt(tax_rate, row.precision("tax_rate"))
diff --git a/erpnext/selling/desk_page/selling/selling.json b/erpnext/selling/desk_page/selling/selling.json
index 60b1532..2252382 100644
--- a/erpnext/selling/desk_page/selling/selling.json
+++ b/erpnext/selling/desk_page/selling/selling.json
@@ -23,7 +23,7 @@
   {
    "hidden": 0,
    "label": "Other Reports",
-   "links": "[\n    {\n        \"dependencies\": [\n            \"Lead\"\n        ],\n        \"doctype\": \"Lead\",\n        \"is_query_report\": true,\n        \"label\": \"Lead Details\",\n        \"name\": \"Lead Details\",\n        \"type\": \"report\"\n    },\n    {\n        \"dependencies\": [\n            \"Address\"\n        ],\n        \"doctype\": \"Address\",\n        \"is_query_report\": true,\n        \"label\": \"Customer Addresses And Contacts\",\n        \"name\": \"Address And Contacts\",\n        \"route_options\": {\n            \"party_type\": \"Customer\"\n        },\n        \"type\": \"report\"\n    },\n    {\n        \"dependencies\": [\n            \"Item\"\n        ],\n        \"doctype\": \"Item\",\n        \"is_query_report\": true,\n        \"label\": \"Available Stock for Packing Items\",\n        \"name\": \"Available Stock for Packing Items\",\n        \"type\": \"report\"\n    },\n    {\n        \"dependencies\": [\n            \"Sales Order\"\n        ],\n        \"doctype\": \"Sales Order\",\n        \"is_query_report\": true,\n        \"label\": \"Pending SO Items For Purchase Request\",\n        \"name\": \"Pending SO Items For Purchase Request\",\n        \"type\": \"report\"\n    },\n    {\n        \"dependencies\": [\n            \"Customer\"\n        ],\n        \"doctype\": \"Customer\",\n        \"is_query_report\": true,\n        \"label\": \"Customer Credit Balance\",\n        \"name\": \"Customer Credit Balance\",\n        \"type\": \"report\"\n    },\n    {\n        \"dependencies\": [\n            \"Customer\"\n        ],\n        \"doctype\": \"Customer\",\n        \"is_query_report\": true,\n        \"label\": \"Customers Without Any Sales Transactions\",\n        \"name\": \"Customers Without Any Sales Transactions\",\n        \"type\": \"report\"\n    },\n    {\n        \"dependencies\": [\n            \"Customer\"\n        ],\n        \"doctype\": \"Customer\",\n        \"is_query_report\": true,\n        \"label\": \"Sales Partners Commission\",\n        \"name\": \"Sales Partners Commission\",\n        \"type\": \"report\"\n    }\n]"
+   "links": "[\n    {\n        \"dependencies\": [\n            \"Lead\"\n        ],\n        \"doctype\": \"Lead\",\n        \"is_query_report\": true,\n        \"label\": \"Lead Details\",\n        \"name\": \"Lead Details\",\n        \"type\": \"report\"\n    },\n    {\n        \"dependencies\": [\n            \"Address\"\n        ],\n        \"doctype\": \"Address\",\n        \"is_query_report\": true,\n        \"label\": \"Customer Addresses And Contacts\",\n        \"name\": \"Address And Contacts\",\n        \"route_options\": {\n            \"party_type\": \"Customer\"\n        },\n        \"type\": \"report\"\n    },\n    {\n        \"dependencies\": [\n            \"Item\"\n        ],\n        \"doctype\": \"Item\",\n        \"is_query_report\": true,\n        \"label\": \"Available Stock for Packing Items\",\n        \"name\": \"Available Stock for Packing Items\",\n        \"type\": \"report\"\n    },\n    {\n        \"dependencies\": [\n            \"Sales Order\"\n        ],\n        \"doctype\": \"Sales Order\",\n        \"is_query_report\": true,\n        \"label\": \"Pending SO Items For Purchase Request\",\n        \"name\": \"Pending SO Items For Purchase Request\",\n        \"type\": \"report\"\n    },\n     {\n        \"dependencies\": [\n            \"Delivery Note\"\n        ],\n        \"doctype\": \"Delivery Note\",\n        \"is_query_report\": true,\n        \"label\": \"Delivery Note Trends\",\n        \"name\": \"Delivery Note Trends\",\n        \"type\": \"report\"\n    },\n    {\n        \"dependencies\": [\n            \"Sales Invoice\"\n        ],\n        \"doctype\": \"Sales Invoice\",\n        \"is_query_report\": true,\n        \"label\": \"Sales Invoice Trends\",\n        \"name\": \"Sales Invoice Trends\",\n        \"type\": \"report\"\n    },\n    {\n        \"dependencies\": [\n            \"Customer\"\n        ],\n        \"doctype\": \"Customer\",\n        \"is_query_report\": true,\n        \"label\": \"Customer Credit Balance\",\n        \"name\": \"Customer Credit Balance\",\n        \"type\": \"report\"\n    },\n    {\n        \"dependencies\": [\n            \"Customer\"\n        ],\n        \"doctype\": \"Customer\",\n        \"is_query_report\": true,\n        \"label\": \"Customers Without Any Sales Transactions\",\n        \"name\": \"Customers Without Any Sales Transactions\",\n        \"type\": \"report\"\n    },\n    {\n        \"dependencies\": [\n            \"Customer\"\n        ],\n        \"doctype\": \"Customer\",\n        \"is_query_report\": true,\n        \"label\": \"Sales Partners Commission\",\n        \"name\": \"Sales Partners Commission\",\n        \"type\": \"report\"\n    }\n]"
   }
  ],
  "category": "Modules",
@@ -44,7 +44,7 @@
  "idx": 0,
  "is_standard": 1,
  "label": "Selling",
- "modified": "2020-06-19 13:23:24.861706",
+ "modified": "2020-06-29 19:26:35.139097",
  "modified_by": "Administrator",
  "module": "Selling",
  "name": "Selling",
diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py
index d70c64f..e5c7c3c 100644
--- a/erpnext/selling/doctype/customer/customer.py
+++ b/erpnext/selling/doctype/customer/customer.py
@@ -342,11 +342,10 @@
 @frappe.whitelist()
 def get_customer_list(doctype, txt, searchfield, start, page_len, filters=None):
 	from erpnext.controllers.queries import get_fields
+	fields = ["name", "customer_name", "customer_group", "territory"]
 
 	if frappe.db.get_default("cust_master_name") == "Customer Name":
 		fields = ["name", "customer_group", "territory"]
-	else:
-		fields = ["name", "customer_name", "customer_group", "territory"]
 
 	fields = get_fields("Customer", fields)
 
@@ -552,4 +551,4 @@
 		""", {
 			'customer': customer,
 			'txt': '%%%s%%' % txt
-		})
+		})
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json
index b57c4f3..cd4e1d0 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.json
+++ b/erpnext/selling/doctype/sales_order/sales_order.json
@@ -143,11 +143,15 @@
   {
    "fieldname": "customer_section",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "options": "fa fa-user"
   },
   {
    "fieldname": "column_break0",
    "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "oldfieldtype": "Column Break",
    "width": "50%"
   },
@@ -157,6 +161,8 @@
    "fieldname": "title",
    "fieldtype": "Data",
    "hidden": 1,
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Title",
    "no_copy": 1,
    "print_hide": 1
@@ -164,6 +170,8 @@
   {
    "fieldname": "naming_series",
    "fieldtype": "Select",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Series",
    "no_copy": 1,
    "oldfieldname": "naming_series",
@@ -177,6 +185,8 @@
    "bold": 1,
    "fieldname": "customer",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "in_global_search": 1,
    "in_standard_filter": 1,
    "label": "Customer",
@@ -192,6 +202,8 @@
    "fetch_from": "customer.customer_name",
    "fieldname": "customer_name",
    "fieldtype": "Data",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "in_global_search": 1,
    "label": "Customer Name",
    "read_only": 1
@@ -200,6 +212,8 @@
    "default": "Sales",
    "fieldname": "order_type",
    "fieldtype": "Select",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Order Type",
    "oldfieldname": "order_type",
    "oldfieldtype": "Select",
@@ -210,6 +224,8 @@
   {
    "fieldname": "column_break1",
    "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "oldfieldtype": "Column Break",
    "width": "50%"
   },
@@ -217,6 +233,8 @@
    "fieldname": "amended_from",
    "fieldtype": "Link",
    "hidden": 1,
+   "hide_days": 1,
+   "hide_seconds": 1,
    "ignore_user_permissions": 1,
    "label": "Amended From",
    "no_copy": 1,
@@ -230,6 +248,8 @@
   {
    "fieldname": "company",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "in_standard_filter": 1,
    "label": "Company",
    "oldfieldname": "company",
@@ -244,6 +264,8 @@
    "default": "Today",
    "fieldname": "transaction_date",
    "fieldtype": "Date",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "in_standard_filter": 1,
    "label": "Date",
    "no_copy": 1,
@@ -258,6 +280,8 @@
    "depends_on": "eval:!doc.skip_delivery_note",
    "fieldname": "delivery_date",
    "fieldtype": "Date",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "in_list_view": 1,
    "label": "Delivery Date",
    "no_copy": 1
@@ -266,6 +290,8 @@
    "allow_on_submit": 1,
    "fieldname": "po_no",
    "fieldtype": "Data",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Customer's Purchase Order",
    "oldfieldname": "po_no",
    "oldfieldtype": "Data",
@@ -276,6 +302,8 @@
    "depends_on": "eval:doc.po_no",
    "fieldname": "po_date",
    "fieldtype": "Date",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Customer's Purchase Order Date",
    "oldfieldname": "po_date",
    "oldfieldtype": "Date",
@@ -285,6 +313,8 @@
    "fetch_from": "customer.tax_id",
    "fieldname": "tax_id",
    "fieldtype": "Data",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Tax Id",
    "read_only": 1,
    "width": "100px"
@@ -294,6 +324,8 @@
    "depends_on": "customer",
    "fieldname": "contact_info",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Address and Contact",
    "options": "fa fa-bullhorn"
   },
@@ -301,6 +333,8 @@
    "allow_on_submit": 1,
    "fieldname": "customer_address",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Customer Address",
    "options": "Address",
    "print_hide": 1
@@ -309,12 +343,16 @@
    "allow_on_submit": 1,
    "fieldname": "address_display",
    "fieldtype": "Small Text",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Address",
    "read_only": 1
   },
   {
    "fieldname": "contact_person",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Contact Person",
    "options": "Contact",
    "print_hide": 1
@@ -322,6 +360,8 @@
   {
    "fieldname": "contact_display",
    "fieldtype": "Small Text",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "in_global_search": 1,
    "label": "Contact",
    "read_only": 1
@@ -329,6 +369,8 @@
   {
    "fieldname": "contact_mobile",
    "fieldtype": "Small Text",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Mobile No",
    "read_only": 1
   },
@@ -336,6 +378,8 @@
    "fieldname": "contact_email",
    "fieldtype": "Data",
    "hidden": 1,
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Contact Email",
    "options": "Email",
    "print_hide": 1,
@@ -344,24 +388,32 @@
   {
    "fieldname": "company_address_display",
    "fieldtype": "Small Text",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Company Address",
    "read_only": 1
   },
   {
    "fieldname": "company_address",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Company Address Name",
    "options": "Address"
   },
   {
    "fieldname": "col_break46",
    "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "width": "50%"
   },
   {
    "allow_on_submit": 1,
    "fieldname": "shipping_address_name",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Shipping Address Name",
    "options": "Address",
    "print_hide": 1
@@ -370,6 +422,8 @@
    "allow_on_submit": 1,
    "fieldname": "shipping_address",
    "fieldtype": "Small Text",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Shipping Address",
    "print_hide": 1,
    "read_only": 1
@@ -378,6 +432,8 @@
    "fieldname": "customer_group",
    "fieldtype": "Link",
    "hidden": 1,
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Customer Group",
    "options": "Customer Group",
    "print_hide": 1
@@ -385,6 +441,8 @@
   {
    "fieldname": "territory",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Territory",
    "options": "Territory",
    "print_hide": 1
@@ -393,6 +451,8 @@
    "collapsible": 1,
    "fieldname": "currency_and_price_list",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Currency and Price List",
    "options": "fa fa-tag",
    "print_hide": 1
@@ -400,6 +460,8 @@
   {
    "fieldname": "currency",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Currency",
    "oldfieldname": "currency",
    "oldfieldtype": "Select",
@@ -412,6 +474,8 @@
    "description": "Rate at which customer's currency is converted to company's base currency",
    "fieldname": "conversion_rate",
    "fieldtype": "Float",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Exchange Rate",
    "oldfieldname": "conversion_rate",
    "oldfieldtype": "Currency",
@@ -423,11 +487,15 @@
   {
    "fieldname": "column_break2",
    "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "width": "50%"
   },
   {
    "fieldname": "selling_price_list",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Price List",
    "oldfieldname": "price_list_name",
    "oldfieldtype": "Select",
@@ -439,6 +507,8 @@
   {
    "fieldname": "price_list_currency",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Price List Currency",
    "options": "Currency",
    "print_hide": 1,
@@ -449,6 +519,8 @@
    "description": "Rate at which Price list currency is converted to company's base currency",
    "fieldname": "plc_conversion_rate",
    "fieldtype": "Float",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Price List Exchange Rate",
    "precision": "9",
    "print_hide": 1,
@@ -458,6 +530,8 @@
    "default": "0",
    "fieldname": "ignore_pricing_rule",
    "fieldtype": "Check",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Ignore Pricing Rule",
    "no_copy": 1,
    "permlevel": 1,
@@ -465,11 +539,15 @@
   },
   {
    "fieldname": "sec_warehouse",
-   "fieldtype": "Section Break"
+   "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "fieldname": "set_warehouse",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Set Source Warehouse",
    "options": "Warehouse",
    "print_hide": 1
@@ -477,18 +555,24 @@
   {
    "fieldname": "items_section",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "oldfieldtype": "Section Break",
    "options": "fa fa-shopping-cart"
   },
   {
    "fieldname": "scan_barcode",
    "fieldtype": "Data",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Scan Barcode"
   },
   {
    "allow_bulk_edit": 1,
    "fieldname": "items",
    "fieldtype": "Table",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Items",
    "oldfieldname": "sales_order_details",
    "oldfieldtype": "Table",
@@ -498,32 +582,44 @@
   {
    "fieldname": "pricing_rule_details",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Pricing Rules"
   },
   {
    "fieldname": "pricing_rules",
    "fieldtype": "Table",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Pricing Rule Detail",
    "options": "Pricing Rule Detail",
    "read_only": 1
   },
   {
    "fieldname": "section_break_31",
-   "fieldtype": "Section Break"
+   "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "fieldname": "column_break_33a",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "fieldname": "total_qty",
    "fieldtype": "Float",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Total Quantity",
    "read_only": 1
   },
   {
    "fieldname": "base_total",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Total (Company Currency)",
    "options": "Company:company:default_currency",
    "print_hide": 1,
@@ -532,6 +628,8 @@
   {
    "fieldname": "base_net_total",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Net Total (Company Currency)",
    "oldfieldname": "net_total",
    "oldfieldtype": "Currency",
@@ -542,11 +640,15 @@
   },
   {
    "fieldname": "column_break_33",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "fieldname": "total",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Total",
    "options": "currency",
    "read_only": 1
@@ -554,6 +656,8 @@
   {
    "fieldname": "net_total",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Net Total",
    "options": "currency",
    "print_hide": 1,
@@ -562,6 +666,8 @@
   {
    "fieldname": "total_net_weight",
    "fieldtype": "Float",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Total Net Weight",
    "print_hide": 1,
    "read_only": 1
@@ -569,6 +675,8 @@
   {
    "fieldname": "taxes_section",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Taxes and Charges",
    "oldfieldtype": "Section Break",
    "options": "fa fa-money"
@@ -576,17 +684,23 @@
   {
    "fieldname": "tax_category",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Tax Category",
    "options": "Tax Category",
    "print_hide": 1
   },
   {
    "fieldname": "column_break_38",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "fieldname": "shipping_rule",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Shipping Rule",
    "oldfieldtype": "Button",
    "options": "Shipping Rule",
@@ -594,11 +708,15 @@
   },
   {
    "fieldname": "section_break_40",
-   "fieldtype": "Section Break"
+   "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "fieldname": "taxes_and_charges",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Sales Taxes and Charges Template",
    "oldfieldname": "charge",
    "oldfieldtype": "Link",
@@ -608,6 +726,8 @@
   {
    "fieldname": "taxes",
    "fieldtype": "Table",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Sales Taxes and Charges",
    "oldfieldname": "other_charges",
    "oldfieldtype": "Table",
@@ -617,11 +737,15 @@
    "collapsible": 1,
    "fieldname": "sec_tax_breakup",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Tax Breakup"
   },
   {
    "fieldname": "other_charges_calculation",
    "fieldtype": "Long Text",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Taxes and Charges Calculation",
    "no_copy": 1,
    "oldfieldtype": "HTML",
@@ -630,11 +754,15 @@
   },
   {
    "fieldname": "section_break_43",
-   "fieldtype": "Section Break"
+   "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "fieldname": "base_total_taxes_and_charges",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Total Taxes and Charges (Company Currency)",
    "oldfieldname": "other_charges_total",
    "oldfieldtype": "Currency",
@@ -645,11 +773,15 @@
   },
   {
    "fieldname": "column_break_46",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "fieldname": "total_taxes_and_charges",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Total Taxes and Charges",
    "options": "currency",
    "print_hide": 1,
@@ -659,6 +791,8 @@
    "fieldname": "loyalty_points_redemption",
    "fieldtype": "Section Break",
    "hidden": 1,
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Loyalty Points Redemption",
    "print_hide": 1
   },
@@ -666,6 +800,8 @@
    "fieldname": "loyalty_points",
    "fieldtype": "Int",
    "hidden": 1,
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Loyalty Points",
    "read_only": 1
   },
@@ -673,6 +809,8 @@
    "fieldname": "loyalty_amount",
    "fieldtype": "Currency",
    "hidden": 1,
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Loyalty Amount",
    "print_hide": 1,
    "read_only": 1
@@ -682,11 +820,15 @@
    "collapsible_depends_on": "discount_amount",
    "fieldname": "section_break_48",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Additional Discount and Coupon Code"
   },
   {
    "fieldname": "coupon_code",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Coupon Code",
    "options": "Coupon Code"
   },
@@ -694,6 +836,8 @@
    "default": "Grand Total",
    "fieldname": "apply_discount_on",
    "fieldtype": "Select",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Apply Additional Discount On",
    "options": "\nGrand Total\nNet Total",
    "print_hide": 1
@@ -701,6 +845,8 @@
   {
    "fieldname": "base_discount_amount",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Additional Discount Amount (Company Currency)",
    "options": "Company:company:default_currency",
    "print_hide": 1,
@@ -708,17 +854,23 @@
   },
   {
    "fieldname": "column_break_50",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "fieldname": "additional_discount_percentage",
    "fieldtype": "Float",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Additional Discount Percentage",
    "print_hide": 1
   },
   {
    "fieldname": "discount_amount",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Additional Discount Amount",
    "options": "currency",
    "print_hide": 1
@@ -726,6 +878,8 @@
   {
    "fieldname": "totals",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "oldfieldtype": "Section Break",
    "options": "fa fa-money",
    "print_hide": 1
@@ -733,6 +887,8 @@
   {
    "fieldname": "base_grand_total",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Grand Total (Company Currency)",
    "oldfieldname": "grand_total",
    "oldfieldtype": "Currency",
@@ -744,6 +900,8 @@
   {
    "fieldname": "base_rounding_adjustment",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Rounding Adjustment (Company Currency)",
    "no_copy": 1,
    "options": "Company:company:default_currency",
@@ -753,6 +911,8 @@
   {
    "fieldname": "base_rounded_total",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Rounded Total (Company Currency)",
    "oldfieldname": "rounded_total",
    "oldfieldtype": "Currency",
@@ -765,6 +925,8 @@
    "description": "In Words will be visible once you save the Sales Order.",
    "fieldname": "base_in_words",
    "fieldtype": "Data",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "In Words (Company Currency)",
    "oldfieldname": "in_words",
    "oldfieldtype": "Data",
@@ -775,6 +937,8 @@
   {
    "fieldname": "column_break3",
    "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "oldfieldtype": "Column Break",
    "print_hide": 1,
    "width": "50%"
@@ -782,6 +946,8 @@
   {
    "fieldname": "grand_total",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "in_list_view": 1,
    "label": "Grand Total",
    "oldfieldname": "grand_total_export",
@@ -793,6 +959,8 @@
   {
    "fieldname": "rounding_adjustment",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Rounding Adjustment",
    "no_copy": 1,
    "options": "currency",
@@ -803,6 +971,8 @@
    "bold": 1,
    "fieldname": "rounded_total",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Rounded Total",
    "oldfieldname": "rounded_total_export",
    "oldfieldtype": "Currency",
@@ -813,6 +983,8 @@
   {
    "fieldname": "in_words",
    "fieldtype": "Data",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "In Words",
    "oldfieldname": "in_words_export",
    "oldfieldtype": "Data",
@@ -823,6 +995,8 @@
   {
    "fieldname": "advance_paid",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Advance Paid",
    "no_copy": 1,
    "options": "party_account_currency",
@@ -834,6 +1008,8 @@
    "collapsible_depends_on": "packed_items",
    "fieldname": "packing_list",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Packing List",
    "oldfieldtype": "Section Break",
    "options": "fa fa-suitcase",
@@ -842,6 +1018,8 @@
   {
    "fieldname": "packed_items",
    "fieldtype": "Table",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Packed Items",
    "options": "Packed Item",
    "print_hide": 1,
@@ -850,11 +1028,15 @@
   {
    "fieldname": "payment_schedule_section",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Payment Terms"
   },
   {
    "fieldname": "payment_terms_template",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Payment Terms Template",
    "options": "Payment Terms Template",
    "print_hide": 1
@@ -862,6 +1044,8 @@
   {
    "fieldname": "payment_schedule",
    "fieldtype": "Table",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Payment Schedule",
    "no_copy": 1,
    "options": "Payment Schedule",
@@ -872,6 +1056,8 @@
    "collapsible_depends_on": "terms",
    "fieldname": "terms_section_break",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Terms and Conditions",
    "oldfieldtype": "Section Break",
    "options": "fa fa-legal"
@@ -879,6 +1065,8 @@
   {
    "fieldname": "tc_name",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Terms",
    "oldfieldname": "tc_name",
    "oldfieldtype": "Link",
@@ -888,6 +1076,8 @@
   {
    "fieldname": "terms",
    "fieldtype": "Text Editor",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Terms and Conditions Details",
    "oldfieldname": "terms",
    "oldfieldtype": "Text Editor"
@@ -897,6 +1087,8 @@
    "collapsible_depends_on": "project",
    "fieldname": "more_info",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "More Information",
    "oldfieldtype": "Section Break",
    "options": "fa fa-file-text",
@@ -905,6 +1097,8 @@
   {
    "fieldname": "inter_company_order_reference",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Inter Company Order Reference",
    "options": "Purchase Order"
   },
@@ -912,6 +1106,8 @@
    "description": "Track this Sales Order against any Project",
    "fieldname": "project",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Project",
    "oldfieldname": "project",
    "oldfieldtype": "Link",
@@ -921,6 +1117,8 @@
    "fieldname": "party_account_currency",
    "fieldtype": "Link",
    "hidden": 1,
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Party Account Currency",
    "no_copy": 1,
    "options": "Currency",
@@ -929,11 +1127,15 @@
   },
   {
    "fieldname": "column_break_77",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "fieldname": "source",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Source",
    "oldfieldname": "source",
    "oldfieldtype": "Select",
@@ -943,6 +1145,8 @@
   {
    "fieldname": "campaign",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Campaign",
    "oldfieldname": "campaign",
    "oldfieldtype": "Link",
@@ -953,11 +1157,15 @@
    "collapsible": 1,
    "fieldname": "printing_details",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Print Settings"
   },
   {
    "fieldname": "language",
    "fieldtype": "Data",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Print Language",
    "print_hide": 1,
    "read_only": 1
@@ -966,6 +1174,8 @@
    "allow_on_submit": 1,
    "fieldname": "letter_head",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Letter Head",
    "oldfieldname": "letter_head",
    "oldfieldtype": "Select",
@@ -975,6 +1185,8 @@
   {
    "fieldname": "column_break4",
    "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "oldfieldtype": "Column Break",
    "print_hide": 1,
    "width": "50%"
@@ -983,6 +1195,8 @@
    "allow_on_submit": 1,
    "fieldname": "select_print_heading",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Print Heading",
    "no_copy": 1,
    "oldfieldname": "select_print_heading",
@@ -996,6 +1210,8 @@
    "default": "0",
    "fieldname": "group_same_items",
    "fieldtype": "Check",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Group same items",
    "print_hide": 1
   },
@@ -1003,6 +1219,8 @@
    "collapsible": 1,
    "fieldname": "section_break_78",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Billing and Delivery Status",
    "oldfieldtype": "Column Break",
    "print_hide": 1,
@@ -1012,6 +1230,8 @@
    "default": "Draft",
    "fieldname": "status",
    "fieldtype": "Select",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "in_list_view": 1,
    "label": "Status",
    "no_copy": 1,
@@ -1028,6 +1248,8 @@
    "fieldname": "delivery_status",
    "fieldtype": "Select",
    "hidden": 1,
+   "hide_days": 1,
+   "hide_seconds": 1,
    "in_standard_filter": 1,
    "label": "Delivery Status",
    "no_copy": 1,
@@ -1039,6 +1261,8 @@
    "description": "% of materials delivered against this Sales Order",
    "fieldname": "per_delivered",
    "fieldtype": "Percent",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "in_list_view": 1,
    "label": "%  Delivered",
    "no_copy": 1,
@@ -1050,13 +1274,17 @@
   },
   {
    "fieldname": "column_break_81",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "depends_on": "eval:!doc.__islocal",
    "description": "% of materials billed against this Sales Order",
    "fieldname": "per_billed",
    "fieldtype": "Percent",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "in_list_view": 1,
    "label": "% Amount Billed",
    "no_copy": 1,
@@ -1070,6 +1298,8 @@
    "fieldname": "billing_status",
    "fieldtype": "Select",
    "hidden": 1,
+   "hide_days": 1,
+   "hide_seconds": 1,
    "in_standard_filter": 1,
    "label": "Billing Status",
    "no_copy": 1,
@@ -1081,6 +1311,8 @@
    "collapsible_depends_on": "commission_rate",
    "fieldname": "sales_team_section_break",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Commission",
    "oldfieldtype": "Section Break",
    "options": "fa fa-group",
@@ -1089,6 +1321,8 @@
   {
    "fieldname": "sales_partner",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Sales Partner",
    "oldfieldname": "sales_partner",
    "oldfieldtype": "Link",
@@ -1099,12 +1333,16 @@
   {
    "fieldname": "column_break7",
    "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "print_hide": 1,
    "width": "50%"
   },
   {
    "fieldname": "commission_rate",
    "fieldtype": "Float",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Commission Rate",
    "oldfieldname": "commission_rate",
    "oldfieldtype": "Currency",
@@ -1114,6 +1352,8 @@
   {
    "fieldname": "total_commission",
    "fieldtype": "Currency",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Total Commission",
    "oldfieldname": "total_commission",
    "oldfieldtype": "Currency",
@@ -1125,6 +1365,8 @@
    "collapsible_depends_on": "sales_team",
    "fieldname": "section_break1",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Sales Team",
    "print_hide": 1
   },
@@ -1132,6 +1374,8 @@
    "allow_on_submit": 1,
    "fieldname": "sales_team",
    "fieldtype": "Table",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Sales Team",
    "oldfieldname": "sales_team",
    "oldfieldtype": "Table",
@@ -1140,8 +1384,11 @@
   },
   {
    "allow_on_submit": 1,
+   "collapsible": 1,
    "fieldname": "subscription_section",
    "fieldtype": "Section Break",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Auto Repeat Section",
    "no_copy": 1,
    "print_hide": 1,
@@ -1151,6 +1398,8 @@
    "allow_on_submit": 1,
    "fieldname": "from_date",
    "fieldtype": "Date",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "From Date",
    "no_copy": 1
   },
@@ -1158,16 +1407,22 @@
    "allow_on_submit": 1,
    "fieldname": "to_date",
    "fieldtype": "Date",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "To Date",
    "no_copy": 1
   },
   {
    "fieldname": "column_break_108",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "hide_days": 1,
+   "hide_seconds": 1
   },
   {
    "fieldname": "auto_repeat",
    "fieldtype": "Link",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Auto Repeat",
    "options": "Auto Repeat"
   },
@@ -1176,11 +1431,15 @@
    "depends_on": "eval: doc.auto_repeat",
    "fieldname": "update_auto_repeat_reference",
    "fieldtype": "Button",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Update Auto Repeat Reference"
   },
   {
    "fieldname": "contact_phone",
    "fieldtype": "Data",
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Phone",
    "read_only": 1
   },
@@ -1189,6 +1448,8 @@
    "fieldname": "skip_delivery_note",
    "fieldtype": "Check",
    "hidden": 1,
+   "hide_days": 1,
+   "hide_seconds": 1,
    "label": "Skip Delivery Note",
    "print_hide": 1
   }
@@ -1197,7 +1458,7 @@
  "idx": 105,
  "is_submittable": 1,
  "links": [],
- "modified": "2020-05-19 21:39:19.486684",
+ "modified": "2020-06-30 11:56:42.301317",
  "modified_by": "Administrator",
  "module": "Selling",
  "name": "Sales Order",
diff --git a/erpnext/setup/doctype/customer_group/customer_group.py b/erpnext/setup/doctype/customer_group/customer_group.py
index f62613e..68e1ccb 100644
--- a/erpnext/setup/doctype/customer_group/customer_group.py
+++ b/erpnext/setup/doctype/customer_group/customer_group.py
@@ -6,9 +6,12 @@
 from frappe import _
 
 
-from frappe.utils.nestedset import NestedSet
+from frappe.utils.nestedset import NestedSet, get_root_of
 class CustomerGroup(NestedSet):
 	nsm_parent_field = 'parent_customer_group'
+	def validate(self):
+		if not self.parent_customer_group:
+			self.parent_customer_group = get_root_of("Customer Group")
 
 	def on_update(self):
 		self.validate_name_with_customer()
diff --git a/erpnext/setup/doctype/sales_person/sales_person.py b/erpnext/setup/doctype/sales_person/sales_person.py
index 3379534..19c2e5b 100644
--- a/erpnext/setup/doctype/sales_person/sales_person.py
+++ b/erpnext/setup/doctype/sales_person/sales_person.py
@@ -5,13 +5,16 @@
 import frappe
 from frappe import _
 from frappe.utils import flt
-from frappe.utils.nestedset import NestedSet
+from frappe.utils.nestedset import NestedSet, get_root_of
 from erpnext import get_default_currency
 
 class SalesPerson(NestedSet):
 	nsm_parent_field = 'parent_sales_person'
 
 	def validate(self):
+		if not self.parent_sales_person:
+			self.parent_sales_person = get_root_of("Sales Person")
+
 		for d in self.get('targets') or []:
 			if not flt(d.target_qty) and not flt(d.target_amount):
 				frappe.throw(_("Either target qty or target amount is mandatory."))
diff --git a/erpnext/setup/doctype/territory/territory.py b/erpnext/setup/doctype/territory/territory.py
index 808b538..05e8f66 100644
--- a/erpnext/setup/doctype/territory/territory.py
+++ b/erpnext/setup/doctype/territory/territory.py
@@ -6,12 +6,14 @@
 from frappe.utils import flt
 from frappe import _
 
-from frappe.utils.nestedset import NestedSet
+from frappe.utils.nestedset import NestedSet, get_root_of
 
 class Territory(NestedSet):
 	nsm_parent_field = 'parent_territory'
 
 	def validate(self):
+		if not self.parent_territory:
+			self.parent_territory = get_root_of("Territory")
 
 		for d in self.get('targets') or []:
 			if not flt(d.target_qty) and not flt(d.target_amount):
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index c371999..963c87a 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -987,6 +987,7 @@
    "read_only": 1
   },
   {
+   "collapsible": 1,
    "depends_on": "eval:(!doc.is_item_from_hub)",
    "fieldname": "hub_publishing_sb",
    "fieldtype": "Section Break",
@@ -1060,7 +1061,7 @@
  "image_field": "image",
  "links": [],
  "max_attachments": 1,
- "modified": "2020-04-08 15:56:06.195722",
+ "modified": "2020-06-30 12:01:07.534447",
  "modified_by": "Administrator",
  "module": "Stock",
  "name": "Item",
@@ -1122,4 +1123,4 @@
  "sort_order": "DESC",
  "title_field": "item_name",
  "track_changes": 1
-}
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/stock_settings/stock_settings.js b/erpnext/stock/doctype/stock_settings/stock_settings.js
index d5049ac..48624e0 100644
--- a/erpnext/stock/doctype/stock_settings/stock_settings.js
+++ b/erpnext/stock/doctype/stock_settings/stock_settings.js
@@ -20,7 +20,7 @@
 	{
 		fieldname: "item_naming_by",
 		title: __("Item Naming By"),
-		description: __("By default, the Item Name is set as per the Item Code entered. If you want Items to be named by a") + "<a href='https://docs.erpnext.com/docs/user/manual/en/setting-up/settings/naming-series' target='_blank'>Naming Series</a>" + __(" choose the 'Naming Series' option."),
+		description: __("By default, the Item Name is set as per the Item Code entered. If you want Items to be named by a ") + "<a href='https://docs.erpnext.com/docs/user/manual/en/setting-up/settings/naming-series' target='_blank'>Naming Series</a>" + __(" choose the 'Naming Series' option."),
 	},
 	{
 		fieldname: "default_warehouse",
diff --git a/erpnext/stock/module_onboarding/stock/stock.json b/erpnext/stock/module_onboarding/stock/stock.json
index de24575..10f05d4 100644
--- a/erpnext/stock/module_onboarding/stock/stock.json
+++ b/erpnext/stock/module_onboarding/stock/stock.json
@@ -19,7 +19,7 @@
  "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/stock",
  "idx": 0,
  "is_complete": 0,
- "modified": "2020-05-19 19:03:23.602423",
+ "modified": "2020-06-29 16:41:09.440378",
  "modified_by": "Administrator",
  "module": "Stock",
  "name": "Stock",
@@ -32,15 +32,15 @@
    "step": "Create a Product"
   },
   {
+   "step": "Create a Supplier"
+  },
+  {
    "step": "Introduction to Stock Entry"
   },
   {
    "step": "Create a Stock Entry"
   },
   {
-   "step": "Create a Supplier"
-  },
-  {
    "step": "Create a Purchase Receipt"
   },
   {
@@ -49,6 +49,5 @@
  ],
  "subtitle": "Inventory, Warehouses, Analysis and more.",
  "success_message": "The Stock Module is all set up!",
- "title": "Let's Setup the Stock Module.",
- "user_can_dismiss": 1
+ "title": "Let's Set Up the Stock Module."
 }
\ No newline at end of file
diff --git a/erpnext/stock/onboarding_step/create_a_supplier/create_a_supplier.json b/erpnext/stock/onboarding_step/create_a_supplier/create_a_supplier.json
index 7a64224..4e753f4 100644
--- a/erpnext/stock/onboarding_step/create_a_supplier/create_a_supplier.json
+++ b/erpnext/stock/onboarding_step/create_a_supplier/create_a_supplier.json
@@ -8,7 +8,7 @@
  "is_mandatory": 0,
  "is_single": 0,
  "is_skipped": 0,
- "modified": "2020-05-14 22:09:10.043554",
+ "modified": "2020-06-29 16:36:53.948242",
  "modified_by": "Administrator",
  "name": "Create a Supplier",
  "owner": "Administrator",