diff --git a/.idea/workspace.xml b/.idea/workspace.xml index cd4a6736..74609c4e 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,13 +3,17 @@ - - + + + + + + - - - - + + + + @@ -24,7 +28,7 @@ - + @@ -51,93 +55,101 @@ - - + + - - - - - - - - - - - - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + @@ -147,8 +159,6 @@ - table_invoice - sale_id oqs void red @@ -170,7 +180,22 @@ gem "select2-rails" custom_excel load + promotion_original_product + in_juti + Juty + Juti + juty + Juties + juties + product_qty + item_code + + Duties + Duty + duty + duties + - @@ -276,6 +301,7 @@ + @@ -306,7 +332,7 @@ - + @@ -321,6 +347,14 @@ + + + + + + + + @@ -334,45 +368,48 @@ - + + - - + - - + + - + + - - - - + + + + + + + - <% if !@inventory_definition.item_code.nil? %> - <% menuiteminstance = MenuItemInstance.find_by_item_instance_code(@inventory_definition.item_code) %> - <% if menuiteminstance.nil?%> - <% code = @inventory_definition.item_code %> - <% else %> - <% code = menuiteminstance.menu_item.item_code %> - <% end %> - <% end %> - <% arr.each do |a| %> - <% if a[1] == code %> - - <% else %> - - <% end %> - <% end %> - +
+
+ <% arr = MenuItem.active.order("name desc").pluck(:name, :item_code) %> + <% Product.order("name desc").pluck(:name, :item_code).each do |p| %> + <% arr.push(p) %> + <% end %> +
+ + +
+ <% sample = [] %> + <% if @inventory_definition.item_code.nil? %> + <% if !MenuItemInstance.find_by_item_instance_code(@inventory_definition.item_code).nil? %> + <% sample = MenuItemInstance.where("item_instance_code=?", @inventory_definition.item_code).pluck(:item_instance_name, :item_instance_code) %> + <% else %> + <% sample = Product.where("item_code=?", @inventory_definition.item_code).pluck(:name, :item_code) %> + <% end %> + <% end %> +
<%= f.input :item_code, collection: sample %>
- <% sample = [] %> - <% if @inventory_definition.item_code.nil? %> - <% if !MenuItemInstance.find_by_item_instance_code(@inventory_definition.item_code).nil? %> - <% sample = MenuItemInstance.where("item_instance_code=?",@inventory_definition.item_code).pluck(:item_instance_name,:item_instance_code)%> - <% else %> - <% sample = Product.where("item_code=?",@inventory_definition.item_code).pluck(:name,:item_code)%> - <% end %> - <% end %> -
<%= f.input :item_code, collection: sample %>
- -
<%= f.input :min_qty %>
+ <%= f.input :min_order_level %> + <%= f.input :max_stock_level %>
- <%= f.input :min_order_level %> - <%= f.input :max_stock_level %> - - -
- <%= f.button :submit %> -
+
+ <%= link_to 'Back', inventory_path, class: 'btn btn-success' %> + <%= f.button :submit, class: 'btn btn-primary' %> +
<% end %> + + \ No newline at end of file diff --git a/app/views/inventory/inventory_definitions/edit.html.erb b/app/views/inventory/inventory_definitions/edit.html.erb index 80ce29e1..b6d6a7bb 100644 --- a/app/views/inventory/inventory_definitions/edit.html.erb +++ b/app/views/inventory/inventory_definitions/edit.html.erb @@ -1,6 +1,10 @@ -

Editing Inventory Definition

- -<%= render 'form', inventory_definition: @inventory_definition %> - -<%= link_to 'Show', @inventory_definition %> | -<%= link_to 'Back', inventory_definitions_path %> +
+ + <%= render 'form', inventory: @inventory_definition %> +
diff --git a/app/views/inventory/stock_checks/index.html.erb b/app/views/inventory/stock_checks/index.html.erb index 812d4409..69af59a4 100644 --- a/app/views/inventory/stock_checks/index.html.erb +++ b/app/views/inventory/stock_checks/index.html.erb @@ -7,17 +7,29 @@
- -
+ +

- Product + Item
- +

@@ -27,14 +39,14 @@ Qty
- +

- +
@@ -44,9 +56,10 @@
- + +
# Product Balance
@@ -54,49 +67,69 @@
- + +
diff --git a/app/views/inventory/stock_checks/show.html.erb b/app/views/inventory/stock_checks/show.html.erb index 4d0e83d0..f4af6db0 100644 --- a/app/views/inventory/stock_checks/show.html.erb +++ b/app/views/inventory/stock_checks/show.html.erb @@ -3,81 +3,96 @@
- Check by + Check by
- <%= @check.check_by %> + <%= Employee.find(@check.check_by).name rescue '' %>
- Check At + Check At
- <%= @check.created_at %>
+ <%= @check.created_at.utc.getlocal.strftime("%e %b %Y %I:%M %p") rescue '-' %>
- Reason + Reason
- <%= @check.reason %> + <%= @check.reason %>

- - - - - - - - - - <% - count = 0 - @check.stock_check_items.each do |item| - count += 1 - %> +
#ProductStock CountStock BalanceDifferentRemark
- - - - - - + + + + + + - <% end %> -
<%= count %><%= item.item_code %><%= item.stock_count %><%= item.stock_balance %><%= item.different %><%= item.remark %>#ProductStock CountStock BalanceDifferentRemark
+ <% + count = 0 + @check.stock_check_items.each do |item| + count += 1 + %> + + <%= count %> + + <% menu_item = MenuItemInstance.find_by_item_instance_code(item.item_code)%> + <% if menu_item.nil? %> + <%= Product.find_by_item_code(item.item_code).name rescue "-" %> + <% else %> + <%= menu_item.menu_item.name rescue "-" %> + - <%= menu_item.item_instance_name rescue "-" %> + <% end %> + + <%= item.stock_count %> + <%= item.stock_balance %> + <%= item.different %> + <%= item.remark %> + + <% end %> + +
-
- - - + + +
diff --git a/app/views/layouts/_header_inventory.html.erb b/app/views/layouts/_header_inventory.html.erb new file mode 100644 index 00000000..17a8e764 --- /dev/null +++ b/app/views/layouts/_header_inventory.html.erb @@ -0,0 +1,38 @@ +
+
+
+ Inventory - +
+
+ <% if current_login_employee %> + <%= current_login_employee.name %> | <%= link_to 'Logout', logout_path, method: :delete, data: { confirm: 'Are you sure?' } %> + <% end %> +
+
+
+ +
diff --git a/app/views/layouts/inventory.html.erb b/app/views/layouts/inventory.html.erb index d6bbf436..8982d546 100644 --- a/app/views/layouts/inventory.html.erb +++ b/app/views/layouts/inventory.html.erb @@ -9,14 +9,14 @@ SmartSales : Restaurant <%= csrf_meta_tags %> - <%= stylesheet_link_tag 'origami', media: 'all', 'data-turbolinks-track': 'reload' %> + <%= stylesheet_link_tag 'inventory_definitions', media: 'all', 'data-turbolinks-track': 'reload' %> <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> <%= stylesheet_link_tag 'jquery-confirm', media: 'all', 'data-turbolinks-track': 'reload' %> <%= javascript_include_tag 'jquery-confirm', 'data-turbolinks-track': 'reload' %> - <%= render 'layouts/header_orgiami' %> + <%= render 'layouts/header_inventory' %>
<% flash.each do |type, message| %> <% if !flash["errors"]%> diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index 45750d6f..42fac2a4 100644 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -332,7 +332,7 @@ - + @@ -579,9 +579,9 @@ window.location.href = '/origami/table/' + dining_id + "/sale/" + sale_id + "/load_commissioners"; }); - $('#in_juties').on('click', function () { + $('#in_duties').on('click', function () { var dining_id = "<%= @dining.id %>" - window.location.href = '/origami/assign_in_juty/'+ dining_id; + window.location.href = '/origami/assign_in_duty/'+ dining_id; }); $('#void').on('click', function () { diff --git a/app/views/origami/in_juties/_assign_in_juty.html.erb b/app/views/origami/in_duties/_assign_in_duty.html.erb similarity index 100% rename from app/views/origami/in_juties/_assign_in_juty.html.erb rename to app/views/origami/in_duties/_assign_in_duty.html.erb diff --git a/app/views/origami/in_juties/_edit_in_juty.html.erb b/app/views/origami/in_duties/_edit_in_duty.html.erb similarity index 87% rename from app/views/origami/in_juties/_edit_in_juty.html.erb rename to app/views/origami/in_duties/_edit_in_duty.html.erb index a297ac65..41a492eb 100644 --- a/app/views/origami/in_juties/_edit_in_juty.html.erb +++ b/app/views/origami/in_duties/_edit_in_duty.html.erb @@ -1,4 +1,4 @@ -<%= simple_form_for([:origami, @in_juty]) do |f| %> +<%= simple_form_for([:origami, @in_duty]) do |f| %> <%= f.error_notification %>
diff --git a/app/views/origami/in_juties/_form.html.erb b/app/views/origami/in_duties/_form.html.erb similarity index 95% rename from app/views/origami/in_juties/_form.html.erb rename to app/views/origami/in_duties/_form.html.erb index 61342d7b..3351dbd3 100644 --- a/app/views/origami/in_juties/_form.html.erb +++ b/app/views/origami/in_duties/_form.html.erb @@ -1,4 +1,4 @@ -<%= simple_form_for @in_juty, :url => origami_index_in_juty_path(@table.id), :method => :post do |f| %> +<%= simple_form_for @in_duty, :url => origami_index_in_duty_path(@table.id), :method => :post do |f| %> <%= f.error_notification %> <%= f.hidden_field :id, :class => "form-control col-md-6 " %> diff --git a/app/views/origami/in_duties/_in_duty.json.jbuilder b/app/views/origami/in_duties/_in_duty.json.jbuilder new file mode 100644 index 00000000..6b13c2f9 --- /dev/null +++ b/app/views/origami/in_duties/_in_duty.json.jbuilder @@ -0,0 +1,2 @@ +json.extract! in_duty, :id, :created_at, :updated_at +json.url in_duty_url(in_duty, format: :json) diff --git a/app/views/origami/in_juties/assign_in_juty.html.erb b/app/views/origami/in_duties/assign_in_duty.html.erb similarity index 76% rename from app/views/origami/in_juties/assign_in_juty.html.erb rename to app/views/origami/in_duties/assign_in_duty.html.erb index 7176dea6..31e95a50 100644 --- a/app/views/origami/in_juties/assign_in_juty.html.erb +++ b/app/views/origami/in_duties/assign_in_duty.html.erb @@ -1,9 +1,9 @@
- <%= simple_form_for([:origami,@in_juty]) do |f| %> + <%= simple_form_for([:origami,@in_duty]) do |f| %> <%= f.error_notification %>
@@ -22,10 +22,10 @@
- <%= link_to 'Back', origami_index_in_juty_path(@table.id), class: 'btn btn-success' %> + <%= link_to 'Back', origami_index_in_duty_path(@table.id), class: 'btn btn-success' %>
- +
@@ -45,18 +45,18 @@ $(function() { $('.datepicker').css('cursor','pointer'); }); - $('#in_juty').on('click', function () { - var ajax_url = "/origami/assign_in_juty"; - var commissioner_ids = $('#in_juty_commissioner_ids').val(); - var in_time = $('#in_juty_in_time').val(); - var out_time = $('#in_juty_out_time').val(); + $('#in_duty').on('click', function () { + var ajax_url = "/origami/assign_in_duty"; + 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 %>' $.ajax({ type: "POST", url: ajax_url, data: 'dining_id=' + dining_id + "&commissioner_ids=" + commissioner_ids +'&in_time=' + in_time + "&out_time=" + out_time, success: function (result) { - window.location.href = '/origami/assign_in_juty/'+ dining_id; + window.location.href = '/origami/assign_in_duty/'+ dining_id; } }); }) diff --git a/app/views/origami/in_juties/edit.html.erb b/app/views/origami/in_duties/edit.html.erb similarity index 61% rename from app/views/origami/in_juties/edit.html.erb rename to app/views/origami/in_duties/edit.html.erb index 3a6fc774..3e64b2f2 100644 --- a/app/views/origami/in_juties/edit.html.erb +++ b/app/views/origami/in_duties/edit.html.erb @@ -2,9 +2,9 @@ - <%= render 'form', in_juty: @in_juty %> + <%= render 'form', in_duty: @in_duty %>
\ No newline at end of file diff --git a/app/views/origami/in_duties/edit_in_duty.html.erb b/app/views/origami/in_duties/edit_in_duty.html.erb new file mode 100644 index 00000000..bcc984aa --- /dev/null +++ b/app/views/origami/in_duties/edit_in_duty.html.erb @@ -0,0 +1,6 @@ +
+ + <%= render 'edit_in_duty', in_duty: @in_duty %> +
\ No newline at end of file diff --git a/app/views/origami/in_juties/index.html.erb b/app/views/origami/in_duties/index.html.erb similarity index 54% rename from app/views/origami/in_juties/index.html.erb rename to app/views/origami/in_duties/index.html.erb index ff5a0fd3..355a7afb 100644 --- a/app/views/origami/in_juties/index.html.erb +++ b/app/views/origami/in_duties/index.html.erb @@ -14,27 +14,27 @@ - <% @juties_in.each do |in_juty| %> - + <% @duties_in.each do |in_duty| %> + - <%= in_juty.dining_facility.name rescue '-' %> - <%= in_juty.commissioner.name rescue '-' %> - <%= in_juty.in_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %> - <%= in_juty.out_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %> - <%= link_to 'Destroy', origami_destroy_in_juty_path(in_juty.dining_facility.id, in_juty), method: :delete, data: {confirm: 'Are you sure?'} %> + <%= in_duty.dining_facility.name rescue '-' %> + <%= in_duty.commissioner.name rescue '-' %> + <%= in_duty.in_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %> + <%= in_duty.out_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %> + <%= link_to 'Destroy', origami_destroy_in_duty_path(in_duty.dining_facility.id, in_duty), method: :delete, data: {confirm: 'Are you sure?'} %> <% end %> - <%= paginate @juties_in %> + <%= paginate @duties_in %>
- <%= render 'form', in_juty: @in_juty, table: @table %> + <%= render 'form', in_duty: @in_duty, table: @table %>
- <%= link_to t('.new', :default => t("helpers.links.new")), new_origami_in_juty_path, :class => 'btn btn-primary btn-sm' %> + <%= link_to t('.new', :default => t("helpers.links.new")), new_origami_in_duty_path, :class => 'btn btn-primary btn-sm' %>
@@ -43,13 +43,13 @@
diff --git a/app/views/reports/stock_check/index.html.erb b/app/views/reports/stock_check/index.html.erb new file mode 100644 index 00000000..07008de8 --- /dev/null +++ b/app/views/reports/stock_check/index.html.erb @@ -0,0 +1,79 @@ + + +
+ <%= render :partial => 'stock_check_report_filter', + :locals => {:period_type => true, :shift_name => true, :report_path => reports_stock_check_index_path} %> +
+
+ +
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + + <% total_qty = 0 %> + <% total_price = 0 %> + <% total_amount = 0 %> + + <% @transaction.each do |result| %> + + + + + + + + + + + <% total_qty += result.qty.to_f %> + <% total_price += result.price.to_f %> + <% total_amount += result.amount.to_f %> + <% end %> + + + + + + + + + +
From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %>
SaleSale ItemCommissioner NameProduct NameQtyCommission PriceCommission AmountDate
<%= result.sale_id rescue '-' %><%= result.sale_item_id rescue '-' %><%= result.commissioner.name rescue '-' %><%= result.commission.menu_item.name rescue '-' %><%= sprintf "%.2f", result.qty.to_f.to_d rescue '-' %><%= sprintf "%.2f", result.price.to_f.to_d rescue '-' %><%= sprintf "%.2f", result.amount.to_f.to_d rescue '-' %><%= result.updated_at.strftime("%e %b %Y %I:%M%p") rescue '-' %>
<%= sprintf("%.2f", total_qty) rescue '-' %><%= sprintf("%.2f", total_price) rescue '-' %><%= sprintf("%.2f", total_amount) rescue '-' %>
+
+
+
+ \ No newline at end of file diff --git a/app/views/reports/stock_check/index.xls.erb b/app/views/reports/stock_check/index.xls.erb new file mode 100644 index 00000000..4ea1f2f0 --- /dev/null +++ b/app/views/reports/stock_check/index.xls.erb @@ -0,0 +1,52 @@ +
+
+
+ + + + + + + + + + + + + + + + <% total_qty = 0 %> + <% total_price = 0 %> + <% total_amount = 0 %> + + <% @transaction.each do |result| %> + + + + + + + + + <% total_qty += result.qty.to_f %> + <% total_price += result.price.to_f %> + <% total_amount += result.amount.to_f %> + <% end %> + + + + + + + + + +
From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %>
Commissioner NameProduct NameQtyCommission PriceCommission AmountDate
+ <%= result.commissioner.name rescue '-' %> + + <%= result.commission.menu_item.name rescue '-' %> + <%= sprintf "%.2f", result.qty.to_f.to_d rescue '-' %><%= sprintf "%.2f", result.price.to_f.to_d rescue '-' %><%= sprintf "%.2f", result.amount.to_f.to_d rescue '-' %><%= result.updated_at.strftime("%e %b %Y %I:%M%p") rescue '-' %>
<%= sprintf("%.2f", total_qty) rescue '-' %><%= sprintf("%.2f", total_price) rescue '-' %><%= sprintf("%.2f", total_amount) rescue '-' %>
+
+
+
diff --git a/app/views/settings/promotions/_form.html.erb b/app/views/settings/promotions/_form.html.erb index c832461d..1760f894 100644 --- a/app/views/settings/promotions/_form.html.erb +++ b/app/views/settings/promotions/_form.html.erb @@ -39,18 +39,19 @@ <% end %>
- +
- <%= f.hidden_field :promo_day, :value => "", :class => "form-control col-md-1" %> -
Sun
-
Mon
-
Tue
-
Wed
-
Thu
-
Fri
-
Sat
+
+ <%= f.hidden_field :promo_day, :class => "form-control" %> +
+
+
+
+
+
+
- +
<%= f.input :promo_type,input_html: { class: "" }, @@ -73,11 +74,12 @@ <% code = menuiteminstance.menu_item.item_code %> <% end %> <% end %> + <% arr.each do |a| %> <% if a[1] == code %> <% else %> - + <% end %> <% end %> @@ -109,19 +111,23 @@
<%= f.fields_for :promotion_products do |pro| %>
+ <%= pro.hidden_field :item_code,:class => "promo_product" %> <% arr = MenuItem.active.order("name desc").pluck(:name,:item_code) %> <% Product.order("name desc").pluck(:name,:item_code).each do |p| %> <% arr.push(p) %> <% end %> -
+ - <% sample = [] %> -
<%= pro.input :item_code, :class => 'promoproduct', collection: sample,input_html: { selected: 2 }, label: false %>
+ + +
<%= pro.input :item_code, :class => 'promoproduct', collection:[],input_html: { selected: 2 }, label: false %>
+
<%= pro.input :min_qty , label: false%>
<%= pro.input :net_off , label: false %>
<%= pro.input :net_price , label: false %>
@@ -156,14 +162,24 @@ $(document).ready(function(){ $('#promotion_promo_start_hour').datetimepicker({ datepicker:false, format:'H:m' - }); + }); $('#promotion_promo_end_hour').datetimepicker({ datepicker:false, format:'H:m' }); + $('#promotion_promo_start_hour').on('change', function(event) { + $('#promotion_promo_start_hour').val($('#promotion_promo_start_hour').val().split(":")[0]+":00"); + }); + $('#promotion_promo_end_hour').on('change', function(event) { + $('#promotion_promo_end_hour').val($('#promotion_promo_end_hour').val().split(":")[0]+":00"); + }); + var dayy = $("#promotion_promo_day").val().replace("[","").replace("]",""); + jQuery.each( dayy.split(","), function( i, d ) { + $("input.selectDay[value='"+d+"']").prop( "checked", true ); + }); var form = document.getElementById("new_promotion"); var inputs = $("input"); @@ -197,7 +213,7 @@ $(".selectDay").click(function() { $("#promotion_original_product").select2(); $(".item_code_place").select2(); $(".item_code_place").on('change', function(event) { - var ajax_url = "<%= settings_find_item_instance_path %>"; + var ajax_url = "<%= settings_find_item_instance_path %>"; var item_code = this.value; $.ajax({ type: "GET", @@ -223,6 +239,29 @@ $(".selectDay").click(function() { callforpromoproduct(); }, 0); }); + + // for promotion products data showing + var promopdt = $(".promo_product"); + jQuery.each( promopdt, function( i, ppdt ) { + var ajax_url = "<%= settings_find_parent_item_path %>"; + var item_code = ppdt.value; + var select_id = ppdt.id; + $.ajax({ + type: "GET", + url: ajax_url, + data: 'item_instance_code=' + item_code, + success: function (result) { + if(result.length > 0){ + $("select#"+select_id).empty(); + $("select#"+select_id).append(""); + $("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(); + } + } + }); + }); + + // promotion_promotion_products_attributes_0_item_code function callforpromoproduct(){ $(".item_code_place1").select2(); $(".item_code_place1").on('change', function(event) { @@ -234,16 +273,17 @@ $(".selectDay").click(function() { url: ajax_url, data: 'item_code=' + item_code, success: function (result) { - $("#"+id).empty(); + $("select#"+id).empty(); var itemlist; for (var i = 0; i < result.length; i++) { itemlist += "" } - $("#"+id).append(itemlist); - $("#"+id).select2(); + $("select#"+id).append(itemlist); + $("select#"+id).select2(); } }); }); } + }); diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index bcb83367..3b43f5ea 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -36,3 +36,7 @@ Rails.application.config.assets.precompile += %w( fileinput.min.js ) # --- Customer/ Customer - Crm ---- Rails.application.config.assets.precompile += %w( addorder.css ) Rails.application.config.assets.precompile += %w( addorder.js ) + +# --- Inventory Definition ---- +Rails.application.config.assets.precompile += %w( inventory_definitions.css ) + diff --git a/config/routes.rb b/config/routes.rb index 95315b8a..6ac723aa 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -88,14 +88,14 @@ Rails.application.routes.draw do post 'item_void_cancel' => "sale_edit#item_void_cancel" post 'cancel_all_void' => 'sale_edit#cancel_all_void' post 'apply_void' => 'sale_edit#apply_void' - # in_juties - get '/table/:table_id/assign_in_juty' => 'in_juties#assign_in_juty', as: 'assign_in_juty' - get 'assign_in_juty/:table_id' => 'in_juties#index_in_juty', as: 'index_in_juty' - post 'assign_in_juty/:table_id' => 'in_juties#create_for_in_juty' + # in_duties + get '/table/:table_id/assign_in_duty' => 'in_duties#assign_in_duty', as: 'assign_in_duty' + get 'assign_in_duty/:table_id' => 'in_duties#index_in_duty', as: 'index_in_duty' + post 'assign_in_duty/:table_id' => 'in_duties#create_for_in_duty' - get 'assign_in_juty/table/:table_id/in_juty/:id/edit' => 'in_juties#edit_in_juty' ,as: 'edit_in_juty' - patch 'edit_in_juty/:id' => 'in_juties#update_for_in_juty', as: 'update_for_in_juty' - delete 'table/:table_id/destroy_in_juty/:id' => 'in_juties#destroy_in_juty', as: 'destroy_in_juty' + get 'assign_in_duty/table/:table_id/in_duty/:id/edit' => 'in_duties#edit_in_duty' ,as: 'edit_in_duty' + patch 'edit_in_duty/:id' => 'in_duties#update_for_in_duty', as: 'update_for_in_duty' + delete 'table/:table_id/destroy_in_duty/:id' => 'in_duties#destroy_in_duty', as: 'destroy_in_duty' get 'table/:dining_id/movetable' => "movetable#move_dining" get 'table/:dining_id/moveroom' => "moveroom#move_dining" @@ -184,7 +184,8 @@ Rails.application.routes.draw do resources :commissions resources :commissioners - resources :in_juties + resources :addorders + resources :in_duties # product_commission get 'table/:table_id/sale/:sale_id/load_commissioners' => 'product_commissions#load_commissioners', as: 'load_commissioners' @@ -305,6 +306,7 @@ Rails.application.routes.draw do resources :promotion_products end get '/find_item_instance' => 'promotions#find_item_instance', as:'find_item_instance' + get '/find_parent_item' => 'promotions#find_parent_item', as:'find_parent_item' # commission resources :commissions @@ -335,6 +337,7 @@ Rails.application.routes.draw do resources :credit_payment, :only => [:index, :show] resources :void_sale, :only => [:index, :show] resources :commission, :only => [:index, :show] + resources :stock_check, :only => [:index, :show] get "receipt_no/get_shift_by_date", to: "receipt_no#get_shift_by_date", as: "get_shift_by_date" end diff --git a/db/migrate/20170823081747_create_in_juties.rb b/db/migrate/20170823081748_create_in_duties.rb similarity index 54% rename from db/migrate/20170823081747_create_in_juties.rb rename to db/migrate/20170823081748_create_in_duties.rb index 15e48483..ca6d15b2 100644 --- a/db/migrate/20170823081747_create_in_juties.rb +++ b/db/migrate/20170823081748_create_in_duties.rb @@ -1,7 +1,9 @@ -class CreateInJuties < ActiveRecord::Migration[5.1] +class CreateInDuties < ActiveRecord::Migration[5.1] def change - create_table :in_juties do |t| + create_table :in_duties do |t| t.integer :dinning_id + t.string :booking_id + t.string :sale_id t.json :commissioner_ids t.datetime :in_time t.datetime :out_time diff --git a/spec/controllers/origami/in_juties_controller_spec.rb b/spec/controllers/origami/in_duties_controller_spec.rb similarity index 97% rename from spec/controllers/origami/in_juties_controller_spec.rb rename to spec/controllers/origami/in_duties_controller_spec.rb index ac4dfe63..1d5c466b 100644 --- a/spec/controllers/origami/in_juties_controller_spec.rb +++ b/spec/controllers/origami/in_duties_controller_spec.rb @@ -23,7 +23,7 @@ require 'rails_helper' # removed from Rails core in Rails 5, but can be added back in via the # `rails-controller-testing` gem. -RSpec.describe Origami::InJutiesController, type: :controller do +RSpec.describe Origami::InDutiesController, type: :controller do # This should return the minimal set of attributes required to create a valid # InJuty. As you add validations to InJuty, be sure to @@ -38,7 +38,7 @@ RSpec.describe Origami::InJutiesController, type: :controller do # This should return the minimal set of values that should be in the session # in order to pass any filters (e.g. authentication) defined in - # Origami::InJutiesController. Be sure to keep this updated too. + # Origami::InDutiesController. Be sure to keep this updated too. let(:valid_session) { {} } describe "GET #index" do diff --git a/spec/models/in_juty_spec.rb b/spec/models/in_duty_spec.rb similarity index 68% rename from spec/models/in_juty_spec.rb rename to spec/models/in_duty_spec.rb index 163b6534..b3015536 100644 --- a/spec/models/in_juty_spec.rb +++ b/spec/models/in_duty_spec.rb @@ -1,5 +1,5 @@ require 'rails_helper' -RSpec.describe InJuty, type: :model do +RSpec.describe InDuty, type: :model do pending "add some examples to (or delete) #{__FILE__}" end