From: Thomas Kasulke Date: Fri, 4 May 2007 08:02:56 +0000 (+0000) Subject: Neues PopupMenu für Zahlungsbedingungen eingefügt und Änderungen an deren Varibale... X-Git-Tag: release-2.4.3^2~397 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=d52e2ffc5a084a39f3442311bc8c02b114aa128a;p=kivitendo-erp.git Neues PopupMenu für Zahlungsbedingungen eingefügt und Änderungen an deren Varibale abgefangen. --- diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index f08daabfd..640fb37e5 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -157,7 +157,6 @@ sub edit { sub order_links { $lxdebug->enter_sub(); - # get customer/vendor $form->all_vc(\%myconfig, $form->{vc}, ($form->{vc} eq 'customer') ? "AR" : "AP"); @@ -231,6 +230,7 @@ sub order_links { } $form->{cp_id} = $cp_id; + if ($payment_id) { $form->{payment_id} = $payment_id; } @@ -334,14 +334,6 @@ sub form_header { $form->{jsscript} = $form->{jscalendar}; $jsscript = ""; - $payment = qq||; - foreach $item (@{ $form->{payment_terms} }) { - if ($form->{payment_id} eq $item->{id}) { - $payment .= qq||; - } else { - $payment .= qq||; - } - } if ($form->{jsscript}) { # with JavaScript Calendar @@ -418,6 +410,7 @@ sub form_header { "old_id" => \@old_project_ids }, "employees" => "ALL_SALESMEN", "taxzones" => "ALL_TAXZONES", + "payments" => "ALL_PAYMENTS", "currencies" => "ALL_CURRENCIES"); ($form->{vc} eq "customer" ? $form->get_lists("customers" => "ALL_CUSTOMERS") @@ -453,6 +446,20 @@ sub form_header { {vc}"}) . qq|">|; + %labels = (); + @values = (""); + foreach my $item (@{ $form->{"ALL_PAYMENTS"} }) { + push(@values, $item->{"id"}); + $labels{$item->{"id"}} = $item->{"description"}; + } + + $payments = qq| + | . $locale->text('Payment Terms') . qq| + | . + NTI($cgi->popup_menu('-name' => 'payment_id', '-values' => \@values, + '-labels' => \%labels, '-default' => $form->{payment_id})) + . qq||; + %labels = (); @values = (""); foreach my $item (@{ $form->{"ALL_SHIPTO"} }) { @@ -1008,10 +1015,10 @@ sub form_footer { $notes $intnotes - | . $locale->text('Payment Terms') . qq| - - + + $payments + + $taxincluded @@ -1184,9 +1191,17 @@ sub update { map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(exchangerate creditlimit creditremaining); $form->{update} = 1; - + + if($form->{payment_id}) { + $payment_id = $form->{payment_id}; + } + &check_name($form->{vc}); - + + if($form->{payment_id} eq "") { + $form->{payment_id} = $payment_id; + } + $buysell = 'buy'; $buysell = 'sell' if ($form->{vc} eq 'vendor'); $form->{exchangerate} = $exchangerate @@ -1922,9 +1937,16 @@ sub save_and_close { if ($form->{currency} ne $form->{defaultcurrency}); &validate_items; - + + if($form->{payment_id}) { + $payment_id = $form->{payment_id}; + } + # if the name changed get new values if (&check_name($form->{vc})) { + if($form->{payment_id} eq "") { + $form->{payment_id} = $payment_id; + } &update; exit; } @@ -2006,9 +2028,16 @@ sub save { if ($form->{currency} ne $form->{defaultcurrency}); &validate_items; - + + if($form->{payment_id}) { + $payment_id = $form->{payment_id}; + } + # if the name changed get new values if (&check_name($form->{vc})) { + if($form->{payment_id} eq "") { + $form->{payment_id} = $payment_id; + } &update; exit; } @@ -2161,9 +2190,16 @@ sub invoice { $form->{ordnumber} = ""; $form->{quodate} = $form->{transdate}; } - + + if($form->{payment_id}) { + $payment_id = $form->{payment_id}; + } + # if the name changed get new values if (&check_name($form->{vc})) { + if($form->{payment_id} eq "") { + $form->{payment_id} = $payment_id; + } &update; exit; }