Merge branch 'august_spring' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
Yan
2017-08-24 15:28:56 +06:30
10 changed files with 225 additions and 206 deletions

View File

@@ -76,6 +76,11 @@ class Origami::CommissionsController < BaseOrigamiController
sale_item_id = params[:sale_item_id]
@sale_item = SaleItem.find_by_sale_item_id(sale_item_id)
@commissioners = Commissioner.active.all
respond_to do |format|
format.json {render json: @commissioners}
# format.html {render @commissioners}
end
end
private

View File

@@ -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