thatcher_app/app/controllers/admin/p_sheet_lines_controller.rb
2019-11-11 16:11:03 +01:00

25 lines
470 B
Ruby

# -*- encoding : utf-8 -*-
class Admin::PSheetLinesController < ApplicationController
layout "admin"
before_action :auth_admin
before_action :admin_space
def admin_space
@admin_space = "stocks"
end
def decrement
@p_sheet_line = PSheetLine.find(params[:id])
@p_sheet_line.decrement_stock
@p_sheet_line = PSheetLine.find(params[:id])
@p_sheet_line.save
@p_sheet_line.p_customer_sheet.save
redirect_to :back
end
end