This commit is contained in:
Nweni
2017-06-29 18:59:17 +06:30
parent 11c3be8f4a
commit 8046bc7745
9 changed files with 119 additions and 69 deletions

View File

@@ -12,54 +12,7 @@
<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'>
@@ -67,7 +20,7 @@
<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>
<span style='font-size:20px;'><b><input type='text' id='closing_balance_amount' value=''></b></span>
</div>
</div>
</div>
@@ -78,8 +31,11 @@
</div>
<script>
$('#close_cashier').on('click',function(){
var amount = $('#closing_balance_amount').val();
var shift_id = "<%= @shift.id %>"
$.ajax({type: "POST",
url: "<%= origami_close_shift_path %>",
data: "closing_balance="+ amount + "&shift_id="+ shift_id,
success:function(result){
console.log(result)
window.location.href = '/';