[POS] Enhancement to set default payment as cash, functionality to clear amount value, renamed doctype Payments and some fixes.
diff --git a/erpnext/public/js/controllers/taxes_and_totals.js b/erpnext/public/js/controllers/taxes_and_totals.js
index f775f29..cf66501 100644
--- a/erpnext/public/js/controllers/taxes_and_totals.js
+++ b/erpnext/public/js/controllers/taxes_and_totals.js
@@ -577,7 +577,7 @@
 		var me = this;
 		var paid_amount = base_paid_amount = 0.0;
 		$.each(this.frm.doc['payments'] || [], function(index, data){
-			if(data.amount > 0){
+			if(data.amount > -1){
 				data.base_amount = flt(data.amount * me.frm.doc.conversion_rate);
 				paid_amount += data.amount;
 				base_paid_amount += data.base_amount;	
diff --git a/erpnext/public/js/payment/payment_details.html b/erpnext/public/js/payment/payment_details.html
index 00a2d93..18f9d03 100644
--- a/erpnext/public/js/payment/payment_details.html
+++ b/erpnext/public/js/payment/payment_details.html
@@ -1,9 +1,11 @@
 <div class="row pos-payment-row" type="{{type}}" idx={{idx}}>
-    <div class="col-xs-6"><h5 class="payment-mode text-ellipsis" idx="{{idx}}"> {{mode_of_payment}} </h5></div>
-	<div class="col-xs-6 text-right">
-		<input disabled data-fieldtype="Currency"
-			style="cursor: pointer;"
-			class="input-with-feedback form-control text-right amount"
-			idx="{{idx}}" type="text" value="{{format_number(amount, 2)}}">
+    <div class="col-xs-6">{{mode_of_payment}}</div>
+	<div class="col-xs-6">
+		<div class="input-group">
+			<input disabled class="form-control text-right amount" idx="{{idx}}" type="text" value="{{format_number(amount, 2)}}">
+			<span class="input-group-btn">
+				<button type="button" class="btn btn-default clr" idx="{{idx}}" style="border:1px solid #d1d8dd">C</button>
+			</span>
 		</div>
+	</div>
 </div>
\ No newline at end of file
diff --git a/erpnext/public/js/payment/payments.js b/erpnext/public/js/payment/payments.js
index f5527b1..4cd12f1 100644
--- a/erpnext/public/js/payment/payments.js
+++ b/erpnext/public/js/payment/payments.js
@@ -31,6 +31,7 @@
 		$(this.$body).html(frappe.render_template('pos_payment', this.frm.doc))
 		this.show_payment_details();
 		this.bind_keyboard_event()
+		this.clear_amount()
 	},
 
 	make_multimode_payment: function(){
@@ -57,11 +58,33 @@
 					currency: me.frm.doc.currency,
 					type: data.type
 				})).appendTo(multimode_payments)
+
+				if (data.type == 'Cash' && me.frm.doc.outstanding_amount > 0) {
+					me.idx = data.idx;
+					me.set_outstanding_amount();
+				}
 			})
 		}else{
 			$("<p>No payment mode selected in pos profile</p>").appendTo(multimode_payments)
 		}
 	},
+
+	set_outstanding_amount: function(){
+		this.selected_mode = $(this.$body).find(repl("input[idx='%(idx)s']",{'idx': this.idx}));
+		this.highlight_selected_row()
+		this.payment_val = 0.0
+		if(this.frm.doc.outstanding_amount > 0 && flt(this.selected_mode.val()) == 0.0){
+			//When user first tithis click on row
+			this.payment_val = flt(this.frm.doc.outstanding_amount)
+			this.selected_mode.val(format_number(this.payment_val, 2));
+			this.update_paid_amount()
+		}else if(flt(this.selected_mode.val()) > 0){
+			//If user click on existing row which has value
+			this.payment_val = flt(this.selected_mode.val());
+		}
+		this.selected_mode.select()
+		this.bind_amount_change_event();
+	},
 	
 	bind_keyboard_event: function(){
 		var me = this;
@@ -69,28 +92,15 @@
 		this.bind_payment_mode_keys_event();
 		this.bind_keyboard_keys_event();
 	},
-	
+
 	bind_payment_mode_keys_event: function(){
 		var me = this;
 		$(this.$body).find('.pos-payment-row').click(function(){
 			me.idx = $(this).attr("idx");
-			me.selected_mode = $(me.$body).find(repl("input[idx='%(idx)s']",{'idx': me.idx}));
-			me.highlight_selected_row()
-			me.payment_val = 0.0
-			if(me.frm.doc.outstanding_amount > 0 && flt(me.selected_mode.val()) == 0.0){
-				//When user first time click on row
-				me.payment_val = flt(me.frm.doc.outstanding_amount)
-				me.selected_mode.val(format_number(me.payment_val, 2));
-				me.update_paid_amount()
-			}else if(flt(me.selected_mode.val()) > 0){
-				//If user click on existing row which has value
-				me.payment_val = flt(me.selected_mode.val());
-			}
-			me.selected_mode.select()
-			me.bind_amount_change_event();
+			me.set_outstanding_amount()
 		})
 	},
-	
+
 	highlight_selected_row: function(){
 		var me = this;
 		selected_row = $(this.$body).find(repl(".pos-payment-row[idx='%(idx)s']",{'idx': this.idx}));
@@ -127,7 +137,19 @@
 			me.update_paid_amount()
 		})
 	},
-	
+
+	clear_amount: function(){
+		var me = this;
+		$(this.$body).find('.clr').click(function(e){
+			e.stopPropagation();
+			me.idx = $(this).attr("idx");
+			me.selected_mode = $(me.$body).find(repl("input[idx='%(idx)s']",{'idx': me.idx}));
+			me.payment_val = 0.0;
+			me.selected_mode.val(0.0);
+			me.update_paid_amount();
+		})
+	},
+
 	update_paid_amount: function(){
 		var me = this;
 		$.each(this.frm.doc.payments, function(index, data){
diff --git a/erpnext/public/js/pos/pos_invoice_list.html b/erpnext/public/js/pos/pos_invoice_list.html
index cb25072..c0b4764 100644
--- a/erpnext/public/js/pos/pos_invoice_list.html
+++ b/erpnext/public/js/pos/pos_invoice_list.html
@@ -1,6 +1,6 @@
 <div class="row list-row pos-invoice-list" invoice-name = "{{name}}">
-	<div class="col-xs-3">{%= sr %}</div>
-	<div class="col-xs-3">{%= customer %}</div>
-	<div class="col-xs-4 text-center">{%= grand_total %}</div>
+	<div class="col-xs-2">{%= sr %}</div>
+	<div class="col-xs-4">{%= customer %}</div>
 	<div class="col-xs-2 text-left"><span class="indicator {{data.indicator}}">{{ data.status }}</span></div>
+	<div class="col-xs-4 text-right">{%= grand_total %}</div>
 </div>
diff --git a/erpnext/public/less/erpnext.less b/erpnext/public/less/erpnext.less
index a9ef2d0..404540a 100644
--- a/erpnext/public/less/erpnext.less
+++ b/erpnext/public/less/erpnext.less
@@ -177,7 +177,8 @@
 
 .pos-payment-row {
 	border-bottom:1px solid #d1d8dd;
-    margin: 2px 0px 5px 0px;
+    	margin: 2px 0px 5px 0px;
+	height: 60px;
 }
 
 .pos-payment-row:hover, .pos-keyboard-key:hover{
@@ -196,10 +197,6 @@
 	border-color: #e8e8e8;
 }
 
-.amount {
-	margin-top: 5px;
-}
-
 .amount-label {
 	font-size: 16px;
 }