[flat discount] added flat discount in pos
diff --git a/accounts/doctype/sales_invoice/pos.js b/accounts/doctype/sales_invoice/pos.js
index adbdca1..81f6ae9 100644
--- a/accounts/doctype/sales_invoice/pos.js
+++ b/accounts/doctype/sales_invoice/pos.js
@@ -30,12 +30,14 @@
 						</div>\
 						<br>\
 						<div class="totals-area" style="margin-left: 40%;">\
-							<table class="table table-condensed">\
-								<tr>\
-									<td><b>Net Total</b></td>\
-									<td style="text-align: right;" class="net-total"></td>\
-								</tr>\
-							</table>\
+							<div class="net-total-area">\
+								<table class="table table-condensed">\
+									<tr>\
+										<td><b>Net Total</b></td>\
+										<td style="text-align: right;" class="net-total"></td>\
+									</tr>\
+								</table>\
+							</div>\
 							<div class="tax-table" style="display: none;">\
 								<table class="table table-condensed">\
 									<thead>\
@@ -48,6 +50,17 @@
 									</tbody>\
 								</table>\
 							</div>\
+							<div class="flat-discount-area">\
+								<table class="table table-condensed">\
+									<tr>\
+										<td style="vertical-align: middle;"><b>Flat Discount</b></td>\
+										<td style="text-align: right;">\
+											<input type="text" class="form-control flat-discount" \
+												style="text-align: right;">\
+										</td>\
+									</tr>\
+								</table>\
+							</div>\
 							<div class="grand-total-area">\
 								<table class="table table-condensed">\
 									<tr>\
@@ -82,6 +95,10 @@
 			me.refresh();
 		});
 
+		this.wrapper.find('input.flat-discount').on("change", function() {
+			wn.model.set_value(me.frm.doctype, me.frm.docname, "flat_discount", this.value);
+		});
+
 		this.call_function("delete-items", function() {me.remove_selected_item();});
 		this.call_function("make-payment", function() {me.make_payment();});
 	},
@@ -112,9 +129,9 @@
 	},
 	make: function() {
 		this.make_party();
-		this.make_item_group();
-		this.make_search();
 		this.make_barcode();
+		this.make_search();
+		this.make_item_group();
 		this.make_item_list();
 	},
 	make_party: function() {
@@ -137,23 +154,23 @@
 					me.party.toLowerCase(), this.value);
 		});
 	},
-	make_item_group: function() {
+	make_barcode: function() {
 		var me = this;
-		this.item_group = wn.ui.form.make_control({
+		this.barcode = wn.ui.form.make_control({
 			df: {
-				"fieldtype": "Link",
-				"options": "Item Group",
-				"label": "Item Group",
-				"fieldname": "pos_item_group",
-				"placeholder": "Item Group"
+				"fieldtype": "Data",
+				"label": "Barcode",
+				"fieldname": "pos_barcode",
+				"placeholder": "Barcode / Serial No"
 			},
-			parent: this.wrapper.find(".item-group-area"),
+			parent: this.wrapper.find(".barcode-area"),
 			only_input: true,
 		});
-		this.item_group.make_input();
-		this.item_group.$input.on("change", function() {
-			if(!me.item_group.autocomplete_open)
-				me.make_item_list();
+		this.barcode.make_input();
+		this.barcode.$input.on("keypress", function() {
+			if(me.barcode_timeout)
+				clearTimeout(me.barcode_timeout);
+			me.barcode_timeout = setTimeout(function() { me.add_item_thru_barcode(); }, 1000);
 		});
 	},
 	make_search: function() {
@@ -176,23 +193,23 @@
 				me.item_timeout = setTimeout(function() { me.make_item_list(); }, 1000);
 		});
 	},
-	make_barcode: function() {
+	make_item_group: function() {
 		var me = this;
-		this.barcode = wn.ui.form.make_control({
+		this.item_group = wn.ui.form.make_control({
 			df: {
-				"fieldtype": "Data",
-				"label": "Barcode",
-				"fieldname": "pos_barcode",
-				"placeholder": "Barcode / Serial No"
+				"fieldtype": "Link",
+				"options": "Item Group",
+				"label": "Item Group",
+				"fieldname": "pos_item_group",
+				"placeholder": "Item Group"
 			},
-			parent: this.wrapper.find(".barcode-area"),
+			parent: this.wrapper.find(".item-group-area"),
 			only_input: true,
 		});
-		this.barcode.make_input();
-		this.barcode.$input.on("keypress", function() {
-			if(me.barcode_timeout)
-				clearTimeout(me.barcode_timeout);
-			me.barcode_timeout = setTimeout(function() { me.add_item_thru_barcode(); }, 1000);
+		this.item_group.make_input();
+		this.item_group.$input.on("change", function() {
+			if(!me.item_group.autocomplete_open)
+				me.make_item_list();
 		});
 	},
 	make_item_list: function() {
@@ -321,6 +338,7 @@
 	refresh: function() {
 		var me = this;
 		this.party_field.set_input(this.frm.doc[this.party.toLowerCase()]);
+		this.wrapper.find('input.flat-discount').val(this.frm.doc.flat_discount);
 		this.barcode.set_input("");
 
 		this.show_items_in_item_cart();
diff --git a/patches/patch_list.py b/patches/patch_list.py
index 608ba77..b567eb1 100644
--- a/patches/patch_list.py
+++ b/patches/patch_list.py
@@ -173,18 +173,18 @@
 	"patches.july_2013.p05_custom_doctypes_in_list_view",
 	"patches.july_2013.p06_same_sales_rate",
 	"patches.july_2013.p07_repost_billed_amt_in_sales_cycle",
-	"execute:webnotes.reload_doc('accounts', 'Print Format', 'Sales Invoice Classic') # 2013-07-22",
-	"execute:webnotes.reload_doc('accounts', 'Print Format', 'Sales Invoice Modern') # 2013-07-22",
-	"execute:webnotes.reload_doc('accounts', 'Print Format', 'Sales Invoice Spartan') # 2013-07-22",
-	"execute:webnotes.reload_doc('selling', 'Print Format', 'Quotation Classic') # 2013-07-22",
-	"execute:webnotes.reload_doc('selling', 'Print Format', 'Quotation Modern') # 2013-07-22",
-	"execute:webnotes.reload_doc('selling', 'Print Format', 'Quotation Spartan') # 2013-07-22",
-	"execute:webnotes.reload_doc('selling', 'Print Format', 'Sales Order Classic') # 2013-07-22",
-	"execute:webnotes.reload_doc('selling', 'Print Format', 'Sales Order Modern') # 2013-07-22",
-	"execute:webnotes.reload_doc('selling', 'Print Format', 'Sales Order Spartan') # 2013-07-22",
-	"execute:webnotes.reload_doc('stock', 'Print Format', 'Delivery Note Classic') # 2013-07-22",
-	"execute:webnotes.reload_doc('stock', 'Print Format', 'Delivery Note Modern') # 2013-07-22",
-	"execute:webnotes.reload_doc('stock', 'Print Format', 'Delivery Note Spartan') # 2013-07-22",
+	"execute:webnotes.reload_doc('accounts', 'Print Format', 'Sales Invoice Classic') # 2013-12-26",
+	"execute:webnotes.reload_doc('accounts', 'Print Format', 'Sales Invoice Modern') # 2013-12-26",
+	"execute:webnotes.reload_doc('accounts', 'Print Format', 'Sales Invoice Spartan') # 2013-12-26",
+	"execute:webnotes.reload_doc('selling', 'Print Format', 'Quotation Classic') # 2013-12-26",
+	"execute:webnotes.reload_doc('selling', 'Print Format', 'Quotation Modern') # 2013-12-26",
+	"execute:webnotes.reload_doc('selling', 'Print Format', 'Quotation Spartan') # 2013-12-26",
+	"execute:webnotes.reload_doc('selling', 'Print Format', 'Sales Order Classic') # 2013-12-26",
+	"execute:webnotes.reload_doc('selling', 'Print Format', 'Sales Order Modern') # 2013-12-26",
+	"execute:webnotes.reload_doc('selling', 'Print Format', 'Sales Order Spartan') # 2013-12-26",
+	"execute:webnotes.reload_doc('stock', 'Print Format', 'Delivery Note Classic') # 2013-12-26",
+	"execute:webnotes.reload_doc('stock', 'Print Format', 'Delivery Note Modern') # 2013-12-26",
+	"execute:webnotes.reload_doc('stock', 'Print Format', 'Delivery Note Spartan') # 2013-12-26",
 	"patches.july_2013.p08_custom_print_format_net_total_export",
 	"patches.july_2013.p09_remove_website_pyc",
 	"patches.july_2013.p10_change_partner_user_to_website_user",
@@ -263,4 +263,9 @@
 	"patches.1311.p08_email_digest_recipients",
 	"execute:webnotes.delete_doc('DocType', 'Warehouse Type')",
 	"patches.1312.p02_update_item_details_in_item_price",
+	"execute:webnotes.reload_doc('accounts', 'Print Format', 'POS Invoice') # 2013-12-26",
+	"execute:webnotes.reload_doc('accounts', 'doctype', 'sales_invoice') # 2013-12-26",
+	"execute:webnotes.reload_doc('selling', 'doctype', 'sales_order') # 2013-12-26",
+	"execute:webnotes.reload_doc('selling', 'doctype', 'quotation') # 2013-12-26",
+	"execute:webnotes.reload_doc('stock', 'doctype', 'delivery_note') # 2013-12-26",
 ]
\ No newline at end of file