multiple invoice void
This commit is contained in:
@@ -128,6 +128,7 @@
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
|
||||
<button type="button" id="pay" class="btn btn-primary btn-block">Pay</button>
|
||||
<button type="button" id="void" class="btn btn-primary btn-block"> Void </button>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
@@ -143,5 +144,21 @@ $('#pay').on('click',function() {
|
||||
});
|
||||
$('#back').on('click',function(){
|
||||
window.location.href = '/origami/table/<%= @table.id %>';
|
||||
})
|
||||
});
|
||||
$('#void').on('click',function () {
|
||||
var sure = confirm("Are you sure want to Void");
|
||||
if (sure == true) {
|
||||
var sale_id = $('#sale_id').val();
|
||||
var ajax_url = "/origami/sale/" + sale_id + '/void';
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: ajax_url,
|
||||
success: function () {
|
||||
window.location.href = '/origami/';
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user