update conflic
This commit is contained in:
@@ -137,25 +137,25 @@
|
||||
<% if !@total_dinein.nil? %>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.dine_in") %> : </td>
|
||||
<td align="right"><%= @total_dinein.total_dinein_cus %></td>
|
||||
<td align="right"><%= @total_dinein %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if !@total_takeaway.nil? %>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.takeaway") %> : </td>
|
||||
<td align="right"><%= @total_takeaway.total_take_cus %></td>
|
||||
<td align="right"><%= @total_takeaway %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if !@total_other_customer.nil? %>
|
||||
<!-- <% if !@total_other_customer.nil? %>
|
||||
<tr>
|
||||
<td><%= t :customer %> : </td>
|
||||
<td align="right"><%= @total_other_customer.total_cus %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %> -->
|
||||
<% if !@total_membership.nil? %>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.membership") %> : </td>
|
||||
<td align="right"><%= @total_membership.total_memb_cus %></td>
|
||||
<td align="right"><%= @total_membership %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
@@ -991,8 +991,9 @@
|
||||
});
|
||||
|
||||
$('#in_duties').on('click', function () {
|
||||
var dining_id = "<%= @dining.id %>"
|
||||
window.location.href = '/origami/assign_in_duty/'+ dining_id;
|
||||
var dining_id = "<%= @dining.id %>";
|
||||
var sale_id = "<%= @obj_sale.sale_id rescue "" %>";
|
||||
window.location.href = '/origami/assign_in_duty/'+ sale_id;
|
||||
});
|
||||
|
||||
$('#void').on('click', function () {
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
<span class="patch_method"></span>
|
||||
<%= f.error_notification %>
|
||||
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
|
||||
<%= f.hidden_field :booking_id, :value => @booking_id %>
|
||||
<%= f.hidden_field :sale_id, :value => @sale_id %>
|
||||
<div class="form-inputs form-group">
|
||||
<%= f.hidden_field :dinning_id, :value => @table.id, :class => "form-control col-md-4 " %>
|
||||
<label>Commissioner Name:</label>
|
||||
@@ -21,9 +23,9 @@
|
||||
<i class="material-icons">date_range</i>
|
||||
</span>
|
||||
<% if !@in_duty.in_time.nil?%>
|
||||
<input type="text" name="in_duty[in_time]" value="<%= @in_duty.in_time.strftime('%A, %d-%m-%Y') %>" class="datepicker form-control col-md-12" placeholder="Start Date...">
|
||||
<input type="text" name="in_duty[in_time]" id="in_duty_in_time" value="<%= @in_duty.in_time.strftime('%A, %d-%m-%Y') %>" class="datepicker form-control col-md-12" placeholder="Start Date...">
|
||||
<% else %>
|
||||
<input type="text" name="in_duty[in_time]" class="datetimepicker form-control col-md-12" placeholder="In Time...">
|
||||
<input type="text" name="in_duty[in_time]" id="in_duty_in_time" class="datetimepicker form-control col-md-12" placeholder="In Time...">
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -34,19 +36,19 @@
|
||||
<i class="material-icons">date_range</i>
|
||||
</span>
|
||||
<% if !@in_duty.out_time.nil?%>
|
||||
<input type="text" name="in_duty[out_time]" value="<%= @in_duty.out_time.strftime('%A, %d-%m-%Y') %>" class="datepicker form-control col-md-12" placeholder="Start Date...">
|
||||
<input type="text" name="in_duty[out_time]" id="in_duty_out_time" value="<%= @in_duty.out_time.strftime('%A, %d-%m-%Y') %>" class="datepicker form-control col-md-12" placeholder="Start Date...">
|
||||
<% else %>
|
||||
<input type="text" name="in_duty[out_time]" class="datetimepicker form-control col-md-12" placeholder="Out Time...">
|
||||
<input type="text" name="in_duty[out_time]" id="in_duty_out_time" class="datetimepicker form-control col-md-12" placeholder="Out Time...">
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div><br>
|
||||
|
||||
<div class="form-group">
|
||||
<!-- <div class="form-group">
|
||||
<% f.button :submit, "Create", :class => 'btn bg-blue ', :id => 'create' %>
|
||||
<% f.button :submit, "Update", :class => 'btn bg-blue ', :disabled => '', :id => 'update' %>
|
||||
<% f.button :button, "Reset", :class => 'btn bg-danger ', :id => 'reset' %>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="form-actions">
|
||||
<%= f.submit "Create In Duty", :class => 'btn bg-blue' %>
|
||||
</div>
|
||||
|
||||
@@ -53,11 +53,13 @@ $(function() {
|
||||
var commissioner_ids = $('#in_duty_commissioner_ids').val();
|
||||
var in_time = $('#in_duty_in_time').val();
|
||||
var out_time = $('#in_duty_out_time').val();
|
||||
var dining_id = '<%= @table.id %>'
|
||||
var dining_id = '<%= @table.id %>';
|
||||
var sale_id = '<%= @sale_id %>';
|
||||
var booking_id = '<%= @booking_id %>';
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ajax_url,
|
||||
data: 'dining_id=' + dining_id + "&commissioner_ids=" + commissioner_ids +'&in_time=' + in_time + "&out_time=" + out_time,
|
||||
data: 'dining_id=' + dining_id + "sale_id=" + sale_id + "booking_id=" + booking_id + "&commissioner_ids=" + commissioner_ids +'&in_time=' + in_time + "&out_time=" + out_time,
|
||||
success: function (result) {
|
||||
window.location.href = '/origami/assign_in_duty/'+ dining_id;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<td><%= in_duty.in_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %></td>
|
||||
<td><%= in_duty.out_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %></td>
|
||||
<td>
|
||||
<button class="delete btn btn-danger btn-sm waves-effect" data-ref="../table/<%=in_duty.dining_facility.id%>/destroy_in_duty/<%=in_duty.id%>" data-method="delete">
|
||||
<button class="delete btn btn-danger btn-sm waves-effect" data-ref="../table/<%=in_duty.dining_facility.id%>/<%= @sale_id %>/destroy_in_duty/<%=in_duty.id%>" data-method="delete">
|
||||
Remove
|
||||
</button>
|
||||
|
||||
@@ -68,7 +68,8 @@
|
||||
|
||||
var in_duty_id = $(this).attr('data-ref');
|
||||
var table_id = "<%= @table.id %>";
|
||||
var url = "/origami/assign_in_duty/table/" + table_id + "/in_duty/" + in_duty_id + "/edit";
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
var url = "/origami/assign_in_duty/table/" + sale_id + "/in_duty/" + in_duty_id + "/edit";
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
@@ -76,25 +77,30 @@
|
||||
data: {},
|
||||
|
||||
success: function (data) {
|
||||
debugger;
|
||||
$('.partial').empty().append(data);
|
||||
// $('#in_duty_id').val(data.in_duty.id);
|
||||
// $('#in_duty_commissioner_ids').val(data.commissioner.id);
|
||||
// $('#in_duty_in_time').val(data.in_duty.in_time);
|
||||
// $('#in_duty_out_time').val(data.in_duty.out_time);
|
||||
//
|
||||
// $('#update').removeAttr('disabled').val('');
|
||||
// $('#update').attr('value', 'Update');
|
||||
// $('#create').attr('disabled', 'disabled');
|
||||
//
|
||||
// $("#new_in_duty").attr('class', 'simple_form edit_in_duty');
|
||||
// var id = "edit_in_duty_" + in_duty_id;
|
||||
// $("#new_in_duty").attr('id', id);
|
||||
//
|
||||
// $(".edit_in_duty").attr('id', id);
|
||||
// $(".edit_in_duty").attr('action', '/origami/edit_in_duty/' + $('#in_duty_id').val());
|
||||
// $(".edit_in_duty").attr('action', '/origami/edit_in_duty/' + $('#in_duty_id').val());
|
||||
// $(".patch_method").html('<input type="hidden" name="_method" value="patch">');
|
||||
// debugger;
|
||||
// $('.partial').empty().append(data);
|
||||
var inT = new Date(data.in_duty.in_time);
|
||||
var in_time = ((inT.getDate() >= 10 ? inT.getDate() : '0'+inT.getDate()) +"-"+ (inT.getMonth() >= 10 ? inT.getMonth() : '0'+inT.getMonth()) +"-"+ inT.getFullYear() +" - "+ (inT.getHours()>10? inT.getHours() : '0'+inT.getHours()) +":"+ (inT.getMinutes() >= 10? inT.getMinutes() : '0'+inT.getMinutes()));
|
||||
var outT = new Date(data.in_duty.out_time);
|
||||
var out_time = ((outT.getDate() >= 10? outT.getDate() : '0'+outT.getDate()) +"-"+ (outT.getMonth() >= 10 ? outT.getMonth() : '0'+outT.getMonth()) +"-"+ outT.getFullYear() +" - "+ (outT.getHours()>10? outT.getHours() : '0'+outT.getHours()) +":"+ (outT.getMinutes() >= 10? outT.getMinutes() : '0'+outT.getMinutes()));
|
||||
|
||||
$('#in_duty_id').val(data.in_duty.id);
|
||||
$('#in_duty_commissioner_ids').val(data.commissioner.id);
|
||||
$('#in_duty_in_time').val(in_time);
|
||||
$('#in_duty_out_time').val(out_time);
|
||||
|
||||
// $('#update').removeAttr('disabled').val('');
|
||||
// $('#update').attr('value', 'Update');
|
||||
// $('#create').attr('disabled', 'disabled');
|
||||
|
||||
$("#new_in_duty").attr('class', 'simple_form edit_in_duty');
|
||||
var id = "edit_in_duty_" + data.in_duty.id;
|
||||
$("#new_in_duty").attr('id', data.in_duty.id);
|
||||
|
||||
$(".edit_in_duty").attr('id', data.in_duty.id);
|
||||
$(".edit_in_duty").attr('action', '/origami/edit_in_duty/' + $('#in_duty_id').val());
|
||||
$(".edit_in_duty").attr('action', '/origami/edit_in_duty/' + $('#in_duty_id').val());
|
||||
$(".patch_method").html('<input type="hidden" name="_method" value="patch">');
|
||||
|
||||
// setInterval(function () {
|
||||
// $('.partial').load('/controller_name/action_name');
|
||||
|
||||
Reference in New Issue
Block a user