void
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
}
|
||||
</style>
|
||||
<%= javascript_include_tag 'custom', 'data-turbolinks-track': 'reload' %>
|
||||
<%= javascript_include_tag 'foodcourt', 'data-turbolinks-track': 'reload' %>
|
||||
<% if @booking.nil?%>
|
||||
<div class="page-header">
|
||||
<ol class="breadcrumb">
|
||||
@@ -24,7 +25,7 @@
|
||||
</div>
|
||||
<div class="row m-t--20">
|
||||
<% if !@booking.nil?%>
|
||||
<div class="col-md-9 col-lg-9 col-sm-12 m-t-10">
|
||||
<div class="col-md-8 col-lg-8 col-sm-12 m-t-10">
|
||||
<% else %>
|
||||
<div class="col-md-12 col-lg-12 col-sm-12 m-t-10">
|
||||
<% end %>
|
||||
@@ -57,80 +58,168 @@
|
||||
</div>
|
||||
</div>
|
||||
<% if !@booking.nil?%>
|
||||
<div class="col-md-3 col-lg-3 col-sm-12 m-t-10">
|
||||
<div class="card-header" style="padding: 0.12rem 0.25rem">
|
||||
<div class="row" style="margin:auto">
|
||||
<div class="col-md-9 col-lg-9 col-sm-9">
|
||||
<strong id="order-title" class="font-14 p-l-10">ORDER DETAILS </strong>| <span class="font-14">Table-<%=@booking.dining_facility.name%></span><br>
|
||||
<strong class="font-14 p-l-10">Booking - <%=@booking.booking_id%></strong><br>
|
||||
<strong class="font-14 p-l-10">Order No- <%=@booking.order_id%></strong>
|
||||
<span id="sale_id" style="display:none"><%= @booking.sale_id %></span>
|
||||
<div class="col-md-3 col-lg-3 col-sm-12 m-t-10">
|
||||
<div class="card-header" style="padding: 0.12rem 0.25rem">
|
||||
<div class="row" style="margin:auto">
|
||||
<div class="col-md-12 col-lg-12 col-sm-12">
|
||||
<strong id="order-title" class="font-14 p-l-10">ORDER DETAILS </strong>| <span class="font-14">Table-<%=@booking.dining_facility.name%></span><br>
|
||||
<strong class="font-14 p-l-10">Booking - <%=@booking.booking_id%></strong><br>
|
||||
<strong class="font-14 p-l-10">Order No- <%=@booking.order_id%></strong>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-lg-3 col-sm-3">
|
||||
<button type="button" class="btn btn-block btn-default waves-effect" id='back'>
|
||||
<i class="material-icons">reply</i>
|
||||
Back
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-text" id="order-detail-slimscroll" data-height="250">
|
||||
<table class="table table-striped summary-items">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th class="item-name">Items</th>
|
||||
<th class="item-qty">Qty</th>
|
||||
<th class="item-attr">Price</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="font-13">
|
||||
<% sub_total = 0
|
||||
count = 0
|
||||
%>
|
||||
<% @sale_data.sale_items.each do |sale_item|
|
||||
count += 1
|
||||
%>
|
||||
<% sub_total += sale_item.price%>
|
||||
<div class="card-block">
|
||||
<div class="card-text" id="order-detail-slimscroll" data-height="250">
|
||||
<table class="table table-striped summary-items">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><%= count %></td>
|
||||
<td class="item-name"><%=sale_item.product_name%>@<%=number_with_precision( sale_item.unit_price, precision: precision.to_i )%></td>
|
||||
<td class=""><%=sale_item.qty%></td>
|
||||
<td class="item-attr"><%=(number_with_precision(sale_item.price, precision: precision.to_i ))%></td>
|
||||
</tr>
|
||||
<%end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<th>#</th>
|
||||
<th class="item-name">Items</th>
|
||||
<th class="item-qty">Qty</th>
|
||||
<th class="item-attr">Price</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="font-13">
|
||||
<% sub_total = 0
|
||||
count = 0
|
||||
%>
|
||||
<% @sale_data.sale_items.each do |sale_item|
|
||||
count += 1
|
||||
%>
|
||||
<% sub_total += sale_item.price%>
|
||||
<tr>
|
||||
<td><%= count %></td>
|
||||
<td class="item-name"><%=sale_item.product_name%>@<%=number_with_precision( sale_item.unit_price, precision: precision.to_i )%></td>
|
||||
<td class=""><%=sale_item.qty%></td>
|
||||
<td class="item-attr"><%=(number_with_precision(sale_item.price, precision: precision.to_i ))%></td>
|
||||
</tr>
|
||||
<%end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer custom-card-footer" style="padding: 0.35rem 0.15rem !important;">
|
||||
<table class="table" id="order-charges-table" border="0">
|
||||
<tr>
|
||||
<td colspan="2" style="padding:2px; text-align:" class="charges-name" width="25%"><strong>Sub Total</strong></td>
|
||||
<td style="padding:2px; text-align:" width="25%" class="item-attr"><strong id="sub_total"><%=number_with_precision(sub_total, precision: precision.to_i)%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="padding:2px; text-align:" class="charges-name" width="25%"><strong>(Discount)</strong></td>
|
||||
<td style="padding:2px; text-align:" width="25%" class="item-attr"><strong id="sub_total">(<%= number_with_precision(@sale_data.total_discount, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %>)</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="padding:2px; text-align:" class="charges-name" width="25%"><strong>Total Tax</strong></td>
|
||||
<td style="padding:2px; text-align:" width="25%" class="item-attr"><strong id="sub_total"><%= number_with_precision(@sale_data.total_tax, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i )%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="padding:2px; text-align:" class="charges-name" width="25%"><strong>Rounding Adj</strong></td>
|
||||
<td style="padding:2px; text-align:" width="25%" class="item-attr"><strong id="sub_total"><%= number_with_precision(@sale_data.rounding_adjustment, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i )%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="padding:2px; text-align:" class="charges-name" width="25%"><strong>Grand Total</strong></td>
|
||||
<td style="padding:2px; text-align:" width="25%" class="item-attr"><strong id="sub_total"><%= number_with_precision(@sale_data.grand_total, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i )%></strong></td>
|
||||
</tr>
|
||||
</table>
|
||||
<button type="button" class="btn btn-primary action-btn create col-md-12" id="done_order" style="padding-top:4px !important;padding-bottom:4px !important;">DONE</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer custom-card-footer" style="padding: 0.35rem 0.15rem !important;">
|
||||
<table class="table" id="order-charges-table" border="0">
|
||||
<tr>
|
||||
<td colspan="2" style="padding:2px; text-align:" class="charges-name" width="25%"><strong>Sub Total</strong></td>
|
||||
<td style="padding:2px; text-align:" width="25%" class="item-attr"><strong id="sub_total"><%=number_with_precision(sub_total, precision: precision.to_i)%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="padding:2px; text-align:" class="charges-name" width="25%"><strong>(Discount)</strong></td>
|
||||
<td style="padding:2px; text-align:" width="25%" class="item-attr"><strong id="sub_total">(<%= number_with_precision(@sale_data.total_discount, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %>)</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="padding:2px; text-align:" class="charges-name" width="25%"><strong>Total Tax</strong></td>
|
||||
<td style="padding:2px; text-align:" width="25%" class="item-attr"><strong id="sub_total"><%= number_with_precision(@sale_data.total_tax, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i )%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="padding:2px; text-align:" class="charges-name" width="25%"><strong>Rounding Adj</strong></td>
|
||||
<td style="padding:2px; text-align:" width="25%" class="item-attr"><strong id="sub_total"><%= number_with_precision(@sale_data.rounding_adjustment, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i )%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="padding:2px; text-align:" class="charges-name" width="25%"><strong>Grand Total</strong></td>
|
||||
<td style="padding:2px; text-align:" width="25%" class="item-attr"><strong id="sub_total"><%= number_with_precision(@sale_data.grand_total, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i )%></strong></td>
|
||||
</tr>
|
||||
</table>
|
||||
<button type="button" class="btn btn-primary action-btn create col-md-12" id="done_order" style="padding-top:4px !important;padding-bottom:4px !important;">DONE</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1 col-lg-1 col-sm-12">
|
||||
<button type="button" class="btn btn-block btn-default waves-effect" id='back'>
|
||||
<i class="material-icons">reply</i>
|
||||
Back
|
||||
</button>
|
||||
<a class="btn btn-block bg-red waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="modal fade" id="voidModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="voidModalLabel">Please Enter Reason for Void</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input type="textarea" name="remark" class="form-control col-md-12 remark" id="remark">
|
||||
</div>
|
||||
<div class="modal-footer ">
|
||||
<div class="row p-r-20">
|
||||
<div class="col-md-5">
|
||||
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-red waves-effect " id="void" active="true">VOID</button>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue waves-effect" data-dismiss="modal">CLOSE</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="modal fade" id="AccessCodeModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-sm" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="AccessCodeModalLabel">Enter Access Code</h4>
|
||||
<button type="button" class="close" id="close" data-dismiss="modal" aria-hidden="true" style="font-size: 20px;color:#111;">×</button>
|
||||
</div>
|
||||
<div class="modal-body" style="padding: 0px 25px 15px 25px !important">
|
||||
<input type="password" id="access_code" class="access_code form-control col-md-12 ">
|
||||
<div class="row bottom p-l-15 p-r-15 m-t-10">
|
||||
<div class="col-md-3 access_number border-top border-left" data-value="1" data-type="num">1</div>
|
||||
<div class="col-md-3 access_number border-top border-left" data-value="2" data-type="num">2</div>
|
||||
<div class="col-md-3 access_number border-top border-left" data-value="3" data-type="num">3</div>
|
||||
<div class="col-md-3 access_number border-top border-left" data-value="4" data-type="num">4</div>
|
||||
</div>
|
||||
<div class="row bottom p-l-15 p-r-15">
|
||||
<div class="col-md-3 access_number border-top border-left" data-value="5" data-type="num">5</div>
|
||||
<div class="col-md-3 access_number border-top border-left" data-value="6" data-type="num">6</div>
|
||||
<div class="col-md-3 access_number border-top border-left" data-value="7" data-type="num">7</div>
|
||||
<div class="col-md-3 access_number border-top border-left" data-value="8" data-type="num">8</div>
|
||||
</div>
|
||||
<div class="row bottom p-l-15 p-r-15">
|
||||
<div class="col-md-3 access_number border-top border-left" data-value="9" data-type="num">9</div>
|
||||
<div class="col-md-3 access_number border-top border-left" data-value="0" data-type="num">0</div>
|
||||
<div class="col-md-3 access_number border-top border-left orange" data-type="clr">Clr</div>
|
||||
<div class="col-md-3 access_number ok border-top border-left blue" data-type="ok" data-action="">OK</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="AccessCodeModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-sm" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="AccessCodeModalLabel">Enter Access Code</h4>
|
||||
<button type="button" class="close" id="close" data-dismiss="modal" aria-hidden="true" style="font-size: 20px;color:#111;">×</button>
|
||||
</div>
|
||||
<div class="modal-body" style="padding: 0px 25px 15px 25px !important">
|
||||
<input type="password" id="access_code" class="access_code form-control col-md-12 ">
|
||||
<div class="row bottom p-l-15 p-r-15 m-t-10">
|
||||
<div class="col-md-3 access_number border-top border-left" data-value="1" data-type="num">1</div>
|
||||
<div class="col-md-3 access_number border-top border-left" data-value="2" data-type="num">2</div>
|
||||
<div class="col-md-3 access_number border-top border-left" data-value="3" data-type="num">3</div>
|
||||
<div class="col-md-3 access_number border-top border-left" data-value="4" data-type="num">4</div>
|
||||
</div>
|
||||
<div class="row bottom p-l-15 p-r-15">
|
||||
<div class="col-md-3 access_number border-top border-left" data-value="5" data-type="num">5</div>
|
||||
<div class="col-md-3 access_number border-top border-left" data-value="6" data-type="num">6</div>
|
||||
<div class="col-md-3 access_number border-top border-left" data-value="7" data-type="num">7</div>
|
||||
<div class="col-md-3 access_number border-top border-left" data-value="8" data-type="num">8</div>
|
||||
</div>
|
||||
<div class="row bottom p-l-15 p-r-15">
|
||||
<div class="col-md-3 access_number border-top border-left" data-value="9" data-type="num">9</div>
|
||||
<div class="col-md-3 access_number border-top border-left" data-value="0" data-type="num">0</div>
|
||||
<div class="col-md-3 access_number border-top border-left orange" data-type="clr">Clr</div>
|
||||
<div class="col-md-3 access_number ok border-top border-left blue" data-type="ok" data-action="">OK</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
@@ -168,4 +257,37 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#void').on('click', function () {
|
||||
var access_code = localStorage.getItem("access_code");
|
||||
swal({
|
||||
title: "Alert",
|
||||
text: "Are you sure want to Void?",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "Yes, void it!",
|
||||
closeOnConfirm: false
|
||||
}, function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
$('.confirm').prop("disabled",true);
|
||||
var sale_id = $('#sale_id').text();
|
||||
var remark = $("#remark").val();
|
||||
var ajax_url = "/foodcourt/sale/" + sale_id +'/food_court/void';
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: ajax_url,
|
||||
data: "remark="+ remark + "&sale_id=" + sale_id+ "&access_code=" + access_code,
|
||||
success: function (result) {
|
||||
// For Server Print - from jade
|
||||
if ($("#server_mode").val() == "cloud") {
|
||||
if(typeof code2lab != 'undefined'){
|
||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||
}
|
||||
}
|
||||
window.location.href = '/foodcourt/app_orders';
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -389,53 +389,22 @@
|
||||
</div>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
|
||||
<button type="button" class="btn btn-block btn-default waves-effect" id='refresh'>
|
||||
<!-- <i class="material-icons">reply</i> -->
|
||||
Refresh
|
||||
</button>
|
||||
<!-- -->
|
||||
<% if current_login_employee.role == "cashier" %>
|
||||
<% if @other_payment <= 0 && @sale_payment.nil? %>
|
||||
<% if @sale_payment.nil? %>
|
||||
<button type="button" class="btn bg-red btn-block" data-toggle="modal" data-target="#voidModal" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void </button>
|
||||
<% if @other_payment <= 0 %>
|
||||
<%if @sale_data.total_discount == 0 %>
|
||||
<a class="btn btn-block bg-deep-purple waves-effect access_modal" data-toggle="modal" data-type="foc"> FOC</a>
|
||||
<% end %>
|
||||
<%end %>
|
||||
<% if @sale_payment.nil? %>
|
||||
<a class="btn btn-block bg-red waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a>
|
||||
<% if @other_payment <= 0 %>
|
||||
<%if @sale_data.total_discount == 0 %>
|
||||
<a class="btn btn-block bg-deep-purple waves-effect access_modal" data-toggle="modal" data-type="waste"> Waste</a>
|
||||
<a class="btn btn-block bg-deep-purple waves-effect access_modal" data-toggle="modal" data-type="spoile"> Spoile</a>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if @other_payment <= 0 && @sale_payment.nil?%>
|
||||
<%if @sale_data.total_discount == 0 %>
|
||||
<button type="button" class="btn bg-deep-purple btn-block" data-toggle="modal" data-target="#focModal" <%= (can? :foc, :payment)? ' ': 'disabled=' %> active="true"> FOC </button>
|
||||
<%end %>
|
||||
<%end %>
|
||||
<% if @sale_payment.nil? %>
|
||||
<button type="button" class="btn bg-red btn-block" data-toggle="modal" data-target="#voidModal" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void </button>
|
||||
<% if @other_payment <= 0 %>
|
||||
<%if @sale_data.total_discount == 0 %>
|
||||
<button type="button" class="btn btn-block bg-deep-purple waves-effect " data-status="waste" value="waste" id="btn_waste" onclick="waste_and_spoilage('waste')">Waste</button>
|
||||
<button type="button" class="btn btn-block bg-deep-purple waves-effect " data-status="spoile" value="spoile" id="btn_spoile" onclick="waste_and_spoilage('spoile')">Spoile</button>
|
||||
<% end %>
|
||||
<button type="button" class="btn btn-block bg-deep-purple waves-effect " data-status="waste" value="waste" id="btn_waste" onclick="waste_and_spoilage('waste')">Waste</button>
|
||||
<button type="button" class="btn btn-block bg-deep-purple waves-effect " data-status="spoile" value="spoile" id="btn_spoile" onclick="waste_and_spoilage('spoile')">Spoile</button>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if (@cashier_type=="quick_service" || @cashier_type=="food_court") && @sale_payment.nil? %>
|
||||
<hr>
|
||||
<% if current_login_employee.role == "cashier" %>
|
||||
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="edit">Edit</a>
|
||||
<% else %>
|
||||
<button type="button" class="btn btn-block bg-blue waves-effect" id='edit' <%= (can? :edit, :sale_edit)? ' ': 'disabled=' %> active="true">Edit</button>
|
||||
<% end %>
|
||||
|
||||
<button type="button" id="discount" class="btn btn-block bg-blue waves-effect" <%= (can? :index, :discount)? ' ': 'disabled=' %> active="true">Discount</button>
|
||||
<button type="button" id="other-charges" class="btn btn-block bg-blue waves-effect">Charges</button>
|
||||
<!-- Waiter Buttons -->
|
||||
<% if @sale_payment.nil? %>
|
||||
<hr>
|
||||
<button type="button" class="btn btn-block bg-blue waves-effect" id='edit' <%= (can? :edit, :sale_edit)? ' ': 'disabled=' %> active="true">Edit</button>
|
||||
<button type="button" id="discount" class="btn btn-block bg-blue waves-effect" <%= (can? :index, :discount)? ' ': 'disabled=' %> active="true">Discount</button>
|
||||
<button type="button" id="other-charges" class="btn btn-block bg-blue waves-effect">Charges</button>
|
||||
<%end %>
|
||||
</div>
|
||||
<input type="hidden" id="server_mode" value="<%= ENV["SERVER_MODE"] %>">
|
||||
@@ -1313,55 +1282,6 @@ $(document).ready(function(){
|
||||
var sale_id = $("#sale_id").text() || 0;
|
||||
update_sale("", customer_id, customer_name, sale_id);
|
||||
});
|
||||
|
||||
$(document).on('click', '.access_modal', function(event){
|
||||
type = $(this).data("type");
|
||||
$(".ok").attr("data-action",type)
|
||||
$('#AccessCodeModal').modal('show');
|
||||
});
|
||||
|
||||
function check_emp_access_code(access_code,type) {
|
||||
var url = "/foodcourt/check_emp_access_code/" + access_code ;
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: url,
|
||||
data: {},
|
||||
success: function (result) {
|
||||
// console.log(result)
|
||||
if (result.status == true) {
|
||||
createAccessCode(code);
|
||||
if (type == "edit") {
|
||||
var dining_id = $('#dining').text();
|
||||
var sale_id = $('#sale_id').text();
|
||||
if (dining_id) {
|
||||
window.location.href = '/foodcourt/table/' + dining_id + "/sale/" + sale_id + "/"+cashier_type+"/edit";
|
||||
}else{
|
||||
window.location.href = "/foodcourt/table/sale/" + sale_id + "/"+cashier_type+"/edit";
|
||||
}
|
||||
}else if(type == "void"){
|
||||
$('#AccessCodeModal').modal('hide');
|
||||
$('#voidModal').modal('show');
|
||||
// overall_void();
|
||||
}else if(type == "waste") {
|
||||
// $('#AccessCodeModal').modal('hide');
|
||||
// $('#focModal').modal('show');
|
||||
waste_and_spoilage("waste")
|
||||
}else if(type == "spoile") {
|
||||
// $('#AccessCodeModal').modal('hide');
|
||||
// $('#voidModal').modal('show');
|
||||
waste_and_spoilage("spoile")
|
||||
}else if(type == "foc"){
|
||||
$('#AccessCodeModal').modal('hide');
|
||||
$('#focModal').modal('show');
|
||||
// overall_foc();
|
||||
}
|
||||
}else{
|
||||
swal("Oops",result.message,"warning");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#foc').on('click', function () {
|
||||
var access_code = localStorage.getItem("access_code");
|
||||
var remark = $("#foc_remark").val();
|
||||
@@ -1417,50 +1337,6 @@ $(document).ready(function(){
|
||||
});
|
||||
});
|
||||
|
||||
$('#void').on('click', function () {
|
||||
var access_code = localStorage.getItem("access_code");
|
||||
swal({
|
||||
title: "Alert",
|
||||
text: "Are you sure want to Void?",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "Yes, void it!",
|
||||
closeOnConfirm: false
|
||||
}, function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
$('.confirm').prop("disabled",true);
|
||||
var sale_id = $('#sale_id').text();
|
||||
var remark = $("#remark").val();
|
||||
var ajax_url = "/foodcourt/sale/" + sale_id +'/'+cashier_type+ '/void';
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: ajax_url,
|
||||
data: "remark="+ remark + "&sale_id=" + sale_id+ "&access_code=" + access_code,
|
||||
success: function (result) {result
|
||||
customer_display_view(null,"reload");
|
||||
// For Server Print - from jade
|
||||
if ($("#server_mode").val() == "cloud") {
|
||||
if(typeof code2lab != 'undefined'){
|
||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||
}
|
||||
}
|
||||
var flag = localStorage.getItem("trans_flag");
|
||||
if((flag!=null) && (flag != "true")){
|
||||
window.location.href = '/transactions/sales/'+sale_id;
|
||||
}else{
|
||||
if (cashier_type=="cashier") {
|
||||
window.location.href = '/foodcourt';
|
||||
}else{
|
||||
window.location.href = '/foodcourt/'+cashier_type;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function waste_and_spoilage(remark) {
|
||||
var access_code = localStorage.getItem("access_code");
|
||||
var sale_id = $('#sale_id').text();
|
||||
@@ -1784,4 +1660,39 @@ $(document).ready(function(){
|
||||
}
|
||||
},100);
|
||||
});
|
||||
$('#void').on('click', function () {
|
||||
alert("in void");
|
||||
var access_code = localStorage.getItem("access_code");
|
||||
swal({
|
||||
title: "Alert",
|
||||
text: "Are you sure want to Void?",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "Yes, void it!",
|
||||
closeOnConfirm: false
|
||||
}, function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
$('.confirm').prop("disabled",true);
|
||||
var sale_id = $('#sale_id').text();
|
||||
var remark = $("#remark").val();
|
||||
var ajax_url = "/foodcourt/sale/" + sale_id +'/food_court/void';
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: ajax_url,
|
||||
data: "remark="+ remark + "&sale_id=" + sale_id+ "&access_code=" + access_code,
|
||||
success: function (result) {result
|
||||
customer_display_view(null,"reload");
|
||||
// For Server Print - from jade
|
||||
if ($("#server_mode").val() == "cloud") {
|
||||
if(typeof code2lab != 'undefined'){
|
||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||
}
|
||||
}
|
||||
window.location.href = '/foodcourt/food_court';
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user