X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fic.pl;h=4eb1e41e108a32d790f6b8ba6d94624b2c81f2b0;hb=27ffa16a85221662dee49da0f210312383341240;hp=4b09b5ac8c323a2c80612d3ad6df1e524daa4e69;hpb=a4551dbafb54620a87faedac6b0970ca9cb78979;p=kivitendo-erp.git diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index 4b09b5ac8..4eb1e41e1 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -78,7 +78,7 @@ sub add { $auth->assert('part_service_assembly_edit'); - my $title = '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; @@ -1235,6 +1235,7 @@ sub generate_report { 'attachment_basename' => $attachment_basenames{$form->{searchitems}} . strftime('_%Y%m%d', localtime time), ); $report->set_options_from_form(); + $locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv'; $report->set_columns(%column_defs); $report->set_column_order(@columns); @@ -1420,7 +1421,7 @@ sub edit { $form->{"original_partnumber"} = $form->{"partnumber"}; - my $title = 'Edit ' . ucfirst $form->{item}; + my $title = 'Edit ' . ucfirst $form->{item}; $form->{title} = $locale->text($title); &link_part; @@ -1525,7 +1526,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); @@ -1579,8 +1580,8 @@ sub form_footer { sub makemodel_row { $lxdebug->enter_sub(); my ($numrows) = @_; - - my @mm_data = grep { any { $_ ne '' } @$_{qw(make model)} } map +{ make => $form->{"make_$_"}, model => $form->{"model_$_"} }, 1 .. $numrows; + #hli + my @mm_data = grep { any { $_ ne '' } @$_{qw(make model)} } map +{ make => $form->{"make_$_"}, model => $form->{"model_$_"}, lastcost => $form->{"lastcost_$_"}, lastupdate => $form->{"lastupdate_$_"}, sortorder => $form->{"sortorder_$_"} }, 1 .. $numrows; delete @{$form}{grep { m/^make_\d+/ || m/^model_\d+/ } keys %{ $form }}; print $form->parse_html_template('ic/makemodel', { MM_DATA => [ @mm_data, {} ], mm_rows => scalar @mm_data + 1 }); @@ -1758,7 +1759,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!")); @@ -1799,20 +1800,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') {