From b40d4982f330ba829567fb7ee143367ee877d746 Mon Sep 17 00:00:00 2001 From: Myat Zin Wai Maw Date: Tue, 28 May 2019 14:02:14 +0630 Subject: [PATCH 1/6] add total grand balance --- app/controllers/crm/customers_controller.rb | 1 + app/views/crm/customers/show.html.erb | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index c895c4b6..50c0da09 100644 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -122,6 +122,7 @@ class Crm::CustomersController < BaseCrmController #get customer amount @customer = Customer.find(params[:id]) @response = Customer.get_membership_transactions(@customer) + puts @response.to_json Rails.logger.debug "get membership transactions response" Rails.logger.debug @response.to_json diff --git a/app/views/crm/customers/show.html.erb b/app/views/crm/customers/show.html.erb index 572b3937..646cd06a 100644 --- a/app/views/crm/customers/show.html.erb +++ b/app/views/crm/customers/show.html.erb @@ -179,11 +179,14 @@ <%= t("views.right_panel.detail.sales_status") %> <%= t("views.right_panel.detail.receipt_date") %> + + <% add_grand_total =0 %> <% @sales.each do |sale| %> + <%= link_to sale.sale_id, transactions_sale_path(sale) %> <%= sale.receipt_no %> <%= sale.total_discount %> @@ -194,7 +197,15 @@ <%= sale.sale_status %> <%= sale.receipt_date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> + <% add_grand_total += sale.grand_total%> <% end %> + <% if !@sales.empty?%> + + Balance + <%= add_grand_total %> + + <% end %> + From 2fb4a85295472feafba0d3628ac4c0a06fc7a865 Mon Sep 17 00:00:00 2001 From: NyanLinHtut Date: Wed, 29 May 2019 17:32:53 +0630 Subject: [PATCH 2/6] mobile view --- app/assets/stylesheets/application.scss | 11 +- app/assets/stylesheets/login.scss | 10 +- app/views/layouts/_left_sidebar.html.erb | 285 +++++++++++++++++------ app/views/layouts/login.html.erb | 38 +-- 4 files changed, 246 insertions(+), 98 deletions(-) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index b1718ee2..f3cd1157 100755 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -119,9 +119,14 @@ i.logout_icon{ margin-right: 15px; color:#fff !important; # background-color: green !important; -} +} .payment-btn-box { - width: 130px; + width: 130px; height: 50px; -} \ No newline at end of file +} + +@media screen and (max-width: 785px) { + #setting{ display: none;} + .menu-up{ display: none;} +} diff --git a/app/assets/stylesheets/login.scss b/app/assets/stylesheets/login.scss index f156d4d3..3d2504d0 100755 --- a/app/assets/stylesheets/login.scss +++ b/app/assets/stylesheets/login.scss @@ -22,7 +22,7 @@ display: block; width: 100%; text-align: center; - color: #000; + color: #000; margin-top: -5px; } @@ -117,4 +117,10 @@ .box { margin : 0 -60px 0 -60px; -} \ No newline at end of file +} + +@media screen and (max-width: 785px) { + .login_pwd{width: 90%;} + .login_ent{width: 10%;} + +} diff --git a/app/views/layouts/_left_sidebar.html.erb b/app/views/layouts/_left_sidebar.html.erb index 21b32859..d9f12423 100644 --- a/app/views/layouts/_left_sidebar.html.erb +++ b/app/views/layouts/_left_sidebar.html.erb @@ -2,12 +2,12 @@ - - <%= javascript_include_tag 'login', 'data-turbolinks-track': 'reload' %> + <%= javascript_include_tag 'login', 'data-turbolinks-track': 'reload' %> @@ -57,8 +57,8 @@ <% flash.each do |type, message| %> - <% - if type == "notice" + <% + if type == "notice" color = "alert-success" elsif type == "error" color = "alert-danger" @@ -67,22 +67,22 @@ else color = "bg-black" end %> - + - <% end %> + <% end %>