X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fis.pl;h=7ac9f4d49a6432a83359c09f70085a90ee55a866;hb=c9902d7658d0cacdf665971b32de0e054637efd0;hp=a94a720f22023d1376545aebd3cc576dfde8d249;hpb=c0249f11d53031726da0f26bb733a7e769cdff0c;p=kivitendo-erp.git diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index a94a720f2..7ac9f4d49 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -155,14 +155,6 @@ sub invoice_links { $ref->{name} = $form->quote($ref->{name}); } - # Load data for a specific order and update form fields - my $order_data = OE->get_order_data_by_ordnumber(%$form) if $form->{ordnumber}; - - # Copy the fields we need to %form - for my $key (qw(payment_id salesman_id orddate taxzone_id quonumber)) { - $form->{$key} = $order_data->{$key}; - } - $form->restore_vars(qw(id)); IS->retrieve_invoice(\%myconfig, \%$form); @@ -266,6 +258,8 @@ sub prepare_invoice { $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty); + $form->{"sellprice_pg_$i"} = join ('--', $form->{"sellprice_$i"}, $form->{"pricegroup_id_$i"}); + $form->{rowcount} = $i; } @@ -511,7 +505,11 @@ sub update { my $rows = scalar @{ $form->{item_list} }; - $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{customer_discount} * 100); + # Falls kein Kundenrabatt vorhanden ist, den aktuellen Rabatt nicht mit 0% überschreiben, + # da hier der Anwender schon manual einen Wert eingetragen haben könnte (analog zu qty) Bugfix: 1412 + if ($form->{customer_discount}){ + $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{customer_discount} * 100); + } if ($rows) { $form->{"qty_$i"} = ($form->{"qty_$i"} * 1) ? $form->{"qty_$i"} : 1;