From 5cff9c891baea88a410430e1383a6d72e0218239 Mon Sep 17 00:00:00 2001 From: Phyo Date: Wed, 14 Jun 2017 12:02:52 +0630 Subject: [PATCH 1/2] Other Payment shown by type --- .../origami/payments_controller.rb | 5 ++++- app/views/origami/payments/show.html.erb | 20 +++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/app/controllers/origami/payments_controller.rb b/app/controllers/origami/payments_controller.rb index a9437736..97d08547 100644 --- a/app/controllers/origami/payments_controller.rb +++ b/app/controllers/origami/payments_controller.rb @@ -19,6 +19,7 @@ class Origami::PaymentsController < BaseOrigamiController if Sale.exists?(sale_id) @cash = 0.0 @other = 0.0 + @ppamount = 0.0 @sale_data = Sale.find_by_sale_id(sale_id) #get customer amount @@ -55,8 +56,10 @@ class Origami::PaymentsController < BaseOrigamiController if spay.payment_method == "cash" @cash = spay.payment_amount end - if spay.payment_method == "mpu" || spay.payment_method == "paypar" + if spay.payment_method == "mpu" @other += spay.payment_amount + elsif spay.payment_method == "paypar" + @ppamount += spay.payment_amount end end end diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index 490ec341..b9c2fdbf 100644 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -102,8 +102,24 @@
-
Others Payment
-
<%= @other %>
+
+ <% if @other != 0.0 %> +
+
MPU
+
<%= @other %>
+
+ <% elsif @ppamount != 0.0 %> +
+
Paypar
+
<%= @ppamount %>
+
+ <% else %> +
+
Others Payment
+
<%= @ppamount %>
+
+ <% end %> +

From f7451a46754cf1bd1ab83eda1101fc30321c4d9c Mon Sep 17 00:00:00 2001 From: Nweni Date: Wed, 14 Jun 2017 13:33:09 +0630 Subject: [PATCH 2/2] update --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 36be43b7..6c3703d2 100644 --- a/Gemfile +++ b/Gemfile @@ -42,7 +42,7 @@ gem 'to_xls-rails' #Reporting gem #gem 'compendium' - +#gem "cancan" # Use jquery as the JavaScript library gem 'jquery-rails' gem 'jquery-ui-rails'