X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fic.pl;h=3fa0da5cdf18716668010e04bcca18e4e7a71cb0;hb=4bbb5dbe9a272bc31d5f059b3ece3e230c2a6642;hp=965e4bafa6ecf9c7ed525edfbb5e100401171878;hpb=a1c4f3ced1a73e63c94377051edbe32462eb521a;p=kivitendo-erp.git diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index 965e4bafa..3fa0da5cd 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -78,7 +78,8 @@ sub add { $auth->assert('part_service_assembly_edit'); - $form->{title} = $locale->text('Add ' . ucfirst $form->{item}); + my $title = 'Add ' . ucfirst $form->{item}; + $form->{title} = $locale->text($title); $form->{callback} = "$form->{script}?action=add&item=$form->{item}" unless $form->{callback}; $form->{unit_changeable} = 1; @@ -127,6 +128,8 @@ sub search_update_prices { my $pricegroups = IC->get_pricegroups(\%myconfig, \%$form); + $form->{title} = $locale->text('Update Prices'); + $form->header; print $form->parse_html_template('ic/search_update_prices', { PRICE_ROWS => $pricegroups }); @@ -789,7 +792,7 @@ sub addtop100 { if ($form->{l_subtotal} eq 'Y' && !$ref->{assemblyitem}) { if ($sameitem ne $ref->{ $form->{sort} }) { - &parts_subtotal; + parts_subtotal(\@column_index, \$subtotalonhand, \$subtotalsellprice, \$subtotallastcost, \$subtotallistprice); $sameitem = $ref->{ $form->{sort} }; } } @@ -912,7 +915,7 @@ sub addtop100 { } if ($form->{l_subtotal} eq 'Y') { - &parts_subtotal; + parts_subtotal(\@column_index, \$subtotalonhand, \$subtotalsellprice, \$subtotallastcost, \$subtotallistprice); } #fi if ($form->{"l_linetotal"}) { @@ -1365,39 +1368,38 @@ sub parts_subtotal { $auth->assert('part_service_assembly_edit'); - # imports - our (%column_data, @column_index); - our ($subtotalonhand, $totalsellprice, $totallastcost, $totallistprice, $subtotalsellprice, $subtotallastcost, $subtotallistprice); + my (%column_data); + my ($column_index, $subtotalonhand, $subtotalsellprice, $subtotallastcost, $subtotallistprice) = @_; - map { $column_data{$_} = " " } @column_index; - $subtotalonhand = 0 if ($form->{searchitems} eq 'assembly' && $form->{bom}); + map { $column_data{$_} = " " } @{ $column_index }; + $$subtotalonhand = 0 if ($form->{searchitems} eq 'assembly' && $form->{bom}); $column_data{onhand} = "" - . $form->format_amount(\%myconfig, $subtotalonhand) + . $form->format_amount(\%myconfig, $$subtotalonhand) . ""; $column_data{linetotalsellprice} = "" - . $form->format_amount(\%myconfig, $subtotalsellprice, 2) + . $form->format_amount(\%myconfig, $$subtotalsellprice, 2) . ""; $column_data{linetotallistprice} = "" - . $form->format_amount(\%myconfig, $subtotallistprice, 2) + . $form->format_amount(\%myconfig, $$subtotallistprice, 2) . ""; $column_data{linetotallastcost} = "" - . $form->format_amount(\%myconfig, $subtotallastcost, 2) + . $form->format_amount(\%myconfig, $$subtotallastcost, 2) . ""; - $subtotalonhand = 0; - $subtotalsellprice = 0; - $subtotallistprice = 0; - $subtotallastcost = 0; + $$subtotalonhand = 0; + $$subtotalsellprice = 0; + $$subtotallistprice = 0; + $$subtotallastcost = 0; print ""; - map { print "\n$column_data{$_}" } @column_index; + map { print "\n$column_data{$_}" } @{ $column_index }; print qq| @@ -1418,7 +1420,8 @@ sub edit { $form->{"original_partnumber"} = $form->{"partnumber"}; - $form->{title} = $locale->text('Edit ' . ucfirst $form->{item}); + my $title = 'Edit ' . ucfirst $form->{item}; + $form->{title} = $locale->text($title); &link_part; &display_form; @@ -1590,8 +1593,6 @@ sub assembly_row { my (@column_index); my ($nochange, $callback, $previousform, $linetotal, $line_purchase_price, $href); - our ($deliverydate); # ToDO: check if this indeed comes from global context - @column_index = qw(runningnumber qty unit bom partnumber description partsgroup lastcost total); if ($form->{previousform}) { @@ -1679,7 +1680,6 @@ sub assembly_row { $row{lastcost}{data} = $line_purchase_price; $row{total}{data} = $linetotal; - $row{deliverydate}{data} = $deliverydate; $row{lastcost}{align} = 'right'; $row{total}{align} = 'right'; $row{deliverydate}{align} = 'right'; @@ -1723,7 +1723,7 @@ sub update { if ($rows > 1) { $form->{makemodel_rows}--; &select_item; - exit; + ::end_of_request(); } else { map { $form->{item_list}[$i]{$_} =~ s/\"/"/g } qw(partnumber description unit partsgroup); @@ -1787,7 +1787,7 @@ sub save { if(!exists $form->{addition}) { $form->{snumbers} = qq|partnumber_| . $form->{partnumber}; $form->{addition} = "SAVED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->save_history; } # /saving the history $parts_id = $form->{id}; @@ -1871,7 +1871,7 @@ sub save { $form->{creditremaining} -= $amount; # redo number formatting, because invoice parse them! - map { $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}) } qw(weight listprice sellprice rop); + map { $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}) } qw(weight listprice sellprice lastcost rop); } $form->{"id_$i"} = $parts_id; @@ -1920,7 +1920,7 @@ sub save_as_new { if(!exists $form->{addition}) { $form->{snumbers} = qq|partnumber_| . $form->{partnumber}; $form->{addition} = "SAVED AS NEW"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->save_history; } # /saving the history $form->{id} = 0; @@ -1941,7 +1941,7 @@ sub delete { if(!exists $form->{addition}) { $form->{snumbers} = qq|partnumber_| . $form->{partnumber}; $form->{addition} = "DELETED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->save_history; } # /saving the history my $rc = IC->delete(\%myconfig, \%$form); @@ -1976,8 +1976,6 @@ sub parts_language_selection { $auth->assert('part_service_assembly_edit'); - our ($onload, $callback); - my $languages = IC->retrieve_languages(\%myconfig, $form); if ($form->{language_values} ne "") { @@ -2002,15 +2000,13 @@ sub parts_language_selection { my @header = map(+{ "column_title" => $header_title{$_}, "column" => $_, - "callback" => $callback, }, @header_sort); $form->{"title"} = $locale->text("Language Values"); $form->header(); print $form->parse_html_template("ic/parts_language_selection", { "HEADER" => \@header, - "LANGUAGES" => $languages, - "onload" => $onload }); + "LANGUAGES" => $languages, }); $lxdebug->leave_sub(); }