# -*- 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
