X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=59479931fb4c8a30431e88f8b7afe638ab301058;hb=cc5d61a92113701ad19ef3c366da307307a764b0;hp=c9ddfa5be82d09cc502d07654277b1927eba9218;hpb=74fca575d438232002756175338c23f55b8a6c12;p=kivitendo-erp.git diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index c9ddfa5be..59479931f 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -239,7 +239,7 @@ sub order_links { $form->{"$form->{vc}_id"} ||= $form->{"all_$form->{vc}"}->[0]->{id} if $form->{"all_$form->{vc}"}; - $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id taxincluded cp_id intnotes shipto_id)); + $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id taxincluded cp_id intnotes shipto_id currency)); $form->{shipto} = 1 if $form->{id}; # get customer / vendor @@ -247,6 +247,7 @@ sub order_links { IS->get_customer(\%myconfig, \%$form) if $form->{type} =~ /sales_(order|quotation)/; $form->restore_vars(qw(payment_id language_id taxzone_id intnotes cp_id shipto_id)); + $form->restore_vars(qw(currency)) if $form->{id}; $form->restore_vars(qw(taxincluded)) if $form->{id}; $form->restore_vars(qw(salesman_id)) if $editing; $form->{forex} = $form->{exchangerate}; @@ -361,7 +362,9 @@ sub form_header { $form->{currency} = $form->{defaultcurrency} unless $form->{currency}; $TMPL_VAR{show_exchangerate} = $form->{currency} ne $form->{defaultcurrency}; $TMPL_VAR{currencies} = NTI($cgi->popup_menu('-name' => 'currency', '-default' => $form->{"currency"}, - '-values' => \@values, '-labels' => \%labels)) if scalar @values; + '-values' => \@values, '-labels' => \%labels, + '-onchange' => "document.getElementById('update_button').click();" + )) if scalar @values; push @custom_hiddens, "forex"; push @custom_hiddens, "exchangerate" if $form->{forex}; @@ -1766,9 +1769,11 @@ sub poso { map { delete $form->{$_} } qw(id subject message cc bcc printed emailed queued customer vendor creditlimit creditremaining discount tradediscount oldinvtotal delivered ordnumber); # if purchase_order was generated from sales_order, use lastcost_$i as sellprice_$i + # also reset discounts if ( $form->{sales_order_to_purchase_order} ) { for my $i (1 .. $form->{rowcount}) { $form->{"sellprice_${i}"} = $form->format_amount(\%myconfig,$form->{"lastcost_${i}"}); + $form->{"discount_${i}"} = 0; }; };