Remove bank statement import functionality

This commit is contained in:
Karl Erik Õunapuu 2020-09-07 12:55:42 +03:00
parent bfa60a9c17
commit aa2d9547a4
No known key found for this signature in database
GPG key ID: C9DD647298A34764
8 changed files with 2 additions and 125 deletions

View file

@ -2,7 +2,7 @@ module Admin
class BankStatementsController < BaseController
load_and_authorize_resource
before_action :set_bank_statement, only: [:show, :download_import_file, :bind_invoices]
before_action :set_bank_statement, only: [:show, :bind_invoices]
def index
@q = BankStatement.search(params[:q])
@ -43,22 +43,6 @@ module Admin
end
end
def import
@bank_statement = BankStatement.new
end
def create_from_import
@bank_statement = BankStatement.new(bank_statement_params)
if @bank_statement.import
flash[:notice] = I18n.t('record_created')
redirect_to [:admin, @bank_statement]
else
flash.now[:alert] = I18n.t('failed_to_create_record')
render 'new'
end
end
def bind_invoices
@bank_statement.bind_invoices(manual: true)
@ -69,11 +53,6 @@ module Admin
redirect_to [:admin, @bank_statement]
end
def download_import_file
filename = @bank_statement.import_file_path.split('/').last
send_data File.open(@bank_statement.import_file_path, 'r').read, filename: filename
end
private
def set_bank_statement
@ -81,7 +60,7 @@ module Admin
end
def bank_statement_params
params.require(:bank_statement).permit(:th6_file, :bank_code, :iban, bank_transactions_attributes: [
params.require(:bank_statement).permit(:bank_code, :iban, bank_transactions_attributes: [
:description, :sum, :currency, :reference_no, :paid_at
])
end