fixed conflict
This commit is contained in:
@@ -10,14 +10,14 @@
|
||||
<nav class="pagination">
|
||||
<%= first_page_tag unless current_page.first? %>
|
||||
<%= prev_page_tag unless current_page.first? %>
|
||||
<% each_page do |page| -%>
|
||||
<% if page.left_outer? || page.right_outer? || page.inside_window? -%>
|
||||
<% each_page do |page| %>
|
||||
<% if page.left_outer? || page.right_outer? || page.inside_window? %>
|
||||
<%= page_tag page %>
|
||||
<% elsif !page.was_truncated? -%>
|
||||
<% elsif !page.was_truncated? %>
|
||||
<%= gap_tag %>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= next_page_tag unless current_page.last? %>
|
||||
<%= last_page_tag unless current_page.last? %>
|
||||
</nav>
|
||||
<% end -%>
|
||||
<% end %>
|
||||
|
||||
@@ -31,28 +31,28 @@
|
||||
customer_id = ""
|
||||
|
||||
# For CSS- Class for Order? Sale?
|
||||
sale_status=""
|
||||
if cpo.order_status == 'new'
|
||||
unique_id=cpo.booking_id
|
||||
# sale_status=""
|
||||
# if cpo.order_status == 'new'
|
||||
# unique_id=cpo.booking_id
|
||||
|
||||
customer_id=cpo.order_customer_id
|
||||
# check selected item and assign
|
||||
if @selected_item != nil
|
||||
if cpo.order_id == @selected_item.order_id
|
||||
sale_status = sale_status + " selected-item"
|
||||
end
|
||||
end
|
||||
else
|
||||
unique_id=cpo.sale_id
|
||||
customer_id=cpo.sale_customer_id
|
||||
sale_status="paid"
|
||||
# check selected item and assign
|
||||
if @selected_item != nil
|
||||
if unique_id == @selected_item.sale_id
|
||||
sale_status = sale_status + " selected-item"
|
||||
end
|
||||
# customer_id=cpo.order_customer_id
|
||||
# # check selected item and assign
|
||||
# if @selected_item_type == "Sale"
|
||||
# if cpo.order_id == @selected_item.order_id
|
||||
# sale_status = sale_status + " selected-item"
|
||||
# end
|
||||
# end
|
||||
# else
|
||||
unique_id=cpo.sale_id
|
||||
customer_id=cpo.sale_customer_id
|
||||
sale_status="paid"
|
||||
# check selected item and assign
|
||||
if @selected_item != nil
|
||||
if unique_id == @selected_item.sale_id
|
||||
sale_status = sale_status + " selected-item"
|
||||
end
|
||||
end
|
||||
# end
|
||||
%>
|
||||
<div class="card orders <%= sale_status %>">
|
||||
<div class="card-block">
|
||||
@@ -69,9 +69,7 @@
|
||||
</p>
|
||||
<p class="card-text">
|
||||
Order Status :
|
||||
<span class="orders-order-status">
|
||||
<%= cpo.order_status %>
|
||||
</span>
|
||||
<span class="orders-order-status"><%= cpo.sale_status %></span>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
@@ -84,10 +82,10 @@
|
||||
|
||||
<!--- Panel 1 - Table Orders -->
|
||||
<div class="tab-pane active" id="tables" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<%
|
||||
@booking_orders.each do |bko|
|
||||
# No Show completed
|
||||
# No Show completed
|
||||
if bko.sale_status == 'completed'
|
||||
next
|
||||
end
|
||||
@@ -101,11 +99,11 @@
|
||||
unique_id=bko.booking_id
|
||||
customer_id=bko.order_customer_id
|
||||
# check selected item and assign
|
||||
if !@selected_item.nil?
|
||||
if bko.order_id == @selected_item.order_id
|
||||
sale_status = sale_status + " selected-item"
|
||||
end
|
||||
end
|
||||
# if @selected_item != nil
|
||||
# if bko.order_id == @selected_item.order_id
|
||||
# sale_status = sale_status + " selected-item"
|
||||
# end
|
||||
# end
|
||||
else
|
||||
unique_id=bko.sale_id
|
||||
customer_id=bko.sale_customer_id
|
||||
@@ -132,9 +130,7 @@
|
||||
</p>
|
||||
<p class="card-text">
|
||||
Order Status :
|
||||
<span class="orders-order-status">
|
||||
<%= bko.order_status %>
|
||||
</span>
|
||||
<span class="orders-order-status"><%= bko.order_status %></span>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
@@ -165,11 +161,11 @@
|
||||
unique_id=rmo.booking_id
|
||||
customer_id=rmo.order_customer_id
|
||||
# check selected item and assign
|
||||
if @selected_item != nil
|
||||
if rmo.order_id == @selected_item.order_id
|
||||
sale_status = sale_status + " selected-item"
|
||||
end
|
||||
end
|
||||
# if @selected_item != nil
|
||||
# if rmo.order_id == @selected_item.order_id
|
||||
# sale_status = sale_status + " selected-item"
|
||||
# end
|
||||
# end
|
||||
else
|
||||
unique_id=rmo.sale_id
|
||||
customer_id=rmo.sale_customer_id
|
||||
@@ -196,9 +192,7 @@
|
||||
</p>
|
||||
<p class="card-text">
|
||||
Order Status :
|
||||
<span class="orders-order-status">
|
||||
<%= rmo.order_status %>
|
||||
</span>
|
||||
<span class="orders-order-status"><%= rmo.order_status %></span>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
@@ -213,7 +207,7 @@
|
||||
<div class="tab-pane" id="orders" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<%
|
||||
@orders.each do |odr|
|
||||
@orders.each do |odr|
|
||||
# No Show completed
|
||||
if odr.sale_status == 'completed'
|
||||
next
|
||||
@@ -227,11 +221,11 @@
|
||||
if odr.order_status == 'new'
|
||||
unique_id=odr.booking_id
|
||||
customer_id = odr.order_customer_id
|
||||
if @selected_item != nil
|
||||
if odr.order_id == @selected_item.order_id
|
||||
sale_status = sale_status + " selected-item"
|
||||
end
|
||||
end
|
||||
# if @selected_item != nil
|
||||
# if odr.order_id == @selected_item.order_id
|
||||
# sale_status = sale_status + " selected-item"
|
||||
# end
|
||||
# end
|
||||
else
|
||||
unique_id=odr.sale_id
|
||||
customer_id = odr.sale_customer_id
|
||||
@@ -258,9 +252,7 @@
|
||||
</p>
|
||||
<p class="card-text">
|
||||
Order Status :
|
||||
<span class="orders-order-status">
|
||||
<%= odr.order_status %>
|
||||
</span>
|
||||
<span class="orders-order-status"><%= odr.order_status %></span>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
@@ -308,14 +300,14 @@
|
||||
<th class="item-attr">Price</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody>
|
||||
<%
|
||||
# For Sale Items
|
||||
sub_total = 0
|
||||
if @selected_item_type == "Sale"
|
||||
@selected_item.sale_items.each do |sale_item|
|
||||
sub_total += (sale_item.qty*sale_item.unit_price)
|
||||
%>
|
||||
%>
|
||||
<tr>
|
||||
<td class='item-name'><%= sale_item.product_name %></td>
|
||||
<td class='item-attr'><%= sale_item.qty %></td>
|
||||
@@ -327,8 +319,7 @@
|
||||
%>
|
||||
|
||||
<%
|
||||
# For Order Items
|
||||
sub_total = 0
|
||||
# For Order Items
|
||||
if @selected_item_type == "Order"
|
||||
@selected_item.order_items.each do |order_item|
|
||||
sub_total += (order_item.qty*order_item.unit_price)
|
||||
@@ -386,13 +377,12 @@
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Add Order</button>
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Edit</button>
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Move</button>
|
||||
<button type="button" id="customer" class="btn btn-primary btn-lg btn-block" disabled>Customer</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block" disabled>Req.Bill</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block" disabled>Req.Bill</button>
|
||||
<button type="button" id="customer" class="btn btn-primary btn-lg btn-block">Customer</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block">Req.Bill</button>
|
||||
<!-- Cashier Buttons -->
|
||||
<button type="button" id="discount" class="btn btn-primary btn-lg btn-block" disabled>Discount</button>
|
||||
<button type="button" id="discount" class="btn btn-primary btn-lg btn-block">Discount</button>
|
||||
<!-- <button type="button" class="btn btn-primary btn-lg btn-block" disabled>Tax</button> -->
|
||||
<button type="button" id="pay-bill" class="btn btn-primary btn-lg btn-block" disabled>Pay</button>
|
||||
<button type="button" id="pay-bill" class="btn btn-primary btn-lg btn-block">Pay</button>
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Re.Print</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,19 +1,41 @@
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-5 col-md-5 col-sm-3">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h2>JCB</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card" style="margin-top:10px;padding-top:20px;">
|
||||
<div class="rebate-form">
|
||||
<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">You can pay upto </label>
|
||||
<input type="text" name="validamount" id="validamount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@can_jcb %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<% if @jcbcount != 0 %>
|
||||
<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">Recent JCB paid amount </label>
|
||||
<input type="text" name="" id="" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@jcbcount %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<% end %>
|
||||
<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 Rebate 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="" data-value="<%=@sale_id %>" data-member-value="">
|
||||
<label class="col-lg-4 col-md-4 col-sm-4">Reference Number</label>
|
||||
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<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">Redeem Amount</label>
|
||||
<div id="used_amount" class="form-control col-lg-7 col-md-7 col-sm-7">0.0</div>
|
||||
<label class="col-lg-4 col-md-4 col-sm-4">Amount</label>
|
||||
<div id="amount" class="form-control col-lg-7 col-md-7 col-sm-7">0.0</div>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
@@ -21,7 +43,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-7 col-md-7 col-sm-7">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6" style="margin-top:75px;">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-1 col-sm-1">
|
||||
@@ -61,23 +83,26 @@
|
||||
<div class="cashier_number long left" data-value="10000" data-type="add">10000</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class="pay purple" id="redeem">Pay</div>
|
||||
<div class="pay purple" id="jcb_pay">Pay</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> Back </button>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
<script>
|
||||
// number key pad
|
||||
$(document).on('click', '.cashier_number', function(event){
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
if(event.handled !== true) {
|
||||
var original_value;
|
||||
original_value = $('#used_amount').text();
|
||||
original_value = $('#amount').text();
|
||||
|
||||
var input_value = $(this).attr("data-value");
|
||||
|
||||
@@ -85,24 +110,24 @@ $(document).on('click', '.cashier_number', function(event){
|
||||
switch (input_type) {
|
||||
case 'num':
|
||||
if (original_value == "0.0"){
|
||||
$('#used_amount').text(input_value);
|
||||
$('#amount').text(input_value);
|
||||
}else{
|
||||
$('#used_amount').append(input_value);
|
||||
$('#amount').append(input_value);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
var input_value = $(this).attr("data-value");
|
||||
amount = parseInt(input_value) + parseInt(original_value);
|
||||
$('#used_amount').html(amount);
|
||||
$('#amount').html(amount);
|
||||
|
||||
break;
|
||||
case 'clr':
|
||||
$('#used_amount').html("0.0");
|
||||
$('#amount').html("0.0");
|
||||
break;
|
||||
case 'del' :
|
||||
var cash=$('#used_amount').text();
|
||||
$('#used_amount').text(cash.substr(0,cash.length-1));
|
||||
var cash=$('#amount').text();
|
||||
$('#amount').text(cash.substr(0,cash.length-1));
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -112,33 +137,23 @@ $(document).on('click', '.cashier_number', function(event){
|
||||
}
|
||||
});
|
||||
|
||||
$("#redeem").click(function(){
|
||||
valid_amount = $("#valid_amount").val();
|
||||
sale_id = $("#valid_amount").attr('data-value');
|
||||
membership_id = $("#valid_amount").attr('data-member-value');
|
||||
redeem_amount = parseFloat($("#used_amount").text());
|
||||
if(redeem_amount<=0 ){
|
||||
alert("Please type valid amount");
|
||||
|
||||
}else if(valid_amount< redeem_amount){
|
||||
alert(" Insufficient Amount!")
|
||||
}else{
|
||||
if(redeem_amount <= "<%= @food_prices %>"){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=origami_payment_paypar_path%>",
|
||||
data: {redeem_amount:redeem_amount,membership_id:membership_id,sale_id:sale_id},
|
||||
success: function(result){
|
||||
if(result.status == true){
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment"
|
||||
}else{
|
||||
alert(result.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
}else {
|
||||
alert("Redeem Amount is over!");
|
||||
$('#jcb_pay').on('click',function(){
|
||||
var amount = $('#amount').text();
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
if(parseFloat(amount) <= "<%= @can_jcb %>"){
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_payment_jcb_path %>",
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||
success:function(result){
|
||||
if(result){
|
||||
alert("Payment success")
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
alert("Paid Amount is over!");
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -1,19 +1,41 @@
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-5 col-md-5 col-sm-3">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h2>Master</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card" style="margin-top:10px;padding-top:20px;">
|
||||
<div class="rebate-form">
|
||||
<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">You can pay upto </label>
|
||||
<input type="text" name="validamount" id="validamount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@can_master %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<% if @mastercount != 0 %>
|
||||
<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">Recent Master paid amount </label>
|
||||
<input type="text" name="" id="" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@mastercount %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<% end %>
|
||||
<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 Rebate 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="" data-value="<%=@sale_id %>" data-member-value="">
|
||||
<label class="col-lg-4 col-md-4 col-sm-4">Reference Number</label>
|
||||
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<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">Redeem Amount</label>
|
||||
<div id="used_amount" class="form-control col-lg-7 col-md-7 col-sm-7">0.0</div>
|
||||
<label class="col-lg-4 col-md-4 col-sm-4">Amount</label>
|
||||
<div id="amount" class="form-control col-lg-7 col-md-7 col-sm-7">0.0</div>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
@@ -21,7 +43,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-7 col-md-7 col-sm-7">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6" style="margin-top:75px;">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-1 col-sm-1">
|
||||
@@ -61,23 +83,25 @@
|
||||
<div class="cashier_number long left" data-value="10000" data-type="add">10000</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class="pay purple" id="redeem">Pay</div>
|
||||
<div class="pay purple" id="master_pay">Pay</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> Back </button>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
<script>
|
||||
$(document).on('click', '.cashier_number', function(event){
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
if(event.handled !== true) {
|
||||
var original_value;
|
||||
original_value = $('#used_amount').text();
|
||||
original_value = $('#amount').text();
|
||||
|
||||
var input_value = $(this).attr("data-value");
|
||||
|
||||
@@ -85,24 +109,24 @@ $(document).on('click', '.cashier_number', function(event){
|
||||
switch (input_type) {
|
||||
case 'num':
|
||||
if (original_value == "0.0"){
|
||||
$('#used_amount').text(input_value);
|
||||
$('#amount').text(input_value);
|
||||
}else{
|
||||
$('#used_amount').append(input_value);
|
||||
$('#amount').append(input_value);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
var input_value = $(this).attr("data-value");
|
||||
amount = parseInt(input_value) + parseInt(original_value);
|
||||
$('#used_amount').html(amount);
|
||||
$('#amount').html(amount);
|
||||
|
||||
break;
|
||||
case 'clr':
|
||||
$('#used_amount').html("0.0");
|
||||
$('#amount').html("0.0");
|
||||
break;
|
||||
case 'del' :
|
||||
var cash=$('#used_amount').text();
|
||||
$('#used_amount').text(cash.substr(0,cash.length-1));
|
||||
var cash=$('#amount').text();
|
||||
$('#amount').text(cash.substr(0,cash.length-1));
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -111,34 +135,22 @@ $(document).on('click', '.cashier_number', function(event){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$("#redeem").click(function(){
|
||||
valid_amount = $("#valid_amount").val();
|
||||
sale_id = $("#valid_amount").attr('data-value');
|
||||
membership_id = $("#valid_amount").attr('data-member-value');
|
||||
redeem_amount = parseFloat($("#used_amount").text());
|
||||
if(redeem_amount<=0 ){
|
||||
alert("Please type valid amount");
|
||||
|
||||
}else if(valid_amount< redeem_amount){
|
||||
alert(" Insufficient Amount!")
|
||||
$('#master_pay').on('click',function(){
|
||||
var amount = $('#amount').text();
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
if(parseFloat(amount) <= "<%= @can_master %>"){
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_payment_master_path %>",
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||
success:function(result){
|
||||
if(result){
|
||||
alert("Payment success")
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
if(redeem_amount <= "<%= @food_prices %>"){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=origami_payment_paypar_path%>",
|
||||
data: {redeem_amount:redeem_amount,membership_id:membership_id,sale_id:sale_id},
|
||||
success: function(result){
|
||||
if(result.status == true){
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment"
|
||||
}else{
|
||||
alert(result.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
}else {
|
||||
alert("Redeem Amount is over!");
|
||||
}
|
||||
alert("Paid Amount is over!");
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -1,19 +1,41 @@
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-5 col-md-5 col-sm-3">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h2>MPU</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card" style="margin-top:10px;padding-top:20px;">
|
||||
<div class="rebate-form">
|
||||
<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 Rebate 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="" data-value="<%=@sale_id %>" data-member-value="">
|
||||
<label class="col-lg-4 col-md-4 col-sm-4">You can pay upto </label>
|
||||
<input type="text" name="validamount" id="validamount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@can_mpu %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<% if @mpucount != 0 %>
|
||||
<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">Recent MPU paid amount </label>
|
||||
<input type="text" name="" id="" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@mpucount %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<% end %>
|
||||
<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">Reference Number</label>
|
||||
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<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">Redeem Amount</label>
|
||||
<div id="used_amount" class="form-control col-lg-7 col-md-7 col-sm-7">0.0</div>
|
||||
<label class="col-lg-4 col-md-4 col-sm-4">Amount</label>
|
||||
<div id="amount" class="form-control col-lg-7 col-md-7 col-sm-7">0.0</div>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
@@ -21,7 +43,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-7 col-md-7 col-sm-7">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6" style="margin-top:75px;">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-1 col-sm-1">
|
||||
@@ -61,23 +83,25 @@
|
||||
<div class="cashier_number long left" data-value="10000" data-type="add">10000</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class="pay purple" id="redeem">Pay</div>
|
||||
<div class="pay purple" id="mpu_pay">Pay</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> Back </button>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
<script>
|
||||
$(document).on('click', '.cashier_number', function(event){
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
if(event.handled !== true) {
|
||||
var original_value;
|
||||
original_value = $('#used_amount').text();
|
||||
original_value = $('#amount').text();
|
||||
|
||||
var input_value = $(this).attr("data-value");
|
||||
|
||||
@@ -85,24 +109,24 @@ $(document).on('click', '.cashier_number', function(event){
|
||||
switch (input_type) {
|
||||
case 'num':
|
||||
if (original_value == "0.0"){
|
||||
$('#used_amount').text(input_value);
|
||||
$('#amount').text(input_value);
|
||||
}else{
|
||||
$('#used_amount').append(input_value);
|
||||
$('#amount').append(input_value);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
var input_value = $(this).attr("data-value");
|
||||
amount = parseInt(input_value) + parseInt(original_value);
|
||||
$('#used_amount').html(amount);
|
||||
$('#amount').html(amount);
|
||||
|
||||
break;
|
||||
case 'clr':
|
||||
$('#used_amount').html("0.0");
|
||||
$('#amount').html("0.0");
|
||||
break;
|
||||
case 'del' :
|
||||
var cash=$('#used_amount').text();
|
||||
$('#used_amount').text(cash.substr(0,cash.length-1));
|
||||
var cash=$('#amount').text();
|
||||
$('#amount').text(cash.substr(0,cash.length-1));
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -111,62 +135,22 @@ $(document).on('click', '.cashier_number', function(event){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$("#redeem").click(function(){
|
||||
valid_amount = $("#valid_amount").val();
|
||||
sale_id = $("#valid_amount").attr('data-value');
|
||||
membership_id = $("#valid_amount").attr('data-member-value');
|
||||
redeem_amount = parseFloat($("#used_amount").text());
|
||||
if(redeem_amount<=0 ){
|
||||
alert("Please type valid amount");
|
||||
|
||||
}else if(valid_amount< redeem_amount){
|
||||
alert(" Insufficient Amount!")
|
||||
}else{
|
||||
if(redeem_amount <= "<%= @food_prices %>"){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=origami_payment_paypar_path%>",
|
||||
data: {redeem_amount:redeem_amount,membership_id:membership_id,sale_id:sale_id},
|
||||
success: function(result){
|
||||
if(result.status == true){
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment"
|
||||
}else{
|
||||
alert(result.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
}else {
|
||||
alert("Redeem Amount is over!");
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- -->
|
||||
<h2> MPU </h2>
|
||||
|
||||
|
||||
Amount :
|
||||
|
||||
<input type="text" name="amount" id="amount" value=""/>
|
||||
|
||||
<button type="submit" id="mpu_pay" > PAY </button>
|
||||
|
||||
<script>
|
||||
$('#mpu_pay').on('click',function(){
|
||||
var amount = $('#amount').val();
|
||||
var amount = $('#amount').text();
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_payment_mpu_path %>",
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||
success:function(result){
|
||||
if(result){
|
||||
alert("Payment success")
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
}
|
||||
}
|
||||
});
|
||||
if(parseFloat(amount) <= "<%= @can_mpu %>"){
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_payment_mpu_path %>",
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||
success:function(result){
|
||||
if(result){
|
||||
alert("Payment success")
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
alert("Paid Amount is over!")
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -101,10 +101,87 @@
|
||||
<div class="col-md-4" id="credit">0.0</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row" id="card_payment">
|
||||
<div class="col-md-8">Others Payment</div>
|
||||
<div class="col-md-4" id="others"><%= @other %></div>
|
||||
</div>
|
||||
<% if @other == 0.0 && @ppamount == 0.0 && @visacount == 0.0 && @jcbcount == 0.0 && @mastercount == 0.0%>
|
||||
<div class="row" id="card_payment">
|
||||
<div class="col-md-8">Other Payments</div>
|
||||
<div class="col-md-4" id="others"><%= @other %></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="row" id="card_payment">
|
||||
<div class="col-md-12">Other Payments</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<!-- mpu -->
|
||||
<% if @other != 0.0 %>
|
||||
<div class="row">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">MPU</div>
|
||||
<div class="col-md-4" id="others"><%= @other %></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="row" style="display:none">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">MPU</div>
|
||||
<div class="col-md-4" id="others">0.0</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- paypar -->
|
||||
<% if @ppamount != 0.0 %>
|
||||
<div class="row">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">Paypar</div>
|
||||
<div class="col-md-4" id="ppamount"><%= @ppamount %></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="row" style="display:none">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">Paypar</div>
|
||||
<div class="col-md-4" id="ppamount">0.0</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- Visa -->
|
||||
<% if @visacount != 0.0 %>
|
||||
<div class="row">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">Visa</div>
|
||||
<div class="col-md-4" id="visacount"><%= @visacount %></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="row" style="display:none">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">Visa</div>
|
||||
<div class="col-md-4" id="visacount">0.0</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- JCB -->
|
||||
<% if @jcbcount != 0.0 %>
|
||||
<div class="row">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">JCB</div>
|
||||
<div class="col-md-4" id="jcbcount"><%= @jcbcount %></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="row" style="display:none">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">JCB</div>
|
||||
<div class="col-md-4" id="jcbcount">0.0</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- Master -->
|
||||
<% if @mastercount != 0.0 %>
|
||||
<div class="row">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">Master</div>
|
||||
<div class="col-md-4" id="mastercount"><%= @mastercount %></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="row" style="display:none">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">Master</div>
|
||||
<div class="col-md-4" id="mastercount">0.0</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-md-8">Balance</div>
|
||||
@@ -167,6 +244,7 @@
|
||||
$(document).ready(function(){
|
||||
update_balance();
|
||||
})
|
||||
|
||||
$(document).on('click', '.cashier_number', function(event){
|
||||
if(event.handled !== true) {
|
||||
var original_value;
|
||||
@@ -193,7 +271,10 @@ $(document).on('click', '.cashier_number', function(event){
|
||||
break;
|
||||
case 'del' :
|
||||
var cash=$('#cash').text();
|
||||
$('#cash').text(cash.substr(0,cash.length-1));
|
||||
if(cash.length == 1)
|
||||
$('#cash').text("0.0");
|
||||
else
|
||||
$('#cash').text(cash.substr(0,cash.length-1));
|
||||
update_balance();
|
||||
break;
|
||||
case 'clr':
|
||||
@@ -255,9 +336,13 @@ function update_balance(){
|
||||
var cash = $('#cash').text();
|
||||
var credit = $('#credit').text();
|
||||
var card = $('#others').text();
|
||||
var paypar = $('#ppamount').text();
|
||||
var visa = $('#visacount').text();
|
||||
var jcb = $('#jcbcount').text();
|
||||
var master = $('#mastercount').text();
|
||||
var amount_due = $('#amount_due').text();
|
||||
var total = parseFloat(cash) + parseFloat(credit) + parseFloat(card)
|
||||
var result = amount_due - total
|
||||
var total = parseFloat(cash) + parseFloat(credit) + parseFloat(card) + parseFloat(paypar) + parseFloat(visa) + parseFloat(jcb) + parseFloat(master)
|
||||
var result = amount_due - total;
|
||||
$('#balance').text(result.toFixed(2));
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -5,7 +5,23 @@
|
||||
<div class="rebate-form">
|
||||
<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 Rebate Amount</label>
|
||||
<label class="col-lg-4 col-md-4 col-sm-4">You can redeem upto </label>
|
||||
<input type="text" name="" id="" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%= @food_prices %>" data-value="<%=@sale_id %>" data-member-value="<%= @membership_id %>">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<% if @payparcount > 0 %>
|
||||
<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">Recent Redeem Amount </label>
|
||||
<input type="text" name="" id="" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%= @payparcount %>" data-value="<%=@sale_id %>" data-member-value="<%= @membership_id %>">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<% end %>
|
||||
<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">Available Redeem 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="<%=@membership_rebate_balance%>" data-value="<%=@sale_id %>" data-member-value="<%= @membership_id %>">
|
||||
</div>
|
||||
<hr>
|
||||
@@ -19,10 +35,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% if @payparcount > 0 %>
|
||||
<!-- <% if @payparcount > 0 %>
|
||||
<p class="">Last time rebate amount is <%= @payparcount %></p>
|
||||
<% end %>
|
||||
<p class="">You can rebate upto <span style="color:red;" id="food_prices"><%= @food_prices %></span></p>
|
||||
<p class="">You can rebate upto <span style="color:red;" id="food_prices"><%= @food_prices %></span></p> -->
|
||||
</div>
|
||||
|
||||
<div class="col-lg-7 col-md-7 col-sm-7">
|
||||
@@ -115,7 +131,6 @@ $(document).on('click', '.cashier_number', function(event){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$("#redeem").click(function(){
|
||||
valid_amount = $("#valid_amount").val();
|
||||
sale_id = $("#valid_amount").attr('data-value');
|
||||
|
||||
@@ -1,19 +1,41 @@
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-5 col-md-5 col-sm-3">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h2>VISA</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card" style="margin-top:10px;padding-top:20px;">
|
||||
<div class="rebate-form">
|
||||
<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">You can pay upto </label>
|
||||
<input type="text" name="validamount" id="validamount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@can_visa %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<% if @visacount != 0 %>
|
||||
<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">Recent Visa paid amount </label>
|
||||
<input type="text" name="" id="" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@visacount %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<% end %>
|
||||
<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 Rebate 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="" data-value="<%=@sale_id %>" data-member-value="">
|
||||
<label class="col-lg-4 col-md-4 col-sm-4">Reference Number</label>
|
||||
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<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">Redeem Amount</label>
|
||||
<div id="used_amount" class="form-control col-lg-7 col-md-7 col-sm-7">0.0</div>
|
||||
<label class="col-lg-4 col-md-4 col-sm-4">Amount</label>
|
||||
<div id="amount" class="form-control col-lg-7 col-md-7 col-sm-7">0.0</div>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
@@ -21,7 +43,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-7 col-md-7 col-sm-7">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6" style="margin-top:75px;">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-1 col-sm-1">
|
||||
@@ -61,23 +83,25 @@
|
||||
<div class="cashier_number long left" data-value="10000" data-type="add">10000</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class="pay purple" id="redeem">Pay</div>
|
||||
<div class="pay purple" id="visa_pay">Pay</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> Back </button>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
<script>
|
||||
$(document).on('click', '.cashier_number', function(event){
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
if(event.handled !== true) {
|
||||
var original_value;
|
||||
original_value = $('#used_amount').text();
|
||||
original_value = $('#amount').text();
|
||||
|
||||
var input_value = $(this).attr("data-value");
|
||||
|
||||
@@ -85,24 +109,24 @@ $(document).on('click', '.cashier_number', function(event){
|
||||
switch (input_type) {
|
||||
case 'num':
|
||||
if (original_value == "0.0"){
|
||||
$('#used_amount').text(input_value);
|
||||
$('#amount').text(input_value);
|
||||
}else{
|
||||
$('#used_amount').append(input_value);
|
||||
$('#amount').append(input_value);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
var input_value = $(this).attr("data-value");
|
||||
amount = parseInt(input_value) + parseInt(original_value);
|
||||
$('#used_amount').html(amount);
|
||||
$('#amount').html(amount);
|
||||
|
||||
break;
|
||||
case 'clr':
|
||||
$('#used_amount').html("0.0");
|
||||
$('#amount').html("0.0");
|
||||
break;
|
||||
case 'del' :
|
||||
var cash=$('#used_amount').text();
|
||||
$('#used_amount').text(cash.substr(0,cash.length-1));
|
||||
var cash=$('#amount').text();
|
||||
$('#amount').text(cash.substr(0,cash.length-1));
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -111,34 +135,22 @@ $(document).on('click', '.cashier_number', function(event){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$("#redeem").click(function(){
|
||||
valid_amount = $("#valid_amount").val();
|
||||
sale_id = $("#valid_amount").attr('data-value');
|
||||
membership_id = $("#valid_amount").attr('data-member-value');
|
||||
redeem_amount = parseFloat($("#used_amount").text());
|
||||
if(redeem_amount<=0 ){
|
||||
alert("Please type valid amount");
|
||||
|
||||
}else if(valid_amount< redeem_amount){
|
||||
alert(" Insufficient Amount!")
|
||||
$('#visa_pay').on('click',function(){
|
||||
var amount = $('#amount').text();
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
if(parseFloat(amount) <= "<%= @can_visa %>"){
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_payment_visa_path %>",
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||
success:function(result){
|
||||
if(result){
|
||||
alert("Payment success")
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
if(redeem_amount <= "<%= @food_prices %>"){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=origami_payment_paypar_path%>",
|
||||
data: {redeem_amount:redeem_amount,membership_id:membership_id,sale_id:sale_id},
|
||||
success: function(result){
|
||||
if(result.status == true){
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment"
|
||||
}else{
|
||||
alert(result.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
}else {
|
||||
alert("Redeem Amount is over!");
|
||||
}
|
||||
alert("Paid Amount is over!");
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -18,5 +18,6 @@
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
<%= link_to 'Back', print_settings_path, :class => "btn btn-default" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
<h1>Editing Print Setting</h1>
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= print_settings_path %>">Print Setting</a></li>
|
||||
<li>Edit</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', print_setting: @print_setting %>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
<%= render 'form', print_setting: @print_setting %>
|
||||
|
||||
<%= link_to 'Show', @print_setting %> |
|
||||
<%= link_to 'Back', print_settings_path %>
|
||||
|
||||
@@ -1,49 +1,55 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= %>">Home</a></li>
|
||||
<li>Print Settings</li>
|
||||
<span style="float: right">
|
||||
<%= link_to t('.new', :default => t("helpers.links.new")),new_print_setting_path,:class => 'btn btn-primary btn-sm' %>
|
||||
</span>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<h1>Print Settings</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Unique code</th>
|
||||
<th>Template</th>
|
||||
<th>Db name</th>
|
||||
<th>Db type</th>
|
||||
<th>Db username</th>
|
||||
<th>Db password</th>
|
||||
<th>Printer name</th>
|
||||
<th>Api settings</th>
|
||||
<th>Page width</th>
|
||||
<th>Page height</th>
|
||||
<th>Print copies</th>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @print_settings.each do |print_setting| %>
|
||||
<br />
|
||||
<div class="card">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><%= print_setting.name %></td>
|
||||
<td><%= print_setting.unique_code %></td>
|
||||
<td><%= print_setting.template %></td>
|
||||
<td><%= print_setting.db_name %></td>
|
||||
<td><%= print_setting.db_type %></td>
|
||||
<td><%= print_setting.db_username %></td>
|
||||
<td><%= print_setting.db_password %></td>
|
||||
<td><%= print_setting.printer_name %></td>
|
||||
<td><%= print_setting.api_settings %></td>
|
||||
<td><%= print_setting.page_width %></td>
|
||||
<td><%= print_setting.page_height %></td>
|
||||
<td><%= print_setting.print_copies %></td>
|
||||
<td><%= link_to 'Show', print_setting %></td>
|
||||
<td><%= link_to 'Edit', edit_print_setting_path(print_setting) %></td>
|
||||
<td><%= link_to 'Destroy', print_setting, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
<th>Name</th>
|
||||
<th>Unique code</th>
|
||||
<th>Template</th>
|
||||
<!-- <th>Db name</th>
|
||||
<th>Db type</th>
|
||||
<th>Db username</th>
|
||||
<th>Db password</th> -->
|
||||
<th>Printer name</th>
|
||||
<th>Api settings</th>
|
||||
<th>Page width</th>
|
||||
<th>Page height</th>
|
||||
<th>Print copies</th>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Print Setting', new_print_setting_path %>
|
||||
<tbody>
|
||||
<% @print_settings.each do |print_setting| %>
|
||||
<tr>
|
||||
<td><%= print_setting.name %></td>
|
||||
<td><%= print_setting.unique_code %></td>
|
||||
<td><%= print_setting.template %></td>
|
||||
<!-- <td><%= print_setting.db_name %></td>
|
||||
<td><%= print_setting.db_type %></td>
|
||||
<td><%= print_setting.db_username %></td>
|
||||
<td><%= print_setting.db_password %></td> -->
|
||||
<td><%= print_setting.printer_name %></td>
|
||||
<td><%= print_setting.api_settings %></td>
|
||||
<td><%= print_setting.page_width %></td>
|
||||
<td><%= print_setting.page_height %></td>
|
||||
<td><%= print_setting.print_copies %></td>
|
||||
<td><%= link_to 'Show', print_setting %></td>
|
||||
<td><%= link_to 'Edit', edit_print_setting_path(print_setting) %></td>
|
||||
<td><%= link_to 'Destroy', print_setting, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
<h1>New Print Setting</h1>
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= print_settings_path %>">Print Setting</a></li>
|
||||
<li>New</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', print_setting: @print_setting %>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<%= render 'form', print_setting: @print_setting %>
|
||||
|
||||
<%= link_to 'Back', print_settings_path %>
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= print_settings_path %>">Print Setting</a></li>
|
||||
<li>Show</li>
|
||||
</ul>
|
||||
</div>
|
||||
<p>
|
||||
<strong>Name:</strong>
|
||||
<%= @print_setting.name %>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_employees_path %>">Employees</a></li>
|
||||
<li>Edit</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_employees_path %>">Employees</a></li>
|
||||
<li>Edit</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', employee: @employee %>
|
||||
</div>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_employees_path %>">Employees</a></li>
|
||||
<li>New</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_employees_path %>">Employees</a></li>
|
||||
<li>New</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', employee: @employee %>
|
||||
</div>
|
||||
|
||||
@@ -116,6 +116,7 @@
|
||||
<tr>
|
||||
<!-- <th>Menu Item Id</th> -->
|
||||
<th>item_instance_code</th>
|
||||
<th>item_instance_name</th>
|
||||
<th>item_attributes</th>
|
||||
<th>price</th>
|
||||
<th>is_on_promotion</th>
|
||||
@@ -131,6 +132,7 @@
|
||||
<tr>
|
||||
<!-- <td><%= settings_menu_item.menu_item_id %></td> -->
|
||||
<td><%= settings_menu_item.item_instance_code %></td>
|
||||
<td><%= settings_menu_item.item_instance_name %></td>
|
||||
<td><%= settings_menu_item.item_attributes %></td>
|
||||
<td><%= settings_menu_item.price %></td>
|
||||
<td><%= settings_menu_item.is_on_promotion %></td>
|
||||
|
||||
@@ -122,6 +122,7 @@
|
||||
<tr>
|
||||
<!-- <th>Menu Item Id</th> -->
|
||||
<th>item_instance_code</th>
|
||||
<th>Instances Name</th>
|
||||
<th>item_attributes</th>
|
||||
<th>price</th>
|
||||
<th>is_on_promotion</th>
|
||||
@@ -138,6 +139,7 @@
|
||||
<tr>
|
||||
|
||||
<td><%= settings_menu_item.item_instance_code %></td>
|
||||
<td><%= settings_menu_item.item_instance_name %></td>
|
||||
<td><%= settings_menu_item.item_attributes %></td>
|
||||
<td><%= settings_menu_item.price %></td>
|
||||
<td><%= settings_menu_item.is_on_promotion %></td>
|
||||
|
||||
@@ -166,12 +166,13 @@
|
||||
</div>
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
|
||||
<a href="<%= transactions_sales_path%>" style="margin-top: 10px " class="btn btn-primary pull-right btn-lg">
|
||||
<i class="fa fa-arrow-left fa-lg"></i> Back
|
||||
</a>
|
||||
|
||||
<a href="<%= transactions_sales_path%>" style="margin-top: 10px " class="btn btn-primary pull-right btn-lg">
|
||||
<i class="fa fa-arrow-left fa-lg"></i> Back
|
||||
</a>
|
||||
|
||||
<!-- Temporary No Needs -->
|
||||
<!-- <a href="<%= transactions_void_path(@sale)%>" style="margin-top: 10px " class="btn btn-primary pull-right btn-lg">
|
||||
|
||||
<i class="fa fa-trash fa-lg"></i> Void Sale
|
||||
</a>
|
||||
<a href="<%= transactions_manual_void_sale_path(@sale)%>" style="margin-top: 10px " class="btn btn-primary pull-right btn-lg">
|
||||
|
||||
Reference in New Issue
Block a user