X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FCsvImport%2FBankTransaction.pm;h=d6a7e87aa3880fb8b08b4941b61d6fc2bb03fea6;hb=036d1ca4bd5e9574118a7041e58b64fda4bc003d;hp=addcb016dd53afbb9c272000a09bcb62e9f217e6;hpb=b9d025079a0ea00235e47c249a1d00dde90cb3cb;p=kivitendo-erp.git diff --git a/SL/Controller/CsvImport/BankTransaction.pm b/SL/Controller/CsvImport/BankTransaction.pm index addcb016d..d6a7e87aa 100644 --- a/SL/Controller/CsvImport/BankTransaction.pm +++ b/SL/Controller/CsvImport/BankTransaction.pm @@ -56,6 +56,7 @@ sub check_objects { } $self->add_info_columns({ header => $::locale->text('Bank account'), method => 'local_bank_name' }); + $self->add_raw_data_columns("currency", "currency_id") if grep { /^currency(?:_id)?$/ } @{ $self->csv->header }; } sub check_existing { @@ -82,25 +83,29 @@ sub check_existing { }; } +sub _displayable_columns { + ( + { name => 'local_bank_code', description => $::locale->text('Own bank code') }, + { name => 'local_account_number', description => $::locale->text('Own bank account number or IBAN') }, + { name => 'local_bank_account_id', description => $::locale->text('ID of own bank account') }, + { name => 'remote_bank_code', description => $::locale->text('Bank code of the goal/source') }, + { name => 'remote_account_number', description => $::locale->text('Account number of the goal/source') }, + { name => 'transdate', description => $::locale->text('Date of transaction') }, + { name => 'valutadate', description => $::locale->text('Valuta date') }, + { name => 'amount', description => $::locale->text('Amount') }, + { name => 'currency', description => $::locale->text('Currency') }, + { name => 'currency_id', description => $::locale->text('Currency (database ID)') }, + { name => 'remote_name', description => $::locale->text('Name of the goal/source (if field names remote_name and remote_name_1 exist they will be combined into field "remote_name")') }, + { name => 'purpose', description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') } + ); +} + sub setup_displayable_columns { my ($self) = @_; $self->SUPER::setup_displayable_columns; - # TODO: don't show fields cleared, invoice_amount and transaction_id in the help text, as these should not be imported - $self->add_displayable_columns({ name => 'local_bank_code', description => $::locale->text('Own bank code') }, - { name => 'local_account_number', description => $::locale->text('Own bank account number or IBAN') }, - { name => 'local_bank_account_id', description => $::locale->text('ID of own bank account') }, - { name => 'remote_bank_code', description => $::locale->text('Bank code of the goal/source') }, - { name => 'remote_account_number', description => $::locale->text('Account number of the goal/source') }, - { name => 'transdate', description => $::locale->text('Date of transaction') }, - { name => 'valutadate', description => $::locale->text('Valuta date') }, - { name => 'amount', description => $::locale->text('Amount') }, - { name => 'currency', description => $::locale->text('Currency') }, - { name => 'currency_id', description => $::locale->text('Currency (database ID)') }, - { name => 'remote_name', description => $::locale->text('Name of the goal/source (if field names remote_name and remote_name_1 exist they will be combined into field "remote_name")') }, - { name => 'purpose', description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') }, - ); + $self->add_displayable_columns($self->_displayable_columns); } sub check_bank_account { @@ -147,7 +152,6 @@ sub check_bank_account { $object->local_bank_account_id($bank_account->id); $entry->{info_data}->{local_bank_name} = $bank_account->name; } - return $object->local_bank_account_id ? 1 : 0; } @@ -182,4 +186,8 @@ sub join_remote_names { $object->remote_name($remote_name); } +sub check_auth { + $::auth->assert('config') if ! $::auth->assert('bank_transaction',1); +} + 1;