X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fap.pl;h=a5fea70166ecf7c362e48127adae1a62321ae46d;hb=27ffa16a85221662dee49da0f210312383341240;hp=ae2bda36b605e454bf2a4fafe93000ffa59dd66d;hpb=662ded382ad646d46d1e2613df42ed35ee2f6265;p=kivitendo-erp.git diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index ae2bda36b..a5fea7016 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}> @@ -1081,7 +1074,7 @@ sub post { if(!exists $form->{addition} && $form->{id} ne "") { $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; $form->{addition} = "POSTED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->save_history; } # /saving the history remove_draft() if $form->{remove_draft}; @@ -1107,7 +1100,7 @@ sub post_as_new { if(!exists $form->{addition} && $form->{id} ne "") { $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; $form->{addition} = "POSTED AS NEW"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->save_history; } # /saving the history &post; @@ -1185,12 +1178,12 @@ 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}; $form->{addition} = "DELETED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->save_history; } # /saving the history $form->redirect($locale->text('Transaction deleted!')); @@ -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}"; @@ -1433,7 +1427,7 @@ sub storno { if(!exists $form->{addition} && $form->{id} ne "") { $form->{snumbers} = "ordnumber_$form->{ordnumber}"; $form->{addition} = "STORNO"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->save_history; } # /saving the history