[fix] Precision issue for field conversion rate in POS
diff --git a/erpnext/public/js/controllers/taxes_and_totals.js b/erpnext/public/js/controllers/taxes_and_totals.js
index 8e14922..2892412 100644
--- a/erpnext/public/js/controllers/taxes_and_totals.js
+++ b/erpnext/public/js/controllers/taxes_and_totals.js
@@ -72,7 +72,7 @@
 	},
 
 	validate_conversion_rate: function() {
-		this.frm.doc.conversion_rate = flt(this.frm.doc.conversion_rate, precision("conversion_rate"));
+		this.frm.doc.conversion_rate = flt(this.frm.doc.conversion_rate, (cur_frm) ? precision("conversion_rate") : 9);
 		var conversion_rate_label = frappe.meta.get_label(this.frm.doc.doctype, "conversion_rate",
 			this.frm.doc.name);
 		var company_currency = this.frm.doc.currency || this.get_company_currency();
@@ -573,7 +573,7 @@
 				this.frm.doc.paid_amount : this.frm.doc.base_paid_amount;
 
 			this.frm.doc.outstanding_amount =  flt(total_amount_to_pay - flt(paid_amount) + 
-				flt(this.frm.doc.change_amount), precision("outstanding_amount"));
+				flt(this.frm.doc.change_amount * this.frm.doc.conversion_rate), precision("outstanding_amount"));
 
 		} else if(this.frm.doc.doctype == "Purchase Invoice") {
 			this.frm.doc.outstanding_amount = flt(total_amount_to_pay, precision("outstanding_amount"));
diff --git a/erpnext/public/js/payment/payments.js b/erpnext/public/js/payment/payments.js
index 23db61f..4fa0390 100644
--- a/erpnext/public/js/payment/payments.js
+++ b/erpnext/public/js/payment/payments.js
@@ -84,7 +84,7 @@
 		this.payment_val = 0.0
 		if(this.frm.doc.outstanding_amount > 0 && flt(this.selected_mode.val()) == 0.0){
 			//When user first time click on row
-			this.payment_val = flt(this.frm.doc.outstanding_amount)
+			this.payment_val = flt(this.frm.doc.outstanding_amount / this.frm.doc.conversion_rate, precision("outstanding_amount"))
 			this.selected_mode.val(format_number(this.payment_val, 2));
 			this.update_payment_amount()
 		}else if(flt(this.selected_mode.val()) > 0){
@@ -200,7 +200,7 @@
 				me.change_amount(value)
 			} else{
 				if(value == 0 && update_write_off) {
-					value = me.frm.doc.outstanding_amount;
+					value = flt(me.frm.doc.outstanding_amount / me.frm.doc.conversion_rate, precision(me.idx));
 				}
 				me.write_off_amount(value)
 			}
@@ -227,7 +227,7 @@
 		$(this.$body).find(".write_off_amount").val(format_number(this.frm.doc.write_off_amount, precision("write_off_amount")));
 		$(this.$body).find('.paid_amount').text(format_currency(this.frm.doc.paid_amount, this.frm.doc.currency));
 		$(this.$body).find('.change_amount').val(format_number(this.frm.doc.change_amount, precision("change_amount")))
-		$(this.$body).find('.outstanding_amount').text(format_currency(this.frm.doc.outstanding_amount, this.frm.doc.currency))
+		$(this.$body).find('.outstanding_amount').text(format_currency(this.frm.doc.outstanding_amount, frappe.get_doc(":Company", this.frm.doc.company).default_currency))
 		this.update_invoice();
 	}
 })
\ No newline at end of file