Loyalty Program (#12631)

* First Cut for the Loyalty Program

* finished the collection part

* redmeption for the loyalty point

	update the loyalty point entry in the FIFO style
	make the accounting entry knocking the debtors account against the expense account selected in the loyalty program
	update the outstanding balance in the client side

* completed for the desk viewe

* wrap up for the desk and shopping cart

* pos

* fix and test the travis
diff --git a/erpnext/templates/pages/order.py b/erpnext/templates/pages/order.py
index 2874047..70bd702 100644
--- a/erpnext/templates/pages/order.py
+++ b/erpnext/templates/pages/order.py
@@ -32,6 +32,13 @@
 
 	if not frappe.has_website_permission(context.doc):
 		frappe.throw(_("Not Permitted"), frappe.PermissionError)
+	
+	# check for the loyalty program of the customer
+	customer_loyalty_program = frappe.db.get_value("Customer", context.doc.customer, "loyalty_program")	
+	if customer_loyalty_program:
+		from erpnext.accounts.doctype.loyalty_program.loyalty_program import get_loyalty_program_details
+		loyalty_program_details = get_loyalty_program_details(context.doc.customer, customer_loyalty_program)
+		context.available_loyalty_points = int(loyalty_program_details.get("loyalty_points"))
 
 def get_attachments(dt, dn):
         return frappe.get_all("File",