Add membership action
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<div class="card">
|
||||
<% @payment_method_setting.each do |payment_method|%>
|
||||
<div class="col-md-5">
|
||||
<div class="col-md-12 long purple " id="<%= payment_method.payment_method%>"><%= payment_method.payment_method %></div>
|
||||
<div class="col-md-12 long purple " id="<%= payment_method.payment_method%>" data-url="<%=payment_method.gateway_url%>" data-sale-id="<%= @sale_id%>"><%= payment_method.payment_method %></div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -15,7 +15,7 @@
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label class="col-lg-4 col-md-4 col-sm-4">Valid Amount</label>
|
||||
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="1000">
|
||||
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
@@ -136,11 +136,24 @@ $(document).on('click', '.cashier_number', function(event){
|
||||
|
||||
$("#REDIMREBATE").click(function(){
|
||||
$('.rebate-form').removeAttr("hidden");
|
||||
gateway_url = $(this).attr("data-url");
|
||||
sale_id = $(this).attr("data-sale-id");
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "../../../../settings/membership_actions",
|
||||
data: {type:"redeem_url",gateway_url:gateway_url,sale_id:sale_id},
|
||||
success: function(result){
|
||||
$("#valid_amount").val(result[1]);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
});
|
||||
|
||||
$("#redeem").click(function(){
|
||||
valid_amount = $("#valid_amount").val();
|
||||
sale_id = $(this).attr("data-value")
|
||||
sale_id = $("#REDIMREBATE").attr("data-sale-id");
|
||||
alert(sale_id);
|
||||
membership_id = $(this).attr("data-member-value");
|
||||
redeem_amount = parseInt($("#used_amount").text());
|
||||
if(redeem_amount<=0){
|
||||
|
||||
Reference in New Issue
Block a user