X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fic.pl;h=0eb7995b24c78e0b7821a4253f6a439f1821c9e6;hb=5c41c19b68c3edeb374b32fd75ac4253aafc4df1;hp=3eb67383cdc96123082fca1418aa998da70e4637;hpb=67079598f8f98a12e12a8acddc3afbf12bb58c5d;p=kivitendo-erp.git diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index 3eb67383c..0eb7995b2 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -1010,7 +1010,7 @@ sub addtop100 { # bought sold onorder ordered rfq quoted # l_partnumber l_description l_serialnumber l_unit l_listprice l_sellprice l_lastcost # l_linetotal l_priceupdate l_bin l_rop l_weight l_image l_drawing l_microfiche -# l_partsgroup l_subtotal l_soldtotal l_deliverydate +# l_partsgroup l_subtotal l_soldtotal l_deliverydate l_pricegroups # # hiddens: # nextsub revers lastsort sort ndxs_counter @@ -1220,18 +1220,33 @@ sub generate_report { transdate name serialnumber deliverydate ean projectnumber projectdescription ); + my $pricegroups = SL::DB::Manager::Pricegroup->get_all(sort => 'id'); + my @pricegroup_columns; + my %column_defs_pricegroups; + if ($form->{l_pricegroups}) { + @pricegroup_columns = map { "pricegroup_" . $_->id } @{ $pricegroups }; + %column_defs_pricegroups = map { + "pricegroup_" . $_->id => { + text => $::locale->text('Pricegroup') . ' ' . $_->pricegroup, + visible => 1, + }, + } @{ $pricegroups }; + } + push @columns, @pricegroup_columns; + my @includeable_custom_variables = grep { $_->{includeable} } @{ $cvar_configs }; my @searchable_custom_variables = grep { $_->{searchable} } @{ $cvar_configs }; my %column_defs_cvars = map { +"cvar_$_->{name}" => { 'text' => $_->{description} } } @includeable_custom_variables; push @columns, map { "cvar_$_->{name}" } @includeable_custom_variables; - %column_defs = (%column_defs,%column_defs_cvars); # nochmal die cvars als überschrift hinzufügen - 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); + %column_defs = (%column_defs, %column_defs_cvars, %column_defs_pricegroups); + 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), @pricegroup_columns; - my @hidden_variables = (qw(l_subtotal l_linetotal searchitems itemstatus bom), @itemstatus_keys, @callback_keys, + my @hidden_variables = (qw(l_subtotal l_linetotal searchitems itemstatus bom l_pricegroups), @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); @@ -1319,6 +1334,10 @@ sub generate_report { $row->{$_}{data} = $form->format_amount(\%myconfig, $ref->{$_}, -2); $row->{"linetotal$_"}{data} = $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{$_}, 2); } + foreach ( @pricegroup_columns ) { + $row->{$_}{data} = $form->format_amount(\%myconfig, $ref->{"$_"}, -2); + }; + map { $row->{$_}{data} = $form->format_amount(\%myconfig, $ref->{$_}); } qw(onhand rop weight soldtotal); @@ -1733,8 +1752,11 @@ 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"}; + # same for makemodel lastcosts + # but parse_amount not necessary for assembly component lastcosts + unless ($form->{item} eq "assembly") { + map { $form->{"lastcost_$_"} = $form->parse_amount(\%myconfig, $form->{"lastcost_$_"}) } 1 .. $form->{"makemodel_rows"}; + }; if ($form->{item} eq "assembly") { my $i = $form->{assembly_rows}; @@ -2016,6 +2038,10 @@ sub parts_language_selection { $language->{translation} = $translation; $language->{longdescription} = $longdescription; + + $language->{translation_area} = ($language->{translation_rows} = $form->numtextrows($language->{translation}, 40)) > 1; + $language->{longdescription_rows} = max 4, $form->numtextrows($language->{longdescription}, 40); + last; } }