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

@@ -11,7 +11,7 @@
</tr>
<tr>
<td><strong>Table No</strong> <% if @sale_data%>- <%=@sale_data.receipt_no%><% end %></td>
<td><strong>Sale Id</strong> </span><span id="sale_id"><% if @sale_data %><%=@sale_data.sale_id %><% end %></td>
<td><strong>Sale Id</strong> <span id="sale_id"><% if @sale_data %><%=@sale_data.sale_id %><% end %></span></td>
</tr>
<tr>
<td><strong>Customer :</strong> <%= @sale_data.customer.name%></td>
@@ -244,7 +244,7 @@
<button type="button" class="btn btn-primary btn-block" onclick="localStorage.removeItem('cash');window.location.href = '/origami';"> Back </button>
<button type="button" class="btn btn-primary btn-block"> FOC </button>
<button type="button" class="btn btn-primary btn-block"> Void </button>
<button type="button" class="btn btn-primary btn-block" id="void"> Void </button>
</div>
</div>
@@ -354,6 +354,23 @@ $( document ).ready(function() {
}
});
$('#void').on('click',function () {
var sure = confirm("Are you sure want to Void");
if (sure == true) {
var sale_id = $('#sale_id').text();
var ajax_url = "/origami/sale/" + sale_id + '/void';
$.ajax({
type: 'POST',
url: ajax_url,
success: function () {
window.location.href = '/origami/';
}
})
} else {
}
});
});
function update_balance(){
@@ -369,4 +386,5 @@ function update_balance(){
var result = amount_due - total;
$('#balance').text(result.toFixed(2));
}
</script>