X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fap.pl;h=886ff65f359709b1a30238b75b3d8061486813c0;hb=ba5d3542135b3408a011ce42d2311fa3aefa7f38;hp=8b32585a0bce450a465ad0749e1f0d9a091b3148;hpb=a590a6518025280c2d6e76c87641764ca6198521;p=kivitendo-erp.git diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index 8b32585a0..886ff65f3 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -92,7 +92,7 @@ sub add { $form->{title} = "Add"; - $form->{callback} = "ap.pl?action=add" unless $form->{callback}; + $form->{callback} = "ap.pl?action=add&DONT_LOAD_DRAFT=1" unless $form->{callback}; AP->get_transdate(\%myconfig, $form); $form->{initial_transdate} = $form->{transdate}; @@ -244,17 +244,10 @@ sub form_header { $form->{forex} = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{transdate}, 'sell'); $form->{exchangerate} = $form->{forex} if $form->{forex}; - # format amounts - $form->{exchangerate} = - $form->format_amount(\%myconfig, $form->{exchangerate}); - if ($form->{exchangerate} == 0) { - $form->{exchangerate} = ""; - } - $form->{creditlimit} = - $form->format_amount(\%myconfig, $form->{creditlimit}, 0, "0"); - $form->{creditremaining} = - $form->format_amount(\%myconfig, $form->{creditremaining}, 0, "0"); + $form->{exchangerate} = $form->{exchangerate} ? $form->format_amount(\%myconfig, $form->{exchangerate}) : ''; + $form->{creditlimit} = $form->format_amount(\%myconfig, $form->{creditlimit}, 0, "0"); + $form->{creditremaining} = $form->format_amount(\%myconfig, $form->{creditremaining}, 0, "0"); my $exchangerate = qq| {forex}> @@ -1185,7 +1178,7 @@ sub yes { $main::auth->assert('general_ledger'); - if (AP->delete_transaction(\%myconfig, \%$form, $main::spool)) { + if (AP->delete_transaction(\%myconfig, \%$form)) { # saving the history if(!exists $form->{addition}) { $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; @@ -1203,7 +1196,7 @@ sub yes { sub search { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger | invoice_edit'); + $main::auth->assert('general_ledger | vendor_invoice_edit'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -1276,7 +1269,7 @@ sub ap_transactions { vendornumber country ustid taxzone payment_terms charts); my @hidden_variables = map { "l_${_}" } @columns; - push @hidden_variables, "l_subtotal", qw(open closed vendor invnumber ordnumber transaction_description notes project_id transdatefrom transdateto); + push @hidden_variables, "l_subtotal", qw(open closed vendor invnumber ordnumber transaction_description notes project_id transdatefrom transdateto department); my $href = build_std_url('action=ap_transactions', grep { $form->{$_} } @hidden_variables); @@ -1342,6 +1335,7 @@ sub ap_transactions { 'attachment_basename' => $locale->text('vendor_invoice_list') . 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'; # add sort and escape callback, this one we use for the add sub $form->{callback} = $href .= "&sort=$form->{sort}";