X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fis.pl;h=58d4c4f9172b8fee3fd9a680373d7dfb0b0c3061;hb=c2f911bdbad03f7b81e0121e4e866bb96586168c;hp=aefa5452252a687fc76bf6cf82a7d6b3a37aac81;hpb=dd70b2b0ab95ac40943e8562589a5542c815e4f4;p=kivitendo-erp.git diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index aefa54522..58d4c4f91 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -90,6 +90,8 @@ sub edit { $main::auth->assert('invoice_edit'); + $form->{taxincluded_changed_by_user} = 1; + # show history button $form->{javascript} = qq||; #/show hhistory button @@ -405,6 +407,14 @@ sub form_footer { my ($tax, $subtotal); $form->{taxaccounts_array} = [ split / /, $form->{taxaccounts} ]; + my $paymet_id = $::form->{payment_id}; + IS->get_customer(\%myconfig, \%$form) if $form->{type} =~ /sales_(order|quotation)/; + $::form->{payment_id} = $paymet_id; + + if ( $form->{vc} eq 'customer' && !$form->{taxincluded_changed_by_user} ) { + $form->{taxincluded} = defined($form->{taxincluded_checked}) ? $form->{taxincluded_checked} : $myconfig{taxincluded_checked}; + } + foreach my $item (@{ $form->{taxaccounts_array} }) { if ($form->{"${item}_base"}) { if ($form->{taxincluded}) { @@ -509,6 +519,9 @@ sub update { for my $i (1 .. $form->{paidaccounts}) { next unless $form->{"paid_$i"}; map { $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) } qw(paid exchangerate); + if (!$form->{"forex_$i"}) { #read exchangerate from input field (not hidden) + $form->{exchangerate} = $form->{"exchangerate_$i"}; + } $form->{"forex_$i"} = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'buy'); $form->{"exchangerate_$i"} = $form->{"forex_$i"} if $form->{"forex_$i"}; } @@ -822,7 +835,7 @@ sub storno { $form->error($locale->text("Invoice has already been storno'd!")); } - map({ my $key = $_; delete($form->{$key}) unless (grep({ $key eq $_ } qw(id login password stylesheet type))); } keys(%{ $form })); + map({ my $key = $_; delete($form->{$key}) unless (grep({ $key eq $_ } qw(id login password type))); } keys(%{ $form })); invoice_links(); prepare_invoice(); @@ -872,8 +885,6 @@ sub delete { $form->header; print qq| - -
|;