mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Manual invoice binding improvement #2733
This commit is contained in:
parent
194a551203
commit
1142b1dfc7
6 changed files with 45 additions and 4 deletions
|
@ -17,6 +17,14 @@ class Admin::BankStatementsController < AdminController
|
|||
|
||||
def new
|
||||
@bank_statement = BankStatement.new
|
||||
@invoice = Invoice.find_by(id: params[:invoice_id])
|
||||
@bank_transaction = @bank_statement.bank_transactions.build(
|
||||
description: @invoice.to_s,
|
||||
sum: @invoice.sum,
|
||||
reference_no: @invoice.reference_no,
|
||||
paid_at: Time.zone.now.to_date,
|
||||
currency: 'EUR'
|
||||
) if @invoice
|
||||
end
|
||||
|
||||
def create
|
||||
|
@ -69,6 +77,8 @@ class Admin::BankStatementsController < AdminController
|
|||
end
|
||||
|
||||
def bank_statement_params
|
||||
params.require(:bank_statement).permit(:th6_file, :bank_code, :iban)
|
||||
params.require(:bank_statement).permit(:th6_file, :bank_code, :iban, bank_transactions_attributes: [
|
||||
:description, :sum, :reference_no, :paid_at
|
||||
])
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue