X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/24f530ced23c4acab71ac8e37408dbba9d788ef2..51fa09f29ebea609f58d14506d6938c0e0ee1ab0:/bin/mozilla/is.pl diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index aeba18777..07b40d4d5 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -132,8 +132,8 @@ sub invoice_links { $form->{vc} = 'customer'; # create links - $form->{webdav} = $main::webdav; - $form->{lizenzen} = $main::lizenzen; + $form->{webdav} = $::lx_office_conf{system}->{webdav}; + $form->{lizenzen} = $::lx_office_conf{system}->{lizenzen}; $form->create_links("AR", \%myconfig, "customer"); @@ -266,7 +266,13 @@ sub prepare_invoice { # get pricegroups for parts IS->get_pricegroups_for_parts(\%myconfig, \%$form); - set_pricegroup($_) for 1 .. $form->{rowcount}; + + # Problem: set_pricegroup resets the sellprice of old invoices to the price + # currently defined in the pricegroup, which is a problem if the price has + # changed, as the old invoice gets the new price + # set_pricegroup must never be called, when an old invoice is initially loaded + + # set_pricegroup($_) for 1 .. $form->{rowcount}; } $main::lxdebug->leave_sub(); } @@ -555,7 +561,7 @@ sub update { $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}); - if ($main::lizenzen) { + if ($::lx_office_conf{system}->{lizenzen}) { if ($form->{"inventory_accno_$i"} ne "") { $form->{"lizenzen_$i"} = qq||; foreach my $item (@{ $form->{LIZENZEN}{ $form->{"id_$i"} } }) { @@ -780,6 +786,11 @@ sub use_as_template { $form->{paidaccounts} = 1; $form->{rowcount}--; $form->{invdate} = $form->current_date(\%myconfig); + + # remember pricegroups for "use as template" + IS->get_pricegroups_for_parts(\%myconfig, \%$form); + set_pricegroup($_) for 1 .. $form->{rowcount}; + &display_form; $main::lxdebug->leave_sub(); @@ -953,7 +964,7 @@ sub yes { $main::auth->assert('invoice_edit'); - if (IS->delete_invoice(\%myconfig, \%$form, $main::spool)) { + if (IS->delete_invoice(\%myconfig, \%$form)) { # saving the history if(!exists $form->{addition}) { $form->{snumbers} = qq|invnumber_| . $form->{invnumber};