Merge branch 'master' into discount

This commit is contained in:
Yan
2017-07-10 12:08:03 +06:30
23 changed files with 1079 additions and 387 deletions

View File

@@ -49,11 +49,14 @@ class Origami::DiscountsController < BaseOrigamiController
end
# Re-calc All Amount in Sale
sale.compute_by_sale_items(sale_id, sale.sale_items, overall_discount.to_f)
sale.compute_by_sale_items(sale_id, sale.sale_items, overall_discount.to_f)
result = {:status=> "Success", :table_id => table_id, :table_type => table_type }
else
result = {:status=> "Please, Check Again!", :table_id => table_id, :table_type => table_type }
end
dining = {:table_id => table_id, :table_type => table_type }
render :json => dining.to_json
render :json => result.to_json
end
# Remove selected discount Items
@@ -78,11 +81,12 @@ class Origami::DiscountsController < BaseOrigamiController
# sale.save
# Re-calc All Amount in Sale
sale.compute_by_sale_items(sale_id, sale.sale_items, sale.total_discount)
end
result = {:status=> "Success", :table_id => table_id, :table_type => table_type }
else
result = {:status=> "Please, Check Again!", :table_id => table_id, :table_type => table_type }
end
dining = {:table_id => table_id, :table_type => table_type }
render :json => dining.to_json
render :json => result.to_json
end
# Remove all discount Items
@@ -108,11 +112,12 @@ class Origami::DiscountsController < BaseOrigamiController
# Re-calc All Amount in Sale
sale.compute_by_sale_items(sale_id, sale.sale_items, 0)
end
result = {:status=> "Success", :table_id => table_id, :table_type => table_type }
else
result = {:status=> "Please, Check Again!", :table_id => table_id, :table_type => table_type }
end
dining = {:table_id => table_id, :table_type => table_type }
render :json => dining.to_json
render :json => result.to_json
end
# Member Discount