X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fis.pl;h=07b40d4d5b8cd5025a7add8d2d475a040b42e662;hb=2c1c6a9a9204afad82c8e403f3fce1d0d4b9cd90;hp=aeba18777ae74217d3ad8213400bd6ec215696ce;hpb=24f530ced23c4acab71ac8e37408dbba9d788ef2;p=kivitendo-erp.git 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};