```ruby
class SalariesController < InvoicesController
  defaults :resource_class => Salary

  respond_to :html, :pdf
  
  # Filter/Search
  # =============
  has_scope :by_state, :default => nil
  has_scope :by_value_period, :using => [:from, :to], :default => proc { |c| c.session[:has_scope] }
  has_scope :by_employee_id

  # Actions
  # =======
  def statistics
    index!
  end

  def select_employee
    # Allow pre-seeding some parameters
    salary_params = {
      :customer_id    => current_tenant.company.id,
      :state          => 'booked',
      :duration_from  => Date.today,
      :duration_to    => Date.today.in(30.days).to_date
    }

    # Set default parameters
    salary_params.merge!(params[:salary]) if params[:salary]

    @salary = Salary.new(salary_params)
  end

  def new
    @salary = Salary.new(params[:salary])

    employment = @salary.employee.employments.current

    @salary.amount = employment.salary_amount

    # Line Items

    # Prebuild an empty attachment instance
    @salary.attachments.build

    new!
  end

  def create
    @salary = Salary.new(params[:salary])
    @salary.build_booking

    create!
  end

  def payslip
    show! do |format|
      format.html { redirect_to :action => :show }
    end
  end
end
```

Use employer_id instead of customer_id when building salary_params.
user
```ruby
class SalariesController < InvoicesController
  defaults :resource_class => Salary

  respond_to :html, :pdf
  
  # Filter/Search
  # =============
  has_scope :by_state, :default => nil
  has_scope :by_value_period, :using => [:from, :to], :default => proc { |c| c.session[:has_scope] }
  has_scope :by_employee_id

  # Actions
  # =======
  def statistics
    index!
  end

  def select_employee
    # Allow pre-seeding some parameters
    salary_params = {
      :employer_id    => current_tenant.company.id,
      :state          => 'booked',
      :duration_from  => Date.today,
      :duration_to    => Date.today.in(30.days).to_date
    }

    # Set default parameters
    salary_params.merge!(params[:salary]) if params[:salary]

    @salary = Salary.new(salary_params)
  end

  def new
    @salary = Salary.new(params[:salary])

    employment = @salary.employee.employments.current

    @salary.amount = employment.salary_amount

    # Line Items

    # Prebuild an empty attachment instance
    @salary.attachments.build

    new!
  end

  def create
    @salary = Salary.new(params[:salary])
    @salary.build_booking

    create!
  end

  def payslip
    show! do |format|
      format.html { redirect_to :action => :show }
    end
  end
end
```
assistant