Add CB settlement report and transaction
This commit is contained in:
@@ -96,7 +96,13 @@
|
||||
<td><%= cardSale.res_date %> <%= cardSale.res_time.utc.getlocal.strftime("%I:%M %p") %></td>
|
||||
<td><%= cardSale.ref_no %></td>
|
||||
<td><%= cardSale.res_amt %></td>
|
||||
<td><%= cardSale.app %></td>
|
||||
<td>
|
||||
<% if cardSale.app == 'cup' %>
|
||||
UNION
|
||||
<% else %>
|
||||
<%= cardSale.app %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= cardSale.sale.customer.name rescue '-' %></td>
|
||||
<td><%= cardSale.sale.cashier_name rescue '-' %></td>
|
||||
|
||||
@@ -176,7 +182,7 @@
|
||||
search_by_date();
|
||||
});
|
||||
|
||||
function search_by_date(){
|
||||
function search_by_date(){
|
||||
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
@@ -196,9 +202,50 @@
|
||||
if(check_arr.length == 3){
|
||||
check_arr = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function show_shift_name(period,period_type,from,to,shift_item){
|
||||
var shift = $('#shift_name');
|
||||
if (from == '' && to == '') {
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
}
|
||||
shift.empty();
|
||||
|
||||
var str = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '<%= params[:shift_name] rescue '-'%>';
|
||||
|
||||
url = '<%= reports_get_shift_by_date_path %>';
|
||||
|
||||
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
|
||||
|
||||
str = '<option value="0">--- All Shift ---</option>';
|
||||
$(data.message).each(function(index){
|
||||
|
||||
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
|
||||
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
|
||||
var shift_id = data.message[index].shift_id ;
|
||||
if(param_shift != ''){
|
||||
if(shift_id == param_shift){
|
||||
selected = 'selected = "selected"';
|
||||
}
|
||||
else{
|
||||
selected = '';
|
||||
}
|
||||
}else{
|
||||
selected = '';
|
||||
}
|
||||
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
|
||||
|
||||
// console.log(sh_date)
|
||||
})
|
||||
shift.append(str);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user