merge with old_town_aston req
This commit is contained in:
3
app/views/origami/split_bill/index.html.erb
Executable file → Normal file
3
app/views/origami/split_bill/index.html.erb
Executable file → Normal file
@@ -387,7 +387,8 @@
|
||||
$('#order_item_split').on('click',function () {
|
||||
var cnt_order_item = "<%= @order_items.count %>";
|
||||
var order_items = get_selected_order_items();// Selected Order Items
|
||||
var cnt_items = parseInt(cnt_order_item) - parseInt(order_items.length);
|
||||
|
||||
var cnt_items = parseInt(cnt_order_item - 1) - parseInt(order_items.length);
|
||||
if (order_items.length > 0){
|
||||
// if(cnt_items > 0){
|
||||
swal({
|
||||
|
||||
76
app/views/origami/table_invoices/show.html.erb
Executable file → Normal file
76
app/views/origami/table_invoices/show.html.erb
Executable file → Normal file
@@ -157,11 +157,59 @@
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button id="back" type="button" class="btn btn-block btn-lg bg-default"> <i class="material-icons">reply</i> <%= t("views.btn.back") %>
|
||||
<button type="button" id="pay" class="btn bg-blue btn-block">Pay</button>
|
||||
<button type="button" class="btn bg-deep-purple btn-block" id="foc" active="<%= can? :foc, :payment %>"> FOC </button>
|
||||
<button type="button" id="void" class="btn bg-danger btn-block" active="<%= can? :overall_void, :void %>" > Void </button>
|
||||
<button type="button" class="btn bg-deep-purple btn-block" data-toggle="modal" data-target="#focModal" <%= (can? :foc, :payment)? ' ': 'disabled=' %> active="true"> FOC </button>
|
||||
<button type="button" data-toggle="modal" data-target="#voidModal" class="btn bg-danger btn-block" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void </button>
|
||||
</div>
|
||||
</div>
|
||||
</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>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="focModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="focModalLabel">Please Enter Reason for FOC</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input type="textarea" name="remark" class="form-control col-md-12 remark" id="foc_remark">
|
||||
</div>
|
||||
<div class="modal-footer ">
|
||||
<div class="row p-r-20">
|
||||
<div class="col-md-5">
|
||||
<button type="button" class="btn btn-link bg-red waves-effect " id="foc" active="true">FOC</button>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<button type="button" class="btn btn-link bg-blue waves-effect" data-dismiss="modal">CLOSE</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".tables").on('click', function(){
|
||||
@@ -177,17 +225,18 @@ $(document).ready(function(){
|
||||
$('#pay').on('click',function() {
|
||||
var sale_id = '<%= @sale.id %>';
|
||||
|
||||
var url = '<%= @calculate_rouding_adj_path %>';
|
||||
// var url = '<%= @calculate_rouding_adj_path %>';
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
success:function(result){
|
||||
// location.reload();
|
||||
}
|
||||
});
|
||||
// $.ajax({
|
||||
// type: "GET",
|
||||
// url: url,
|
||||
// success:function(result){
|
||||
// // console.log(result);
|
||||
// }
|
||||
// });
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/cashier/payment";
|
||||
});
|
||||
|
||||
$('#back').on('click',function(){
|
||||
var lookup_split_bill = '<%= @split_bill %>';
|
||||
if(lookup_split_bill == '1'){
|
||||
@@ -211,10 +260,12 @@ $('#void').on('click',function () {
|
||||
}, function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
var sale_id = $('#sale_id').val();
|
||||
var remark = $("#remark").val();
|
||||
var ajax_url = "/origami/sale/" + sale_id + '/void';
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: ajax_url,
|
||||
data: "remark="+ remark + "&sale_id=" + sale_id,
|
||||
success: function () {
|
||||
window.location.href = '/origami';
|
||||
}
|
||||
@@ -227,13 +278,14 @@ $('#void').on('click',function () {
|
||||
});
|
||||
|
||||
$('#foc').click(function() {
|
||||
var remark = $("#foc_remark").val();
|
||||
var cash = $('#grand_total').text();
|
||||
var sub_total = $('#sub_total').text();
|
||||
var sale_id = '';
|
||||
if($('.receipt_block > div').hasClass('selected-item')){
|
||||
sale_id = $('.receipt_block > div.selected-item').parent().attr('data-id');
|
||||
}
|
||||
var params = { 'cash':cash,'sale_id':sale_id,'sub_total':sub_total };
|
||||
var params = { 'cash':cash,'sale_id':sale_id,'sub_total':sub_total,'remark':remark,'type':'cashier' };
|
||||
// console.log(sale_id);
|
||||
if(sale_id != ''){
|
||||
if ($(this).attr('active')=== "true") {
|
||||
@@ -247,7 +299,7 @@ $('#foc').click(function() {
|
||||
title: "Information!",
|
||||
text: 'Thank You !',
|
||||
}, function () {
|
||||
window.location.href = '/origami';
|
||||
window.location.href = '/origami';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user