update survey

This commit is contained in:
Aung Myo
2017-11-07 14:49:42 +06:30
parent 0ad958d8a8
commit 97c03c1744
5 changed files with 85 additions and 25 deletions

View File

@@ -402,11 +402,11 @@
if (sale) {
var sale_id = sale
} else {
var sale_id = $('#save_order_id').attr('data-order');
var sale_id = $('.tables').attr("data-id");;
}
var table_id = $('.tables').attr("data-id");
//var table_id = $('.tables').attr("data-id");
window.location.href = '/origami/' + sale_id + "/survey"
window.location.href = '/origami/' + sale_id + "/surveys"
});
// bind customer to order or sale

View File

@@ -1,14 +1,42 @@
<div class="row">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
<%= simple_form_for([:settings,@settings_account]) do |f| %>
<%= simple_form_for(@survey, :url => origami_create_surveys_path) do |f| %>
<%= f.error_notification %>
<div class="form-inputs p-l-10">
<%= f.input :title ,:input_html=>{:class=>"col-md-10"},:required=>true%>
<%= f.input :account_type, :collection => Lookup.collection_of("account_type"),:input_html=>{:class=>"col-md-10"},:required=>true %>
<%= f.input :discount %>
<%= f.input :point %>
<%= f.input :bonus %>
<%= f.input :rebate %>
<%= f.input :child%>
<%= f.input :adult %>
<%= f.input :male %>
<%= f.input :female %>
<%= f.input :local %>
<div class="row clearfix">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="form-group">
<label>Foreigner</label>
<select class="form-control col-md-12 selectpicker show-tick" name="survey[foreigner]" style="height: " >
<% Lookup.where("lookup_type = ?", "country" ).each do |ct| %>
<option value="<%= ct.value %>">
<%= ct.name %></option>
<%end %>
</select>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="form-group">
<label>Number</label>
<input type="number" name="survey[foreigner]" class="form-control">
</div>
</div>
</div>
<%= f.input :total_customer %>
<input type="hidden" name="table_id" value="<%=@dining_facility.id%>">
<%= f.input :dining_name, :as => :hidden, :input_html => { :value => @dining_facility.name } %>
<%= f.input :created_by, :as => :hidden, :input_html => { :value => current_login_employee.name } %>
<%= f.input :receipt_no, :as => :hidden, :input_html => { :value => @receipt_no} %>
<%= f.input :total_amount, :as => :hidden, :input_html => { :value => @grand_total } %>
</div>
<div class="form-actions">
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
@@ -40,3 +68,5 @@
</div>
</div>
</div>
</div>

View File

@@ -1,12 +1,12 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= origami_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= settings_accounts_path %>"><%= t("views.right_panel.detail.account") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.detail.survey") %></a></li>
<li class="breadcrumb-item active"><%= t("views.btn.new") %></li>
<span class="float-right">
<%= link_to t('.back', :default => t("views.btn.back")), settings_accounts_path %>
<%= link_to t('.back', :default => t("views.btn.back")), root_path %>
</span>
</ol>
</div>
<%= render 'form', settings_account: @settings_account %>
<%= render 'form', survey: @survey %>