Merge branch 'adminbsb_material_ui'
This commit is contained in:
@@ -5,7 +5,7 @@ class Origami::OthersPaymentsController < BaseOrigamiController
|
||||
@payment_method_setting = PaymentMethodSetting.all
|
||||
|
||||
@rebate = MembershipSetting.find_by_rebate(1)
|
||||
|
||||
@sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
# @sale_id = params[:sale_id]
|
||||
# sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
|
||||
|
||||
@@ -417,6 +417,7 @@
|
||||
<div class="modal-body">
|
||||
<select class="form-control show-tick payment_method" id="payment_method" >
|
||||
<option value="Cash">Cash</option>
|
||||
<option value="Credit">Credit</option>
|
||||
<% @payment_methods.each do |pay| %>
|
||||
<option value="<%= pay.payment_method %>">
|
||||
<%= pay.payment_method %>
|
||||
|
||||
@@ -14,8 +14,9 @@
|
||||
<div class="col-lg-11col-md-11 col-sm-11">
|
||||
<div >
|
||||
<div >
|
||||
<span id="receipt_no" class="hidden"><%=@sale_data.receipt_no rescue ' '%></span>
|
||||
<% @payment_method_setting.where("is_active = true").each do |payment_method|%>
|
||||
<div class="purple others-payment bottom left m-l-30" data-type="<%= payment_method.payment_method %>" id="<%= payment_method.payment_method %>" data-url="<%=payment_method.gateway_url%>" data-sale-id="<%= @sale_id%>"><%= payment_method.payment_method %></div>
|
||||
<div class="purple others-payment bottom left m-l-30 <%= payment_method.payment_method %>" data-type="<%= payment_method.payment_method %>" id="<%= payment_method.payment_method %>" data-url="<%=payment_method.gateway_url%>" data-sale-id="<%= @sale_id%>"><%= payment_method.payment_method %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -26,6 +27,19 @@
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
/* start check first bill or not*/
|
||||
var receipt_no = "";
|
||||
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
||||
receipt_no = ($("#receipt_no").html()).trim();
|
||||
}
|
||||
|
||||
payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment");
|
||||
if(payment_type) {
|
||||
$(".others-payment").hide();
|
||||
$("."+payment_type).show();
|
||||
}
|
||||
|
||||
/* end check first bill or not*/
|
||||
|
||||
$('.others-payment').on('click',function(){
|
||||
var input_type = $(this).attr("data-type");
|
||||
|
||||
@@ -302,9 +302,12 @@
|
||||
$("#credit_payment").hide();
|
||||
}else if(payment_type=="Credit"){
|
||||
$("#card_payment").hide();
|
||||
$("#others_payment").hide();
|
||||
}else if(payment_type=="MPU"||payment_type=="VISA"||payment_type=="JCB"||payment_type=="Master"){
|
||||
$("#credit_payment").hide();
|
||||
}
|
||||
|
||||
/* end check first bill or not*/
|
||||
|
||||
var dining_id = "<%= @sale_data.bookings[0].dining_facility_id %>";
|
||||
|
||||
$("#back").on('click', function() {
|
||||
@@ -408,6 +411,9 @@
|
||||
}
|
||||
else if(payment_type == "Master" && $('#mastercount').text()==0 && sub_total != 0.0){
|
||||
swal("Opps","Please Pay with Master Payment","warning");
|
||||
}
|
||||
else if(payment_type == "Credit" && $('#credit').text()==0 && sub_total != 0.0){
|
||||
swal("Opps","Please Pay with Credit Payment","warning");
|
||||
}else{
|
||||
|
||||
$( "#loading_wrapper").show();
|
||||
|
||||
Reference in New Issue
Block a user