diff --git a/app/controllers/transactions/sales_controller.rb b/app/controllers/transactions/sales_controller.rb
index fed62a34..0a069b1b 100644
--- a/app/controllers/transactions/sales_controller.rb
+++ b/app/controllers/transactions/sales_controller.rb
@@ -53,13 +53,7 @@ class Transactions::SalesController < ApplicationController
#get customer amount
@customer = Customer.find(@sale.customer_id)
- response = Customer.get_member_account(@customer)
-
- if(response["status"] == true)
- @membership = response["data"]
- else
- @membership = 0
- end
+ @response = Customer.get_membership_transactions(@customer)
#end customer amount
respond_to do |format|
diff --git a/app/views/crm/customers/show.html.erb b/app/views/crm/customers/show.html.erb
index 6f61e3cb..5bdb9703 100644
--- a/app/views/crm/customers/show.html.erb
+++ b/app/views/crm/customers/show.html.erb
@@ -47,7 +47,7 @@
Redeem |
Rebate |
Balance |
- Account No |
+
Status |
Receipt No |
@@ -60,7 +60,7 @@
<%= transaction["redeem"]%> |
<%= transaction["rebate"] %> |
<%= transaction["balance"] %> |
- <%= transaction["account_no"] %> |
+
<%= transaction["status"] %> |
<%= transaction["receipt_no"] %> |
diff --git a/app/views/transactions/sales/show.html.erb b/app/views/transactions/sales/show.html.erb
index 7fdec433..04343380 100644
--- a/app/views/transactions/sales/show.html.erb
+++ b/app/views/transactions/sales/show.html.erb
@@ -175,63 +175,63 @@
-
-
-
-
-
-
Customer Profile
-
-
-
-
- | Name |
- <%= @customer.name %> |
-
-
- | Email |
- <%= @customer.email %> |
-
-
- | Contact no |
- <%= @customer.contact_no %> |
-
-
- | Company |
- <%= @customer.company %> |
-
-
- | Date Of Birth |
- <%= @customer.date_of_birth %> |
-
-
-
-
-
-
-
-
Membership Detail
-
-
-
- <% if @membership == 0 %>
-
- | "There is no membership data" |
-
- <% else %>
- <% @membership.each do |member| %>
-
- | <%= member["accountable_type"] %> |
- <%= member["balance"] %> |
-
- <% end %>
-
- <% end %>
-
-
-
-
-
+
+
+
+
+
+ | Card No |
+ Name |
+ Company |
+ Contact no |
+ Email |
+ NRC/Passport No |
+ Address |
+ DOB |
+
+
+
+
+
+ | <%= @customer.card_no rescue '-'%> |
+ <%= @customer.name %> |
+ <%= @customer.company rescue '-' %> |
+ <%= @customer.contact_no %> |
+ <%= @customer.email %> |
+ <%= @customer.nrc_no %> |
+ <%= @customer.address%> |
+ <%= @customer.date_of_birth %> |
+
+
+ | Membership Transactions |
+
+
+ | Date |
+ Redeem |
+ Rebate |
+ Balance |
+
+ Status |
+ Receipt No |
+
+
+ <%
+ if @response["status"] == true %>
+ <% @response["data"].each do |transaction| %>
+
+ | <%= transaction["date"]%> |
+ <%= transaction["redeem"]%> |
+ <%= transaction["rebate"] %> |
+ <%= transaction["balance"] %> |
+
+ <%= transaction["status"] %> |
+ <%= transaction["receipt_no"] %> |
+
+
+ <% end %>
+ <% end %>
+
+