diff --git a/app/controllers/origami/customers_controller.rb b/app/controllers/origami/customers_controller.rb index 6e275355..58f70faa 100755 --- a/app/controllers/origami/customers_controller.rb +++ b/app/controllers/origami/customers_controller.rb @@ -121,8 +121,9 @@ class Origami::CustomersController < BaseOrigamiController if status == true render json: JSON.generate({:status => true}) - # Re-calc All Amount in Sale - sale.compute_by_sale_items(sale.sale_id, sale.sale_items, sale.total_discount) + if(id == "SAL") + sale.compute_by_sale_items(sale.sale_id, sale.sale_items, sale.total_discount) + end else render json: JSON.generate({:status => false, :error_message => "Record not found"}) end diff --git a/app/views/crm/customers/show.html.erb b/app/views/crm/customers/show.html.erb index 6027eec6..338aea1d 100755 --- a/app/views/crm/customers/show.html.erb +++ b/app/views/crm/customers/show.html.erb @@ -68,27 +68,42 @@ <%= t("views.right_panel.detail.date") %> - <%= t("views.right_panel.detail.discount_amount") %> + <%= t("views.right_panel.detail.amount") %> - <%= t("views.right_panel.detail.from_account") %> <%= t("views.right_panel.detail.status") %> + <%= t("views.right_panel.detail.from_account") %> + <%= t("views.right_panel.detail.receipt_no") %> <% if @response["status"] == true %> - <% @response["data"].each do |transaction| %> - - <%= transaction["date"]%> - - <%= transaction["deposit"] %> - - <%= transaction["account_status"] %> - <%= transaction["status"] %> - <%= transaction["receipt_no"] %> - - - <% end %> + <% @response["data"].each do |transaction| %> + + <%= transaction["date"]%> + <% if transaction["status"] == 'Rebate' || transaction["status"] == 'Discount'%> + <%= transaction["deposit"] %> + <% else %> + (<%= transaction["withdraw"] %>) + <% end %> + <%= transaction["status"] %> + <%= transaction["account_status"] %> + <%= transaction["receipt_no"] %> + + <% end %> + <% if @response["data"].first["status"] != 'Discount'%> + + Balance + + <%= @response["data"].first["balance"] %> + + + <%end%> + <%else%> + +

There is no transaction coz of <%=@response["data"]%> ...

+ + <% end %> @@ -98,7 +113,7 @@
-

<%= t :order_details %>

+
<%= t :order_details %>
@@ -128,18 +143,20 @@
-

<%= t :sale_details %>

+
<%= t :sale_details %>
- - - - - - - + + + + + + + + + @@ -147,12 +164,14 @@ <% @sales.each do |sale| %> - - - - - - + + + + + + + + <% end %> @@ -165,9 +184,8 @@ diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index ece1d39a..38d93892 100755 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -27,7 +27,7 @@
<%= sale.receipt_no %> - <%= sale.sale_status %> + <%= sale.sale_status %>
<% end %> @@ -43,7 +43,7 @@
<%= table.name %> - billed + billed
@@ -55,7 +55,7 @@ <% end %>
<%= table.name %> - new + new
<% end %> @@ -63,7 +63,7 @@
<%= table.name %> - new + new
<% end %> @@ -81,9 +81,9 @@
<%= room.name %> <% if room.get_booking.nil? %> - billed + billed <% else %> - new + new <% end %>
@@ -91,7 +91,7 @@
<%= room.name %> - +
<% end %> @@ -134,6 +134,8 @@
INVOICE DETAILS | Table <%= @dining.name rescue "" %> Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %>
+ <% else %> + ORDER DETAILS | Table <%= @dining.name rescue "" %> <% end %>
@@ -154,7 +156,16 @@
<% elsif !@date.nil? %> -
+
+ Order No: + <% if @status_order == 'order' %> + <%= @obj_order.order_id rescue '' %> + + <% end %> + +
+
+
Date: <%= @date.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-' %>
@@ -162,15 +173,16 @@
- <% if !@sale_array.empty? %> + <% if @status_sale == 'sale' %> Customer : <%= @sale_array[0].customer.name rescue '' %> - <% else %> + <% elsif @status_order == 'order' + %> Customer : <%= @customer.name rescue "" %> <% end %> - <% end %> +
@@ -350,7 +362,7 @@ <% if @dining.status != "available" %> <% if @status_order == 'order' %> - +
<%= t("views.right_panel.detail.sale_id") %><%= t("views.right_panel.detail.receipt_no") %><%= t("views.right_panel.detail.grand_total") %><%= t("views.right_panel.detail.tax_amount") %><%= t :cashier %><%= t("views.right_panel.detail.sales_status") %><%= t("views.right_panel.detail.receipt_date") %><%= t("views.right_panel.detail.sale_id") %><%= t("views.right_panel.detail.receipt_no") %><%= t("views.right_panel.detail.total_discount") %><%= t("views.right_panel.detail.tax_amount") %><%= t("views.right_panel.detail.sub_total") %><%= t("views.right_panel.detail.grand_total") %><%= t :cashier %><%= t("views.right_panel.detail.sales_status") %><%= t("views.right_panel.detail.receipt_date") %>
<%= 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 %I:%m %p") %> <%= sale.receipt_no %><%= sale.total_discount %><%= sale.total_tax %><%= sale.total_amount %><%= sale.grand_total rescue '-' %><%= sale.cashier_name rescue '-' %> <%= sale.sale_status %> <%= sale.receipt_date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %>