Merge branch 'august_spring' of bitbucket.org:code2lab/sxrestaurant into august_spring
This commit is contained in:
3
app/assets/javascripts/inventory_definitions.coffee
Normal file
3
app/assets/javascripts/inventory_definitions.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://coffeescript.org/
|
||||
3
app/assets/javascripts/stock_check_items.coffee
Normal file
3
app/assets/javascripts/stock_check_items.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://coffeescript.org/
|
||||
3
app/assets/javascripts/stock_checks.coffee
Normal file
3
app/assets/javascripts/stock_checks.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://coffeescript.org/
|
||||
3
app/assets/javascripts/stock_journals.coffee
Normal file
3
app/assets/javascripts/stock_journals.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://coffeescript.org/
|
||||
3
app/assets/stylesheets/inventory_definitions.scss
Normal file
3
app/assets/stylesheets/inventory_definitions.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the inventory_definitions controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
3
app/assets/stylesheets/stock_check_items.scss
Normal file
3
app/assets/stylesheets/stock_check_items.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the stock_check_items controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
3
app/assets/stylesheets/stock_checks.scss
Normal file
3
app/assets/stylesheets/stock_checks.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the stock_checks controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
3
app/assets/stylesheets/stock_journals.scss
Normal file
3
app/assets/stylesheets/stock_journals.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the stock_journals controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
@@ -0,0 +1,74 @@
|
||||
class InventoryDefinitionsController < ApplicationController
|
||||
before_action :set_inventory_definition, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /inventory_definitions
|
||||
# GET /inventory_definitions.json
|
||||
def index
|
||||
@inventory_definitions = InventoryDefinition.all
|
||||
end
|
||||
|
||||
# GET /inventory_definitions/1
|
||||
# GET /inventory_definitions/1.json
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /inventory_definitions/new
|
||||
def new
|
||||
@inventory_definition = InventoryDefinition.new
|
||||
end
|
||||
|
||||
# GET /inventory_definitions/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /inventory_definitions
|
||||
# POST /inventory_definitions.json
|
||||
def create
|
||||
@inventory_definition = InventoryDefinition.new(inventory_definition_params)
|
||||
|
||||
respond_to do |format|
|
||||
if @inventory_definition.save
|
||||
format.html { redirect_to @inventory_definition, notice: 'Inventory definition was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @inventory_definition }
|
||||
else
|
||||
format.html { render :new }
|
||||
format.json { render json: @inventory_definition.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /inventory_definitions/1
|
||||
# PATCH/PUT /inventory_definitions/1.json
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @inventory_definition.update(inventory_definition_params)
|
||||
format.html { redirect_to @inventory_definition, notice: 'Inventory definition was successfully updated.' }
|
||||
format.json { render :show, status: :ok, location: @inventory_definition }
|
||||
else
|
||||
format.html { render :edit }
|
||||
format.json { render json: @inventory_definition.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /inventory_definitions/1
|
||||
# DELETE /inventory_definitions/1.json
|
||||
def destroy
|
||||
@inventory_definition.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to inventory_definitions_url, notice: 'Inventory definition was successfully destroyed.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_inventory_definition
|
||||
@inventory_definition = InventoryDefinition.find(params[:id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def inventory_definition_params
|
||||
params.fetch(:inventory_definition, {})
|
||||
end
|
||||
end
|
||||
74
app/controllers/inventory/stock_check_items_controller.rb
Normal file
74
app/controllers/inventory/stock_check_items_controller.rb
Normal file
@@ -0,0 +1,74 @@
|
||||
class StockCheckItemsController < ApplicationController
|
||||
before_action :set_stock_check_item, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /stock_check_items
|
||||
# GET /stock_check_items.json
|
||||
def index
|
||||
@stock_check_items = StockCheckItem.all
|
||||
end
|
||||
|
||||
# GET /stock_check_items/1
|
||||
# GET /stock_check_items/1.json
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /stock_check_items/new
|
||||
def new
|
||||
@stock_check_item = StockCheckItem.new
|
||||
end
|
||||
|
||||
# GET /stock_check_items/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /stock_check_items
|
||||
# POST /stock_check_items.json
|
||||
def create
|
||||
@stock_check_item = StockCheckItem.new(stock_check_item_params)
|
||||
|
||||
respond_to do |format|
|
||||
if @stock_check_item.save
|
||||
format.html { redirect_to @stock_check_item, notice: 'Stock check item was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @stock_check_item }
|
||||
else
|
||||
format.html { render :new }
|
||||
format.json { render json: @stock_check_item.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /stock_check_items/1
|
||||
# PATCH/PUT /stock_check_items/1.json
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @stock_check_item.update(stock_check_item_params)
|
||||
format.html { redirect_to @stock_check_item, notice: 'Stock check item was successfully updated.' }
|
||||
format.json { render :show, status: :ok, location: @stock_check_item }
|
||||
else
|
||||
format.html { render :edit }
|
||||
format.json { render json: @stock_check_item.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /stock_check_items/1
|
||||
# DELETE /stock_check_items/1.json
|
||||
def destroy
|
||||
@stock_check_item.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to stock_check_items_url, notice: 'Stock check item was successfully destroyed.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_stock_check_item
|
||||
@stock_check_item = StockCheckItem.find(params[:id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def stock_check_item_params
|
||||
params.fetch(:stock_check_item, {})
|
||||
end
|
||||
end
|
||||
74
app/controllers/inventory/stock_checks_controller.rb
Normal file
74
app/controllers/inventory/stock_checks_controller.rb
Normal file
@@ -0,0 +1,74 @@
|
||||
class StockChecksController < ApplicationController
|
||||
before_action :set_stock_check, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /stock_checks
|
||||
# GET /stock_checks.json
|
||||
def index
|
||||
@stock_checks = StockCheck.all
|
||||
end
|
||||
|
||||
# GET /stock_checks/1
|
||||
# GET /stock_checks/1.json
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /stock_checks/new
|
||||
def new
|
||||
@stock_check = StockCheck.new
|
||||
end
|
||||
|
||||
# GET /stock_checks/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /stock_checks
|
||||
# POST /stock_checks.json
|
||||
def create
|
||||
@stock_check = StockCheck.new(stock_check_params)
|
||||
|
||||
respond_to do |format|
|
||||
if @stock_check.save
|
||||
format.html { redirect_to @stock_check, notice: 'Stock check was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @stock_check }
|
||||
else
|
||||
format.html { render :new }
|
||||
format.json { render json: @stock_check.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /stock_checks/1
|
||||
# PATCH/PUT /stock_checks/1.json
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @stock_check.update(stock_check_params)
|
||||
format.html { redirect_to @stock_check, notice: 'Stock check was successfully updated.' }
|
||||
format.json { render :show, status: :ok, location: @stock_check }
|
||||
else
|
||||
format.html { render :edit }
|
||||
format.json { render json: @stock_check.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /stock_checks/1
|
||||
# DELETE /stock_checks/1.json
|
||||
def destroy
|
||||
@stock_check.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to stock_checks_url, notice: 'Stock check was successfully destroyed.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_stock_check
|
||||
@stock_check = StockCheck.find(params[:id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def stock_check_params
|
||||
params.fetch(:stock_check, {})
|
||||
end
|
||||
end
|
||||
74
app/controllers/inventory/stock_journals_controller.rb
Normal file
74
app/controllers/inventory/stock_journals_controller.rb
Normal file
@@ -0,0 +1,74 @@
|
||||
class StockJournalsController < ApplicationController
|
||||
before_action :set_stock_journal, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /stock_journals
|
||||
# GET /stock_journals.json
|
||||
def index
|
||||
@stock_journals = StockJournal.all
|
||||
end
|
||||
|
||||
# GET /stock_journals/1
|
||||
# GET /stock_journals/1.json
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /stock_journals/new
|
||||
def new
|
||||
@stock_journal = StockJournal.new
|
||||
end
|
||||
|
||||
# GET /stock_journals/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /stock_journals
|
||||
# POST /stock_journals.json
|
||||
def create
|
||||
@stock_journal = StockJournal.new(stock_journal_params)
|
||||
|
||||
respond_to do |format|
|
||||
if @stock_journal.save
|
||||
format.html { redirect_to @stock_journal, notice: 'Stock journal was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @stock_journal }
|
||||
else
|
||||
format.html { render :new }
|
||||
format.json { render json: @stock_journal.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /stock_journals/1
|
||||
# PATCH/PUT /stock_journals/1.json
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @stock_journal.update(stock_journal_params)
|
||||
format.html { redirect_to @stock_journal, notice: 'Stock journal was successfully updated.' }
|
||||
format.json { render :show, status: :ok, location: @stock_journal }
|
||||
else
|
||||
format.html { render :edit }
|
||||
format.json { render json: @stock_journal.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /stock_journals/1
|
||||
# DELETE /stock_journals/1.json
|
||||
def destroy
|
||||
@stock_journal.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to stock_journals_url, notice: 'Stock journal was successfully destroyed.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_stock_journal
|
||||
@stock_journal = StockJournal.find(params[:id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def stock_journal_params
|
||||
params.fetch(:stock_journal, {})
|
||||
end
|
||||
end
|
||||
@@ -4,7 +4,7 @@ class Settings::PromotionsController < ApplicationController
|
||||
# GET /promotions
|
||||
# GET /promotions.json
|
||||
def index
|
||||
@promotions = Promotion.all
|
||||
@promotions = Promotion.all.order("created_at asc")
|
||||
end
|
||||
|
||||
# GET /promotions/1
|
||||
@@ -85,6 +85,6 @@ class Settings::PromotionsController < ApplicationController
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def promotion_params
|
||||
params.require(:promotion).permit(:promo_code, :promo_start_date, :promo_end_date, :promo_start_hour,:promo_end_hour ,:promo_day, :promo_type,:original_product ,:min_qty ,:created_by,
|
||||
:promotion_products_attributes => [:item_code, :min_qty, :net_off, :net_price, :percentage, :_destroy])
|
||||
:promotion_products_attributes => [:id,:item_code, :min_qty, :net_off, :net_price, :percentage, :_destroy])
|
||||
end
|
||||
end
|
||||
|
||||
2
app/helpers/inventory/inventory_definitions_helper.rb
Normal file
2
app/helpers/inventory/inventory_definitions_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module InventoryDefinitionsHelper
|
||||
end
|
||||
2
app/helpers/inventory/stock_check_items_helper.rb
Normal file
2
app/helpers/inventory/stock_check_items_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module StockCheckItemsHelper
|
||||
end
|
||||
2
app/helpers/inventory/stock_checks_helper.rb
Normal file
2
app/helpers/inventory/stock_checks_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module StockChecksHelper
|
||||
end
|
||||
2
app/helpers/inventory/stock_journals_helper.rb
Normal file
2
app/helpers/inventory/stock_journals_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module StockJournalsHelper
|
||||
end
|
||||
2
app/models/inventory_definition.rb
Normal file
2
app/models/inventory_definition.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
class InventoryDefinition < ApplicationRecord
|
||||
end
|
||||
@@ -3,7 +3,7 @@ class Promotion < ApplicationRecord
|
||||
|
||||
has_many :promotion_products
|
||||
|
||||
accepts_nested_attributes_for :promotion_products , :allow_destroy => true
|
||||
accepts_nested_attributes_for :promotion_products , :allow_destroy => true , update_only: true
|
||||
|
||||
PROMO_TYPE1 = "Quantity"
|
||||
PROMO_TYPE2 = "Net_off" # 3000 => - 500 => 2500 [total]
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
class PromotionProduct < ApplicationRecord
|
||||
validates_presence_of :item_code
|
||||
belongs_to :promotion
|
||||
end
|
||||
|
||||
2
app/models/stock_check.rb
Normal file
2
app/models/stock_check.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
class StockCheck < ApplicationRecord
|
||||
end
|
||||
2
app/models/stock_check_item.rb
Normal file
2
app/models/stock_check_item.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
class StockCheckItem < ApplicationRecord
|
||||
end
|
||||
2
app/models/stock_journal.rb
Normal file
2
app/models/stock_journal.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
class StockJournal < ApplicationRecord
|
||||
end
|
||||
10
app/views/inventory/inventory_definitions/_form.html.erb
Normal file
10
app/views/inventory/inventory_definitions/_form.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<%= simple_form_for(@inventory_definition) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -0,0 +1,2 @@
|
||||
json.extract! inventory_definition, :id, :created_at, :updated_at
|
||||
json.url inventory_definition_url(inventory_definition, format: :json)
|
||||
6
app/views/inventory/inventory_definitions/edit.html.erb
Normal file
6
app/views/inventory/inventory_definitions/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing Inventory Definition</h1>
|
||||
|
||||
<%= render 'form', inventory_definition: @inventory_definition %>
|
||||
|
||||
<%= link_to 'Show', @inventory_definition %> |
|
||||
<%= link_to 'Back', inventory_definitions_path %>
|
||||
25
app/views/inventory/inventory_definitions/index.html.erb
Normal file
25
app/views/inventory/inventory_definitions/index.html.erb
Normal file
@@ -0,0 +1,25 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<h1>Inventory Definitions</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @inventory_definitions.each do |inventory_definition| %>
|
||||
<tr>
|
||||
<td><%= link_to 'Show', inventory_definition %></td>
|
||||
<td><%= link_to 'Edit', edit_inventory_definition_path(inventory_definition) %></td>
|
||||
<td><%= link_to 'Destroy', inventory_definition, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Inventory Definition', new_inventory_definition_path %>
|
||||
@@ -0,0 +1 @@
|
||||
json.array! @inventory_definitions, partial: 'inventory_definitions/inventory_definition', as: :inventory_definition
|
||||
5
app/views/inventory/inventory_definitions/new.html.erb
Normal file
5
app/views/inventory/inventory_definitions/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New Inventory Definition</h1>
|
||||
|
||||
<%= render 'form', inventory_definition: @inventory_definition %>
|
||||
|
||||
<%= link_to 'Back', inventory_definitions_path %>
|
||||
4
app/views/inventory/inventory_definitions/show.html.erb
Normal file
4
app/views/inventory/inventory_definitions/show.html.erb
Normal file
@@ -0,0 +1,4 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<%= link_to 'Edit', edit_inventory_definition_path(@inventory_definition) %> |
|
||||
<%= link_to 'Back', inventory_definitions_path %>
|
||||
@@ -0,0 +1 @@
|
||||
json.partial! "inventory_definitions/inventory_definition", inventory_definition: @inventory_definition
|
||||
10
app/views/inventory/stock_check_items/_form.html.erb
Normal file
10
app/views/inventory/stock_check_items/_form.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<%= simple_form_for(@stock_check_item) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -0,0 +1,2 @@
|
||||
json.extract! stock_check_item, :id, :created_at, :updated_at
|
||||
json.url stock_check_item_url(stock_check_item, format: :json)
|
||||
6
app/views/inventory/stock_check_items/edit.html.erb
Normal file
6
app/views/inventory/stock_check_items/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing Stock Check Item</h1>
|
||||
|
||||
<%= render 'form', stock_check_item: @stock_check_item %>
|
||||
|
||||
<%= link_to 'Show', @stock_check_item %> |
|
||||
<%= link_to 'Back', stock_check_items_path %>
|
||||
25
app/views/inventory/stock_check_items/index.html.erb
Normal file
25
app/views/inventory/stock_check_items/index.html.erb
Normal file
@@ -0,0 +1,25 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<h1>Stock Check Items</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @stock_check_items.each do |stock_check_item| %>
|
||||
<tr>
|
||||
<td><%= link_to 'Show', stock_check_item %></td>
|
||||
<td><%= link_to 'Edit', edit_stock_check_item_path(stock_check_item) %></td>
|
||||
<td><%= link_to 'Destroy', stock_check_item, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Stock Check Item', new_stock_check_item_path %>
|
||||
@@ -0,0 +1 @@
|
||||
json.array! @stock_check_items, partial: 'stock_check_items/stock_check_item', as: :stock_check_item
|
||||
5
app/views/inventory/stock_check_items/new.html.erb
Normal file
5
app/views/inventory/stock_check_items/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New Stock Check Item</h1>
|
||||
|
||||
<%= render 'form', stock_check_item: @stock_check_item %>
|
||||
|
||||
<%= link_to 'Back', stock_check_items_path %>
|
||||
4
app/views/inventory/stock_check_items/show.html.erb
Normal file
4
app/views/inventory/stock_check_items/show.html.erb
Normal file
@@ -0,0 +1,4 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<%= link_to 'Edit', edit_stock_check_item_path(@stock_check_item) %> |
|
||||
<%= link_to 'Back', stock_check_items_path %>
|
||||
1
app/views/inventory/stock_check_items/show.json.jbuilder
Normal file
1
app/views/inventory/stock_check_items/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "stock_check_items/stock_check_item", stock_check_item: @stock_check_item
|
||||
10
app/views/inventory/stock_checks/_form.html.erb
Normal file
10
app/views/inventory/stock_checks/_form.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<%= simple_form_for(@stock_check) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -0,0 +1,2 @@
|
||||
json.extract! stock_check, :id, :created_at, :updated_at
|
||||
json.url stock_check_url(stock_check, format: :json)
|
||||
6
app/views/inventory/stock_checks/edit.html.erb
Normal file
6
app/views/inventory/stock_checks/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing Stock Check</h1>
|
||||
|
||||
<%= render 'form', stock_check: @stock_check %>
|
||||
|
||||
<%= link_to 'Show', @stock_check %> |
|
||||
<%= link_to 'Back', stock_checks_path %>
|
||||
25
app/views/inventory/stock_checks/index.html.erb
Normal file
25
app/views/inventory/stock_checks/index.html.erb
Normal file
@@ -0,0 +1,25 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<h1>Stock Checks</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @stock_checks.each do |stock_check| %>
|
||||
<tr>
|
||||
<td><%= link_to 'Show', stock_check %></td>
|
||||
<td><%= link_to 'Edit', edit_stock_check_path(stock_check) %></td>
|
||||
<td><%= link_to 'Destroy', stock_check, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Stock Check', new_stock_check_path %>
|
||||
1
app/views/inventory/stock_checks/index.json.jbuilder
Normal file
1
app/views/inventory/stock_checks/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @stock_checks, partial: 'stock_checks/stock_check', as: :stock_check
|
||||
5
app/views/inventory/stock_checks/new.html.erb
Normal file
5
app/views/inventory/stock_checks/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New Stock Check</h1>
|
||||
|
||||
<%= render 'form', stock_check: @stock_check %>
|
||||
|
||||
<%= link_to 'Back', stock_checks_path %>
|
||||
4
app/views/inventory/stock_checks/show.html.erb
Normal file
4
app/views/inventory/stock_checks/show.html.erb
Normal file
@@ -0,0 +1,4 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<%= link_to 'Edit', edit_stock_check_path(@stock_check) %> |
|
||||
<%= link_to 'Back', stock_checks_path %>
|
||||
1
app/views/inventory/stock_checks/show.json.jbuilder
Normal file
1
app/views/inventory/stock_checks/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "stock_checks/stock_check", stock_check: @stock_check
|
||||
10
app/views/inventory/stock_journals/_form.html.erb
Normal file
10
app/views/inventory/stock_journals/_form.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<%= simple_form_for(@stock_journal) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -0,0 +1,2 @@
|
||||
json.extract! stock_journal, :id, :created_at, :updated_at
|
||||
json.url stock_journal_url(stock_journal, format: :json)
|
||||
6
app/views/inventory/stock_journals/edit.html.erb
Normal file
6
app/views/inventory/stock_journals/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing Stock Journal</h1>
|
||||
|
||||
<%= render 'form', stock_journal: @stock_journal %>
|
||||
|
||||
<%= link_to 'Show', @stock_journal %> |
|
||||
<%= link_to 'Back', stock_journals_path %>
|
||||
25
app/views/inventory/stock_journals/index.html.erb
Normal file
25
app/views/inventory/stock_journals/index.html.erb
Normal file
@@ -0,0 +1,25 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<h1>Stock Journals</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @stock_journals.each do |stock_journal| %>
|
||||
<tr>
|
||||
<td><%= link_to 'Show', stock_journal %></td>
|
||||
<td><%= link_to 'Edit', edit_stock_journal_path(stock_journal) %></td>
|
||||
<td><%= link_to 'Destroy', stock_journal, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Stock Journal', new_stock_journal_path %>
|
||||
1
app/views/inventory/stock_journals/index.json.jbuilder
Normal file
1
app/views/inventory/stock_journals/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @stock_journals, partial: 'stock_journals/stock_journal', as: :stock_journal
|
||||
5
app/views/inventory/stock_journals/new.html.erb
Normal file
5
app/views/inventory/stock_journals/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New Stock Journal</h1>
|
||||
|
||||
<%= render 'form', stock_journal: @stock_journal %>
|
||||
|
||||
<%= link_to 'Back', stock_journals_path %>
|
||||
4
app/views/inventory/stock_journals/show.html.erb
Normal file
4
app/views/inventory/stock_journals/show.html.erb
Normal file
@@ -0,0 +1,4 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<%= link_to 'Edit', edit_stock_journal_path(@stock_journal) %> |
|
||||
<%= link_to 'Back', stock_journals_path %>
|
||||
1
app/views/inventory/stock_journals/show.json.jbuilder
Normal file
1
app/views/inventory/stock_journals/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "stock_journals/stock_journal", stock_journal: @stock_journal
|
||||
@@ -10,18 +10,18 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<span>Promo Start Date</span>
|
||||
<span>* Promo Start Date</span>
|
||||
<%= f.date_field :promo_start_date, :placeholder => "From Date" , :class => "form-control"%>
|
||||
<br>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<span>Promo End Date</span>
|
||||
<span>* Promo End Date</span>
|
||||
<%= f.date_field :promo_end_date ,:placeholder => "To Date" , :class => "form-control"%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<!-- <%= f.input :promo_start_hour %> -->
|
||||
<!-- <span>* Promo Start Hour</span> -->
|
||||
<% if !@promotion.promo_start_hour.nil?%>
|
||||
<%= f.input :promo_start_hour, as: :string, input_html: { :value => @promotion.promo_start_hour.utc.strftime('%H:%M') } %>
|
||||
<% else %>
|
||||
@@ -31,7 +31,7 @@
|
||||
<%= text_field_tag :promo_start_hour , nil, :placeholder => "From Time", :id => "fromtime", :class => 'form-control' %> -->
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<!-- <%= f.input :promo_end_hour %> -->
|
||||
<!-- <span>* Promo End Hour</span> -->
|
||||
<% if !@promotion.promo_end_hour.nil?%>
|
||||
<%= f.input :promo_end_hour, as: :string, input_html: {:value => @promotion.promo_end_hour.utc.strftime('%H:%M') } %>
|
||||
<% else %>
|
||||
@@ -49,60 +49,38 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6"><%= f.input :original_product,collection: MenuItem.order("name desc"),input_html: { selected: 2 } %></div>
|
||||
<div class="col-md-6"><%= f.input :original_product,collection: MenuItem.order("name desc").pluck(:name,:item_code),input_html: { selected: 2 } %></div>
|
||||
<div class="col-md-6"><%= f.input :min_qty %></div>
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
<table class="table" style="border : 1px solid #555555 !important;margin:0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<!-- <td>Promotion Code</td> -->
|
||||
<td>Item Code</td>
|
||||
<td>Min Qty</td>
|
||||
<td>Net off</td>
|
||||
<td>Net Price</td>
|
||||
<td>Percentage</td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
|
||||
<!-- <% @promotion.promotion_products.each do |pp| %>
|
||||
|
||||
<tr>
|
||||
<!-- <td><%= pp.promotion_id %></td>
|
||||
<td><%= pp.item_code %></td>
|
||||
<td><%= pp.min_qty %></td>
|
||||
<td><%= pp.net_off %></td>
|
||||
<td><%= pp.net_price %></td>
|
||||
<td><%= pp.percentage %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_promotion_promotion_product_path(@promotion,pp) %></td>
|
||||
<td><%= link_to 'Destroy', settings_promotion_promotion_product_path(@promotion,pp), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
|
||||
<% end %> -->
|
||||
</tbody>
|
||||
</table>
|
||||
<%= f.fields_for :promotion_products do |pro| %>
|
||||
<table class="table" style="margin:0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<!-- <td></td> -->
|
||||
<td><%= pro.input :item_code, label: false%></td>
|
||||
<td><%= pro.input :min_qty , label: false%></td>
|
||||
<td><%= pro.input :net_off , label: false %></td>
|
||||
<td><%= pro.input :net_price , label: false %></td>
|
||||
<td><%= pro.input :percentage , label: false %></td>
|
||||
<td><%= pro.link_to_remove "X" %></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
<%= f.link_to_add "Add Product", :promotion_products, :class => 'btn btn-primary' %>
|
||||
|
||||
<div class="" style="border: 1px solid #cccccc;padding:1%">
|
||||
<div class="row">
|
||||
<div class="col-md-2" 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">Net off</div>
|
||||
<div class="col-md-2" style="text-align:center">Net Price</div>
|
||||
<div class="col-md-2" style="text-align:center">Percentage</div>
|
||||
<div class="col-md-2" style="text-align:center"></div>
|
||||
</div>
|
||||
<div class="row"></div >
|
||||
<%= f.fields_for :promotion_products do |pro| %>
|
||||
<div class="row">
|
||||
<div class="col-md-2"><%= pro.input :item_code, label: false,collection: MenuItem.order("name desc").pluck(:name,:item_code)%></div>
|
||||
<div class="col-md-2"><%= pro.input :min_qty , label: false%></div>
|
||||
<div class="col-md-2"><%= pro.input :net_off , label: false %></div>
|
||||
<div class="col-md-2"><%= pro.input :net_price , label: false %></div>
|
||||
<div class="col-md-2"><%= pro.input :percentage , label: false %></div>
|
||||
<div class="col-md-2" style="text-align:right"><%= pro.link_to_remove "X" %></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="row">
|
||||
<div class="col-md-12" style="text-align:right;"><%= f.link_to_add "Add Product", :promotion_products, :class => 'btn btn-primary' %></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
|
||||
@@ -39,9 +39,7 @@
|
||||
<td><%= pro.promo_end_hour.utc.strftime("%I:%M %P") rescue "-" %></td>
|
||||
<td><%= pro.promo_day %></td>
|
||||
<td>
|
||||
<% if MenuItem.exists?(pro.original_product) %>
|
||||
<%= MenuItem.find(pro.original_product).name %>
|
||||
<% end %>
|
||||
<%= MenuItem.find_by_item_code(pro.original_product).name rescue "-"%>
|
||||
</td>
|
||||
<% if Employee.exists?(pro.created_by) %>
|
||||
<td><%= Employee.find(pro.created_by).name %></td>
|
||||
|
||||
Reference in New Issue
Block a user