Set received amount based on paid amount if currency is same
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js
index a5fbfba..d155ecd 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.js
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js
@@ -414,10 +414,7 @@
 
 	paid_amount: function(frm) {
 		frm.set_value("base_paid_amount", flt(frm.doc.paid_amount) * flt(frm.doc.source_exchange_rate));
-
 		frm.trigger("reset_received_amount");
-
-		frm.set_paid_amount_based_on_received_amount = false;
 	},
 
 	received_amount: function(frm) {
@@ -436,22 +433,19 @@
 			frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.received_amount);
 		else
 			frm.events.set_difference_amount(frm);
+		
+		frm.set_paid_amount_based_on_received_amount = false;
 	},
 	
 	reset_received_amount: function(frm) {
 		if(!frm.set_paid_amount_based_on_received_amount &&
 				(frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency)) {
 			
-			// var total_deductions = frappe.utils.sum($.map(frm.doc.deductions || [],
-			// 	function(d) { return d.amount}));
-			//
-			// var received_amount = frm.doc.paid_amount +
-			// 	flt(total_deductions) / flt(frm.doc.source_exchange_rate);
-			//
 			frm.set_value("received_amount", frm.doc.paid_amount);
 			frm.set_value("target_exchange_rate", frm.doc.source_exchange_rate);
 			frm.set_value("base_received_amount", frm.doc.base_paid_amount);
 		}
+		
 		if(frm.doc.payment_type == "Receive")
 			frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.paid_amount);
 		else
@@ -611,7 +605,6 @@
 			if(frm.doc.total_allocated_amount < party_amount)
 				unallocated_amount = party_amount - frm.doc.total_allocated_amount;
 		}
-
 		frm.set_value("unallocated_amount", unallocated_amount);
 
 		var difference_amount = 0;
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index af5790f..06bc635 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -10,6 +10,7 @@
  "docstatus": 0, 
  "doctype": "DocType", 
  "document_type": "", 
+ "editable_grid": 0, 
  "fields": [
   {
    "allow_on_submit": 0, 
@@ -1135,7 +1136,7 @@
    "no_copy": 0, 
    "permlevel": 0, 
    "precision": "2", 
-   "print_hide": 0, 
+   "print_hide": 1, 
    "print_hide_if_no_value": 0, 
    "read_only": 1, 
    "report_hide": 0, 
@@ -3676,7 +3677,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2016-07-07 13:40:27.977803", 
+ "modified": "2016-08-03 11:50:49.680278", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Sales Invoice",