Sha256: fcff7c11658c5b545a682f82991d1ae5d4ee2bff1eaec6797353316bf0ef9272

Contents?: true

Size: 1.16 KB

Versions: 24

Compression:

Stored size: 1.16 KB

Contents

class EsrRecordsController < AuthorizedController
  respond_to :html, :js

  before_filter :only => [:index] do
    EsrRecord.update_unsolved_states
  end

  # Scopes
  def index
    @esr_records = EsrRecord.unsolved.paginate :page => params[:page], :order => 'state, value_date'
  end

  # State events
  def write_off
    @esr_record = EsrRecord.find(params[:id])
    @esr_record.invoice.write_off("Korrektur nach VESR Zahlung").save
    @esr_record.write_off!

    respond_to do |format|
      format.js {}
      format.html {redirect_to @esr_record.esr_file}
    end
  end

  def book_extra_earning
    @esr_record = EsrRecord.find(params[:id])
    if invoice = @esr_record.invoice
      @esr_record.invoice.book_extra_earning("Korrektur nach VESR Zahlung").save
    else
      @esr_record.create_extra_earning_booking
    end

    @esr_record.book_extra_earning!
    respond_to do |format|
      format.js {}
      format.html {redirect_to @esr_record.esr_file}
    end
  end

  def resolve
    @esr_record = EsrRecord.find(params[:id])
    @esr_record.resolve!

    respond_to do |format|

      format.js {}
      format.html {redirect_to @esr_record.esr_file}
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
vesr-1.1.1 app/controllers/esr_records_controller.rb
vesr-1.1.0 app/controllers/esr_records_controller.rb
vesr-1.0.1 app/controllers/esr_records_controller.rb
vesr-1.0.0 app/controllers/esr_records_controller.rb
vesr-0.13.1 app/controllers/esr_records_controller.rb
vesr-0.13.0 app/controllers/esr_records_controller.rb
vesr-0.12.7 app/controllers/esr_records_controller.rb
vesr-0.12.6 app/controllers/esr_records_controller.rb
vesr-0.12.5 app/controllers/esr_records_controller.rb
vesr-0.12.4 app/controllers/esr_records_controller.rb
vesr-0.12.3 app/controllers/esr_records_controller.rb
vesr-0.12.2 app/controllers/esr_records_controller.rb
vesr-0.12.1 app/controllers/esr_records_controller.rb
vesr-0.12.0 app/controllers/esr_records_controller.rb
vesr-0.11.9 app/controllers/esr_records_controller.rb
vesr-0.11.8 app/controllers/esr_records_controller.rb
vesr-0.11.7 app/controllers/esr_records_controller.rb
vesr-0.11.6 app/controllers/esr_records_controller.rb
vesr-0.11.5 app/controllers/esr_records_controller.rb
vesr-0.11.4 app/controllers/esr_records_controller.rb