separate foodcourt module
This commit is contained in:
53
app/views/foodcourt/cash_outs/new.html.erb
Executable file
53
app/views/foodcourt/cash_outs/new.html.erb
Executable file
@@ -0,0 +1,53 @@
|
||||
<div class="container-fluid">
|
||||
<div class='row'>
|
||||
<div class="col-lg-10 col-md-10 col-sm-10">
|
||||
<h2><%= t :cash_out %></h2>
|
||||
<table class='table table-striped'>
|
||||
<tr>
|
||||
<td> <%= t :payment_reference %></td>
|
||||
<td><input type="text" class="form-control" placeholder="Reference" id="reference"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <%= t("views.right_panel.detail.remark") %></td>
|
||||
<td><input type="text" class="form-control" placeholder="Remark" id="remark"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <%= t("views.right_panel.detail.amount") %> </td>
|
||||
<td><input type="text" class="form-control" placeholder="Amount" id="amount"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<br><br>
|
||||
<button type="button" class="btn bg-default btn-block" id='back'> <i class="material-icons">reply</i><%= t("views.btn.back") %> </button>
|
||||
<button type="button" class="btn bg-blue btn-block" id='cash_out'> <%= t("views.btn.cash_out") %> </button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
cashier_type = '<%= @cashier_type %>';
|
||||
$('#cash_out').on('click',function(){
|
||||
var reference = $('#reference').val();
|
||||
var remark = $('#remark').val();
|
||||
var amount = $('#amount').val();
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= foodcourt_cash_outs_path %>",
|
||||
data: "reference="+ reference + "&remark=" + remark + "&amount="+ amount,
|
||||
success:function(result){
|
||||
if (cashier_type == 'quick_service' || cashier_type == 'food_court') {
|
||||
window.location.href = '/foodcourt/'+cashier_type+'/pending_order';
|
||||
}else{
|
||||
window.location.href = '/foodcourt';
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
$('#back').on('click',function(){
|
||||
if (cashier_type == 'quick_service' || cashier_type == 'food_court') {
|
||||
window.location.href = '/foodcourt/'+cashier_type+'/pending_order';
|
||||
}else{
|
||||
window.location.href = '/foodcourt';
|
||||
}
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user