X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fsepa.pl;h=2850bfb14ef93d6be1fd3602a420f8f950699ef6;hb=2da5d610ce0aeb43428de82e6b5e79acfb502628;hp=518b9a8fcea3a7d11194c13ee2dbaeb7003353fb;hpb=233c00b160a769b46815ea7f8b45e9a52a1397bd;p=kivitendo-erp.git diff --git a/bin/mozilla/sepa.pl b/bin/mozilla/sepa.pl index 518b9a8fc..2850bfb14 100755 --- a/bin/mozilla/sepa.pl +++ b/bin/mozilla/sepa.pl @@ -127,8 +127,6 @@ sub bank_transfer_create { my $bank_account_label_sub = sub { $locale->text('Account number #1, bank code #2, #3', $_[0]->{account_number}, $_[0]->{bank_code}, $_[0]->{bank}) }; - $form->{jsscript} = 1; - $form->header(); print $form->parse_html_template('sepa/bank_transfer_create', { 'BANK_TRANSFERS' => \@bank_transfers, @@ -169,7 +167,6 @@ sub bank_transfer_search { my $vc = $form->{vc} eq 'customer' ? 'customer' : 'vendor'; $form->{title} = $vc eq 'customer' ? $::locale->text('List of bank collections') : $locale->text('List of bank transfers'); - $form->{jsscript} = 1; $form->header(); print $form->parse_html_template('sepa/bank_transfer_search', { vc => $vc }); @@ -330,7 +327,6 @@ sub bank_transfer_edit { $form->error($locale->text('That export does not exist.')); } - $form->{jsscript} = 1; $form->{title} = $locale->text('View SEPA export'); $form->header(); print $form->parse_html_template('sepa/bank_transfer_edit', @@ -452,13 +448,14 @@ sub bank_transfer_download_sepa_xml { my $locale = $main::locale; my $cgi = $::request->{cgi}; my $vc = $form->{vc} eq 'customer' ? 'customer' : 'vendor'; + my $defaults = SL::DB::Default->get; - if (!$myconfig->{company}) { - $form->show_generic_error($locale->text('You have to enter a company name in your user preferences (see the "Program" menu, "Preferences").'), 'back_button' => 1); + if (!$defaults->company) { + $form->show_generic_error($locale->text('You have to enter a company name in the client configuration.'), 'back_button' => 1); } - if (($vc eq 'customer') && !$myconfig->{sepa_creditor_id}) { - $form->show_generic_error($locale->text('You have to enter the SEPA creditor ID in your user preferences (see the "Program" menu, "Preferences").'), 'back_button' => 1); + if (($vc eq 'customer') && !$defaults->sepa_creditor_id) { + $form->show_generic_error($locale->text('You have to enter the SEPA creditor ID in the client configuration.'), 'back_button' => 1); } my @ids; @@ -486,9 +483,9 @@ sub bank_transfer_download_sepa_xml { my $message_id = strftime('MSG%Y%m%d%H%M%S', localtime) . sprintf('%06d', $$); - my $sepa_xml = SL::SEPA::XML->new('company' => $myconfig->{company}, - 'creditor_id' => $myconfig->{sepa_creditor_id}, - 'src_charset' => $::lx_office_conf{system}->{dbcharset} || 'ISO-8859-15', + my $sepa_xml = SL::SEPA::XML->new('company' => $defaults->company, + 'creditor_id' => $defaults->sepa_creditor_id, + 'src_charset' => 'UTF-8', 'message_id' => $message_id, 'grouped' => 1, 'collection' => $vc eq 'customer', @@ -511,6 +508,7 @@ sub bank_transfer_download_sepa_xml { 'dst_iban' => $item->{vc_iban}, 'dst_bic' => $item->{vc_bic}, 'company' => $item->{vc_name}, + 'company_number' => $item->{vc_number}, 'amount' => $item->{amount}, 'reference' => $item->{reference}, 'reference_date' => $item->{reference_date},