From 9b1bc61adc3b9dae171214660bd93421cda3069a Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Fri, 17 Nov 2017 09:47:09 +0630 Subject: [PATCH 1/3] update cus show --- app/views/crm/customers/show.html.erb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/views/crm/customers/show.html.erb b/app/views/crm/customers/show.html.erb index 6027eec6..101ed798 100755 --- a/app/views/crm/customers/show.html.erb +++ b/app/views/crm/customers/show.html.erb @@ -98,7 +98,7 @@
-

<%= t :order_details %>

+
<%= t :order_details %>
@@ -128,7 +128,7 @@
-

<%= t :sale_details %>

+
<%= t :sale_details %>
@@ -165,9 +165,8 @@ From 393d0badc3180c0a64364f4375a56321bbb32d7a Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Fri, 17 Nov 2017 11:47:42 +0630 Subject: [PATCH 2/3] update customer transaction list --- .../origami/customers_controller.rb | 5 +- app/views/crm/customers/show.html.erb | 70 ++++++++++++------- app/views/origami/home/show.html.erb | 36 ++++++---- 3 files changed, 70 insertions(+), 41 deletions(-) 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 101ed798..20808a54 100755 --- a/app/views/crm/customers/show.html.erb +++ b/app/views/crm/customers/show.html.erb @@ -68,27 +68,39 @@ - + - + + <% if @response["status"] == true %> - <% @response["data"].each do |transaction| %> - - - - - - - - - - - <% end %> + <% @response["data"].each do |transaction| %> + + + <% if transaction["status"] == 'Rebate' || transaction["status"] == 'Discount'%> + + <% else %> + + <% end %> + + + + + <% end %> + <% if @response["data"].first["status"] != 'Discount'%> + + + + + <%end%> + <%else%> + <% end %>
<%= 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") %>
<%= transaction["date"]%><%= transaction["deposit"] %><%= transaction["account_status"] %><%= transaction["status"] %><%= transaction["receipt_no"] %>
<%= transaction["date"]%><%= transaction["deposit"] %>(<%= transaction["withdraw"] %>)<%= transaction["status"] %><%= transaction["account_status"] %><%= transaction["receipt_no"] %>
Balance + <%= @response["data"].first["balance"] %> +

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

@@ -133,13 +145,15 @@ - - - - - - - + + + + + + + + + @@ -147,12 +161,14 @@ <% @sales.each do |sale| %> - - - - - - + + + + + + + + <% end %> 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' %> - + From 02bf6f03f17e3e64857cf465b79daa92da944435 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Fri, 17 Nov 2017 11:58:46 +0630 Subject: [PATCH 3/3] update customer show --- app/views/crm/customers/show.html.erb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/views/crm/customers/show.html.erb b/app/views/crm/customers/show.html.erb index 20808a54..338aea1d 100755 --- a/app/views/crm/customers/show.html.erb +++ b/app/views/crm/customers/show.html.erb @@ -92,15 +92,18 @@ <% end %> <% if @response["data"].first["status"] != 'Discount'%> - + - <%end%> <%else%> - + + + <% end %>
<%= 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") %>
Balance + <%= @response["data"].first["balance"] %>

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

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

+