X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fic.pl;h=c5fddcce1ec040472a0c442ac13460156ce48e5e;hb=1de53cbf8a926ae3ae89bc5466ab660df82484b2;hp=ec287aa61219f7a58d69c2f42a4b6b99e4f236a0;hpb=831f10968e839d686e9d10881211ecdc578de613;p=kivitendo-erp.git
diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl
index ec287aa61..c5fddcce1 100644
--- a/bin/mozilla/ic.pl
+++ b/bin/mozilla/ic.pl
@@ -78,7 +78,7 @@ sub add {
$auth->assert('part_service_assembly_edit');
- $form->{title} = $locale->text('Add ' . ucfirst $form->{item});
+ $form->{title} = $locale->text('Add' . ucfirst $form->{item});
$form->{callback} = "$form->{script}?action=add&item=$form->{item}" unless $form->{callback};
$form->{unit_changeable} = 1;
@@ -127,6 +127,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 +791,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 +914,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 +1367,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 +1419,7 @@ sub edit {
$form->{"original_partnumber"} = $form->{"partnumber"};
- $form->{title} = $locale->text('Edit ' . ucfirst $form->{item});
+ $form->{title} = $locale->text('Edit' . ucfirst $form->{item});
&link_part;
&display_form;
@@ -1590,8 +1591,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 +1678,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 +1721,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 +1785,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};
@@ -1920,7 +1918,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 +1939,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 +1974,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 +1998,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();
}