multiple invoice void

This commit is contained in:
Zin Lin Phyo
2017-06-27 11:35:36 +06:30
parent c1646b812e
commit bcd44db9a2
11 changed files with 568 additions and 142 deletions

View File

@@ -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>