update promtion and dining charges

This commit is contained in:
Aung Myo
2017-10-25 18:13:44 +06:30
parent fa5b544416
commit d5141c30bb
12 changed files with 245 additions and 194 deletions

View File

@@ -104,10 +104,10 @@ $(document).on('turbolinks:load', function() {
}); });
$(document).on("focus", "[data-behaviour~='datepicker']", function(e){ // $(document).on("focus", "[data-behaviour~='datepicker']", function(e){
$(this).datepicker({"format": "yyyy-M-dd", "weekStart": 1, "autoclose": true}); // $(this).datepicker({"format": "yyyy-M-dd", "weekStart": 1, "autoclose": true});
$('.dropdown-toggle').dropdown(); // $('.dropdown-toggle').dropdown();
}); // });
function export_to(path) function export_to(path)
{ {

View File

@@ -214,6 +214,12 @@ section.content {
margin-top: 7px; margin-top: 7px;
} }
.bmd-form-group .bmd-label-static{
font-size: 0.85rem;
}
.form-group {
margin-bottom: 15px;
}
/* FORM */ /* FORM */
.input-group-addon { .input-group-addon {
padding: 0rem 0rem; padding: 0rem 0rem;

View File

@@ -4,15 +4,52 @@
<%= f.error_notification %> <%= f.error_notification %>
<div class="form-inputs p-l-15"> <div class="form-inputs p-l-15">
<%= f.input :item_code, :input_html => { :id => 'item_code' } %> <%= f.input :item_code, :input_html => { :id => 'item_code',:class=>"col-md-9" } %>
<%= f.input :unit_price, :input_html => { :id => 'unit_price'} %> <%= f.input :unit_price, :input_html => { :id => 'unit_price',:class=>"col-md-9"} %>
<%= f.input :taxable %> <%= f.input :taxable, :input_html => {:class=>"col-md-9"} %>
<%= f.input :charge_type, :collection => [:hr, :day] %> <%= f.input :charge_type, :collection => [:hr, :day], :input_html => {:class=>"col-md-8"} %>
<%= f.input :minimum_free_time %> <!--<%= f.input :minimum_free_time ,:input_html => { :class => 'timepicker'} %> -->
<%= f.input :charge_block, :input_html => { :id => 'charge_block'} %> <label class="control-label">* Minimum Free Time</label>
<%= f.input :time_rounding, :collection => [:down, :up] %> <div class="input-group">
<%= f.input :time_rounding_block, :input_html => { :id => 'time_rounding_block'} %> <span class="input-group-addon">
<%= f.input :time_rounding_block_price, :input_html => { :id => 'time_rounding_block_price'} %> <i class="material-icons">access_time</i>
</span>
<% if !@dining_charge.minimum_free_time.nil?%>
<input type="text" name="minimum_free_time" value="<%= @dining_charge.minimum_free_time.utc.strftime('%H:%M') %>" class="timepicker form-control col-md-8" placeholder="Start Time...">
<% else %>
<input type="text" name="minimum_free_time" class="timepicker form-control col-md-8" placeholder="Start Time...">
<% end %>
</div>
<!--<%= f.input :charge_block, :input_html => { :id => 'charge_block'} %>-->
<div class="form-group">
<label class="control-label required"> Change Block</label>
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">access_time</i>
</span>
<% if !@dining_charge.charge_block.nil?%>
<input type="text" name="charge_block" value="<%= @dining_charge.charge_block.utc.strftime('%H:%M') %>" class="timepicker form-control col-md-8" placeholder="Start Time...">
<% else %>
<input type="text" name="charge_block" class="timepicker form-control col-md-8" placeholder="Start Time...">
<% end %>
</div>
</div>
<%= f.input :time_rounding, :collection => [:down, :up], :input_html => { :class=>"col-md-8"} %>
<!-- <%= f.input :time_rounding_block, :input_html => { :id => 'time_rounding_block'} %>-->
<div class="form-group">
<label class="control-label required"> Time Rounding Block</label>
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">access_time</i>
</span>
<% if !@dining_charge.time_rounding_block.nil?%>
<input type="text" name="time_rounding_block" value="<%= @dining_charge.time_rounding_block.utc.strftime('%H:%M') %>" class="timepicker form-control col-md-8" placeholder="Start Time...">
<% else %>
<input type="text" name="time_rounding_block" class="timepicker form-control col-md-8" placeholder="Start Time...">
<% end %>
</div>
</div>
<%= f.input :time_rounding_block_price, :input_html => { :id => 'time_rounding_block_price',:class=>"col-md-8"} %>
</div> </div>
<div class="form-actions"> <div class="form-actions">

View File

@@ -1,21 +1,4 @@
<!-- <h1>New Dining Charge</h1>
<%= render 'form', dining_charge: @dining_charge %> -->
<!-- <div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= settings_zone_path(@zone) %>">Zone</a></li>
<% if @table %>
<li><a href="<%= edit_settings_zone_table_path(@zone,@settings_dining_facility) %>">Table / Room</a></li>
<% elsif @room %>
<li><a href="<%= edit_settings_zone_room_path(@zone,@settings_dining_facility) %>">Table / Room</a></li>
<% end %>
<li>New</li>
</ul>
</div>
<%= render 'form', dining_charge: @dining_charge %>
</div> -->
<div class="page-header"> <div class="page-header">
<ol class="breadcrumb"> <ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li> <li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>

View File

@@ -105,7 +105,7 @@
<% else %> <% else %>
<td><%= link_to 'Show', settings_menu_category_set_menu_item_path(@settings_menu_category, settings_menu_item ),:class => 'btn btn-info btn-sm waves-effect' %> <td><%= link_to 'Show', settings_menu_category_set_menu_item_path(@settings_menu_category, settings_menu_item ),:class => 'btn btn-info btn-sm waves-effect' %>
<%= link_to t("views.btn.edit"), edit_settings_menu_category_set_menu_item_path(@settings_menu_category, settings_menu_item),:class => 'btn btn-primary btn-sm waves-effect' %> <%= link_to t("views.btn.edit"), edit_settings_menu_category_set_menu_item_path(@settings_menu_category, settings_menu_item),:class => 'btn btn-primary btn-sm waves-effect' %>
<!-- <%= link_to t("views.btn.delete"), settings_menu_category_set_menu_item_path(@settings_menu_category, settings_menu_item ), method: :delete, data: { confirm: 'Are you sure?' },:class => 'btn btn-danger btn-sm waves-effect' %> -->
</td> </td>
<% end %> <% end %>
</tr> </tr>

View File

@@ -6,7 +6,7 @@
<div class="form-inputs p-l-15"> <div class="form-inputs p-l-15">
<div class="div-border"> <div class="div-border">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6 form-group">
<label>*Promo Code</label> <label>*Promo Code</label>
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"> <span class="input-group-addon">
@@ -18,58 +18,58 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6 form-group">
<label>* Start Date</label> <label>* Start Date</label>
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"> <span class="input-group-addon">
<i class="material-icons">date_range</i> <i class="material-icons">date_range</i>
</span> </span>
<% if !@promotion.promo_start_date.nil?%> <% if !@promotion.promo_start_date.nil?%>
<input type="text" name="promotion[promo_start_date]" value="<%= @promotion.promo_start_date.strftime('%A, %d-%m-%Y') %>" class="datepicker form-control" placeholder="Start Date..."> <input type="text" name="promotion[promo_start_date]" value="<%= @promotion.promo_start_date.strftime('%A, %d-%m-%Y') %>" class="datepicker form-control col-md-8" placeholder="Start Date...">
<% else %> <% else %>
<input type="text" name="promotion[promo_start_date]" class="datepicker form-control" placeholder="Start Date..."> <input type="text" name="promotion[promo_start_date]" class="datepicker form-control col-md-8" placeholder="Start Date...">
<% end %> <% end %>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6 form-group">
<label>* End Date</label> <label>* End Date</label>
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"> <span class="input-group-addon">
<i class="material-icons">date_range</i> <i class="material-icons">date_range</i>
</span> </span>
<% if !@promotion.promo_end_date.nil?%> <% if !@promotion.promo_end_date.nil?%>
<input type="text" name="promotion[promo_end_date]" value="<%= @promotion.promo_end_date.strftime('%A, %d-%m-%Y') %>" class="datepicker form-control" placeholder="Start Date..."> <input type="text" name="promotion[promo_end_date]" value="<%= @promotion.promo_end_date.strftime('%A, %d-%m-%Y') %>" class="datepicker form-control col-md-8" placeholder="Start Date...">
<% else %> <% else %>
<input type="text" name="promotion[promo_end_date]" class="datepicker form-control" placeholder="End Date..."> <input type="text" name="promotion[promo_end_date]" class="datepicker form-control col-md-8" placeholder="End Date...">
<% end %> <% end %>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6 form-group">
<label class="control-label">* Start Hour</label> <label class="control-label">* Start Hour</label>
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"> <span class="input-group-addon">
<i class="material-icons">access_time</i> <i class="material-icons">access_time</i>
</span> </span>
<% if !@promotion.promo_start_hour.nil?%> <% if !@promotion.promo_start_hour.nil?%>
<input type="text" name="promotion[promo_start_hour]" value="<%= @promotion.promo_start_hour.utc.strftime('%H:%M') %>" class="timepicker form-control" placeholder="Start Time..."> <input type="text" name="promotion[promo_start_hour]" value="<%= @promotion.promo_start_hour.utc.strftime('%H:%M') %>" class="timepicker form-control col-md-8" placeholder="Start Time...">
<% else %> <% else %>
<input type="text" name="promotion[promo_start_hour]" class="timepicker form-control" placeholder="Start Time..."> <input type="text" name="promotion[promo_start_hour]" class="timepicker form-control col-md-8" placeholder="Start Time...">
<% end %> <% end %>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6 form-group">
<label class="control-label">* End Hour</label> <label class="control-label">* End Hour</label>
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"> <span class="input-group-addon">
<i class="material-icons">access_time</i> <i class="material-icons">access_time</i>
</span> </span>
<% if !@promotion.promo_end_hour.nil?%> <% if !@promotion.promo_end_hour.nil?%>
<input type="text" name="promotion[promo_end_hour]" value="<%= @promotion.promo_end_hour.utc.strftime('%H:%M') %>" class="timepicker form-control" placeholder="End Time..."> <input type="text" name="promotion[promo_end_hour]" value="<%= @promotion.promo_end_hour.utc.strftime('%H:%M') %>" class="timepicker form-control col-md-8" placeholder="End Time...">
<% else %> <% else %>
<input type="text" name="promotion[promo_end_hour]" class="timepicker form-control" placeholder="End Time..."> <input type="text" name="promotion[promo_end_hour]" class="timepicker form-control col-md-8" placeholder="End Time...">
<% end %> <% end %>
</div> </div>
<!-- <% if !@promotion.promo_end_hour.nil?%> <!-- <% if !@promotion.promo_end_hour.nil?%>
@@ -81,8 +81,10 @@
</div> </div>
<br> <br>
<div class="row checkboxes"> <div class="row checkboxes ">
<div class="col-md-2"><label class="control-label"><abbr title="required">*</abbr> Promotion Day</label></div> <div class="col-md-2">
<label class="control-label font-14"><abbr title="required">*</abbr> Promotion Day</label>
</div>
<%= f.hidden_field :promo_day, :class => "form-control" %> <%= f.hidden_field :promo_day, :class => "form-control" %>
<div class="col-md-1"><label><input class="selectDay" type="checkbox" name="Sunday" value="0" id="0"> Sun</label></div> <div class="col-md-1"><label><input class="selectDay" type="checkbox" name="Sunday" value="0" id="0"> Sun</label></div>
<div class="col-md-1"><label><input class="selectDay" type="checkbox" name="Monday" value="1" id="1">Mon</label></div> <div class="col-md-1"><label><input class="selectDay" type="checkbox" name="Monday" value="1" id="1">Mon</label></div>
@@ -92,10 +94,9 @@
<div class="col-md-1"><label><input class="selectDay" type="checkbox" name="Friday" value="5" id="5"> Fri</label></div> <div class="col-md-1"><label><input class="selectDay" type="checkbox" name="Friday" value="5" id="5"> Fri</label></div>
<div class="col-md-1"><label><input class="selectDay" type="checkbox" name="Saturday" value="6" id="6"> Sat</label></div> <div class="col-md-1"><label><input class="selectDay" type="checkbox" name="Saturday" value="6" id="6"> Sat</label></div>
</div> </div>
<br>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-5 form-group">
<select name="promotion[promo_type]" class="form-control"> <select name="promotion[promo_type]" class="form-control">
<option>Quantity</option> <option>Quantity</option>
<option>Net_off</option> <option>Net_off</option>
@@ -111,7 +112,7 @@
<% Product.order("name desc").pluck(:name,:item_code).each do |p| %> <% Product.order("name desc").pluck(:name,:item_code).each do |p| %>
<% arr.push(p) %> <% arr.push(p) %>
<% end %> <% end %>
<div class="col-md-3"> <div class="col-md-3 form-group">
<label class="control-label"><abbr title="required">*</abbr> Item</label> <label class="control-label"><abbr title="required">*</abbr> Item</label>
<select class="form-control item_code_place"> <select class="form-control item_code_place">
<% if !@promotion.original_product.nil? %> <% if !@promotion.original_product.nil? %>
@@ -142,12 +143,12 @@
<% sample = Product.where("item_code=?",@promotion.original_product).pluck(:name,:item_code)%> <% sample = Product.where("item_code=?",@promotion.original_product).pluck(:name,:item_code)%>
<% end %> <% end %>
<% end %> <% end %>
<div class="col-md-3"><%= f.input :original_product,collection: sample %></div> <div class="col-md-3 form-group"><%= f.input :original_product,collection: sample %></div>
<!-- <div class="col-md-6"><%= f.input :original_product,collection: MenuItemInstance.order("item_instance_name desc").pluck(:item_instance_name,:item_instance_code),input_html: { selected: 2 } %></div> --> <!-- <div class="col-md-6"><%= f.input :original_product,collection: MenuItemInstance.order("item_instance_name desc").pluck(:item_instance_name,:item_instance_code),input_html: { selected: 2 } %></div> -->
<div class="col-md-6"><%= f.input :min_qty %></div> <div class="col-md-6 form-group"><%= f.input :min_qty %></div>
</div> </div>
<br> <br>
<div class="" style="border: 1px solid #cccccc;padding:1%"> <div class="card">
<div class="row"> <div class="row">
<div class="col-md-4" style="text-align:center">Item Code</div> <div class="col-md-4" style="text-align:center">Item Code</div>
<div class="col-md-2" style="text-align:center">Min Qty</div> <div class="col-md-2" style="text-align:center">Min Qty</div>
@@ -237,18 +238,18 @@ $(document).ready(function(){
// $('#promotion_promo_end_hour').val($('#promotion_promo_end_hour').val().split(":")[0]+":00"); // $('#promotion_promo_end_hour').val($('#promotion_promo_end_hour').val().split(":")[0]+":00");
// }); // });
$('.datepicker').bootstrapMaterialDatePicker({ // $('.datepicker').bootstrapMaterialDatePicker({
format: 'dddd DD MM YYYY', // format: 'dddd DD MM YYYY',
clearButton: true, // clearButton: true,
weekStart: 1, // weekStart: 1,
time: false // time: false
}); // });
$('.timepicker').bootstrapMaterialDatePicker({ // $('.timepicker').bootstrapMaterialDatePicker({
format: 'HH:mm', // format: 'HH:mm',
clearButton: true, // clearButton: true,
date: false // date: false
}); // });
// var dayy = $("#promotion_promo_day").val().replace("[","").replace("]",""); // var dayy = $("#promotion_promo_day").val().replace("[","").replace("]","");
// jQuery.each( dayy.split(","), function( i, d ) { // jQuery.each( dayy.split(","), function( i, d ) {
@@ -283,8 +284,8 @@ $(".selectDay").click(function() {
document.getElementById("promotion_promo_day").value = day; document.getElementById("promotion_promo_day").value = day;
}); });
$("#promotion_original_product").select2(); // $("#promotion_original_product").select2();
$(".item_code_place").select2(); // $(".item_code_place").select2();
$(".item_code_place").on('change', function(event) { $(".item_code_place").on('change', function(event) {
var ajax_url = "<%= settings_find_item_instance_path %>"; var ajax_url = "<%= settings_find_item_instance_path %>";
@@ -300,19 +301,19 @@ $(".selectDay").click(function() {
itemlist += "<option value ="+result[i][1]+">"+result[i][0]+"</option>" itemlist += "<option value ="+result[i][1]+">"+result[i][0]+"</option>"
} }
$("#promotion_original_product").append(itemlist); $("#promotion_original_product").append(itemlist);
$("#promotion_original_product").select2(); //$("#promotion_original_product").select2();
} }
}); });
}); });
$(".promotion_promotion_products_item_code select").select2(); //$(".promotion_promotion_products_item_code select").select2();
$(".item_code_place1").select2(); //$(".item_code_place1").select2();
callforpromoproduct(); callforpromoproduct();
$(".addProduct").on('click', function(event) { $(".addProduct").on('click', function(event) {
setTimeout(function(){ setTimeout(function(){
$(".promotion_promotion_products_item_code select").select2(); // $(".promotion_promotion_products_item_code select").select2();
callforpromoproduct(); callforpromoproduct();
}, 0); }, 0);
}); });
@@ -332,7 +333,7 @@ $(".selectDay").click(function() {
$("select#"+select_id).empty(); $("select#"+select_id).empty();
$("select#"+select_id).append("<option value='"+item_code+"'>"+result[0]+"</option>"); $("select#"+select_id).append("<option value='"+item_code+"'>"+result[0]+"</option>");
$("select#"+select_id).parent().parent().siblings("div.menu_item_choose").find("select").find("option[value='"+result[1]+"']").attr("selected","true") $("select#"+select_id).parent().parent().siblings("div.menu_item_choose").find("select").find("option[value='"+result[1]+"']").attr("selected","true")
$("select#"+select_id).parent().parent().siblings("div.menu_item_choose").find("select").select2(); // $("select#"+select_id).parent().parent().siblings("div.menu_item_choose").find("select").select2();
} }
} }
}); });
@@ -340,7 +341,7 @@ $(".selectDay").click(function() {
// promotion_promotion_products_attributes_0_item_code // promotion_promotion_products_attributes_0_item_code
function callforpromoproduct(){ function callforpromoproduct(){
$(".item_code_place1").select2(); //$(".item_code_place1").select2();
$(".item_code_place1").on('change', function(event) { $(".item_code_place1").on('change', function(event) {
id = $(this).parent().next().find("select").attr("id"); id = $(this).parent().next().find("select").attr("id");
var ajax_url = "<%= settings_find_item_instance_path %>"; var ajax_url = "<%= settings_find_item_instance_path %>";
@@ -356,7 +357,7 @@ $(".selectDay").click(function() {
itemlist += "<option value ="+result[i][1]+">"+result[i][0]+"</option>" itemlist += "<option value ="+result[i][1]+">"+result[i][0]+"</option>"
} }
$("select#"+id).append(itemlist); $("select#"+id).append(itemlist);
$("select#"+id).select2(); //$("select#"+id).select2();
} }
}); });
}); });

View File

@@ -13,22 +13,42 @@
<%= f.input :is_active %> <%= f.input :is_active %>
<% if @settings_room.dining_charges.length == 0 %> <% if @settings_room.dining_charges.length == 0 %>
<% if @settings_room.id != nil %> <% if @settings_room.id != nil %>
<div class="div-border"> <div class="">
<div class="col-md-10"> <div class="">
<%= link_to 'Add For Extra Charges', new_settings_zone_room_dining_charge_path(@zone,@settings_room),:class => 'btn btn-primary' %> <%= link_to 'Add For Extra Charges', new_settings_zone_room_dining_charge_path(@zone,@settings_room),:class => 'btn bg-deep-purple' %>
</div> </div>
</div> </div>
<% end %> <% end %>
<% else %> <% else %>
<% @settings_room.dining_charges.each do |dc| %> <% @settings_room.dining_charges.each do |dc| %>
<div class="div-border">
<div class="col-md-10"><b><u>Dining Charge</u></b></div> <div class="card">
<div class="col-md-10">item code : <%= dc.item_code %></div> <div class="col-md-7">
<div class="col-md-10">Unit price : <%= dc.unit_price %></div> <table class="table">
<div class="col-md-10">Charge type : <%= dc.charge_type %></div> <tr><td colspan="2">
<div class="col-md-10"> <div class="col-md-10"><b><u>Dining Charge</u></b></div></td>
<%= link_to 'Edit Charges', edit_settings_zone_room_dining_charge_path(@zone,@settings_room,dc),:class => 'btn btn-primary' %> </tr>
<tr>
<td>Item code :</td>
<td><%= dc.item_code %></td>
</tr>
<tr>
<td>Unit price : </td>
<td><%= dc.unit_price %></td>
</tr>
<tr>
<td>Charge type : </td>
<td><%= dc.charge_type %></td>
</tr>
<tr>
<td>
<%= link_to 'Edit Charges', edit_settings_zone_room_dining_charge_path(@zone,@settings_room,dc),:class => 'btn bg-deep-purple' %>
<!-- <button class="btn btn-primary" src="<%= edit_settings_zone_room_dining_charge_path(@zone,@settings_room,dc) %>">Edit Charge</button> --> <!-- <button class="btn btn-primary" src="<%= edit_settings_zone_room_dining_charge_path(@zone,@settings_room,dc) %>">Edit Charge</button> -->
</td>
<td></td>
</tr>
</table>
</div> </div>
</div> </div>
<% end %> <% end %>

View File

@@ -1,34 +1,33 @@
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8"> <div class="col-xs-12 col-sm-12 col-md-9 col-lg-9">
<%= simple_form_for([:settings,@category, @settings_menu_item]) do |f| %> <%= simple_form_for([:settings,@category, @settings_menu_item]) do |f| %>
<%= f.error_notification %> <%= f.error_notification %>
<div class="row">
<div class="col-md-6">
<div class="p-l-20">
<%= f.input :item_code,:input_html => {:class => "col-md-9"} %>
<%= f.input :name,:input_html => {:class => "col-md-9"} %>
<%= f.input :alt_name,:input_html => {:class => "col-md-9"} %>
<%= f.input :type,:input_html => {:class => "col-md-9"} %>
<%= f.input :min_qty,:input_html => {:class => "col-md-9"} %>
<%= f.input :account_id, :label => "Account type", :collection => Account.collection,:input_html => {:class => "col-md-9"} %>
<div class="col-md- panel"> <%= f.input :is_available,:input_html => {:class => "col-md-9"} %>
<div class="form-group p-l-15">
<div class="col-md-">
<%= f.input :item_code %>
<%= f.input :name %>
<%= f.input :alt_name %>
<%= f.input :type %>
<%= f.input :min_qty %>
<%= f.input :account_id, :label => "Account type", :collection => Account.collection %>
</div>
<div class="col-md-">
<%= f.input :is_available, :class => "form-control" %>
<%= f.input :is_sub_item, :class => "form-control" %> <%= f.input :is_sub_item,:input_html => {:class => "col-md-9"} %>
<%= f.input :unit, :collection => Lookup.collection_of("unit") ,:class => "form-control" %> <%= f.input :unit, :collection => Lookup.collection_of("unit") ,:input_html => {:class => "col-md-9"} %>
<%= f.input :item_attributes, :collection => @item_attributes, :input_html => { :multiple => true }, :class => "form-control item_attributes" %>
<%= f.input :item_options, :collection => @item_options, :input_html => { :multiple => true }, :class => "form-control item_options" %>
</div>
</div> </div>
</div> </div>
<div class="col-md-">
<div class="col-md-6">
<%= f.input :item_attributes, :collection => @item_attributes, :input_html => { :multiple => true,:class => "form-control item_attributes col-md-9" } %>
<%= f.input :item_options, :collection => @item_options, :input_html => { :multiple => true,:class => "form-control item_options col-md-9" } %>
<div class="panel padding-10"> <div class="panel padding-10">
<div class="form-group"> <div class="form-group">
<div class="menu-item-img"> <div class="menu-item-img">
@@ -54,9 +53,10 @@
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
</div> </div>
</div> </div>
</div>
<% end %> <% end %>
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4"> <div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
<div class="card"> <div class="card">
<div class="body"> <div class="body">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod

View File

@@ -105,11 +105,11 @@
<% if settings_menu_item.type == "SimpleMenuItem" %> <% if settings_menu_item.type == "SimpleMenuItem" %>
<td><%= link_to 'Show', settings_menu_category_simple_menu_item_path(@category, settings_menu_item ),:class => 'btn btn-info btn-sm waves-effect' %> <td><%= link_to 'Show', settings_menu_category_simple_menu_item_path(@category, settings_menu_item ),:class => 'btn btn-info btn-sm waves-effect' %>
<%= link_to t("views.btn.edit"), edit_settings_menu_category_simple_menu_item_path(@category, settings_menu_item),:class => 'btn btn-primary btn-sm waves-effect' %> <%= link_to t("views.btn.edit"), edit_settings_menu_category_simple_menu_item_path(@category, settings_menu_item),:class => 'btn btn-primary btn-sm waves-effect' %>
<%= link_to t("views.btn.delete"), settings_menu_category_simple_menu_item_path(@category, settings_menu_item ), method: :delete, data: { confirm: 'Are you sure?' } ,:class => 'btn btn-danger btn-sm waves-effect'%></td> <!-- <%= link_to t("views.btn.delete"), settings_menu_category_simple_menu_item_path(@category, settings_menu_item ), method: :delete, data: { confirm: 'Are you sure?' } ,:class => 'btn btn-danger btn-sm waves-effect'%>--></td>
<% else %> <% else %>
<td><%= link_to 'Show', settings_menu_category_set_menu_item_path(@category, settings_menu_item ),:class => 'btn btn-info btn-sm waves-effect' %> <td><%= link_to 'Show', settings_menu_category_set_menu_item_path(@category, settings_menu_item ),:class => 'btn btn-info btn-sm waves-effect' %>
<%= link_to t("views.btn.edit"), edit_settings_menu_category_set_menu_item_path(@category, settings_menu_item),:class => 'btn btn-primary btn-sm waves-effect' %> <%= link_to t("views.btn.edit"), edit_settings_menu_category_set_menu_item_path(@category, settings_menu_item),:class => 'btn btn-primary btn-sm waves-effect' %>
<%= link_to t("views.btn.delete"), settings_menu_category_set_menu_item_path(@category, settings_menu_item ), method: :delete, data: { confirm: 'Are you sure?' },:class => 'btn btn-danger btn-sm waves-effect' %></td> <!-- <%= link_to t("views.btn.delete"), settings_menu_category_set_menu_item_path(@category, settings_menu_item ), method: :delete, data: { confirm: 'Are you sure?' },:class => 'btn btn-danger btn-sm waves-effect' %>--></td>
<% end %> <% end %>
</tr> </tr>
<% end %> <% end %>

View File

@@ -3,58 +3,48 @@
<div class="col-xs-12 col-sm-12 col-md-9 col-lg-9"> <div class="col-xs-12 col-sm-12 col-md-9 col-lg-9">
<%= simple_form_for([:settings,@category, @settings_menu_item]) do |f| %> <%= simple_form_for([:settings,@category, @settings_menu_item]) do |f| %>
<%= f.error_notification %> <%= f.error_notification %>
<div class="row">
<div class="col-md-6 panel">
<div class="form- p-l-20">
<%= f.input :item_code,:input_html => {:class => "col-md-9"} %>
<%= f.input :name,:input_html => {:class => "col-md-9"} %>
<%= f.input :alt_name,:input_html => {:class => "col-md-9"} %>
<%= f.input :type,:input_html => {:class => "col-md-9"} %>
<%= f.input :min_qty,:input_html => {:class => "col-md-9"} %>
<%= f.input :account_id, :label => "Account type", :collection => Account.collection,:input_html => {:class => "col-md-9"} %>
<div class="col-md- panel"> <%= f.input :is_available,:input_html => {:class => "col-md-9"} %>
<div class="form-group">
<div class="col-md-">
<%= f.input :item_code %>
<%= f.input :name %>
<%= f.input :alt_name %>
<%= f.input :type %>
<%= f.input :min_qty %>
<%= f.input :account_id, :label => "Account type", :collection => Account.collection %>
</div>
<div class="col-md-">
<%= f.input :is_available, :class => "form-control" %>
<%= f.input :is_sub_item, :class => "form-control" %> <%= f.input :is_sub_item,:input_html => {:class => "col-md-9"} %>
<%= f.input :unit, :collection => Lookup.collection_of("unit") ,:class => "form-control" %> <%= f.input :unit, :collection => Lookup.collection_of("unit") ,:input_html => {:class => "col-md-9"} %>
<%= f.input :item_attributes, :collection => @item_attributes, :input_html => { :multiple => true }, :class => "form-control item_attributes" %>
<%= f.input :item_options, :collection => @item_options, :input_html => { :multiple => true }, :class => "form-control item_options" %>
</div>
</div> </div>
</div> </div>
<div class="col-md-"> <div class="col-md-6">
<div class="panel padding-10"> <%= f.input :item_attributes, :collection => @item_attributes, :input_html => { :multiple => true,:class => "col-md-9 item_attributes" } %>
<div class="form-group">
<%= f.input :item_options, :collection => @item_options, :input_html => { :multiple => true,:class => "col-md-9" } %>
<div class="menu-item-img"> <div class="menu-item-img">
<% if f.object.image_path? %> <% if f.object.image_path? %>
<p><%= f.object.name %></p> <p><%= f.object.name %></p>
<%= image_tag f.object.image_path.url, :class => "img-thumbnail" %> <%= image_tag f.object.image_path.url,:input_html => { :class => "col-md-4 img-thumbnail" } %>
<% else %> <% else %>
<p>Menu Item Image</p> <p>Menu Item Image</p>
<%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %> <%= image_tag "/image/menu_images/default.png",:input_html => { :class => "col-md-4 img-thumbnail" } %>
<% end %> <% end %>
</div> </div>
<%= f.file_field :image_path, :class => "img-thumbnail" %> <%= f.file_field :image_path,:input_html => { :class => "col-md-4 img-thumbnail" } %>
</div>
</div>
<div class="panel padding-10"> <%= f.input :item_sets, :collection => @item_sets, :input_html => { :multiple => true,:class => "form-control item_sets col-md-9" } %>
<div class="form-group">
<%= f.input :item_sets, :collection => @item_sets, :input_html => { :multiple => true }, :class => "form-control item_sets" %>
</div>
</div>
<div class="form-actions"> <div class="form-actions">
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
</div> </div>
</div> </div>
<% end %> </div>
<% end %>
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3"> <div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
<div class="card"> <div class="card">

View File

@@ -11,29 +11,43 @@
<%= f.input :is_active %> <%= f.input :is_active %>
<% if @settings_table.dining_charges.length == 0 %> <% if @settings_table.dining_charges.length == 0 %>
<% if @settings_table.id != nil %> <% if @settings_table.id != nil %>
<div class="div-border"> <div class="col-md-">
<div class="col-md-10"> <%= link_to 'Add For Extra Charges', new_settings_zone_table_dining_charge_path(@zone,@settings_table),:class => 'btn bg-deep-purple' %>
<%= link_to 'Add For Extra Charges', new_settings_zone_table_dining_charge_path(@zone,@settings_table),:class => 'btn btn-primary' %>
</div>
</div> </div>
<% end %> <% end %>
<% else %> <% else %>
<% @settings_table.dining_charges.each do |dc| %> <% @settings_table.dining_charges.each do |dc| %>
<div class="div-border"> <div class="card">
<div class="col-md-10"><b><u>Dining Charge</u></b></div> <div class="">
<div class="col-md-10">item code : <%= dc.item_code %></div> <table class="table">
<div class="col-md-10">Unit price : <%= dc.unit_price %></div> <tr><td colspan="2">
<div class="col-md-10">Charge type : <%= dc.charge_type %></div> <div class="col-md-10"><b><u>Dining Charge</u></b></div></td>
<div class="col-md-10"> </tr>
<%= link_to 'Edit Charges', edit_settings_zone_table_dining_charge_path(@zone,@settings_table,dc),:class => 'btn btn-primary' %> <tr>
<!-- <button class="btn btn-primary" src="<%= edit_settings_zone_table_dining_charge_path(@zone,@settings_table,dc) %>">Edit Charge</button> --> <td>Item code :</td>
<td><%= dc.item_code %></td>
</tr>
<tr>
<td>Unit price : </td>
<td><%= dc.unit_price %></td>
</tr>
<tr>
<td>Charge type : </td>
<td><%= dc.charge_type %></td>
</tr>
<tr>
<td><%= link_to 'Edit Charges', edit_settings_zone_table_dining_charge_path(@zone,@settings_table,dc),:class => 'btn bg-deep-purple' %>
<!-- <button class="btn btn-primary" src="<%= edit_settings_zone_table_dining_charge_path(@zone,@settings_table,dc) %>">Edit Charge</button> --></td>
<td></td>
</tr>
</table>
</div> </div>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<div class="form-actions"> <div class="form-actions p-l-15">
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
</div> </div>
<% end %> <% end %>