diff --git a/app/assets/javascripts/origami.js b/app/assets/javascripts/origami.js index b39a4c6e..6149a2bc 100644 --- a/app/assets/javascripts/origami.js +++ b/app/assets/javascripts/origami.js @@ -227,20 +227,24 @@ $(document).ready(function(){ dataType: "json", success: function(data) { $("#customer_name").text(data["customer"].name); - $.each(data["response_data"]["data"], function (i) { - if(data["response_data"]["data"][i]["accountable_type"] == "RebateAccount"){ - var balance = data["response_data"]["data"][i]["balance"]; - if (data["response_data"]["status"]==true) { - $('.rebate_amount').removeClass('hide'); - row = - '' + data["response_data"]["data"][i]["accountable_type"] +'' - +'' + balance + ''; + if (data["response_data"]["data"].length) { + $.each(data["response_data"]["data"], function (i) { + if(data["response_data"]["data"][i]["accountable_type"] == "RebateAccount"){ + var balance = data["response_data"]["data"][i]["balance"]; + if (data["response_data"]["status"]==true) { + $('.rebate_amount').removeClass('hide'); + row = + '' + data["response_data"]["data"][i]["accountable_type"] +'' + +'' + balance + ''; - $(".rebate_amount").html(row); - } + $(".rebate_amount").html(row); + } - } - }); + } + }); + }else{ + $('.rebate_amount').addClass('hide'); + } } }); //End Ajax diff --git a/app/views/crm/customers/show.html.erb b/app/views/crm/customers/show.html.erb index d806ec34..04f3acf9 100644 --- a/app/views/crm/customers/show.html.erb +++ b/app/views/crm/customers/show.html.erb @@ -1,26 +1,8 @@
-
+
- - - - - -
-
-

Customer Profile

@@ -51,11 +33,8 @@
-
-
-
-
+

Membership Detail

@@ -78,8 +57,22 @@ + - + + + +

Order Details

@@ -114,9 +107,8 @@
-
-

Sale Details

+

Sale Details

@@ -146,7 +138,6 @@
-
diff --git a/app/views/transactions/orders/index.html.erb b/app/views/transactions/orders/index.html.erb index 29cd001c..80befdc1 100644 --- a/app/views/transactions/orders/index.html.erb +++ b/app/views/transactions/orders/index.html.erb @@ -34,7 +34,6 @@ Order status Order date Items Count - Action @@ -42,13 +41,13 @@ <% @orders.each do |order| %> - <%= order.order_id %> + <%= link_to order.order_id, transactions_order_path(order) %> <%= order.order_type %> <%= order.customer.name rescue '-' %> <%= order.status %> <%= order.date.strftime("%d-%m-%Y") %> <%= order.item_count %> - <%= link_to 'Show', transactions_order_path(order) %> + <% end %> diff --git a/app/views/transactions/orders/show.html.erb b/app/views/transactions/orders/show.html.erb index dc5bae88..e1127296 100644 --- a/app/views/transactions/orders/show.html.erb +++ b/app/views/transactions/orders/show.html.erb @@ -14,7 +14,7 @@
-
+
@@ -70,13 +70,16 @@ <% end %>
- - Back - +
+
diff --git a/app/views/transactions/sales/index.html.erb b/app/views/transactions/sales/index.html.erb index b7e73219..2f437f3c 100644 --- a/app/views/transactions/sales/index.html.erb +++ b/app/views/transactions/sales/index.html.erb @@ -36,7 +36,6 @@ Cashier Sales status Receipt Date - Action @@ -44,14 +43,13 @@ <% if @sales != 0 %> <% @sales.each do |sale| %> - <%= sale.sale_id %> + <%= link_to sale.sale_id, transactions_sale_path(sale) %> <%= sale.receipt_no %> <%= sale.grand_total rescue '-' %> <%= sale.total_tax %> <%= sale.cashier_name rescue '-' %> <%= sale.sale_status %> <%= sale.receipt_date.strftime("%d-%m-%Y") %> - <%= link_to 'Show', transactions_sale_path(sale) %> <% end %> <% else %> diff --git a/app/views/transactions/sales/show.html.erb b/app/views/transactions/sales/show.html.erb index 5f6365e5..5f4e8f6e 100644 --- a/app/views/transactions/sales/show.html.erb +++ b/app/views/transactions/sales/show.html.erb @@ -82,12 +82,13 @@ Discount <%= number_with_precision(@sale.total_discount, :precision => 2, :delimiter => ',') rescue ' '%> + <% @sale.sale_taxes.each do |r|%> - Tax - <%= number_with_precision(@sale.total_tax, :precision => 2, :delimiter => ',') rescue ' '%> + <%= r.tax_name %>(<%= r.tax_rate %>) + <%= number_with_precision(r.tax_payable_amount, :precision => 2, :delimiter => ',') rescue ' '%> - + <% end %> Grand Total @@ -99,21 +100,24 @@ Pay Amount <%= number_with_precision(@sale.amount_received, :precision => 2, :delimiter => ',') rescue ' '%> - - - Change - <%= number_with_precision(@sale.amount_changed, :precision => 2, :delimiter => ',') rescue ' '%> - + <% @sale_receivables.each do |r|%> Payment <%= r.payment_method rescue ' '%> <%= number_with_precision(r.payment_amount, :precision => 2, :delimiter => ',') rescue ' '%> - - + + <% end %> + + + + Change + <%= number_with_precision(@sale.amount_changed, :precision => 2, :delimiter => ',') rescue ' '%> + + @@ -160,7 +164,61 @@
- +
+
+
+

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 %> + + + + <% else %> + <% @membership.each do |member| %> + + + + + <% end %> + + <% end %> + +
"There is no membership data"
<%= member["accountable_type"] %><%= member["balance"] %>
+
+
+
@@ -169,16 +227,15 @@