diff --git a/app/controllers/foodcourt/payments_controller.rb b/app/controllers/foodcourt/payments_controller.rb index 3559edc8..fd09205d 100755 --- a/app/controllers/foodcourt/payments_controller.rb +++ b/app/controllers/foodcourt/payments_controller.rb @@ -170,6 +170,8 @@ class Foodcourt::PaymentsController < BaseFoodcourtController end def show + @cash_exist = PaymentMethodSetting.cash_exist + @credit_exist = PaymentMethodSetting.credit_exist display_type = Lookup.find_by_lookup_type("display_type") if !display_type.nil? && display_type.value.to_i ==2 @display_type = display_type.value diff --git a/app/models/payment_method_setting.rb b/app/models/payment_method_setting.rb index a57e8a4d..1eb3cdef 100755 --- a/app/models/payment_method_setting.rb +++ b/app/models/payment_method_setting.rb @@ -1,4 +1,23 @@ class PaymentMethodSetting < ApplicationRecord # validations - validates_presence_of :payment_method , :gateway_communication_type #, :gateway_url, :auth_token, :merchant_account_id + validates_presence_of :payment_method , :gateway_communication_type #, :gateway_url, :auth_token, :merchant_account_id + + def self.cash_exist + temp = PaymentMethodSetting.where(payment_method: "Cash", is_active: true) + if temp.present? + return true + else + return false + end + + end + def self.credit_exist + temp = PaymentMethodSetting.where(payment_method: "Credit", is_active: true) + if temp.present? + return true + else + return false + end + + end end diff --git a/app/views/foodcourt/payments/show.html.erb b/app/views/foodcourt/payments/show.html.erb index 3790e518..818e1b3c 100755 --- a/app/views/foodcourt/payments/show.html.erb +++ b/app/views/foodcourt/payments/show.html.erb @@ -186,21 +186,20 @@ - + <% if @cash_exist %>
Cash
<%= number_with_precision(@cash, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %>
- <% if @sale_payment.nil? && @cashier_type != "food_court" %> + <%end%> + <%if @credit_exist%>
Credit
<%= number_with_precision(@credit, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %>
- <% else %> - - <% end %> + <%end%>
Other Payments