This commit is contained in:
Myat Zin Wai Maw
2019-05-28 10:36:54 +06:30
44 changed files with 2617 additions and 355 deletions

View File

@@ -721,7 +721,6 @@ $(document).ready(function(){
var sale_id = $('#sale_id').text();
window.location.replace('/origami/sale/'+sale_id+'/cashier/payment');
}
/* replace url type*/
/* start check first bill or not*/
var member_id = $('#membership_id').text();
@@ -1125,6 +1124,8 @@ $(document).ready(function(){
<% else %>
$('#balance').text(parseFloat(result));
<% end %>
show_hide_btn($('#balance').text());
}
function customer_display_view(data,status) {
@@ -1831,4 +1832,15 @@ $(document).ready(function(){
}
},100);
});
function show_hide_btn(balance) {
// show discount when balance is greater than 0
// if(parseFloat(balance) > 0){
// $("#discount").show();
// $("#edit").show();
// }else{
// $("#discount").hide();
// $("#edit").hide();
// }
}
</script>

View File

@@ -26,7 +26,7 @@
<div class='col-md-6'>
<span style='font-size:20px;'><b><input type='number' class="form-control" id='closing_balance_amount' value='' onkeypress="return isNumberKey(event);" onkeyup="closeCashier(this.value);"></b></span>
</div>
</div>
</div><br>
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<button type="button" class="btn bg-default btn-block" id='back'><i class="material-icons">reply</i> <%= t("views.btn.back") %> </button>
@@ -59,6 +59,13 @@
</div>
<script>
// $(document).ready(function(){
// var val = $('#sale_items').val()
// if (val == 1) {
// $('#sale_items').prop( "checked", true );
// }
// })
function closeCashier(val){
var aa = parseInt(val);
if(isNaN(aa)) $("#closing_balance_amount").val("");
@@ -81,9 +88,10 @@
$('#close_cashier').on('click',function(){
var amount = $('#closing_balance_amount').val();
var shift_id = "<%= @shift.id rescue ""%>"
$.ajax({type: "POST",
url: "<%= origami_close_shift_path %>",
data: "closing_balance="+ amount + "&shift_id="+ shift_id,
data: "closing_balance="+ amount + "&shift_id="+ shift_id ,
success:function(result){
console.log(result)
window.location.href = '/';