X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fbankaccounts.pl;h=941e40768404d365db673810c5bd4d0a489a8b84;hb=049e49fea3e4a3c7c78d7aebf055936b3cab40c5;hp=f8bbb3a849e1e0e3337adf1e1ae66e486181258f;hpb=694ced449e7ba97d19119d6a03080f8c5d0f3e04;p=kivitendo-erp.git diff --git a/bin/mozilla/bankaccounts.pl b/bin/mozilla/bankaccounts.pl index f8bbb3a84..941e40768 100644 --- a/bin/mozilla/bankaccounts.pl +++ b/bin/mozilla/bankaccounts.pl @@ -32,6 +32,16 @@ sub bank_account_edit { $main::lxdebug->leave_sub(); } +sub bank_account_delete { + $::lxdebug->enter_sub(); + + SL::BankAccount->delete(id => $::form->{account}{id}); + + print $::form->redirect_header('bankaccounts.pl?action=bank_account_list'); + + $::lxdebug->leave_sub(); +} + sub bank_account_display_form { $main::lxdebug->enter_sub(); @@ -63,9 +73,9 @@ sub bank_account_save { my $account = $form->{account} && (ref $form->{account} eq 'HASH') ? $form->{account} : { }; - if (any { !$account->{$_} } qw(account_number bank_code iban bic)) { + if (any { !$account->{$_} } qw(name account_number bank_code iban bic)) { bank_account_display_form('account' => $account, - 'error' => $locale->text('You have to fill in at least an account number, the bank code, the IBAN and the BIC.')); + 'error' => $locale->text('You have to fill in at least a name, an account number, the bank code, the IBAN and the BIC.')); $main::lxdebug->leave_sub(); return; @@ -105,6 +115,7 @@ sub bank_account_list { my $href = build_std_url('action=bank_account_list'); my %column_defs = ( + 'name' => { 'text' => $locale->text('Name'), }, 'account_number' => { 'text' => $locale->text('Account number'), }, 'bank_code' => { 'text' => $locale->text('Bank code'), }, 'bank' => { 'text' => $locale->text('Bank'), }, @@ -112,7 +123,7 @@ sub bank_account_list { 'iban' => { 'text' => $locale->text('IBAN'), }, ); - my @columns = qw(account_number bank bank_code bic iban); + my @columns = qw(name account_number bank bank_code bic iban); foreach my $name (@columns) { my $sortdir = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir}; @@ -126,7 +137,7 @@ sub bank_account_list { 'attachment_basename' => $locale->text('bankaccounts') . strftime('_%Y%m%d', localtime time), ); $report->set_options_from_form(); - $locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv'; + $locale->set_numberformat_wo_thousands_separator(\%::myconfig) if lc($report->{options}->{output_format}) eq 'csv'; $report->set_columns(%column_defs); $report->set_column_order(@columns);