X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fic.pl;h=28bc105e258b06038a0efb638a9d591e37e4eeb5;hb=cb253140;hp=d83d40942d7bddcfebe9ae9566e4f445c2daf60d;hpb=a873249c8c3c32006540d8636102c195dd4d9448;p=kivitendo-erp.git diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index d83d40942..28bc105e2 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -1031,6 +1031,7 @@ sub generate_report { 'deliverydate' => { 'text' => $locale->text('deliverydate'), }, 'description' => { 'text' => $locale->text('Part Description'), }, 'drawing' => { 'text' => $locale->text('Drawing'), }, + 'ean' => { 'text' => $locale->text('EAN'), }, 'image' => { 'text' => $locale->text('Image'), }, 'invnumber' => { 'text' => $locale->text('Invoice Number'), }, 'lastcost' => { 'text' => $locale->text('Last Cost'), }, @@ -1206,7 +1207,8 @@ sub generate_report { map { $column_defs{$_}->{visible} = $form->{"l_$_"} ? 1 : 0 } @columns; map { $column_defs{$_}->{align} = 'right' } qw(onhand sellprice listprice lastcost linetotalsellprice linetotallastcost linetotallistprice rop weight soldtotal); - my @hidden_variables = (qw(l_subtotal l_linetotal searchitems itemstatus bom), @itemstatus_keys, @callback_keys, @searchable_custom_variables, map { "l_$_" } @columns); + my @hidden_variables = (qw(l_subtotal l_linetotal searchitems itemstatus bom), @itemstatus_keys, @callback_keys, + map({ "cvar_$_->{name}" } @searchable_custom_variables), map { "l_$_" } @columns); my $callback = build_std_url('action=generate_report', grep { $form->{$_} } @hidden_variables); my @sort_full = qw(partnumber description onhand soldtotal deliverydate); @@ -1526,7 +1528,7 @@ sub form_header { $auth->assert('part_service_assembly_edit'); - $form->{eur} = $main::eur; # config dumps into namespace - yuck + $form->{eur} = $::lx_office_conf{system}->{eur}; # config dumps into namespace - yuck $form->{pg_keys} = sub { "$_[0]->{partsgroup}--$_[0]->{id}" }; $form->{description_area} = ($form->{rows} = $form->numtextrows($form->{description}, 40)) > 1; $form->{notes_rows} = max 4, $form->numtextrows($form->{notes}, 40), $form->numtextrows($form->{formel}, 40); @@ -1610,9 +1612,9 @@ sub assembly_row { map { delete $form->{$_} } qw(action header); # save form variables in a previousform variable - $previousform = $form->escape($form->escape(join '&', map { - sprintf "%s=%s", Q($_), /^listprice|lastcost|sellprice$/ ? $form->format_amount(\%myconfig, $form->{$_}) : $form->{$_} - } grep { ref $form->{$_} eq '' && $form->{$_} } grep { !/^select/ } sort keys %$form )); + my %form_to_save = map { ($_ => m/^ (?: listprice | sellprice | lastcost ) $/x ? $form->format_amount(\%myconfig, $form->{$_}) : $form->{$_}) } + keys %{ $form }; + $previousform = $::auth->save_form_in_session(form => \%form_to_save); $form->{callback} = $callback; $form->{assemblytotal} = 0; @@ -1702,6 +1704,9 @@ sub update { # parse pricegroups. and no, don't rely on check_form for this... map { $form->{"price_$_"} = $form->parse_amount(\%myconfig, $form->{"price_$_"}) } 1 .. $form->{price_rows}; + # same for lastcosts + map { $form->{"lastcost_$_"} = $form->parse_amount(\%myconfig, $form->{"lastcost_$_"}) } 1 .. $form->{"makemodel_rows"}; + if ($form->{item} eq "assembly") { my $i = $form->{assembly_rows}; @@ -1723,7 +1728,7 @@ sub update { if ($rows > 1) { $form->{makemodel_rows}--; - &select_item; + select_item(mode => 'IC'); ::end_of_request(); } else { map { $form->{item_list}[$i]{$_} =~ s/\"/"/g } @@ -1759,7 +1764,7 @@ sub save { $auth->assert('part_service_assembly_edit'); - my ($parts_id, %newform, $previousform, $amount, $callback); + my ($parts_id, %newform, $amount, $callback); # check if there is a part number - commented out, cause there is an automatic allocation of numbers # $form->isblank("partnumber", $locale->text(ucfirst $form->{item}." Part Number missing!")); @@ -1800,20 +1805,14 @@ sub save { # save the new form variables before splitting previousform map { $newform{$_} = $form->{$_} } keys %$form; - $previousform = $form->unescape($form->{previousform}); - # don't trample on previous variables map { delete $form->{$_} } keys %newform; my $ic_cvar_configs = CVar->get_configs(module => 'IC'); my @ic_cvar_fields = map { "cvar_$_->{name}" } @{ $ic_cvar_configs }; - # now take it apart and restore original values - foreach my $item (split /&/, $previousform) { - my ($key, $value) = split m/=/, $item, 2; - $value =~ s/%26/&/g; - $form->{$key} = $value; - } + # restore original values + $::auth->restore_form_from_session($newform{previousform}, form => $form); $form->{taxaccounts} = $newform{taxaccount2}; if ($form->{item} eq 'assembly') {