X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fap.pl;h=a5fea70166ecf7c362e48127adae1a62321ae46d;hb=27ffa16a85221662dee49da0f210312383341240;hp=06541ef05b4a147b8a38b40786dd340a8863f156;hpb=a873249c8c3c32006540d8636102c195dd4d9448;p=kivitendo-erp.git diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index 06541ef05..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}> @@ -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}; @@ -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);