Merge branch 'develop'
diff --git a/erpnext/__version__.py b/erpnext/__version__.py
index e571e3d..3289850 100644
--- a/erpnext/__version__.py
+++ b/erpnext/__version__.py
@@ -1,2 +1,2 @@
 from __future__ import unicode_literals
-__version__ = '5.0.24'
+__version__ = '5.0.25'
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
index a9c425b..e192e76 100755
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
@@ -1,1027 +1,1028 @@
 {
- "allow_import": 1,
- "autoname": "naming_series:",
- "creation": "2013-05-21 16:16:39",
- "docstatus": 0,
- "doctype": "DocType",
+ "allow_import": 1, 
+ "autoname": "naming_series:", 
+ "creation": "2013-05-21 16:16:39", 
+ "docstatus": 0, 
+ "doctype": "DocType", 
  "fields": [
   {
-   "fieldname": "naming_series",
-   "fieldtype": "Select",
-   "label": "Series",
-   "no_copy": 1,
-   "oldfieldname": "naming_series",
-   "oldfieldtype": "Select",
-   "options": "PINV-",
-   "permlevel": 0,
-   "print_hide": 1,
-   "read_only": 0,
-   "report_hide": 0,
+   "fieldname": "naming_series", 
+   "fieldtype": "Select", 
+   "label": "Series", 
+   "no_copy": 1, 
+   "oldfieldname": "naming_series", 
+   "oldfieldtype": "Select", 
+   "options": "PINV-", 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "read_only": 0, 
+   "report_hide": 0, 
    "reqd": 1
-  },
+  }, 
   {
-   "fieldname": "supplier",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "label": "Supplier",
-   "oldfieldname": "supplier",
-   "oldfieldtype": "Link",
-   "options": "Supplier",
-   "permlevel": 0,
-   "print_hide": 1,
-   "read_only": 0
-  },
+   "fieldname": "supplier", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "label": "Supplier", 
+   "oldfieldname": "supplier", 
+   "oldfieldtype": "Link", 
+   "options": "Supplier", 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "read_only": 0, 
+   "search_index": 1
+  }, 
   {
-   "depends_on": "supplier",
-   "fieldname": "supplier_name",
-   "fieldtype": "Data",
-   "hidden": 0,
-   "in_list_view": 0,
-   "label": "Name",
-   "oldfieldname": "supplier_name",
-   "oldfieldtype": "Data",
-   "permlevel": 0,
+   "depends_on": "supplier", 
+   "fieldname": "supplier_name", 
+   "fieldtype": "Data", 
+   "hidden": 0, 
+   "in_list_view": 0, 
+   "label": "Name", 
+   "oldfieldname": "supplier_name", 
+   "oldfieldtype": "Data", 
+   "permlevel": 0, 
    "read_only": 1
-  },
+  }, 
   {
-   "fieldname": "address_display",
-   "fieldtype": "Small Text",
-   "hidden": 1,
-   "label": "Address",
-   "permlevel": 0,
+   "fieldname": "address_display", 
+   "fieldtype": "Small Text", 
+   "hidden": 1, 
+   "label": "Address", 
+   "permlevel": 0, 
    "read_only": 1
-  },
+  }, 
   {
-   "fieldname": "contact_display",
-   "fieldtype": "Small Text",
-   "hidden": 1,
-   "label": "Contact",
-   "permlevel": 0,
+   "fieldname": "contact_display", 
+   "fieldtype": "Small Text", 
+   "hidden": 1, 
+   "label": "Contact", 
+   "permlevel": 0, 
    "read_only": 1
-  },
+  }, 
   {
-   "fieldname": "contact_mobile",
-   "fieldtype": "Small Text",
-   "hidden": 1,
-   "label": "Mobile No",
-   "permlevel": 0,
+   "fieldname": "contact_mobile", 
+   "fieldtype": "Small Text", 
+   "hidden": 1, 
+   "label": "Mobile No", 
+   "permlevel": 0, 
    "read_only": 1
-  },
+  }, 
   {
-   "fieldname": "contact_email",
-   "fieldtype": "Small Text",
-   "hidden": 1,
-   "label": "Contact Email",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "contact_email", 
+   "fieldtype": "Small Text", 
+   "hidden": 1, 
+   "label": "Contact Email", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 1
-  },
+  }, 
   {
-   "fieldname": "column_break1",
-   "fieldtype": "Column Break",
-   "oldfieldtype": "Column Break",
-   "permlevel": 0,
-   "read_only": 0,
-   "reqd": 0,
+   "fieldname": "column_break1", 
+   "fieldtype": "Column Break", 
+   "oldfieldtype": "Column Break", 
+   "permlevel": 0, 
+   "read_only": 0, 
+   "reqd": 0, 
    "width": "50%"
-  },
+  }, 
   {
-   "default": "Today",
-   "fieldname": "posting_date",
-   "fieldtype": "Date",
-   "in_filter": 1,
-   "label": "Date",
-   "no_copy": 0,
-   "oldfieldname": "posting_date",
-   "oldfieldtype": "Date",
-   "permlevel": 0,
-   "print_hide": 1,
-   "read_only": 0,
-   "reqd": 1,
+   "default": "Today", 
+   "fieldname": "posting_date", 
+   "fieldtype": "Date", 
+   "in_filter": 1, 
+   "label": "Date", 
+   "no_copy": 0, 
+   "oldfieldname": "posting_date", 
+   "oldfieldtype": "Date", 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "read_only": 0, 
+   "reqd": 1, 
    "search_index": 1
-  },
+  }, 
   {
-   "description": "",
-   "fieldname": "bill_no",
-   "fieldtype": "Data",
-   "in_filter": 1,
-   "label": "Supplier Invoice No",
-   "oldfieldname": "bill_no",
-   "oldfieldtype": "Data",
-   "permlevel": 0,
-   "print_hide": 1,
-   "read_only": 0,
-   "reqd": 0,
-   "search_index": 1
-  },
+   "description": "", 
+   "fieldname": "bill_no", 
+   "fieldtype": "Data", 
+   "in_filter": 1, 
+   "label": "Supplier Invoice No", 
+   "oldfieldname": "bill_no", 
+   "oldfieldtype": "Data", 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "read_only": 0, 
+   "reqd": 0, 
+   "search_index": 0
+  }, 
   {
-   "fieldname": "bill_date",
-   "fieldtype": "Date",
-   "in_filter": 1,
-   "label": "Supplier Invoice Date",
-   "oldfieldname": "bill_date",
-   "oldfieldtype": "Date",
-   "permlevel": 0,
-   "print_hide": 1,
-   "read_only": 0,
-   "reqd": 0,
-   "search_index": 1
-  },
+   "fieldname": "bill_date", 
+   "fieldtype": "Date", 
+   "in_filter": 1, 
+   "label": "Supplier Invoice Date", 
+   "oldfieldname": "bill_date", 
+   "oldfieldtype": "Date", 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "read_only": 0, 
+   "reqd": 0, 
+   "search_index": 0
+  }, 
   {
-   "fieldname": "amended_from",
-   "fieldtype": "Link",
-   "ignore_user_permissions": 1,
-   "label": "Amended From",
-   "no_copy": 1,
-   "oldfieldname": "amended_from",
-   "oldfieldtype": "Link",
-   "options": "Purchase Invoice",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "amended_from", 
+   "fieldtype": "Link", 
+   "ignore_user_permissions": 1, 
+   "label": "Amended From", 
+   "no_copy": 1, 
+   "oldfieldname": "amended_from", 
+   "oldfieldtype": "Link", 
+   "options": "Purchase Invoice", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 1
-  },
+  }, 
   {
-   "fieldname": "company",
-   "fieldtype": "Link",
-   "in_filter": 1,
-   "label": "Company",
-   "oldfieldname": "company",
-   "oldfieldtype": "Link",
-   "options": "Company",
-   "permlevel": 0,
-   "print_hide": 1,
-   "read_only": 0,
-   "search_index": 1
-  },
+   "fieldname": "company", 
+   "fieldtype": "Link", 
+   "in_filter": 1, 
+   "label": "Company", 
+   "oldfieldname": "company", 
+   "oldfieldtype": "Link", 
+   "options": "Company", 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "read_only": 0, 
+   "search_index": 0
+  }, 
   {
-   "fieldname": "currency_and_price_list",
-   "fieldtype": "Section Break",
-   "label": "",
-   "options": "icon-tag",
-   "permlevel": 0,
+   "fieldname": "currency_and_price_list", 
+   "fieldtype": "Section Break", 
+   "label": "", 
+   "options": "icon-tag", 
+   "permlevel": 0, 
    "read_only": 0
-  },
+  }, 
   {
-   "fieldname": "currency",
-   "fieldtype": "Link",
-   "label": "Currency",
-   "oldfieldname": "currency",
-   "oldfieldtype": "Select",
-   "options": "Currency",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "currency", 
+   "fieldtype": "Link", 
+   "label": "Currency", 
+   "oldfieldname": "currency", 
+   "oldfieldtype": "Select", 
+   "options": "Currency", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 0
-  },
+  }, 
   {
-   "description": "The rate at which Bill Currency is converted into company's base currency",
-   "fieldname": "conversion_rate",
-   "fieldtype": "Float",
-   "label": "Exchange Rate",
-   "oldfieldname": "conversion_rate",
-   "oldfieldtype": "Currency",
-   "permlevel": 0,
-   "precision": "9",
-   "print_hide": 1,
+   "description": "The rate at which Bill Currency is converted into company's base currency", 
+   "fieldname": "conversion_rate", 
+   "fieldtype": "Float", 
+   "label": "Exchange Rate", 
+   "oldfieldname": "conversion_rate", 
+   "oldfieldtype": "Currency", 
+   "permlevel": 0, 
+   "precision": "9", 
+   "print_hide": 1, 
    "read_only": 0
-  },
+  }, 
   {
-   "fieldname": "column_break2",
-   "fieldtype": "Column Break",
-   "permlevel": 0,
+   "fieldname": "column_break2", 
+   "fieldtype": "Column Break", 
+   "permlevel": 0, 
    "read_only": 0
-  },
+  }, 
   {
-   "fieldname": "buying_price_list",
-   "fieldtype": "Link",
-   "label": "Price List",
-   "options": "Price List",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "buying_price_list", 
+   "fieldtype": "Link", 
+   "label": "Price List", 
+   "options": "Price List", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 0
-  },
+  }, 
   {
-   "fieldname": "price_list_currency",
-   "fieldtype": "Link",
-   "label": "Price List Currency",
-   "options": "Currency",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "price_list_currency", 
+   "fieldtype": "Link", 
+   "label": "Price List Currency", 
+   "options": "Currency", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 1
-  },
+  }, 
   {
-   "fieldname": "plc_conversion_rate",
-   "fieldtype": "Float",
-   "label": "Price List Exchange Rate",
-   "permlevel": 0,
-   "precision": "9",
-   "print_hide": 1,
+   "fieldname": "plc_conversion_rate", 
+   "fieldtype": "Float", 
+   "label": "Price List Exchange Rate", 
+   "permlevel": 0, 
+   "precision": "9", 
+   "print_hide": 1, 
    "read_only": 0
-  },
+  }, 
   {
-   "fieldname": "ignore_pricing_rule",
-   "fieldtype": "Check",
-   "label": "Ignore Pricing Rule",
-   "no_copy": 1,
-   "permlevel": 1,
+   "fieldname": "ignore_pricing_rule", 
+   "fieldtype": "Check", 
+   "label": "Ignore Pricing Rule", 
+   "no_copy": 1, 
+   "permlevel": 1, 
    "print_hide": 1
-  },
+  }, 
   {
-   "fieldname": "items_section",
-   "fieldtype": "Section Break",
-   "label": "",
-   "oldfieldtype": "Section Break",
-   "options": "icon-shopping-cart",
-   "permlevel": 0,
+   "fieldname": "items_section", 
+   "fieldtype": "Section Break", 
+   "label": "", 
+   "oldfieldtype": "Section Break", 
+   "options": "icon-shopping-cart", 
+   "permlevel": 0, 
    "read_only": 0
-  },
+  }, 
   {
-   "allow_on_submit": 1,
-   "fieldname": "items",
-   "fieldtype": "Table",
-   "label": "Items",
-   "oldfieldname": "entries",
-   "oldfieldtype": "Table",
-   "options": "Purchase Invoice Item",
-   "permlevel": 0,
+   "allow_on_submit": 1, 
+   "fieldname": "items", 
+   "fieldtype": "Table", 
+   "label": "Items", 
+   "oldfieldname": "entries", 
+   "oldfieldtype": "Table", 
+   "options": "Purchase Invoice Item", 
+   "permlevel": 0, 
    "read_only": 0
-  },
+  }, 
   {
-   "fieldname": "section_break_26",
-   "fieldtype": "Section Break",
+   "fieldname": "section_break_26", 
+   "fieldtype": "Section Break", 
    "permlevel": 0
-  },
+  }, 
   {
-   "fieldname": "base_total",
-   "fieldtype": "Currency",
-   "label": "Total (Company Currency)",
-   "options": "Company:company:default_currency",
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 1,
+   "fieldname": "base_total", 
+   "fieldtype": "Currency", 
+   "label": "Total (Company Currency)", 
+   "options": "Company:company:default_currency", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 1, 
    "read_only": 1
-  },
+  }, 
   {
-   "description": "Will be calculated automatically when you enter the details",
-   "fieldname": "base_net_total",
-   "fieldtype": "Currency",
-   "label": "Net Total (Company Currency)",
-   "oldfieldname": "net_total",
-   "oldfieldtype": "Currency",
-   "options": "Company:company:default_currency",
-   "permlevel": 0,
-   "print_hide": 1,
+   "description": "Will be calculated automatically when you enter the details", 
+   "fieldname": "base_net_total", 
+   "fieldtype": "Currency", 
+   "label": "Net Total (Company Currency)", 
+   "oldfieldname": "net_total", 
+   "oldfieldtype": "Currency", 
+   "options": "Company:company:default_currency", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 1
-  },
+  }, 
   {
-   "fieldname": "column_break_28",
-   "fieldtype": "Column Break",
+   "fieldname": "column_break_28", 
+   "fieldtype": "Column Break", 
    "permlevel": 0
-  },
+  }, 
   {
-   "fieldname": "total",
-   "fieldtype": "Currency",
-   "hidden": 0,
-   "label": "Total",
-   "options": "currency",
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
+   "fieldname": "total", 
+   "fieldtype": "Currency", 
+   "hidden": 0, 
+   "label": "Total", 
+   "options": "currency", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
    "read_only": 1
-  },
+  }, 
   {
-   "fieldname": "net_total",
-   "fieldtype": "Currency",
-   "label": "Net Total",
-   "oldfieldname": "net_total_import",
-   "oldfieldtype": "Currency",
-   "options": "currency",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "net_total", 
+   "fieldtype": "Currency", 
+   "label": "Net Total", 
+   "oldfieldname": "net_total_import", 
+   "oldfieldtype": "Currency", 
+   "options": "currency", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 1
-  },
+  }, 
   {
-   "fieldname": "taxes_section",
-   "fieldtype": "Section Break",
-   "label": "",
-   "oldfieldtype": "Section Break",
-   "options": "icon-money",
-   "permlevel": 0,
+   "fieldname": "taxes_section", 
+   "fieldtype": "Section Break", 
+   "label": "", 
+   "oldfieldtype": "Section Break", 
+   "options": "icon-money", 
+   "permlevel": 0, 
    "read_only": 0
-  },
+  }, 
   {
-   "fieldname": "taxes_and_charges",
-   "fieldtype": "Link",
-   "label": "Taxes and Charges",
-   "oldfieldname": "purchase_other_charges",
-   "oldfieldtype": "Link",
-   "options": "Purchase Taxes and Charges Template",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "taxes_and_charges", 
+   "fieldtype": "Link", 
+   "label": "Taxes and Charges", 
+   "oldfieldname": "purchase_other_charges", 
+   "oldfieldtype": "Link", 
+   "options": "Purchase Taxes and Charges Template", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 0
-  },
+  }, 
   {
-   "fieldname": "taxes",
-   "fieldtype": "Table",
-   "label": "Purchase Taxes and Charges",
-   "oldfieldname": "purchase_tax_details",
-   "oldfieldtype": "Table",
-   "options": "Purchase Taxes and Charges",
-   "permlevel": 0,
+   "fieldname": "taxes", 
+   "fieldtype": "Table", 
+   "label": "Purchase Taxes and Charges", 
+   "oldfieldname": "purchase_tax_details", 
+   "oldfieldtype": "Table", 
+   "options": "Purchase Taxes and Charges", 
+   "permlevel": 0, 
    "read_only": 0
-  },
+  }, 
   {
-   "fieldname": "other_charges_calculation",
-   "fieldtype": "HTML",
-   "label": "Taxes and Charges Calculation",
-   "oldfieldtype": "HTML",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "other_charges_calculation", 
+   "fieldtype": "HTML", 
+   "label": "Taxes and Charges Calculation", 
+   "oldfieldtype": "HTML", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 0
-  },
+  }, 
   {
-   "fieldname": "totals",
-   "fieldtype": "Section Break",
-   "label": "",
-   "oldfieldtype": "Section Break",
-   "options": "icon-money",
-   "permlevel": 0,
+   "fieldname": "totals", 
+   "fieldtype": "Section Break", 
+   "label": "", 
+   "oldfieldtype": "Section Break", 
+   "options": "icon-money", 
+   "permlevel": 0, 
    "read_only": 0
-  },
+  }, 
   {
-   "fieldname": "base_taxes_and_charges_added",
-   "fieldtype": "Currency",
-   "label": "Taxes and Charges Added (Company Currency)",
-   "oldfieldname": "other_charges_added",
-   "oldfieldtype": "Currency",
-   "options": "Company:company:default_currency",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "base_taxes_and_charges_added", 
+   "fieldtype": "Currency", 
+   "label": "Taxes and Charges Added (Company Currency)", 
+   "oldfieldname": "other_charges_added", 
+   "oldfieldtype": "Currency", 
+   "options": "Company:company:default_currency", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 1
-  },
+  }, 
   {
-   "fieldname": "base_taxes_and_charges_deducted",
-   "fieldtype": "Currency",
-   "label": "Taxes and Charges Deducted (Company Currency)",
-   "oldfieldname": "other_charges_deducted",
-   "oldfieldtype": "Currency",
-   "options": "Company:company:default_currency",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "base_taxes_and_charges_deducted", 
+   "fieldtype": "Currency", 
+   "label": "Taxes and Charges Deducted (Company Currency)", 
+   "oldfieldname": "other_charges_deducted", 
+   "oldfieldtype": "Currency", 
+   "options": "Company:company:default_currency", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 1
-  },
+  }, 
   {
-   "fieldname": "base_total_taxes_and_charges",
-   "fieldtype": "Currency",
-   "label": "Total Taxes and Charges (Company Currency)",
-   "oldfieldname": "total_tax",
-   "oldfieldtype": "Currency",
-   "options": "Company:company:default_currency",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "base_total_taxes_and_charges", 
+   "fieldtype": "Currency", 
+   "label": "Total Taxes and Charges (Company Currency)", 
+   "oldfieldname": "total_tax", 
+   "oldfieldtype": "Currency", 
+   "options": "Company:company:default_currency", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 1
-  },
+  }, 
   {
-   "fieldname": "column_break_40",
-   "fieldtype": "Column Break",
-   "permlevel": 0,
+   "fieldname": "column_break_40", 
+   "fieldtype": "Column Break", 
+   "permlevel": 0, 
    "precision": ""
-  },
+  }, 
   {
-   "fieldname": "taxes_and_charges_added",
-   "fieldtype": "Currency",
-   "label": "Taxes and Charges Added",
-   "oldfieldname": "other_charges_added_import",
-   "oldfieldtype": "Currency",
-   "options": "currency",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "taxes_and_charges_added", 
+   "fieldtype": "Currency", 
+   "label": "Taxes and Charges Added", 
+   "oldfieldname": "other_charges_added_import", 
+   "oldfieldtype": "Currency", 
+   "options": "currency", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 1
-  },
+  }, 
   {
-   "fieldname": "taxes_and_charges_deducted",
-   "fieldtype": "Currency",
-   "label": "Taxes and Charges Deducted",
-   "oldfieldname": "other_charges_deducted_import",
-   "oldfieldtype": "Currency",
-   "options": "currency",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "taxes_and_charges_deducted", 
+   "fieldtype": "Currency", 
+   "label": "Taxes and Charges Deducted", 
+   "oldfieldname": "other_charges_deducted_import", 
+   "oldfieldtype": "Currency", 
+   "options": "currency", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 1
-  },
+  }, 
   {
-   "fieldname": "total_taxes_and_charges",
-   "fieldtype": "Currency",
-   "label": "Total Taxes and Charges",
-   "options": "currency",
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 1,
+   "fieldname": "total_taxes_and_charges", 
+   "fieldtype": "Currency", 
+   "label": "Total Taxes and Charges", 
+   "options": "currency", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 1, 
    "read_only": 1
-  },
+  }, 
   {
-   "fieldname": "section_break_44",
-   "fieldtype": "Section Break",
-   "permlevel": 0,
+   "fieldname": "section_break_44", 
+   "fieldtype": "Section Break", 
+   "permlevel": 0, 
    "precision": ""
-  },
+  }, 
   {
-   "default": "Grand Total",
-   "fieldname": "apply_discount_on",
-   "fieldtype": "Select",
-   "label": "Apply Additional Discount On",
-   "options": "\nGrand Total\nNet Total",
-   "permlevel": 0,
-   "precision": "",
+   "default": "Grand Total", 
+   "fieldname": "apply_discount_on", 
+   "fieldtype": "Select", 
+   "label": "Apply Additional Discount On", 
+   "options": "\nGrand Total\nNet Total", 
+   "permlevel": 0, 
+   "precision": "", 
    "print_hide": 1
-  },
+  }, 
   {
-   "fieldname": "column_break_46",
-   "fieldtype": "Column Break",
-   "permlevel": 0,
+   "fieldname": "column_break_46", 
+   "fieldtype": "Column Break", 
+   "permlevel": 0, 
    "precision": ""
-  },
+  }, 
   {
-   "fieldname": "discount_amount",
-   "fieldtype": "Currency",
-   "label": "Additional Discount Amount",
-   "options": "currency",
-   "permlevel": 0,
-   "precision": "",
+   "fieldname": "discount_amount", 
+   "fieldtype": "Currency", 
+   "label": "Additional Discount Amount", 
+   "options": "currency", 
+   "permlevel": 0, 
+   "precision": "", 
    "print_hide": 1
-  },
+  }, 
   {
-   "fieldname": "base_discount_amount",
-   "fieldtype": "Currency",
-   "label": "Discount Amount (Company Currency)",
-   "options": "Company:company:default_currency",
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 1,
+   "fieldname": "base_discount_amount", 
+   "fieldtype": "Currency", 
+   "label": "Additional Discount Amount (Company Currency)", 
+   "options": "Company:company:default_currency", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 1, 
    "read_only": 1
-  },
+  }, 
   {
-   "fieldname": "section_break_49",
-   "fieldtype": "Section Break",
-   "permlevel": 0,
+   "fieldname": "section_break_49", 
+   "fieldtype": "Section Break", 
+   "permlevel": 0, 
    "precision": ""
-  },
+  }, 
   {
-   "fieldname": "base_grand_total",
-   "fieldtype": "Currency",
-   "label": "Grand Total (Company Currency)",
-   "oldfieldname": "grand_total",
-   "oldfieldtype": "Currency",
-   "options": "Company:company:default_currency",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "base_grand_total", 
+   "fieldtype": "Currency", 
+   "label": "Grand Total (Company Currency)", 
+   "oldfieldname": "grand_total", 
+   "oldfieldtype": "Currency", 
+   "options": "Company:company:default_currency", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 1
-  },
+  }, 
   {
-   "description": "In Words will be visible once you save the Purchase Invoice.",
-   "fieldname": "base_in_words",
-   "fieldtype": "Data",
-   "label": "In Words (Company Currency)",
-   "oldfieldname": "in_words",
-   "oldfieldtype": "Data",
-   "permlevel": 0,
-   "print_hide": 1,
+   "description": "In Words will be visible once you save the Purchase Invoice.", 
+   "fieldname": "base_in_words", 
+   "fieldtype": "Data", 
+   "label": "In Words (Company Currency)", 
+   "oldfieldname": "in_words", 
+   "oldfieldtype": "Data", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 1
-  },
+  }, 
   {
-   "fieldname": "column_break8",
-   "fieldtype": "Column Break",
-   "oldfieldtype": "Column Break",
-   "permlevel": 0,
-   "print_hide": 1,
-   "read_only": 0,
+   "fieldname": "column_break8", 
+   "fieldtype": "Column Break", 
+   "oldfieldtype": "Column Break", 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "read_only": 0, 
    "width": "50%"
-  },
+  }, 
   {
-   "fieldname": "grand_total",
-   "fieldtype": "Currency",
-   "in_list_view": 1,
-   "label": "Grand Total",
-   "oldfieldname": "grand_total_import",
-   "oldfieldtype": "Currency",
-   "options": "currency",
-   "permlevel": 0,
-   "print_hide": 0,
+   "fieldname": "grand_total", 
+   "fieldtype": "Currency", 
+   "in_list_view": 1, 
+   "label": "Grand Total", 
+   "oldfieldname": "grand_total_import", 
+   "oldfieldtype": "Currency", 
+   "options": "currency", 
+   "permlevel": 0, 
+   "print_hide": 0, 
    "read_only": 1
-  },
+  }, 
   {
-   "fieldname": "in_words",
-   "fieldtype": "Data",
-   "label": "In Words",
-   "oldfieldname": "in_words_import",
-   "oldfieldtype": "Data",
-   "permlevel": 0,
-   "print_hide": 0,
+   "fieldname": "in_words", 
+   "fieldtype": "Data", 
+   "label": "In Words", 
+   "oldfieldname": "in_words_import", 
+   "oldfieldtype": "Data", 
+   "permlevel": 0, 
+   "print_hide": 0, 
    "read_only": 1
-  },
+  }, 
   {
-   "fieldname": "total_amount_to_pay",
-   "fieldtype": "Currency",
-   "hidden": 0,
-   "label": "Total Amount To Pay",
-   "no_copy": 1,
-   "oldfieldname": "total_amount_to_pay",
-   "oldfieldtype": "Currency",
-   "options": "Company:company:default_currency",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "total_amount_to_pay", 
+   "fieldtype": "Currency", 
+   "hidden": 0, 
+   "label": "Total Amount To Pay", 
+   "no_copy": 1, 
+   "oldfieldname": "total_amount_to_pay", 
+   "oldfieldtype": "Currency", 
+   "options": "Company:company:default_currency", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 1
-  },
+  }, 
   {
-   "fieldname": "total_advance",
-   "fieldtype": "Currency",
-   "label": "Total Advance",
-   "no_copy": 1,
-   "oldfieldname": "total_advance",
-   "oldfieldtype": "Currency",
-   "options": "Company:company:default_currency",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "total_advance", 
+   "fieldtype": "Currency", 
+   "label": "Total Advance", 
+   "no_copy": 1, 
+   "oldfieldname": "total_advance", 
+   "oldfieldtype": "Currency", 
+   "options": "Company:company:default_currency", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 1
-  },
+  }, 
   {
-   "fieldname": "outstanding_amount",
-   "fieldtype": "Currency",
-   "in_filter": 1,
-   "in_list_view": 0,
-   "label": "Outstanding Amount",
-   "no_copy": 1,
-   "oldfieldname": "outstanding_amount",
-   "oldfieldtype": "Currency",
-   "options": "Company:company:default_currency",
-   "permlevel": 0,
-   "print_hide": 1,
-   "read_only": 1,
-   "search_index": 1
-  },
+   "fieldname": "outstanding_amount", 
+   "fieldtype": "Currency", 
+   "in_filter": 1, 
+   "in_list_view": 0, 
+   "label": "Outstanding Amount", 
+   "no_copy": 1, 
+   "oldfieldname": "outstanding_amount", 
+   "oldfieldtype": "Currency", 
+   "options": "Company:company:default_currency", 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "read_only": 1, 
+   "search_index": 0
+  }, 
   {
-   "fieldname": "write_off_amount",
-   "fieldtype": "Currency",
-   "label": "Write Off Amount",
-   "no_copy": 1,
-   "options": "Company:company:default_currency",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "write_off_amount", 
+   "fieldtype": "Currency", 
+   "label": "Write Off Amount", 
+   "no_copy": 1, 
+   "options": "Company:company:default_currency", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 0
-  },
+  }, 
   {
-   "depends_on": "eval:flt(doc.write_off_amount)!=0",
-   "fieldname": "write_off_account",
-   "fieldtype": "Link",
-   "label": "Write Off Account",
-   "no_copy": 1,
-   "options": "Account",
-   "permlevel": 0,
-   "print_hide": 1,
+   "depends_on": "eval:flt(doc.write_off_amount)!=0", 
+   "fieldname": "write_off_account", 
+   "fieldtype": "Link", 
+   "label": "Write Off Account", 
+   "no_copy": 1, 
+   "options": "Account", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 0
-  },
+  }, 
   {
-   "depends_on": "eval:flt(doc.write_off_amount)!=0",
-   "fieldname": "write_off_cost_center",
-   "fieldtype": "Link",
-   "label": "Write Off Cost Center",
-   "no_copy": 1,
-   "options": "Cost Center",
-   "permlevel": 0,
-   "print_hide": 1,
+   "depends_on": "eval:flt(doc.write_off_amount)!=0", 
+   "fieldname": "write_off_cost_center", 
+   "fieldtype": "Link", 
+   "label": "Write Off Cost Center", 
+   "no_copy": 1, 
+   "options": "Cost Center", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 0
-  },
+  }, 
   {
-   "fieldname": "against_expense_account",
-   "fieldtype": "Small Text",
-   "hidden": 1,
-   "label": "Against Expense Account",
-   "no_copy": 1,
-   "oldfieldname": "against_expense_account",
-   "oldfieldtype": "Small Text",
-   "permlevel": 0,
-   "print_hide": 1,
-   "read_only": 0,
+   "fieldname": "against_expense_account", 
+   "fieldtype": "Small Text", 
+   "hidden": 1, 
+   "label": "Against Expense Account", 
+   "no_copy": 1, 
+   "oldfieldname": "against_expense_account", 
+   "oldfieldtype": "Small Text", 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "read_only": 0, 
    "report_hide": 0
-  },
+  }, 
   {
-   "fieldname": "fold",
-   "fieldtype": "Fold",
+   "fieldname": "fold", 
+   "fieldtype": "Fold", 
    "permlevel": 0
-  },
+  }, 
   {
-   "fieldname": "advances_section",
-   "fieldtype": "Section Break",
-   "label": "",
-   "oldfieldtype": "Section Break",
-   "options": "icon-money",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "advances_section", 
+   "fieldtype": "Section Break", 
+   "label": "", 
+   "oldfieldtype": "Section Break", 
+   "options": "icon-money", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 0
-  },
+  }, 
   {
-   "fieldname": "get_advances_paid",
-   "fieldtype": "Button",
-   "label": "Get Advances Paid",
-   "oldfieldtype": "Button",
-   "options": "get_advances",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "get_advances_paid", 
+   "fieldtype": "Button", 
+   "label": "Get Advances Paid", 
+   "oldfieldtype": "Button", 
+   "options": "get_advances", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 0
-  },
+  }, 
   {
-   "fieldname": "advances",
-   "fieldtype": "Table",
-   "label": "Advances",
-   "no_copy": 1,
-   "oldfieldname": "advance_allocation_details",
-   "oldfieldtype": "Table",
-   "options": "Purchase Invoice Advance",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "advances", 
+   "fieldtype": "Table", 
+   "label": "Advances", 
+   "no_copy": 1, 
+   "oldfieldname": "advance_allocation_details", 
+   "oldfieldtype": "Table", 
+   "options": "Purchase Invoice Advance", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 0
-  },
+  }, 
   {
-   "fieldname": "terms_section_break",
-   "fieldtype": "Section Break",
-   "label": "",
-   "options": "icon-legal",
+   "fieldname": "terms_section_break", 
+   "fieldtype": "Section Break", 
+   "label": "", 
+   "options": "icon-legal", 
    "permlevel": 0
-  },
+  }, 
   {
-   "fieldname": "tc_name",
-   "fieldtype": "Link",
-   "label": "Terms",
-   "options": "Terms and Conditions",
-   "permlevel": 0,
+   "fieldname": "tc_name", 
+   "fieldtype": "Link", 
+   "label": "Terms", 
+   "options": "Terms and Conditions", 
+   "permlevel": 0, 
    "print_hide": 1
-  },
+  }, 
   {
-   "fieldname": "terms",
-   "fieldtype": "Text Editor",
-   "label": "Terms and Conditions1",
+   "fieldname": "terms", 
+   "fieldtype": "Text Editor", 
+   "label": "Terms and Conditions1", 
    "permlevel": 0
-  },
+  }, 
   {
-   "depends_on": "supplier",
-   "fieldname": "contact_section",
-   "fieldtype": "Section Break",
-   "label": "",
-   "options": "icon-bullhorn",
-   "permlevel": 0,
+   "depends_on": "supplier", 
+   "fieldname": "contact_section", 
+   "fieldtype": "Section Break", 
+   "label": "", 
+   "options": "icon-bullhorn", 
+   "permlevel": 0, 
    "read_only": 0
-  },
+  }, 
   {
-   "fieldname": "supplier_address",
-   "fieldtype": "Link",
-   "label": "Supplier Address",
-   "options": "Address",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "supplier_address", 
+   "fieldtype": "Link", 
+   "label": "Supplier Address", 
+   "options": "Address", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 0
-  },
+  }, 
   {
-   "fieldname": "col_break23",
-   "fieldtype": "Column Break",
-   "permlevel": 0,
-   "read_only": 0,
+   "fieldname": "col_break23", 
+   "fieldtype": "Column Break", 
+   "permlevel": 0, 
+   "read_only": 0, 
    "width": "50%"
-  },
+  }, 
   {
-   "fieldname": "contact_person",
-   "fieldtype": "Link",
-   "label": "Contact Person",
-   "options": "Contact",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "contact_person", 
+   "fieldtype": "Link", 
+   "label": "Contact Person", 
+   "options": "Contact", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 0
-  },
+  }, 
   {
-   "fieldname": "more_info",
-   "fieldtype": "Section Break",
-   "label": "",
-   "oldfieldtype": "Section Break",
-   "options": "icon-file-text",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "more_info", 
+   "fieldtype": "Section Break", 
+   "label": "", 
+   "oldfieldtype": "Section Break", 
+   "options": "icon-file-text", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 0
-  },
+  }, 
   {
-   "description": "Supplier (Payable) Account",
-   "fieldname": "credit_to",
-   "fieldtype": "Link",
-   "in_filter": 1,
-   "label": "Credit To",
-   "oldfieldname": "credit_to",
-   "oldfieldtype": "Link",
-   "options": "Account",
-   "permlevel": 0,
-   "print_hide": 1,
-   "read_only": 0,
-   "reqd": 1,
+   "description": "Supplier (Payable) Account", 
+   "fieldname": "credit_to", 
+   "fieldtype": "Link", 
+   "in_filter": 1, 
+   "label": "Credit To", 
+   "oldfieldname": "credit_to", 
+   "oldfieldtype": "Link", 
+   "options": "Account", 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "read_only": 0, 
+   "reqd": 1, 
    "search_index": 1
-  },
+  }, 
   {
-   "default": "No",
-   "description": "Considered as Opening Balance",
-   "fieldname": "is_opening",
-   "fieldtype": "Select",
-   "in_filter": 1,
-   "label": "Is Opening",
-   "oldfieldname": "is_opening",
-   "oldfieldtype": "Select",
-   "options": "No\nYes",
-   "permlevel": 0,
-   "print_hide": 1,
-   "read_only": 0,
-   "search_index": 1
-  },
+   "default": "No", 
+   "description": "Considered as Opening Balance", 
+   "fieldname": "is_opening", 
+   "fieldtype": "Select", 
+   "in_filter": 1, 
+   "label": "Is Opening", 
+   "oldfieldname": "is_opening", 
+   "oldfieldtype": "Select", 
+   "options": "No\nYes", 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "read_only": 0, 
+   "search_index": 0
+  }, 
   {
-   "allow_on_submit": 1,
-   "fieldname": "select_print_heading",
-   "fieldtype": "Link",
-   "label": "Print Heading",
-   "no_copy": 1,
-   "oldfieldname": "select_print_heading",
-   "oldfieldtype": "Link",
-   "options": "Print Heading",
-   "permlevel": 0,
-   "print_hide": 1,
-   "read_only": 0,
+   "allow_on_submit": 1, 
+   "fieldname": "select_print_heading", 
+   "fieldtype": "Link", 
+   "label": "Print Heading", 
+   "no_copy": 1, 
+   "oldfieldname": "select_print_heading", 
+   "oldfieldtype": "Link", 
+   "options": "Print Heading", 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "read_only": 0, 
    "report_hide": 1
-  },
+  }, 
   {
-   "fieldname": "due_date",
-   "fieldtype": "Date",
-   "in_filter": 1,
-   "label": "Due Date",
-   "no_copy": 0,
-   "oldfieldname": "due_date",
-   "oldfieldtype": "Date",
-   "permlevel": 0,
-   "print_hide": 1,
-   "read_only": 0,
-   "search_index": 1
-  },
+   "fieldname": "due_date", 
+   "fieldtype": "Date", 
+   "in_filter": 1, 
+   "label": "Due Date", 
+   "no_copy": 0, 
+   "oldfieldname": "due_date", 
+   "oldfieldtype": "Date", 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "read_only": 0, 
+   "search_index": 0
+  }, 
   {
-   "fieldname": "mode_of_payment",
-   "fieldtype": "Link",
-   "label": "Mode of Payment",
-   "oldfieldname": "mode_of_payment",
-   "oldfieldtype": "Select",
-   "options": "Mode of Payment",
-   "permlevel": 0,
+   "fieldname": "mode_of_payment", 
+   "fieldtype": "Link", 
+   "label": "Mode of Payment", 
+   "oldfieldname": "mode_of_payment", 
+   "oldfieldtype": "Select", 
+   "options": "Mode of Payment", 
+   "permlevel": 0, 
    "read_only": 0
-  },
+  }, 
   {
-   "fieldname": "column_break_63",
-   "fieldtype": "Column Break",
-   "permlevel": 0,
+   "fieldname": "column_break_63", 
+   "fieldtype": "Column Break", 
+   "permlevel": 0, 
    "read_only": 0
-  },
+  }, 
   {
-   "fieldname": "fiscal_year",
-   "fieldtype": "Link",
-   "in_filter": 1,
-   "label": "Fiscal Year",
-   "oldfieldname": "fiscal_year",
-   "oldfieldtype": "Select",
-   "options": "Fiscal Year",
-   "permlevel": 0,
-   "print_hide": 1,
-   "read_only": 0,
-   "search_index": 1
-  },
+   "fieldname": "fiscal_year", 
+   "fieldtype": "Link", 
+   "in_filter": 1, 
+   "label": "Fiscal Year", 
+   "oldfieldname": "fiscal_year", 
+   "oldfieldtype": "Select", 
+   "options": "Fiscal Year", 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "read_only": 0, 
+   "search_index": 0
+  }, 
   {
-   "fieldname": "remarks",
-   "fieldtype": "Small Text",
-   "label": "Remarks",
-   "no_copy": 1,
-   "oldfieldname": "remarks",
-   "oldfieldtype": "Text",
-   "permlevel": 0,
-   "print_hide": 1,
-   "read_only": 0,
+   "fieldname": "remarks", 
+   "fieldtype": "Small Text", 
+   "label": "Remarks", 
+   "no_copy": 1, 
+   "oldfieldname": "remarks", 
+   "oldfieldtype": "Text", 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "read_only": 0, 
    "reqd": 0
-  },
+  }, 
   {
-   "depends_on": "eval:doc.docstatus<2",
-   "fieldname": "recurring_invoice",
-   "fieldtype": "Section Break",
-   "label": "Recurring Invoice",
-   "options": "icon-time",
-   "permlevel": 0,
+   "depends_on": "eval:doc.docstatus<2", 
+   "fieldname": "recurring_invoice", 
+   "fieldtype": "Section Break", 
+   "label": "Recurring Invoice", 
+   "options": "icon-time", 
+   "permlevel": 0, 
    "print_hide": 1
-  },
+  }, 
   {
-   "fieldname": "column_break_77",
-   "fieldtype": "Column Break",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "column_break_77", 
+   "fieldtype": "Column Break", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "width": "50%"
-  },
+  }, 
   {
-   "allow_on_submit": 1,
-   "depends_on": "eval:doc.docstatus<2",
-   "description": "Check if recurring invoice, uncheck to stop recurring or put proper End Date",
-   "fieldname": "is_recurring",
-   "fieldtype": "Check",
-   "label": "Is Recurring",
-   "no_copy": 1,
-   "permlevel": 0,
+   "allow_on_submit": 1, 
+   "depends_on": "eval:doc.docstatus<2", 
+   "description": "Check if recurring invoice, uncheck to stop recurring or put proper End Date", 
+   "fieldname": "is_recurring", 
+   "fieldtype": "Check", 
+   "label": "Is Recurring", 
+   "no_copy": 1, 
+   "permlevel": 0, 
    "print_hide": 1
-  },
+  }, 
   {
-   "allow_on_submit": 1,
-   "depends_on": "eval:doc.is_recurring==1",
-   "description": "Select the period when the invoice will be generated automatically",
-   "fieldname": "recurring_type",
-   "fieldtype": "Select",
-   "label": "Recurring Type",
-   "no_copy": 1,
-   "options": "Monthly\nQuarterly\nHalf-yearly\nYearly",
-   "permlevel": 0,
+   "allow_on_submit": 1, 
+   "depends_on": "eval:doc.is_recurring==1", 
+   "description": "Select the period when the invoice will be generated automatically", 
+   "fieldname": "recurring_type", 
+   "fieldtype": "Select", 
+   "label": "Recurring Type", 
+   "no_copy": 1, 
+   "options": "Monthly\nQuarterly\nHalf-yearly\nYearly", 
+   "permlevel": 0, 
    "print_hide": 1
-  },
+  }, 
   {
-   "allow_on_submit": 1,
-   "depends_on": "eval:doc.is_recurring==1",
-   "description": "Start date of current invoice's period",
-   "fieldname": "from_date",
-   "fieldtype": "Date",
-   "label": "From Date",
-   "no_copy": 1,
-   "permlevel": 0,
+   "allow_on_submit": 1, 
+   "depends_on": "eval:doc.is_recurring==1", 
+   "description": "Start date of current invoice's period", 
+   "fieldname": "from_date", 
+   "fieldtype": "Date", 
+   "label": "From Date", 
+   "no_copy": 1, 
+   "permlevel": 0, 
    "print_hide": 1
-  },
+  }, 
   {
-   "allow_on_submit": 1,
-   "depends_on": "eval:doc.is_recurring==1",
-   "description": "End date of current invoice's period",
-   "fieldname": "to_date",
-   "fieldtype": "Date",
-   "label": "To Date",
-   "no_copy": 1,
-   "permlevel": 0,
+   "allow_on_submit": 1, 
+   "depends_on": "eval:doc.is_recurring==1", 
+   "description": "End date of current invoice's period", 
+   "fieldname": "to_date", 
+   "fieldtype": "Date", 
+   "label": "To Date", 
+   "no_copy": 1, 
+   "permlevel": 0, 
    "print_hide": 1
-  },
+  }, 
   {
-   "allow_on_submit": 1,
-   "depends_on": "eval:doc.is_recurring==1",
-   "description": "The day of the month on which auto invoice will be generated e.g. 05, 28 etc",
-   "fieldname": "repeat_on_day_of_month",
-   "fieldtype": "Int",
-   "label": "Repeat on Day of Month",
-   "no_copy": 1,
-   "permlevel": 0,
+   "allow_on_submit": 1, 
+   "depends_on": "eval:doc.is_recurring==1", 
+   "description": "The day of the month on which auto invoice will be generated e.g. 05, 28 etc", 
+   "fieldname": "repeat_on_day_of_month", 
+   "fieldtype": "Int", 
+   "label": "Repeat on Day of Month", 
+   "no_copy": 1, 
+   "permlevel": 0, 
    "print_hide": 1
-  },
+  }, 
   {
-   "allow_on_submit": 1,
-   "depends_on": "eval:doc.is_recurring==1",
-   "description": "The date on which recurring invoice will be stop",
-   "fieldname": "end_date",
-   "fieldtype": "Date",
-   "label": "End Date",
-   "no_copy": 1,
-   "permlevel": 0,
+   "allow_on_submit": 1, 
+   "depends_on": "eval:doc.is_recurring==1", 
+   "description": "The date on which recurring invoice will be stop", 
+   "fieldname": "end_date", 
+   "fieldtype": "Date", 
+   "label": "End Date", 
+   "no_copy": 1, 
+   "permlevel": 0, 
    "print_hide": 1
-  },
+  }, 
   {
-   "fieldname": "column_break_82",
-   "fieldtype": "Column Break",
-   "permlevel": 0,
-   "print_hide": 1,
+   "fieldname": "column_break_82", 
+   "fieldtype": "Column Break", 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "width": "50%"
-  },
+  }, 
   {
-   "depends_on": "eval:doc.is_recurring==1",
-   "description": "The date on which next invoice will be generated. It is generated on submit.",
-   "fieldname": "next_date",
-   "fieldtype": "Date",
-   "label": "Next Date",
-   "no_copy": 1,
-   "permlevel": 0,
-   "print_hide": 1,
+   "depends_on": "eval:doc.is_recurring==1", 
+   "description": "The date on which next invoice will be generated. It is generated on submit.", 
+   "fieldname": "next_date", 
+   "fieldtype": "Date", 
+   "label": "Next Date", 
+   "no_copy": 1, 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 1
-  },
+  }, 
   {
-   "depends_on": "eval:doc.is_recurring==1",
-   "description": "The unique id for tracking all recurring invoices. It is generated on submit.",
-   "fieldname": "recurring_id",
-   "fieldtype": "Data",
-   "label": "Recurring Id",
-   "no_copy": 1,
-   "permlevel": 0,
-   "print_hide": 1,
+   "depends_on": "eval:doc.is_recurring==1", 
+   "description": "The unique id for tracking all recurring invoices. It is generated on submit.", 
+   "fieldname": "recurring_id", 
+   "fieldtype": "Data", 
+   "label": "Recurring Id", 
+   "no_copy": 1, 
+   "permlevel": 0, 
+   "print_hide": 1, 
    "read_only": 1
-  },
+  }, 
   {
-   "allow_on_submit": 1,
-   "depends_on": "eval:doc.is_recurring==1",
-   "description": "Enter email id separated by commas, invoice will be mailed automatically on particular date",
-   "fieldname": "notification_email_address",
-   "fieldtype": "Small Text",
-   "label": "Notification Email Address",
-   "no_copy": 1,
-   "permlevel": 0,
+   "allow_on_submit": 1, 
+   "depends_on": "eval:doc.is_recurring==1", 
+   "description": "Enter email id separated by commas, invoice will be mailed automatically on particular date", 
+   "fieldname": "notification_email_address", 
+   "fieldtype": "Small Text", 
+   "label": "Notification Email Address", 
+   "no_copy": 1, 
+   "permlevel": 0, 
    "print_hide": 1
   }
- ],
- "icon": "icon-file-text",
- "idx": 1,
- "is_submittable": 1,
- "modified": "2015-05-27 02:54:48.668118",
- "modified_by": "Administrator",
- "module": "Accounts",
- "name": "Purchase Invoice",
- "owner": "Administrator",
+ ], 
+ "icon": "icon-file-text", 
+ "idx": 1, 
+ "is_submittable": 1, 
+ "modified": "2015-06-16 16:46:47.308287", 
+ "modified_by": "Administrator", 
+ "module": "Accounts", 
+ "name": "Purchase Invoice", 
+ "owner": "Administrator", 
  "permissions": [
   {
-   "amend": 1,
-   "apply_user_permissions": 1,
-   "cancel": 1,
-   "create": 1,
-   "delete": 0,
-   "email": 1,
-   "permlevel": 0,
-   "print": 1,
-   "read": 1,
-   "report": 1,
-   "role": "Accounts User",
-   "share": 1,
-   "submit": 1,
+   "amend": 1, 
+   "apply_user_permissions": 1, 
+   "cancel": 1, 
+   "create": 1, 
+   "delete": 0, 
+   "email": 1, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Accounts User", 
+   "share": 1, 
+   "submit": 1, 
    "write": 1
-  },
+  }, 
   {
-   "amend": 0,
-   "apply_user_permissions": 1,
-   "cancel": 0,
-   "create": 0,
-   "delete": 0,
-   "email": 1,
-   "permlevel": 0,
-   "print": 1,
-   "read": 1,
-   "report": 1,
-   "role": "Purchase User",
-   "submit": 0,
+   "amend": 0, 
+   "apply_user_permissions": 1, 
+   "cancel": 0, 
+   "create": 0, 
+   "delete": 0, 
+   "email": 1, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Purchase User", 
+   "submit": 0, 
    "write": 0
-  },
+  }, 
   {
-   "amend": 0,
-   "apply_user_permissions": 1,
-   "cancel": 0,
-   "create": 0,
-   "delete": 0,
-   "email": 1,
-   "permlevel": 0,
-   "print": 1,
-   "read": 1,
-   "report": 1,
-   "role": "Supplier",
-   "submit": 0,
+   "amend": 0, 
+   "apply_user_permissions": 1, 
+   "cancel": 0, 
+   "create": 0, 
+   "delete": 0, 
+   "email": 1, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Supplier", 
+   "submit": 0, 
    "write": 0
-  },
+  }, 
   {
-   "amend": 1,
-   "cancel": 1,
-   "create": 1,
-   "delete": 1,
-   "email": 1,
-   "permlevel": 0,
-   "print": 1,
-   "read": 1,
-   "report": 1,
-   "role": "Accounts Manager",
-   "share": 1,
-   "submit": 1,
+   "amend": 1, 
+   "cancel": 1, 
+   "create": 1, 
+   "delete": 1, 
+   "email": 1, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Accounts Manager", 
+   "share": 1, 
+   "submit": 1, 
    "write": 1
-  },
+  }, 
   {
-   "amend": 0,
-   "apply_user_permissions": 1,
-   "cancel": 0,
-   "create": 0,
-   "delete": 0,
-   "email": 1,
-   "permlevel": 0,
-   "print": 1,
-   "read": 1,
-   "report": 1,
-   "role": "Auditor",
-   "submit": 0,
+   "amend": 0, 
+   "apply_user_permissions": 1, 
+   "cancel": 0, 
+   "create": 0, 
+   "delete": 0, 
+   "email": 1, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Auditor", 
+   "submit": 0, 
    "write": 0
-  },
+  }, 
   {
-   "permlevel": 1,
-   "read": 1,
-   "role": "Accounts Manager",
+   "permlevel": 1, 
+   "read": 1, 
+   "role": "Accounts Manager", 
    "write": 1
   }
- ],
- "read_only_onload": 1,
- "search_fields": "posting_date, supplier, fiscal_year, bill_no, base_grand_total, outstanding_amount",
- "sort_field": "modified",
- "sort_order": "DESC",
+ ], 
+ "read_only_onload": 1, 
+ "search_fields": "posting_date, supplier, fiscal_year, bill_no, base_grand_total, outstanding_amount", 
+ "sort_field": "modified", 
+ "sort_order": "DESC", 
  "title_field": "supplier_name"
-}
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index dffc6a7..a021be4 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -38,7 +38,8 @@
    "options": "Customer", 
    "permlevel": 0, 
    "print_hide": 1, 
-   "read_only": 0
+   "read_only": 0, 
+   "search_index": 1
   }, 
   {
    "depends_on": "customer", 
@@ -502,7 +503,7 @@
   {
    "fieldname": "base_discount_amount", 
    "fieldtype": "Currency", 
-   "label": "Discount Amount (Company Currency)", 
+   "label": "Additional Discount Amount (Company Currency)", 
    "options": "Company:company:default_currency", 
    "permlevel": 0, 
    "precision": "", 
@@ -880,7 +881,7 @@
    "options": "Project", 
    "permlevel": 0, 
    "read_only": 0, 
-   "search_index": 1
+   "search_index": 0
   }, 
   {
    "depends_on": "eval:doc.source == 'Campaign'", 
@@ -1243,7 +1244,7 @@
  "icon": "icon-file-text", 
  "idx": 1, 
  "is_submittable": 1, 
- "modified": "2015-05-27 02:48:02.897865", 
+ "modified": "2015-06-16 16:45:06.618286", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Sales Invoice", 
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index e5af176..fe5954e 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -65,8 +65,7 @@
 		self.set_against_income_account()
 		self.validate_c_form()
 		self.validate_time_logs_are_submitted()
-		self.validate_multiple_billing("Delivery Note", "dn_detail", "amount",
-			"items")
+		self.validate_multiple_billing("Delivery Note", "dn_detail", "amount", "items")
 
 	def on_submit(self):
 		super(SalesInvoice, self).on_submit()
diff --git a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py
index bf5c4e5..3c8f550 100644
--- a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py
+++ b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py
@@ -9,8 +9,9 @@
 
 def execute(filters=None):
 	if not filters: filters = {}
-
-	columns = get_columns()
+	validate_filters(filters)
+			
+	columns = get_columns(filters)
 	entries = get_entries(filters)
 	invoice_posting_date_map = get_invoice_posting_date_map(filters)
 	against_date = ""
@@ -36,11 +37,18 @@
 		data.append(row)
 
 	return columns, data
+	
+def validate_filters(filters):
+	if (filters.get("payment_type") == "Incoming" and filters.get("party_type") == "Supplier") or \
+		(filters.get("payment_type") == "Outgoing" and filters.get("party_type") == "Customer"):
+			frappe.throw(_("{0} payment entries can not be filtered by {1}")\
+				.format(filters.payment_type, filters.party_type))
 
-def get_columns():
+def get_columns(filters):
 	return [_("Journal Entry") + ":Link/Journal Entry:140", 
-		_("Party Type") + ":Link/DocType:100", _("Party") + ":Dynamic Link/party_type:140",
-		_("Posting Date") + ":Date:100", _("Against Invoice") + ":Link/Purchase Invoice:130",
+		_("Party Type") + ":Link/DocType:100", _("Party") + ":Dynamic Link/Party Type:140",
+		_("Posting Date") + ":Date:100", 
+		_("Against Invoice") + (":Link/Purchase Invoice:130" if filters.get("payment_type") == "Outgoing" else ":Link/Sales Invoice:130"),
 		_("Against Invoice Posting Date") + ":Date:130", _("Debit") + ":Currency:120", _("Credit") + ":Currency:120",
 		_("Reference No") + "::100", _("Reference Date") + ":Date:100", _("Remarks") + "::150", _("Age") +":Int:40",
 		"0-30:Currency:100", "30-60:Currency:100", "60-90:Currency:100", _("90-Above") + ":Currency:100"
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json
index bae6496..dc1dfa4 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.json
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.json
@@ -457,7 +457,7 @@
   {
    "fieldname": "base_discount_amount", 
    "fieldtype": "Currency", 
-   "label": "Discount Amount (Company Currency)", 
+   "label": "Additional Discount Amount (Company Currency)", 
    "options": "Company:company:default_currency", 
    "permlevel": 0, 
    "precision": "", 
@@ -873,7 +873,7 @@
  "icon": "icon-file-text", 
  "idx": 1, 
  "is_submittable": 1, 
- "modified": "2015-06-02 17:15:44.711032", 
+ "modified": "2015-06-15 15:38:56.794601", 
  "modified_by": "Administrator", 
  "module": "Buying", 
  "name": "Purchase Order", 
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
index 374258b..e51b252 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
@@ -439,7 +439,7 @@
   {
    "fieldname": "base_discount_amount", 
    "fieldtype": "Currency", 
-   "label": "Discount Amount (Company Currency)", 
+   "label": "Additional Discount Amount (Company Currency)", 
    "options": "Company:company:default_currency", 
    "permlevel": 0, 
    "precision": "", 
@@ -660,7 +660,7 @@
  "icon": "icon-shopping-cart", 
  "idx": 1, 
  "is_submittable": 1, 
- "modified": "2015-06-02 17:15:57.283516", 
+ "modified": "2015-06-15 15:39:08.954248", 
  "modified_by": "Administrator", 
  "module": "Buying", 
  "name": "Supplier Quotation", 
diff --git a/erpnext/change_log/v5/v5_0_25.md b/erpnext/change_log/v5/v5_0_25.md
new file mode 100644
index 0000000..e8b8634
--- /dev/null
+++ b/erpnext/change_log/v5/v5_0_25.md
@@ -0,0 +1,17 @@
+- Performance upgrade in Trial Balance, General Ledger, AR/AP, Balance Sheet and P&L Statement reports
+- Add index on Account and GL Entry, Sales Invoice and Purchase Invoice table
+- Don't create Time Logs against Production Order if Workstation is not specified in Operations
+- Task should be mandatory in Time Log only when Project is mentioned but Production Order is not
+- Supplier invoice no unique validation and supplier invoice date can not be after posting date
+- Removed BOM No from mandatory from Stock Entry against Production Order
+- Load tasks in project for printing purpose
+- Added Customers Not Buying Since Long Time against Sales Invoice
+- POS - search by Item Group
+- Payment period based on invoice date: show party columns and filter based on party
+- Barcode added to Purchase Receipt
+- Fetch item name and desc on change of item code in Quality Inspection
+- Show item name in item grid view based 'In List View' property
+- Validate and update manufactured qty in Stock Entry
+- Show only users with Expense Approver role in Expense Claim Approver field
+- Over Production Allowance Percentage Setting added to Manufacturing Settings
+- Activity Cost - Mandatory removed for Employee
\ No newline at end of file
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index cd55d2f..fa92684 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -5,7 +5,7 @@
 app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations"
 app_icon = "icon-th"
 app_color = "#e74c3c"
-app_version = "5.0.24"
+app_version = "5.0.25"
 
 error_report_email = "support@erpnext.com"
 
diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.js b/erpnext/hr/doctype/expense_claim/expense_claim.js
index d279074..b556172 100644
--- a/erpnext/hr/doctype/expense_claim/expense_claim.js
+++ b/erpnext/hr/doctype/expense_claim/expense_claim.js
@@ -63,7 +63,7 @@
 
 	cur_frm.set_query("exp_approver", function() {
 		return {
-			filters: [["UserRole", "role", "=", "Expense Approver"]]
+			query: "erpnext.hr.doctype.expense_claim.expense_claim.get_expense_approver"
 		};
 	});
 }
diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.py b/erpnext/hr/doctype/expense_claim/expense_claim.py
index 6687399..112a626 100644
--- a/erpnext/hr/doctype/expense_claim/expense_claim.py
+++ b/erpnext/hr/doctype/expense_claim/expense_claim.py
@@ -58,4 +58,13 @@
 	def validate_sanctioned_amount(self):
 		for d in self.get('expenses'):
 			if flt(d.sanctioned_amount) > flt(d.claim_amount):
-				frappe.throw(_("Sanctioned Amount cannot be greater than Claim Amount in Row {0}.").format(d.idx))
\ No newline at end of file
+				frappe.throw(_("Sanctioned Amount cannot be greater than Claim Amount in Row {0}.").format(d.idx))
+				
+
+@frappe.whitelist()
+def get_expense_approver(doctype, txt, searchfield, start, page_len, filters):
+	return frappe.db.sql("""
+		select u.name, concat(u.first_name, ' ', u.last_name) 
+		from tabUser u, tabUserRole r
+		where u.name = r.parent and r.role = 'Expense Approver' and u.name like %s
+	""", ("%" + txt + "%"))
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.json b/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.json
index 4149046..ea9569f 100644
--- a/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.json
+++ b/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.json
@@ -55,6 +55,13 @@
    "label": "Time Between Operations (in mins)", 
    "permlevel": 0, 
    "precision": ""
+  }, 
+  {
+   "fieldname": "over_production_allowance_percentage", 
+   "fieldtype": "Percent", 
+   "label": "Over Production Allowance Percentage", 
+   "permlevel": 0, 
+   "precision": ""
   }
  ], 
  "hide_heading": 0, 
@@ -65,7 +72,7 @@
  "is_submittable": 0, 
  "issingle": 1, 
  "istable": 0, 
- "modified": "2015-04-21 07:57:40.260862", 
+ "modified": "2015-06-15 05:52:22.986958", 
  "modified_by": "Administrator", 
  "module": "Manufacturing", 
  "name": "Manufacturing Settings", 
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py
index ca5f6d9..0274b7e 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.py
+++ b/erpnext/manufacturing/doctype/production_order/production_order.py
@@ -90,8 +90,9 @@
 			(self.sales_order, self.production_item))[0][0]
 		# total qty in SO
 		so_qty = flt(so_item_qty) + flt(dnpi_qty)
-
-		if total_qty > so_qty:
+		
+		allowance_percentage = flt(frappe.db.get_single_value("Manufacturing Settings", "over_production_allowance_percentage"))
+		if total_qty > so_qty + (allowance_percentage/100 * so_qty):
 			frappe.throw(_("Cannot produce more Item {0} than Sales Order quantity {1}").format(self.production_item,
 				so_qty), OverProductionError)
 
diff --git a/erpnext/patches/v5_0/index_on_account_and_gl_entry.py b/erpnext/patches/v5_0/index_on_account_and_gl_entry.py
index b03b27a..16e43d6 100644
--- a/erpnext/patches/v5_0/index_on_account_and_gl_entry.py
+++ b/erpnext/patches/v5_0/index_on_account_and_gl_entry.py
@@ -5,18 +5,26 @@
 def execute():
 	index_map = {
 		"Account": ["parent_account", "lft", "rgt"],
-		"GL Entry": ["posting_date", "account", 'party', "voucher_no"]
+		"GL Entry": ["posting_date", "account", 'party', "voucher_no"],
+		"Sales Invoice": ["posting_date", "debit_to", "customer"],
+		"Purchase Invoice": ["posting_date", "credit_to", "supplier"]
 	}
 	
 	for dt, indexes in index_map.items():
-		existing_indexes = [d.Key_name for d in frappe.db.sql("""show index from `tab{0}` 
+		existing_indexes = [(d.Key_name, d.Column_name) for d in frappe.db.sql("""show index from `tab{0}` 
 			where Column_name != 'name'""".format(dt), as_dict=1)]
 
-		for old in existing_indexes:
-			if old in ("parent", "group_or_ledger", "is_pl_account", "debit_or_credit", "account_name", "company"):
+		for old, column in existing_indexes:
+			if column in ("parent", "group_or_ledger", "is_group", "is_pl_account", "debit_or_credit", 
+					"account_name", "company", "project_name", "voucher_date", "due_date", "bill_no", 
+					"bill_date", "is_opening", "fiscal_year", "outstanding_amount"):
 				frappe.db.sql("alter table `tab{0}` drop index {1}".format(dt, old))
-				existing_indexes.remove(old)
+		
+		existing_indexes = [(d.Key_name, d.Column_name) for d in frappe.db.sql("""show index from `tab{0}` 
+			where Column_name != 'name'""".format(dt), as_dict=1)]
+			
+		existing_indexed_columns = list(set([x[1] for x in existing_indexes]))
 							
 		for new in indexes:
-			if new not in existing_indexes:
+			if new not in existing_indexed_columns:
 				frappe.db.sql("alter table `tab{0}` add index ({1})".format(dt, new))
\ No newline at end of file
diff --git a/erpnext/projects/doctype/activity_cost/activity_cost.json b/erpnext/projects/doctype/activity_cost/activity_cost.json
index bdc147e..fafea58 100644
--- a/erpnext/projects/doctype/activity_cost/activity_cost.json
+++ b/erpnext/projects/doctype/activity_cost/activity_cost.json
@@ -11,41 +11,6 @@
  "fields": [
   {
    "allow_on_submit": 0, 
-   "fieldname": "employee", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "in_filter": 0, 
-   "in_list_view": 0, 
-   "label": "Employee", 
-   "no_copy": 0, 
-   "options": "Employee", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "read_only": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0
-  }, 
-  {
-   "fieldname": "employee_name", 
-   "fieldtype": "Data", 
-   "label": "Employee Name", 
-   "options": "", 
-   "permlevel": 0, 
-   "precision": "", 
-   "read_only": 1
-  }, 
-  {
-   "fieldname": "column_break_2", 
-   "fieldtype": "Column Break", 
-   "permlevel": 0, 
-   "precision": ""
-  }, 
-  {
-   "allow_on_submit": 0, 
    "fieldname": "activity_type", 
    "fieldtype": "Link", 
    "hidden": 0, 
@@ -65,6 +30,41 @@
    "set_only_once": 0
   }, 
   {
+   "fieldname": "column_break_2", 
+   "fieldtype": "Column Break", 
+   "permlevel": 0, 
+   "precision": ""
+  }, 
+  {
+   "allow_on_submit": 0, 
+   "fieldname": "employee", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Employee", 
+   "no_copy": 0, 
+   "options": "Employee", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "read_only": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0
+  }, 
+  {
+   "fieldname": "employee_name", 
+   "fieldtype": "Data", 
+   "label": "Employee Name", 
+   "options": "", 
+   "permlevel": 0, 
+   "precision": "", 
+   "read_only": 1
+  }, 
+  {
    "fieldname": "section_break_4", 
    "fieldtype": "Section Break", 
    "permlevel": 0, 
@@ -136,7 +136,7 @@
  "is_submittable": 0, 
  "issingle": 0, 
  "istable": 0, 
- "modified": "2015-06-11 06:50:47.999788", 
+ "modified": "2015-06-16 03:12:25.644839", 
  "modified_by": "Administrator", 
  "module": "Projects", 
  "name": "Activity Cost", 
diff --git a/erpnext/projects/doctype/activity_cost/activity_cost.py b/erpnext/projects/doctype/activity_cost/activity_cost.py
index 8cd04f5..862a707 100644
--- a/erpnext/projects/doctype/activity_cost/activity_cost.py
+++ b/erpnext/projects/doctype/activity_cost/activity_cost.py
@@ -15,12 +15,21 @@
 		self.check_unique()
 		
 	def set_title(self):
-		if not self.employee_name:
-			self.employee_name = frappe.db.get_value("Employee", self.employee, "employee_name")
-		self.title = _("{0} for {1}").format(self.employee_name, self.activity_type)
-		
+		if self.employee:
+			if not self.employee_name:
+				self.employee_name = frappe.db.get_value("Employee", self.employee, "employee_name")
+			self.title = _("{0} for {1}").format(self.employee_name, self.activity_type)
+		else:
+			self.title = self.activity_type
+
 	def check_unique(self):
-		if frappe.db.sql("""select name from `tabActivity Cost` where employee_name= %s and activity_type= %s and name != %s""",
-			(self.employee_name, self.activity_type, self.name)):
-				frappe.throw(_("Activity Cost exists for Employee {0} against Activity Type - {1}")
-					.format(self.employee, self.activity_type), DuplicationError)
+		if self.employee:
+			if frappe.db.sql("""select name from `tabActivity Cost` where employee_name= %s and activity_type= %s and name != %s""",
+				(self.employee_name, self.activity_type, self.name)):
+					frappe.throw(_("Activity Cost exists for Employee {0} against Activity Type - {1}")
+						.format(self.employee, self.activity_type), DuplicationError)
+		else:
+			if frappe.db.sql("""select name from `tabActivity Cost` where ifnull(employee, '')='' and activity_type= %s and name != %s""",
+				(self.activity_type, self.name)):
+					frappe.throw(_("Default Activity Cost exists for Activity Type - {0}")
+						.format(self.activity_type), DuplicationError)
diff --git a/erpnext/projects/doctype/time_log/time_log.py b/erpnext/projects/doctype/time_log/time_log.py
index aa5647e..841ef28 100644
--- a/erpnext/projects/doctype/time_log/time_log.py
+++ b/erpnext/projects/doctype/time_log/time_log.py
@@ -272,4 +272,7 @@
 def get_activity_cost(employee=None, activity_type=None):
 	rate = frappe.db.sql("""select costing_rate, billing_rate from `tabActivity Cost` where employee= %s
 		and activity_type= %s""", (employee, activity_type), as_dict=1)
+	if not rate:
+		rate = frappe.db.sql("""select costing_rate, billing_rate from `tabActivity Cost` where ifnull(employee, '')=''
+			and activity_type= %s""", (activity_type), as_dict=1)
 	return rate[0] if rate else {}
diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json
index 056801d..b2e74b3 100644
--- a/erpnext/selling/doctype/quotation/quotation.json
+++ b/erpnext/selling/doctype/quotation/quotation.json
@@ -488,7 +488,7 @@
   {
    "fieldname": "base_discount_amount", 
    "fieldtype": "Currency", 
-   "label": "Discount Amount (Company Currency)", 
+   "label": "Additional Discount Amount (Company Currency)", 
    "options": "Company:company:default_currency", 
    "permlevel": 0, 
    "precision": "", 
@@ -858,7 +858,7 @@
  "idx": 1, 
  "is_submittable": 1, 
  "max_attachments": 1, 
- "modified": "2015-05-27 02:48:00.388847", 
+ "modified": "2015-06-15 15:37:39.199814", 
  "modified_by": "Administrator", 
  "module": "Selling", 
  "name": "Quotation", 
diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json
index a09fab6..ad62d57 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.json
+++ b/erpnext/selling/doctype/sales_order/sales_order.json
@@ -493,7 +493,7 @@
   {
    "fieldname": "base_discount_amount", 
    "fieldtype": "Currency", 
-   "label": "Discount Amount (Company Currency)", 
+   "label": "Additional Discount Amount (Company Currency)", 
    "options": "Company:company:default_currency", 
    "permlevel": 0, 
    "precision": "", 
@@ -1080,7 +1080,7 @@
  "idx": 1, 
  "is_submittable": 1, 
  "issingle": 0, 
- "modified": "2015-05-27 02:48:01.160307", 
+ "modified": "2015-06-15 15:36:38.898462", 
  "modified_by": "Administrator", 
  "module": "Selling", 
  "name": "Sales Order", 
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json
index 13c16e7..d356912 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.json
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.json
@@ -517,7 +517,7 @@
   {
    "fieldname": "base_discount_amount", 
    "fieldtype": "Currency", 
-   "label": "Discount Amount (Company Currency)", 
+   "label": "Additional Discount Amount (Company Currency)", 
    "options": "Company:company:default_currency", 
    "permlevel": 0, 
    "precision": "", 
@@ -1070,7 +1070,7 @@
  "idx": 1, 
  "in_create": 0, 
  "is_submittable": 1, 
- "modified": "2015-05-27 02:47:59.778147", 
+ "modified": "2015-06-15 15:37:54.699371", 
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Delivery Note", 
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
index 63bf4a6..c1a3538 100755
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
@@ -443,7 +443,7 @@
   {
    "fieldname": "base_discount_amount", 
    "fieldtype": "Currency", 
-   "label": "Discount Amount (Company Currency)", 
+   "label": "Additional Discount Amount (Company Currency)", 
    "options": "Company:company:default_currency", 
    "permlevel": 0, 
    "precision": "", 
@@ -854,7 +854,7 @@
  "icon": "icon-truck", 
  "idx": 1, 
  "is_submittable": 1, 
- "modified": "2015-05-27 02:48:00.763945", 
+ "modified": "2015-06-15 15:38:43.754869", 
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Purchase Receipt", 
diff --git a/setup.py b/setup.py
index 103dd77..86e89f9 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = "5.0.24"
+version = "5.0.25"
 
 with open("requirements.txt", "r") as f:
 	install_requires = f.readlines()