diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js
index 412833b..ad5a840 100644
--- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js
+++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js
@@ -4,9 +4,14 @@
 frappe.provide("erpnext.accounts");
 erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationController extends frappe.ui.form.Controller {
 	onload() {
-		var me = this;
+		const default_company = frappe.defaults.get_default('company');
+		this.frm.set_value('company', default_company);
 
-		this.frm.set_query("party_type", function() {
+		this.frm.set_value('party_type', '');
+		this.frm.set_value('party', '');
+		this.frm.set_value('receivable_payable_account', '');
+
+		this.frm.set_query("party_type", () => {
 			return {
 				"filters": {
 					"name": ["in", Object.keys(frappe.boot.party_account_types)],
@@ -14,44 +19,30 @@
 			}
 		});
 
-		this.frm.set_query('receivable_payable_account', function() {
-			check_mandatory(me.frm);
+		this.frm.set_query('receivable_payable_account', () => {
 			return {
 				filters: {
-					"company": me.frm.doc.company,
+					"company": this.frm.doc.company,
 					"is_group": 0,
-					"account_type": frappe.boot.party_account_types[me.frm.doc.party_type]
+					"account_type": frappe.boot.party_account_types[this.frm.doc.party_type]
 				}
 			};
 		});
 
-		this.frm.set_query('bank_cash_account', function() {
-			check_mandatory(me.frm, true);
+		this.frm.set_query('bank_cash_account', () => {
 			return {
 				filters:[
-					['Account', 'company', '=', me.frm.doc.company],
+					['Account', 'company', '=', this.frm.doc.company],
 					['Account', 'is_group', '=', 0],
 					['Account', 'account_type', 'in', ['Bank', 'Cash']]
 				]
 			};
 		});
-
-		this.frm.set_value('party_type', '');
-		this.frm.set_value('party', '');
-		this.frm.set_value('receivable_payable_account', '');
-
-		var check_mandatory = (frm, only_company=false) => {
-			var title = __("Mandatory");
-			if (only_company && !frm.doc.company) {
-				frappe.throw({message: __("Please Select a Company First"), title: title});
-			} else if (!frm.doc.company || !frm.doc.party_type) {
-				frappe.throw({message: __("Please Select Both Company and Party Type First"), title: title});
-			}
-		};
 	}
 
 	refresh() {
 		this.frm.disable_save();
+
 		this.frm.set_df_property('invoices', 'cannot_delete_rows', true);
 		this.frm.set_df_property('payments', 'cannot_delete_rows', true);
 		this.frm.set_df_property('allocation', 'cannot_delete_rows', true);
@@ -85,76 +76,92 @@
 	}
 
 	company() {
-		var me = this;
+		this.frm.set_value('party', '');
 		this.frm.set_value('receivable_payable_account', '');
-		me.frm.clear_table("allocation");
-		me.frm.clear_table("invoices");
-		me.frm.clear_table("payments");
-		me.frm.refresh_fields();
-		me.frm.trigger('party');
+	}
+
+	party_type() {
+		this.frm.set_value('party', '');
 	}
 
 	party() {
-		var me = this;
-		if (!me.frm.doc.receivable_payable_account && me.frm.doc.party_type && me.frm.doc.party) {
+		this.frm.set_value('receivable_payable_account', '');
+		this.frm.trigger("clear_child_tables");
+
+		if (!this.frm.doc.receivable_payable_account && this.frm.doc.party_type && this.frm.doc.party) {
 			return frappe.call({
 				method: "erpnext.accounts.party.get_party_account",
 				args: {
-					company: me.frm.doc.company,
-					party_type: me.frm.doc.party_type,
-					party: me.frm.doc.party
+					company: this.frm.doc.company,
+					party_type: this.frm.doc.party_type,
+					party: this.frm.doc.party
 				},
-				callback: function(r) {
+				callback: (r) => {
 					if (!r.exc && r.message) {
-						me.frm.set_value("receivable_payable_account", r.message);
+						this.frm.set_value("receivable_payable_account", r.message);
 					}
-					me.frm.refresh();
+					this.frm.refresh();
+
 				}
 			});
 		}
 	}
 
+	receivable_payable_account() {
+		this.frm.trigger("clear_child_tables");
+		this.frm.refresh();
+	}
+
+	clear_child_tables() {
+		this.frm.clear_table("invoices");
+		this.frm.clear_table("payments");
+		this.frm.clear_table("allocation");
+		this.frm.refresh_fields();
+	}
+
 	get_unreconciled_entries() {
-		var me = this;
+		this.frm.clear_table("allocation");
 		return this.frm.call({
-			doc: me.frm.doc,
+			doc: this.frm.doc,
 			method: 'get_unreconciled_entries',
-			callback: function(r, rt) {
-				if (!(me.frm.doc.payments.length || me.frm.doc.invoices.length)) {
-					frappe.throw({message: __("No invoice and payment records found for this party")});
+			callback: () => {
+				if (!(this.frm.doc.payments.length || this.frm.doc.invoices.length)) {
+					frappe.throw({message: __("No Unreconciled Invoices and Payments found for this party and account")});
+				} else if (!(this.frm.doc.invoices.length)) {
+					frappe.throw({message: __("No Outstanding Invoices found for this party")});
+				} else if (!(this.frm.doc.payments.length)) {
+					frappe.throw({message: __("No Unreconciled Payments found for this party")});
 				}
-				me.frm.refresh();
+				this.frm.refresh();
 			}
 		});
 
 	}
 
 	allocate() {
-		var me = this;
-		let payments = me.frm.fields_dict.payments.grid.get_selected_children();
+		let payments = this.frm.fields_dict.payments.grid.get_selected_children();
 		if (!(payments.length)) {
-			payments = me.frm.doc.payments;
+			payments = this.frm.doc.payments;
 		}
-		let invoices = me.frm.fields_dict.invoices.grid.get_selected_children();
+		let invoices = this.frm.fields_dict.invoices.grid.get_selected_children();
 		if (!(invoices.length)) {
-			invoices = me.frm.doc.invoices;
+			invoices = this.frm.doc.invoices;
 		}
-		return me.frm.call({
-			doc: me.frm.doc,
+		return this.frm.call({
+			doc: this.frm.doc,
 			method: 'allocate_entries',
 			args: {
 				payments: payments,
 				invoices: invoices
 			},
-			callback: function() {
-				me.frm.refresh();
+			callback: () => {
+				this.frm.refresh();
 			}
 		});
 	}
 
 	reconcile() {
-		var me = this;
-		var show_dialog = me.frm.doc.allocation.filter(d => d.difference_amount && !d.difference_account);
+		var show_dialog = this.frm.doc.allocation.filter(d => d.difference_amount && !d.difference_account);
 
 		if (show_dialog && show_dialog.length) {
 
@@ -186,10 +193,10 @@
 							label: __("Difference Account"),
 							fieldname: 'difference_account',
 							reqd: 1,
-							get_query: function() {
+							get_query: () => {
 								return {
 									filters: {
-										company: me.frm.doc.company,
+										company: this.frm.doc.company,
 										is_group: 0
 									}
 								}
@@ -203,7 +210,7 @@
 						}]
 					},
 				],
-				primary_action: function() {
+				primary_action: () => {
 					const args = dialog.get_values()["allocation"];
 
 					args.forEach(d => {
@@ -211,7 +218,7 @@
 							"difference_account", d.difference_account);
 					});
 
-					me.reconcile_payment_entries();
+					this.reconcile_payment_entries();
 					dialog.hide();
 				},
 				primary_action_label: __('Reconcile Entries')
@@ -237,15 +244,12 @@
 	}
 
 	reconcile_payment_entries() {
-		var me = this;
-
 		return this.frm.call({
-			doc: me.frm.doc,
+			doc: this.frm.doc,
 			method: 'reconcile',
-			callback: function(r, rt) {
-				me.frm.clear_table("allocation");
-				me.frm.refresh_fields();
-				me.frm.refresh();
+			callback: () => {
+				this.frm.clear_table("allocation");
+				this.frm.refresh();
 			}
 		});
 	}
diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py
index fdd8d09..fb23d6f 100644
--- a/erpnext/accounts/utils.py
+++ b/erpnext/accounts/utils.py
@@ -450,7 +450,8 @@
 
 	# new row with references
 	new_row = journal_entry.append("accounts")
-	new_row.update(jv_detail.as_dict().copy())
+
+	new_row.update((frappe.copy_doc(jv_detail)).as_dict())
 
 	new_row.set(d["dr_or_cr"], d["allocated_amount"])
 	new_row.set('debit' if d['dr_or_cr'] == 'debit_in_account_currency' else 'credit',
