Payment Method
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -186,21 +186,20 @@
|
||||
</strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if @cash_exist %>
|
||||
<div class="row payment cash-color p-l-5 p-r-5">
|
||||
<div class="col-md-8">Cash</div>
|
||||
<div class="col-md-4" id="cash" >
|
||||
<%= number_with_precision(@cash, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %>
|
||||
</div>
|
||||
</div>
|
||||
<% if @sale_payment.nil? && @cashier_type != "food_court" %>
|
||||
<%end%>
|
||||
<%if @credit_exist%>
|
||||
<div class="row payment credit-color p-l-5 p-r-5" id="credit_payment" >
|
||||
<div class="col-md-8">Credit</div>
|
||||
<div class="col-md-4" id="credit"><%= number_with_precision(@credit, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="col-md-4 hidden" id="credit">0</div>
|
||||
<% end %>
|
||||
<%end%>
|
||||
<div class="row payment other-payment-color btn_paymal_member">
|
||||
<div class="col-md-8">Other Payments</div>
|
||||
<div class="col-md-4" id="other_payment_amount">
|
||||
|
||||
Reference in New Issue
Block a user