shift open/close
This commit is contained in:
@@ -1,2 +1 @@
|
||||
<h1>Origami::Shifts#edit</h1>
|
||||
<p>Find me in app/views/origami/shifts/edit.html.erb</p>
|
||||
<h1> Close Cashier </h1>
|
||||
|
||||
@@ -1,2 +1,92 @@
|
||||
<h1>Origami::Shifts#show</h1>
|
||||
<p>Find me in app/views/origami/shifts/show.html.erb</p>
|
||||
|
||||
<div class='row'>
|
||||
<div class='col-md-10'>
|
||||
<h1>Close Cashier</h1>
|
||||
<br>
|
||||
<table class='table table-striped'>
|
||||
<tr>
|
||||
<td>Shift Started At</td>
|
||||
<td><%= @shift.shift_started_at.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-' %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cashier Name</td>
|
||||
<td><%= @shift.employee.name rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Opening Balance</td>
|
||||
<td><%= @shift.opening_balance rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Total Revenue</td>
|
||||
<td><%= @shift.total_revenue rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Total Discount</td>
|
||||
<td><%= @shift.total_discounts rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Total Tax</td>
|
||||
<td><%= @shift.total_taxes rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Grand Total</td>
|
||||
<td><%= @shift.grand_total rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Nett Sale</td>
|
||||
<td><%= @shift.nett_sales rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cash Sale</td>
|
||||
<td><%= @shift.cash_sales rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Credit Sale</td>
|
||||
<td><%= @shift.credit_sales rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Other Sale</td>
|
||||
<td><%= @shift.other_sales rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Commercial Tax</td>
|
||||
<td><%= @shift.commercial_taxes rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cash In</td>
|
||||
<td><%= @shift.cash_in rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cash Out</td>
|
||||
<td><%= @shift.cash_out rescue ''%></td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr>
|
||||
<div class='row'>
|
||||
<div class='col-md-5'>
|
||||
<span style='font-size:20px;'><b>Closing Balance</b></span>
|
||||
</div>
|
||||
<div class='col-md-6'>
|
||||
<span style='font-size:20px;padding-left:18px;'><b><%= @shift.closing_balance rescue ''%></b></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<button type="button" class="btn btn-primary btn-block" id='back'> Back </button>
|
||||
<button type="button" class="btn btn-primary btn-block green" id='close_cashier'> Close Cashier </button>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#close_cashier').on('click',function(){
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_close_shift_path %>",
|
||||
success:function(result){
|
||||
console.log(result)
|
||||
window.location.href = '/';
|
||||
}
|
||||
});
|
||||
})
|
||||
$('#back').on('click',function(){
|
||||
window.location.href = '/origami';
|
||||
})
|
||||
</script>
|
||||
|
||||
1
app/views/origami/shifts/update_shift.json.jbuilder
Normal file
1
app/views/origami/shifts/update_shift.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.status true
|
||||
Reference in New Issue
Block a user